rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
@register.filter def makelist(lst): if len(lst) == 0: return 'No responses' result = '' for item in lst: result += '<li>' + str(item) + '</li>' + '\n' return result
def drop_empty_answers(lst): # Takes a list of answers and drops empty ones. Whitespace-only is empty. return [ ans for ans in lst if (not isinstance(ans.answer, basestring)) or ans.answer.strip() ]
79887f5f73026c5f5b3d921b80eeb46527174886 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12041/79887f5f73026c5f5b3d921b80eeb46527174886/survey.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3640, 67, 5531, 67, 22340, 12, 16923, 4672, 468, 282, 23004, 279, 666, 434, 12415, 471, 29535, 1008, 5945, 18, 3497, 5211, 17, 3700, 353, 1008, 18, 327, 306, 4152, 364, 4152, 316, 9441, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3640, 67, 5531, 67, 22340, 12, 16923, 4672, 468, 282, 23004, 279, 666, 434, 12415, 471, 29535, 1008, 5945, 18, 3497, 5211, 17, 3700, 353, 1008, 18, 327, 306, 4152, 364, 4152, 316, 9441, ...
choice = raw_input('Save your login (y/N)?')
choice = input('Save your login (y/N)?')
def send_metadata(self): ''' Send the metadata to the package index server.
2d1ca2dbabde2ed69e06b50ddb2e87b12958d696 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/2d1ca2dbabde2ed69e06b50ddb2e87b12958d696/register.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 4165, 12, 2890, 4672, 9163, 2479, 326, 1982, 358, 326, 2181, 770, 1438, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 4165, 12, 2890, 4672, 9163, 2479, 326, 1982, 358, 326, 2181, 770, 1438, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
def synchronize(self): self.updateWindows() while gtk.events_pending(): gtk.main_iteration_do() def GUI_interact(self):
def GUI_interact(self):
def __init__(self, aSimulator = None ): """sets up the osogo session, creates Mainwindow and other fundamental windows but doesn't show them"""
f90670a48ac9dffeb69d1bfeb6cbfcdcdfc68e69 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/f90670a48ac9dffeb69d1bfeb6cbfcdcdfc68e69/GtkSessionMonitor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 279, 7993, 11775, 273, 599, 262, 30, 3536, 4424, 731, 326, 1140, 717, 83, 1339, 16, 3414, 12740, 5668, 471, 1308, 284, 1074, 14773, 287, 9965, 1496, 3302, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 279, 7993, 11775, 273, 599, 262, 30, 3536, 4424, 731, 326, 1140, 717, 83, 1339, 16, 3414, 12740, 5668, 471, 1308, 284, 1074, 14773, 287, 9965, 1496, 3302, ...
model.set_value(rowiter, 4, gametype)
childmodel = model.get_model() childrowiter = model.convert_iter_to_child_iter(None, rowiter) childmodel.set_value(childrowiter, 4, gametype)
def onWasPrivate (self, gameno): # When observable games were added to the list later than the latest # full send, private information will not be known. model, paths = self.tv.get_selection().get_selected_rows() for path in paths: rowiter = model.get_iter(path) if gameno == model.get_value(rowiter, 0): gametype = model.get_value(rowiter, 4) if not _("Private") in gametype: gametype += ", " + _("Private") model.set_value(rowiter, 4, gametype) break
2ade471641e4ba2b7d6600b55944a2ad519568d2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5339/2ade471641e4ba2b7d6600b55944a2ad519568d2/ICLounge.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 14992, 6014, 261, 2890, 16, 23411, 5764, 4672, 468, 5203, 13875, 28422, 4591, 3096, 358, 326, 666, 5137, 2353, 326, 4891, 468, 1983, 1366, 16, 3238, 1779, 903, 486, 506, 4846, 18, 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, 603, 14992, 6014, 261, 2890, 16, 23411, 5764, 4672, 468, 5203, 13875, 28422, 4591, 3096, 358, 326, 666, 5137, 2353, 326, 4891, 468, 1983, 1366, 16, 3238, 1779, 903, 486, 506, 4846, 18, 9...
self.__axes_range = {}
def __init__(self): """ Create a new empty Graphics objects with all the defaults.
302200621755552db8fe7d958571908ecdddb8ae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/302200621755552db8fe7d958571908ecdddb8ae/plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 3536, 1788, 279, 394, 1008, 16830, 2184, 598, 777, 326, 3467, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 3536, 1788, 279, 394, 1008, 16830, 2184, 598, 777, 326, 3467, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self._tsa.SetInput('\n'.join(self._labelList)) ap = self._position[0] + self._horizBorder, \ self._position[1] + self._vertBorder, self._text_z self._tsa.GetPositionCoordinate().SetCoordinateSystemToWorld() self._tsa.GetPositionCoordinate().SetValue(ap) if False: vp = \ self._tsa.GetPositionCoordinate().GetComputedViewportValue( self.canvas._ren) self._tsa.GetPositionCoordinate().SetCoordinateSystemToViewport() self._tsa.GetPositionCoordinate().SetValue(*vp) if ap[1] < 0: y2 = self._size[1] else: y2 = ap[1] + self._size[1] p2c = max_label_width, y2, self._text_z self._tsa.GetPosition2Coordinate().SetCoordinateSystemToWorld() self._tsa.GetPosition2Coordinate().SetValue(p2c) tprop = self._tsa.GetTextProperty() tcol = [text_normal_col, text_selected_col][self.selected] tprop.SetColor(tcol)
def update_geometry(self): glyph_normal_col = (0.75, 0.75, 0.75) glyph_selected_col = (0.2, 0.367, 0.656) glyph_blocked_col = (0.06, 0.06, 0.06) text_normal_col = (0.0, 0.0, 0.0) text_selected_col = (1.0, 1.0, 1.0) port_conn_col = (0.0, 1.0, 0.0) port_disconn_col = (1.0, 0.0, 0.0)
78002c5baadf5a0187bab25c7bb8294a6484aa9e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4494/78002c5baadf5a0187bab25c7bb8294a6484aa9e/devide_canvas_object.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 14330, 12, 2890, 4672, 9440, 67, 6130, 67, 1293, 273, 261, 20, 18, 5877, 16, 374, 18, 5877, 16, 374, 18, 5877, 13, 9440, 67, 8109, 67, 1293, 273, 261, 20, 18, 22, 16, 374...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 14330, 12, 2890, 4672, 9440, 67, 6130, 67, 1293, 273, 261, 20, 18, 5877, 16, 374, 18, 5877, 16, 374, 18, 5877, 13, 9440, 67, 8109, 67, 1293, 273, 261, 20, 18, 22, 16, 374...
PathOption(p, "Specify the location of %s" % p, dir)
PathOption(p, "Specify the location of %s" % p, dir), PathOption(p + "Include", "Specify the location of %s's include files" % p, dir and dir + "/include" or None), PathOption(p + "Lib", "Specify the location of %s's libraries" % p, dir and dir + "/lib" or None),
def my_excepthook(type, value, tb): print >> sys.stderr, "Error:", value sys.exit(1)
0bae5746efe67aaa04aa7fb9a1a4f99d70970956 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6561/0bae5746efe67aaa04aa7fb9a1a4f99d70970956/SConsUtils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3399, 67, 14137, 4476, 12, 723, 16, 460, 16, 8739, 4672, 1172, 1671, 2589, 18, 11241, 16, 315, 668, 2773, 16, 460, 2589, 18, 8593, 12, 21, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3399, 67, 14137, 4476, 12, 723, 16, 460, 16, 8739, 4672, 1172, 1671, 2589, 18, 11241, 16, 315, 668, 2773, 16, 460, 2589, 18, 8593, 12, 21, 13, 2, -100, -100, -100, -100, -100, -100, ...
self.__oMD5 = md5.new()
self.__oMD5 = md5.md5()
def networkToDataSink( self, dataSink, maxFileSize = 0 ): if "write" not in dir( dataSink ): return S_ERROR( "%s data sink object does not have a write method" % str( dataSink ) ) self.__oMD5 = md5.new() self.bReceivedEOF = False self.bErrorInMD5 = False receivedBytes = 0 try: result = self.receiveData( maxBufferSize = maxFileSize ) if not result[ 'OK' ]: return result strBuffer = result[ 'Value' ] receivedBytes += len( strBuffer ) while not self.receivedEOF(): if maxFileSize > 0 and receivedBytes > maxFileSize: self.sendError( "Exceeded maximum file size" ) return S_ERROR( "Received file exceeded maximum size of %s bytes" % ( maxFileSize ) ) dataSink.write( strBuffer ) result = self.receiveData( maxBufferSize = ( maxFileSize - len( strBuffer ) ) ) if not result[ 'OK' ]: return result strBuffer = result[ 'Value' ] receivedBytes += len( strBuffer ) if strBuffer: dataSink.write( strBuffer ) except Exception, e: return S_ERROR( "Error while receiving file, %s" % str( e ) ) if self.errorInTransmission(): return S_ERROR( "Error in the file CRC" ) self.__fileBytes = receivedBytes return S_OK()
b1722fab06b409adfbc7aeb75c00a51a69ca5492 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/b1722fab06b409adfbc7aeb75c00a51a69ca5492/FileHelper.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2483, 774, 751, 11326, 12, 365, 16, 501, 11326, 16, 943, 15100, 273, 374, 262, 30, 309, 315, 2626, 6, 486, 316, 1577, 12, 501, 11326, 262, 30, 327, 348, 67, 3589, 12, 2213, 87, 501, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2483, 774, 751, 11326, 12, 365, 16, 501, 11326, 16, 943, 15100, 273, 374, 262, 30, 309, 315, 2626, 6, 486, 316, 1577, 12, 501, 11326, 262, 30, 327, 348, 67, 3589, 12, 2213, 87, 501, ...
child_ids = self.copy(cr, uid, child.id, default, context=context, done_list=done_list)
child_ids = self.copy(cr, uid, child.id, default, context=context, done_list=done_list, local=True)
def copy(self, cr, uid, id, default={}, context={}, done_list=[]): account = self.browse(cr, uid, id, context=context) new_child_ids = [] if not default: default = {} default = default.copy() default['parent_id'] = False if account.id in done_list: return False done_list.append(account.id) if account: for child in account.child_id: child_ids = self.copy(cr, uid, child.id, default, context=context, done_list=done_list) if child_ids: new_child_ids.append(child_ids) default['child_parent_ids'] = [(6, 0, new_child_ids)] else: default['child_parent_ids'] = False return super(account_account, self).copy(cr, uid, id, default, context=context)
c3f51002934dd9929b41360b7a9a38984d6bd05d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/c3f51002934dd9929b41360b7a9a38984d6bd05d/account.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1610, 12, 2890, 16, 4422, 16, 4555, 16, 612, 16, 805, 28793, 819, 28793, 2731, 67, 1098, 33, 8526, 4672, 2236, 273, 365, 18, 25731, 12, 3353, 16, 4555, 16, 612, 16, 819, 33, 2472, 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, 1610, 12, 2890, 16, 4422, 16, 4555, 16, 612, 16, 805, 28793, 819, 28793, 2731, 67, 1098, 33, 8526, 4672, 2236, 273, 365, 18, 25731, 12, 3353, 16, 4555, 16, 612, 16, 819, 33, 2472, 13...
raise ScriptError("Bug not created: %s" % error_message)
raise BugzillaError("Bug not created: %s" % error_message)
def _check_create_bug_response(self, response_html): match = re.search("<title>Bug (?P<bug_id>\d+) Submitted</title>", response_html) if match: return match.group('bug_id')
b812388ad43770bdc11aad77ad4b3c6d9b6fd413 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/b812388ad43770bdc11aad77ad4b3c6d9b6fd413/bugzilla.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1893, 67, 2640, 67, 925, 67, 2740, 12, 2890, 16, 766, 67, 2620, 4672, 845, 273, 283, 18, 3072, 2932, 32, 2649, 34, 19865, 13590, 52, 32, 925, 67, 350, 5333, 72, 6975, 2592, 7948...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1893, 67, 2640, 67, 925, 67, 2740, 12, 2890, 16, 766, 67, 2620, 4672, 845, 273, 283, 18, 3072, 2932, 32, 2649, 34, 19865, 13590, 52, 32, 925, 67, 350, 5333, 72, 6975, 2592, 7948...
north = self.out_gt[3] - (self.tminmax[z][3]-y)*self.tilesize*pixelsizey south = north - self.tilesize*pixelsizey
south = self.ominy + y*self.tilesize*pixelsizex north = south + self.tilesize*pixelsizex
def rastertileswne(x,y,z): pixelsizex = (2**(self.tmaxz-z) * self.out_gt[1]) # X-pixel size in level pixelsizey = (2**(self.tmaxz-z) * self.out_gt[1]) # Y-pixel size in level (usually -1*pixelsizex) west = self.out_gt[0] + x*self.tilesize*pixelsizex east = west + self.tilesize*pixelsizex north = self.out_gt[3] - (self.tminmax[z][3]-y)*self.tilesize*pixelsizey south = north - self.tilesize*pixelsizey if not self.isepsg4326: # Transformation to EPSG:4326 (WGS84 datum) west, south = self.ct.TransformPoint(west, south)[:2] east, north = self.ct.TransformPoint(east, north)[:2] return south, west, north, east
c3d8df74eef052268add49773dc5efec101e76b2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10290/c3d8df74eef052268add49773dc5efec101e76b2/gdal2tiles.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12553, 28366, 91, 4644, 12, 92, 16, 93, 16, 94, 4672, 8948, 452, 338, 273, 261, 22, 636, 12, 2890, 18, 88, 1896, 94, 17, 94, 13, 380, 365, 18, 659, 67, 4521, 63, 21, 5717, 468, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12553, 28366, 91, 4644, 12, 92, 16, 93, 16, 94, 4672, 8948, 452, 338, 273, 261, 22, 636, 12, 2890, 18, 88, 1896, 94, 17, 94, 13, 380, 365, 18, 659, 67, 4521, 63, 21, 5717, 468, 1...
city="" coun="" p=data
rcity = "" rcoun = "" p = data
def ParseReport(self, MetarReport=None): """Take report with raw info only and return it with in parsed values filled in. Note: This function edits the WeatherReport object you supply!""" if self.Report is None and MetarReport is None: raise EmptyReportException, \ "No report given on init and ParseReport()." elif MetarReport is not None: self.Report=MetarReport
fe1cdcd11658fbbfba6d30dfe37a2f9dfce6a1a8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4602/fe1cdcd11658fbbfba6d30dfe37a2f9dfce6a1a8/pymetar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2884, 4820, 12, 2890, 16, 21604, 297, 4820, 33, 7036, 4672, 3536, 13391, 2605, 598, 1831, 1123, 1338, 471, 327, 518, 598, 316, 2707, 924, 6300, 316, 18, 3609, 30, 1220, 445, 24450, 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, 2884, 4820, 12, 2890, 16, 21604, 297, 4820, 33, 7036, 4672, 3536, 13391, 2605, 598, 1831, 1123, 1338, 471, 327, 518, 598, 316, 2707, 924, 6300, 316, 18, 3609, 30, 1220, 445, 24450, 326, ...
engagement_calculator = _load_function(settings.LEAN_ENGAGEMENT_CALCULATOR)
engagement_calculator = settings.LEAN_ENGAGEMENT_CALCULATOR engagement_calculator = _load_function(engagement_calculator)()
def handle(self, *args, **options): if len(args): raise CommandError("This command does not take any arguments")
6bacf2d1c3c953ed7285c9347f6e05586e4e6c46 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8053/6bacf2d1c3c953ed7285c9347f6e05586e4e6c46/update_experiment_reports.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 12, 2890, 16, 380, 1968, 16, 2826, 2116, 4672, 309, 562, 12, 1968, 4672, 1002, 3498, 668, 2932, 2503, 1296, 1552, 486, 4862, 1281, 1775, 7923, 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, 0, 0, 0, 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, 1640, 12, 2890, 16, 380, 1968, 16, 2826, 2116, 4672, 309, 562, 12, 1968, 4672, 1002, 3498, 668, 2932, 2503, 1296, 1552, 486, 4862, 1281, 1775, 7923, 2, -100, -100, -100, -100, -100, -100...
chmod(entry.get('name'), calc_perms(S_IFDIR, entry.get('perms')))
os.chmod(entry.get('name'), calc_perms(S_IFDIR, entry.get('perms')))
def InstallDirectory(self, entry): '''Install Directory Entry''' self.CondPrint('verbose', "Installing Directory %s" % (entry.get('name'))) try: fmode = lstat(entry.get('name')) if not S_ISDIR(fmode[ST_MODE]): self.CondPrint("debug", "Found a non-directory entry at %s" % (entry.get('name'))) try: unlink(entry.get('name')) except OSError: self.CondPrint('verbose', "Failed to unlink %s" % (entry.get('name'))) return False else: self.CondPrint("debug", "Found a pre-existing directory at %s" % (entry.get('name'))) exists = True except OSError: # stat failed exists = False
6b7fe3dffd69efeeeabbce0bcd6cab97bde94cef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/6b7fe3dffd69efeeeabbce0bcd6cab97bde94cef/Toolset.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10284, 2853, 12, 2890, 16, 1241, 4672, 9163, 6410, 8930, 3841, 26418, 365, 18, 12441, 5108, 2668, 11369, 2187, 315, 6410, 310, 8930, 738, 87, 6, 738, 261, 4099, 18, 588, 2668, 529, 11, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10284, 2853, 12, 2890, 16, 1241, 4672, 9163, 6410, 8930, 3841, 26418, 365, 18, 12441, 5108, 2668, 11369, 2187, 315, 6410, 310, 8930, 738, 87, 6, 738, 261, 4099, 18, 588, 2668, 529, 11, ...
return [(e + "
return [(e.strip() + "
def map(e, params): return [(e + "#", '')]
ff963c4186201e82ce51c86d804b821b564f0ab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/373/ff963c4186201e82ce51c86d804b821b564f0ab0/test_save.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 852, 12, 73, 16, 859, 4672, 327, 306, 12, 73, 397, 6619, 3113, 875, 25887, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 852, 12, 73, 16, 859, 4672, 327, 306, 12, 73, 397, 6619, 3113, 875, 25887, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if self.fd: self.fd.flush()
if not self.fd: return self.fd.flush()
def flush(self): if self.fd: self.fd.flush()
3d7d63966162f8881fad278dc8cc728a7e5a1f77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/3d7d63966162f8881fad278dc8cc728a7e5a1f77/logger.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3663, 12, 2890, 4672, 309, 365, 18, 8313, 30, 365, 18, 8313, 18, 11330, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3663, 12, 2890, 4672, 309, 365, 18, 8313, 30, 365, 18, 8313, 18, 11330, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
if file.__file__[-3:] != ".py": raise RuntimeError, "cannot compile '%s'" % file.__file__
def byte_compile(py_files, optimize=0, force=0, target_dir=None, verbose=1, dry_run=0, direct=None): if direct is None: direct = (__debug__ and optimize == 0) # "Indirect" byte-compilation: write a temporary script and then # run it with the appropriate flags. if not direct: from tempfile import mktemp from distutils.util import execute script_name = mktemp(".py") if verbose: print "writing byte-compilation script '%s'" % script_name if not dry_run: script = open(script_name, "w") script.write("""\
d5b8d9df5257f58278730f932f795bd6375febff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1361/d5b8d9df5257f58278730f932f795bd6375febff/build_exe.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1160, 67, 11100, 12, 2074, 67, 2354, 16, 10979, 33, 20, 16, 2944, 33, 20, 16, 1018, 67, 1214, 33, 7036, 16, 3988, 33, 21, 16, 10299, 67, 2681, 33, 20, 16, 2657, 33, 7036, 4672, 225...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1160, 67, 11100, 12, 2074, 67, 2354, 16, 10979, 33, 20, 16, 2944, 33, 20, 16, 1018, 67, 1214, 33, 7036, 16, 3988, 33, 21, 16, 10299, 67, 2681, 33, 20, 16, 2657, 33, 7036, 4672, 225...
return NSImage.alloc().initWithContentsFile_("/System/Library/CoreServices/DefaultDesktop.jpg")
theImage = NSImage.alloc().initWithContentsOfFile_("/System/Library/CoreServices/DefaultDesktop.jpg") if theImage: return theImage else: return NSImage.imageNamed_("Solid Aqua Blue")
def getLoginwindowPicture(): desktopPicturePath = '' loginwindowPrefsPath = "/Library/Preferences/com.apple.loginwindow.plist" if os.path.exists(loginwindowPrefsPath): loginwindowPrefs = readPlist(loginwindowPrefsPath) if loginwindowPrefs: desktopPicturePath = loginwindowPrefs.get('DesktopPicture', '') if desktopPicturePath: if os.path.exists(desktopPicturePath): theImage = NSImage.alloc().initWithContentsOfFile_(desktopPicturePath) if theImage: return theImage return NSImage.imageNamed_("Solid Aqua Blue") return NSImage.alloc().initWithContentsFile_("/System/Library/CoreServices/DefaultDesktop.jpg")
491345a1c0009e0b91f3c73eced8f7af073d5a32 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6241/491345a1c0009e0b91f3c73eced8f7af073d5a32/MSController.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25128, 5668, 24061, 13332, 21304, 24061, 743, 273, 875, 3925, 5668, 1386, 2556, 743, 273, 2206, 9313, 19, 12377, 19, 832, 18, 438, 1802, 18, 5819, 5668, 18, 17842, 6, 309, 1140, 18, 803,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25128, 5668, 24061, 13332, 21304, 24061, 743, 273, 875, 3925, 5668, 1386, 2556, 743, 273, 2206, 9313, 19, 12377, 19, 832, 18, 438, 1802, 18, 5819, 5668, 18, 17842, 6, 309, 1140, 18, 803,...
icursor = icursor-1
def __normalize(self, event=None): ew = event.widget contents = ew.get() icursor = ew.index(INSERT) if contents == '': contents = '0' # figure out what the contents value is in the current base try: if self.__hexp.get(): v = string.atoi(contents, 16) else: v = string.atoi(contents) except ValueError: v = None # if value is not legal, delete the last character inserted and ring # the bell if v is None or v < 0 or v > 255: i = ew.index(INSERT) contents = contents[:i-1] + contents[i:] ew.bell() icursor = icursor-1 elif self.__hexp.get(): contents = hex(v) else: contents = int(v) ew.delete(0, END) ew.insert(0, contents) ew.icursor(icursor)
8934af00d8a99e606729b96c34e8da6fb9c9123c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8934af00d8a99e606729b96c34e8da6fb9c9123c/TypeinViewer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12237, 12, 2890, 16, 871, 33, 7036, 4672, 22722, 273, 871, 18, 6587, 2939, 273, 22722, 18, 588, 1435, 277, 9216, 273, 22722, 18, 1615, 12, 11356, 13, 309, 2939, 422, 875, 30, 293...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12237, 12, 2890, 16, 871, 33, 7036, 4672, 22722, 273, 871, 18, 6587, 2939, 273, 22722, 18, 588, 1435, 277, 9216, 273, 22722, 18, 1615, 12, 11356, 13, 309, 2939, 422, 875, 30, 293...
s = "abc123"
s = str8("abc123")
def test_basics(self): s = "abc123" for encoding in all_string_encodings: (encoded, size) = codecs.getencoder(encoding)(s) self.assertEqual(size, len(s)) (chars, size) = codecs.getdecoder(encoding)(encoded) self.assertEqual(chars, s, "%r != %r (encoding=%r)" % (chars, s, encoding))
583118a535c944002f578ae1449b1c29e2ee3e28 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/583118a535c944002f578ae1449b1c29e2ee3e28/test_codecs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9157, 2102, 12, 2890, 4672, 272, 273, 609, 28, 2932, 18947, 12936, 7923, 364, 2688, 316, 777, 67, 1080, 67, 1331, 369, 899, 30, 261, 10787, 16, 963, 13, 273, 17437, 18, 588, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9157, 2102, 12, 2890, 4672, 272, 273, 609, 28, 2932, 18947, 12936, 7923, 364, 2688, 316, 777, 67, 1080, 67, 1331, 369, 899, 30, 261, 10787, 16, 963, 13, 273, 17437, 18, 588, ...
CoincDatabaseConnection.commit()
def append(self, row): self.cursor.execute("INSERT INTO coinc_definer VALUES (?, ?)", (lsctables.ILWDID(row.coinc_def_id), row.table_name)) CoincDatabaseConnection.commit()
d54fb732022835e478a56be4372e71bb33d3cede /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3592/d54fb732022835e478a56be4372e71bb33d3cede/SnglBurstUtils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 714, 12, 2890, 16, 1027, 4672, 365, 18, 9216, 18, 8837, 2932, 11356, 12421, 13170, 71, 67, 5649, 264, 13477, 13590, 16, 692, 2225, 16, 261, 3251, 299, 1538, 18, 2627, 16006, 734, 12, 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, 714, 12, 2890, 16, 1027, 4672, 365, 18, 9216, 18, 8837, 2932, 11356, 12421, 13170, 71, 67, 5649, 264, 13477, 13590, 16, 692, 2225, 16, 261, 3251, 299, 1538, 18, 2627, 16006, 734, 12, 4...
result = int(unit)
result = unit
def unit_convert(self, val, pts=False, base_length='10pt'): ''' Tries to convert html units in C{val} to pixels. Assumes: 1em = 100% = 10pts @param pts: If True return 10*pts instead of pixels. @return: The number of pixels (an int) if successful. Otherwise, returns None. ''' dpi = self.profile.dpi result = None try: result = int(val) except ValueError: pass m = re.search(r"\s*(-*[0-9]*\.?[0-9]*)\s*(%|em|px|mm|cm|in|pt|pc)", val) if m is not None and m.group(1): unit = float(m.group(1)) if m.group(2) == '%': normal = self.unit_convert(base_length) result = int((unit/100.0)*normal) elif m.group(2) == 'px': result = int(unit) elif m.group(2) == 'in': result = int(unit * dpi) elif m.group(2) == 'pt': result = int(unit * dpi/72.) elif m.group(2)== 'em': result = int(unit * (dpi/72.) * 10) elif m.group(2)== 'pc': result = int(unit * (dpi/72.) * 12) elif m.group(2)== 'mm': result = int(unit * 0.04 * (dpi/72.)) elif m.group(2)== 'cm': result = int(unit * 0.4 * (dpi/72.)) if pts: if result is not None: result = int((float(result)/dpi)*720) return result
0c949a265c99b2ae67e33a8f4b007e12591ff195 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/0c949a265c99b2ae67e33a8f4b007e12591ff195/convert_from.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2836, 67, 6283, 12, 2890, 16, 1244, 16, 13397, 33, 8381, 16, 1026, 67, 2469, 2218, 2163, 337, 11, 4672, 9163, 10000, 281, 358, 1765, 1729, 4971, 316, 385, 95, 1125, 97, 358, 8948, 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, 2836, 67, 6283, 12, 2890, 16, 1244, 16, 13397, 33, 8381, 16, 1026, 67, 2469, 2218, 2163, 337, 11, 4672, 9163, 10000, 281, 358, 1765, 1729, 4971, 316, 385, 95, 1125, 97, 358, 8948, 18, ...
if self.manager.disable >= WARNING: return
def warning(self, msg, *args, **kwargs): """ Log 'msg % args' with severity 'WARNING'.
d799aa6cba548323a7ba7ff8ae4c2b3badd26c47 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/d799aa6cba548323a7ba7ff8ae4c2b3badd26c47/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3436, 12, 2890, 16, 1234, 16, 380, 1968, 16, 2826, 4333, 4672, 3536, 1827, 296, 3576, 738, 833, 11, 598, 11426, 296, 9511, 10332, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3436, 12, 2890, 16, 1234, 16, 380, 1968, 16, 2826, 4333, 4672, 3536, 1827, 296, 3576, 738, 833, 11, 598, 11426, 296, 9511, 10332, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
self.assertEqual(bibrecord.warning((1,'(field number(s): [2])')),ee)
self.assertEqual(bibrecord.warning((1, '(field number(s): [2])')), ee)
def test_missing_attribute(self): """ bibrecord - bad input missing \"tag\" """ ws = bibrecord.cfg_bibrecord_warning_msgs xml_error2 = """ <record> <controlfield tag="001">33</controlfield> <datafield ind1="" ind2=""> <subfield code="a">eng</subfield> </datafield> <datafield tag="100" ind1="" ind2=""> <subfield code="a">Doe, John</subfield> </datafield> <datafield tag="245" ind1="" ind2=""> <subfield code="a">On the foo and bar</subfield> </datafield> </record> """ (rec,st,e) = bibrecord.create_record(xml_error2,1,1) ee='' for i in e: if type(i).__name__ == 'str': if i.count(ws[1])>0: ee = i self.assertEqual(bibrecord.warning((1,'(field number(s): [2])')),ee)
2f66588a97ca15909477d0a2e7e1dae76f187c9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/2f66588a97ca15909477d0a2e7e1dae76f187c9d/bibrecord_tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 7337, 67, 4589, 12, 2890, 4672, 3536, 25581, 3366, 300, 5570, 810, 3315, 1239, 2692, 2412, 3536, 4945, 273, 25581, 3366, 18, 7066, 67, 70, 495, 3366, 67, 8551, 67, 27439, 2025,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7337, 67, 4589, 12, 2890, 4672, 3536, 25581, 3366, 300, 5570, 810, 3315, 1239, 2692, 2412, 3536, 4945, 273, 25581, 3366, 18, 7066, 67, 70, 495, 3366, 67, 8551, 67, 27439, 2025,...
'code': account_template.code,
'code': code_acc[:dig],
def action_create(self, cr, uid, ids, context=None): obj_multi = self.browse(cr,uid,ids[0]) obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_acc_template = self.pool.get('account.account.template')
86041cba194ee019204e8993a23af97a849ed873 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/86041cba194ee019204e8993a23af97a849ed873/account.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 67, 2640, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 1081, 67, 7027, 273, 365, 18, 25731, 12, 3353, 16, 1911, 16, 2232, 63, 20, 5717, 1081, 67, 8981, 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, 1301, 67, 2640, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 1081, 67, 7027, 273, 365, 18, 25731, 12, 3353, 16, 1911, 16, 2232, 63, 20, 5717, 1081, 67, 8981, 273,...
'cd %s' % tool[ 'source_dir' ]
'cd "%s"' % tool[ 'source_dir' ]
def build_if_needed( tool, toolset, toolsets ): if os.path.exists( tool[ 'path' ] ): log( 'Found preinstalled "%s"; will use it.' % tool[ 'path' ] ) return log( 'Preinstalled "%s" is not found; building one...' % tool[ 'path' ] ) if toolset is None: if toolsets is not None: toolset = string.split( toolsets, ',' )[0] if not tool[ 'is_supported_toolset' ]( toolset ): log( 'Warning: Specified toolset (%s) cannot be used to bootstrap "%s".'\ % ( toolset, tool[ 'name' ] ) ) toolset = tool[ 'default_toolset' ] log( ' Using default toolset for the platform (%s).' % toolset ) else: toolset = tool[ 'default_toolset' ] log( 'Warning: No bootstrap toolset for "%s" was specified.' % tool[ 'name' ] ) log( ' Using default toolset for the platform (%s).' % toolset ) if os.path.exists( tool[ 'source_dir' ] ): log( 'Found "%s" source directory "%s"' % ( tool[ 'name' ], tool[ 'source_dir' ] ) ) build_cmd = tool[ 'build_cmd' ]( toolset ) log( 'Building "%s" (%s)...' % ( tool[ 'name'], build_cmd ) ) utils.system( [ 'cd %s' % tool[ 'source_dir' ] , build_cmd ] ) else: raise 'Could not find "%s" source directory "%s"' % ( tool[ 'name' ], tool[ 'source_dir' ] ) if not tool.has_key( 'build_path' ): tool[ 'build_path' ] = tool_path( tool ) if not os.path.exists( tool[ 'build_path' ] ): raise 'Failed to find "%s" after build.' % tool[ 'build_path' ] log( '%s succesfully built in "%s" location' % ( tool[ 'name' ], tool[ 'build_path' ] ) )
7f6c970139a589cb887e9d07442cf1d1d00430cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7959/7f6c970139a589cb887e9d07442cf1d1d00430cd/regression.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 67, 430, 67, 17471, 12, 5226, 16, 5226, 542, 16, 5226, 4424, 262, 30, 309, 1140, 18, 803, 18, 1808, 12, 5226, 63, 296, 803, 11, 308, 262, 30, 613, 12, 296, 2043, 675, 13435, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 67, 430, 67, 17471, 12, 5226, 16, 5226, 542, 16, 5226, 4424, 262, 30, 309, 1140, 18, 803, 18, 1808, 12, 5226, 63, 296, 803, 11, 308, 262, 30, 613, 12, 296, 2043, 675, 13435, ...
"install" : install}
"install" : install, "install_data" : install_data}
def filter_images (image): return image.startswith ("plugin-") or image.startswith ("category-")
56b579f590cde973f99968855fc6b7cc2c0e31f6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7183/56b579f590cde973f99968855fc6b7cc2c0e31f6/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1034, 67, 7369, 261, 2730, 4672, 327, 1316, 18, 17514, 1918, 7566, 4094, 17, 7923, 578, 1316, 18, 17514, 1918, 7566, 4743, 17, 7923, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1034, 67, 7369, 261, 2730, 4672, 327, 1316, 18, 17514, 1918, 7566, 4094, 17, 7923, 578, 1316, 18, 17514, 1918, 7566, 4743, 17, 7923, 225, 2, -100, -100, -100, -100, -100, -100, -100, -10...
for sourcefilename in glob.glob(sourcedir + subdir + "/*.jpg"): duplicates = findDuplicateImages(sourcefilename) if duplicates: wikipedia.output(u'Found duplicate image at %s' % duplicates.pop()) else: fileId = getFileId(sourcefilename) print str(fileId) metadata = getMetadata(fileId, cursor) if metadata: description = getDescription(metadata) categories = getCategories(metadata, cursor, cursor2) description = description + categories print description destinationFilename = getTitle(metadata)
for sourcefilename in glob.glob(sourcedir + subdir + u"/*.jpg"): fileId = getFileId(sourcefilename) if fileId>=start_id: wikipedia.output(str(fileId)) duplicates = findDuplicateImages(sourcefilename) if duplicates: wikipedia.output(u'Found duplicate image at %s' % duplicates.pop()) else: metadata = getMetadata(fileId, cursor) if metadata: description = getDescription(metadata) categories = getCategories(metadata, cursor, cursor2) description = description + categories wikipedia.output(description) destinationFilename = getTitle(metadata)
def main(args): ''' Main loop. ''' site = wikipedia.getSite(u'commons', u'commons') wikipedia.setSite(site) start_id=0 found_start_id = False conn = None cursor = None (conn, cursor) = connectDatabase() conn2 = None cursor2 = None (conn2, cursor2) = connectDatabase2('commonswiki-p.db.toolserver.org', u'u_multichill_commons_categories_p') if(len(args) >1): if len(args) > 2: start_id=args[2] sourcedir = args[0] destinationdir = args[1] if os.path.isdir(sourcedir) and os.path.isdir(destinationdir): #print sourcedir for subdir in os.listdir(sourcedir): #print subdir if os.path.isdir(sourcedir + subdir): #print subdir for sourcefilename in glob.glob(sourcedir + subdir + "/*.jpg"): duplicates = findDuplicateImages(sourcefilename) if duplicates: wikipedia.output(u'Found duplicate image at %s' % duplicates.pop()) else: #Get the file id fileId = getFileId(sourcefilename) print str(fileId) #Get metadata metadata = getMetadata(fileId, cursor) #Check if we got metadata if metadata: #Get description description = getDescription(metadata) # The hard part, find suitable categories categories = getCategories(metadata, cursor, cursor2) #print categories description = description + categories print description #Get destinationfilename destinationFilename = getTitle(metadata) #Copy file to destination dir shutil.copy(sourcefilename, destinationdir + destinationFilename + '.jpg') #And save the description as well outputDescriptionFile(destinationdir + destinationFilename + '.txt', description) #Save it
d40ae98e89fc2145baa4083e2e5bf5cef18c6eba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7426/d40ae98e89fc2145baa4083e2e5bf5cef18c6eba/batch_generator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 1968, 4672, 9163, 12740, 2798, 18, 9163, 2834, 273, 21137, 18, 588, 4956, 12, 89, 11, 6054, 87, 2187, 582, 11, 6054, 87, 6134, 21137, 18, 542, 4956, 12, 4256, 13, 225, 787, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 1968, 4672, 9163, 12740, 2798, 18, 9163, 2834, 273, 21137, 18, 588, 4956, 12, 89, 11, 6054, 87, 2187, 582, 11, 6054, 87, 6134, 21137, 18, 542, 4956, 12, 4256, 13, 225, 787, ...
G += line(data, **options)
detect_poles = options.pop('detect_poles', False) if not (polar or parametric) and detect_poles != False: from sage.rings.all import RDF epsilon = 0.0001 startIndex = 0 pole_options = {} pole_options['linestyle'] = '--' pole_options['thickness'] = 1 pole_options['rgbcolor'] = ' for i in range(len(data)-1): x0, y0 = data[i] x1, y1 = data[i+1] if (y1 > 0 and y0 < 0) or (y1 < 0 and y0 > 0): dy = abs(y1-y0) dx = x1 - x0 alpha = (RDF(dy)/RDF(dx)).arctan() if alpha >= RDF(pi/2) - epsilon: G += line(data[startIndex:i], **options) if detect_poles == 'show': G += line([(x0, y0), (x1, y1)], **pole_options) startIndex = i+2 G += line(data[startIndex:], **options) else: G += line(data, **options)
def _plot(funcs, xrange, parametric=False, polar=False, fill=None, label='', randomize=True, **options): if not is_fast_float(funcs): funcs = fast_float(funcs, expect_one_var=True) #parametric_plot will be a list or tuple of two functions (f,g) #and will plotted as (f(x), g(x)) for all x in the given range if parametric: f, g = funcs #or we have only a single function to be plotted: else: f = funcs # xrange has to be either of the form (var, xmin, xmax) or (xmin, xmax) if not isinstance(xrange, (tuple, list)): raise TypeError, "xrange must be a tuple or list" if len(xrange) == 3: xmin, xmax = xrange[1], xrange[2] elif len(xrange) == 2: xmin, xmax = xrange[0], xrange[1] else: raise ValueError, "parametric value range must be a list or tuple of length 2 or 3." #check to see if funcs is a list of functions that will #be all plotted together. if isinstance(funcs, (list, tuple)) and not parametric: rainbow_colors = rainbow(len(funcs)) G = Graphics() for i, h in enumerate(funcs): if isinstance(fill, dict): if i in fill: fill_entry = fill[i] if isinstance(fill_entry, list): if fill_entry[0] < len(funcs): fill_temp = funcs[fill_entry[0]] else: fill_temp = None else: fill_temp = fill_entry else: fill_temp = None else: fill_temp = fill options_temp = options.copy() fillcolor_temp = options_temp.pop('fillcolor', 'automatic') if fillcolor_temp == 'automatic': fillcolor_temp = rainbow_colors[i] G += plot(h, (xmin, xmax), polar = polar, fill = fill_temp, \ fillcolor = fillcolor_temp, **options_temp) return G adaptive_tolerance = options.pop('adaptive_tolerance') adaptive_recursion = options.pop('adaptive_recursion') plot_points = int(options.pop('plot_points')) data = generate_plot_points(f, xrange, plot_points, adaptive_tolerance, adaptive_recursion, randomize) if parametric: data = [(fdata, g(x)) for x, fdata in data] G = Graphics() fillcolor = options.pop('fillcolor', 'automatic') fillalpha = options.pop('fillalpha', 0.5) if fill is not None: if parametric or polar: filldata = data else: if fill == 'axis' or fill is True: base_level = 0 elif fill == 'min': base_level = min(t[1] for t in data) elif fill == 'max': base_level = max(t[1] for t in data) elif hasattr(fill, '__call__'): if fill == max or fill == min: if fill == max: fstr = 'max' else: fstr = 'min' msg = "WARNING: You use the built-in function %s for filling. You probably wanted the string '%s'." % (fstr, fstr) sage.misc.misc.verbose(msg, level=0) if not is_fast_float(fill): fill_f = fast_float(fill, expect_one_var=True) else: fill_f = fill filldata = generate_plot_points(fill_f, xrange, plot_points, adaptive_tolerance, \ adaptive_recursion, randomize) filldata.reverse() filldata += data else: try: base_level = float(fill) except TypeError: base_level = 0 if not hasattr(fill, '__call__') and polar: filldata = generate_plot_points(lambda x: base_level, xrange, plot_points, adaptive_tolerance, \ adaptive_recursion, randomize) filldata.reverse() filldata += data if not hasattr(fill, '__call__') and not polar: filldata = [(data[0][0], base_level)] + data + [(data[-1][0], base_level)] if fillcolor == 'automatic': fillcolor = (0.5, 0.5, 0.5) fill_options = {} fill_options['rgbcolor'] = fillcolor fill_options['alpha'] = fillalpha fill_options['thickness'] = 0 if polar: filldata = [(y*cos(x), y*sin(x)) for x, y in filldata] G += polygon(filldata, **fill_options) if polar: data = [(y*cos(x), y*sin(x)) for x, y in data] from sage.plot.all import line, text G += line(data, **options) # Label? if label: label = ' '+str(label) G += text(label, data[-1], horizontal_alignment='left', vertical_alignment='center') return G
ac5afa0e5ec2f10abdb6b303818bb5a10634a623 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/ac5afa0e5ec2f10abdb6b303818bb5a10634a623/plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4032, 12, 17728, 16, 12314, 16, 579, 1591, 33, 8381, 16, 24244, 33, 8381, 16, 3636, 33, 7036, 16, 1433, 2218, 2187, 2744, 554, 33, 5510, 16, 2826, 2116, 4672, 309, 486, 353, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4032, 12, 17728, 16, 12314, 16, 579, 1591, 33, 8381, 16, 24244, 33, 8381, 16, 3636, 33, 7036, 16, 1433, 2218, 2187, 2744, 554, 33, 5510, 16, 2826, 2116, 4672, 309, 486, 353, 67, ...
d = cached_descs[id]
d = '%i. %s'%(i,cached_descs[id])
def get(self): s = Session()
db4ae60ae70abf8e48ff6b8d6c2e6c8f66d3e3c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5139/db4ae60ae70abf8e48ff6b8d6c2e6c8f66d3e3c9/event_message_factory.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 4672, 272, 273, 3877, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 12, 2890, 4672, 272, 273, 3877, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
integers n -1.
integers n >= 1.
def spherical_bessel_J(n, var, algorithm="maxima"): r""" Returns the spherical Bessel function of the first kind for integers n -1. Reference: AS 10.1.8 page 437 and AS 10.1.15 page 439. EXAMPLES:: sage: spherical_bessel_J(2,x) ((3/x^2 - 1)*sin(x) - 3*cos(x)/x)/x """ if algorithm=="scipy": import scipy.special ans = str(scipy.special.sph_jn(int(n),float(var))) ans = ans.replace("(","") ans = ans.replace(")","") ans = ans.replace("j","*I") return sage_eval(ans) elif algorithm == 'maxima': _init() return meval("spherical_bessel_j(%s,%s)"%(ZZ(n),var)) else: raise ValueError, "unknown algorithm '%s'"%algorithm
394dfa38f63f3b63a7555c2762afda676f9b712a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/394dfa38f63f3b63a7555c2762afda676f9b712a/special.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 21570, 67, 70, 403, 292, 67, 46, 12, 82, 16, 569, 16, 4886, 1546, 1896, 13888, 6, 4672, 436, 8395, 2860, 326, 272, 21570, 605, 403, 292, 445, 434, 326, 1122, 3846, 364, 12321, 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, 272, 21570, 67, 70, 403, 292, 67, 46, 12, 82, 16, 569, 16, 4886, 1546, 1896, 13888, 6, 4672, 436, 8395, 2860, 326, 272, 21570, 605, 403, 292, 445, 434, 326, 1122, 3846, 364, 12321, 2...
exercise(space_group_info = space_group_info)
exercise(space_group_info=space_group_info, verbose=flags.Verbose)
def run_call_back(flags, space_group_info): exercise(space_group_info = space_group_info)
e48cd5794796abe8fe7acd92d168f26a4e2d53b0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/e48cd5794796abe8fe7acd92d168f26a4e2d53b0/tst_fmodel_fd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 1991, 67, 823, 12, 7133, 16, 3476, 67, 1655, 67, 1376, 4672, 24165, 12, 2981, 67, 1655, 67, 1376, 33, 2981, 67, 1655, 67, 1376, 16, 3988, 33, 7133, 18, 14489, 13, 225, 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, 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, 67, 1991, 67, 823, 12, 7133, 16, 3476, 67, 1655, 67, 1376, 4672, 24165, 12, 2981, 67, 1655, 67, 1376, 33, 2981, 67, 1655, 67, 1376, 16, 3988, 33, 7133, 18, 14489, 13, 225, 2, ...
self.callback = callback
def run(self, callback): failed_preconditions = self.checkPreconditions(True) + self.checkPreconditions(False) if len(failed_preconditions): callback(self, failed_preconditions) return self.callback = callback Task.processFinished(self, 0)
519da68556638c7502a4f679f859e6032e258421 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/519da68556638c7502a4f679f859e6032e258421/Process.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 16, 1348, 4672, 2535, 67, 1484, 6381, 273, 365, 18, 1893, 1386, 6381, 12, 5510, 13, 397, 365, 18, 1893, 1386, 6381, 12, 8381, 13, 309, 562, 12, 7307, 67, 1484, 6381, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16, 1348, 4672, 2535, 67, 1484, 6381, 273, 365, 18, 1893, 1386, 6381, 12, 5510, 13, 397, 365, 18, 1893, 1386, 6381, 12, 8381, 13, 309, 562, 12, 7307, 67, 1484, 6381, ...
return re.compile(r'
return re.compile(r'
def redirectRegex(self): """ Regular expression recognizing redirect pages, with a group on the target title. """ try: redirKeywords = [u'redirect'] + self.family.redirect[self.lang] redirKeywordsR = r'(?:' + '|'.join(redirKeywords) + ')' except KeyError: # no localized keyword for redirects redirKeywordsR = r'redirect' # A redirect starts with hash (#), followed by a keyword, then # arbitrary stuff, then a wikilink. The link target ends before # either a | or a ]. return re.compile(r'#' + redirKeywordsR + '.*?\[\[(.*?)(?:\]|\|)', re.IGNORECASE | re.UNICODE)
a30242e13baa67c3d2db00060fcf770830f99b94 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/a30242e13baa67c3d2db00060fcf770830f99b94/wikipedia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3136, 6628, 12, 2890, 4672, 3536, 24544, 2652, 14603, 6894, 3136, 4689, 16, 598, 279, 1041, 603, 326, 1018, 2077, 18, 3536, 775, 30, 283, 1214, 14149, 273, 306, 89, 4565, 7205, 3546, 397...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3136, 6628, 12, 2890, 4672, 3536, 24544, 2652, 14603, 6894, 3136, 4689, 16, 598, 279, 1041, 603, 326, 1018, 2077, 18, 3536, 775, 30, 283, 1214, 14149, 273, 306, 89, 4565, 7205, 3546, 397...
for val in walk(path): yield val
subdirs.append(path)
def walk(dir): fnames = []
cef6e83cc639b41f67b686d9c137cfface9a8978 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10616/cef6e83cc639b41f67b686d9c137cfface9a8978/cmd_restore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5442, 12, 1214, 4672, 25294, 273, 5378, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5442, 12, 1214, 4672, 25294, 273, 5378, 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, -...
ByteArrayTest, ByteArrayAsStringTest, ByteArraySubclassTest, BytearrayPEP3137Test)
ByteArrayTest, ByteArrayAsStringTest, BytesSubclassTest, ByteArraySubclassTest, BytearrayPEP3137Test)
def test_main(): test.support.run_unittest( BytesTest, AssortedBytesTest, BytesAsStringTest, ByteArrayTest, ByteArrayAsStringTest, ByteArraySubclassTest, BytearrayPEP3137Test)
be728c442e022977b20c856887b3fb0f20396547 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/be728c442e022977b20c856887b3fb0f20396547/test_bytes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5254, 13332, 1842, 18, 13261, 18, 2681, 67, 4873, 3813, 12, 5985, 4709, 16, 4725, 24726, 2160, 4709, 16, 5985, 8092, 4709, 16, 7964, 4709, 16, 7964, 8092, 4709, 16, 5985, 1676,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1842, 67, 5254, 13332, 1842, 18, 13261, 18, 2681, 67, 4873, 3813, 12, 5985, 4709, 16, 4725, 24726, 2160, 4709, 16, 5985, 8092, 4709, 16, 7964, 4709, 16, 7964, 8092, 4709, 16, 5985, 1676,...
commentlabel = _('An elegant music player for MPD.')
commentlabel = _('An elegant music client for MPD.')
def about(self, action): self.about_dialog = gtk.AboutDialog() try: self.about_dialog.set_transient_for(self.window) self.about_dialog.set_modal(True) except: pass self.about_dialog.set_name('Sonata') self.about_dialog.set_version(__version__) commentlabel = _('An elegant music player for MPD.') self.about_dialog.set_comments(commentlabel) if self.conn: # Include MPD stats: stats = self.conn.do.stats() statslabel = stats.songs + ' ' + _('songs.') + '\n' statslabel = statslabel + stats.albums + ' ' + _('albums.') + '\n' statslabel = statslabel + stats.artists + ' ' + _('artists.') + '\n' try: hours_of_playtime = convert_time(float(stats.db_playtime)).split(':')[-3] except: hours_of_playtime = '0' statslabel = statslabel + hours_of_playtime + ' ' + _('hours of bliss.') self.about_dialog.set_copyright(statslabel) self.about_dialog.set_license(__license__) self.about_dialog.set_authors(['Scott Horowitz <stonecrest@gmail.com>']) self.about_dialog.set_translator_credits('fr - Floreal M <florealm@gmail.com>\npl - Tomasz Dominikowski <dominikowski@gmail.com>\nde - Paul Johnson <thrillerator@googlemail.com>\nuk - Господарисько Тарас <dogmaton@gmail.com>\nru - Beekeybee <bkb.box@bk.ru>') gtk.about_dialog_set_url_hook(self.show_website, "http://sonata.berlios.de") self.about_dialog.set_website_label("http://sonata.berlios.de") large_icon = gtk.gdk.pixbuf_new_from_file(self.find_path('sonata_large.png')) self.about_dialog.set_logo(large_icon) self.about_dialog.connect('response', self.about_close) self.about_dialog.connect('delete_event', self.about_close) self.about_dialog.show_all()
732ac762206a73175f93a0b4dcdc697b3b3ae2ab /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2312/732ac762206a73175f93a0b4dcdc697b3b3ae2ab/sonata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2973, 12, 2890, 16, 1301, 4672, 365, 18, 21071, 67, 12730, 273, 22718, 18, 24813, 6353, 1435, 775, 30, 365, 18, 21071, 67, 12730, 18, 542, 67, 22670, 67, 1884, 12, 2890, 18, 5668, 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, 2973, 12, 2890, 16, 1301, 4672, 365, 18, 21071, 67, 12730, 273, 22718, 18, 24813, 6353, 1435, 775, 30, 365, 18, 21071, 67, 12730, 18, 542, 67, 22670, 67, 1884, 12, 2890, 18, 5668, 13, ...
AEM_code = None
AEM_code = '????'
def _unpack(self, desc, codecs): desc = desc.AECoerceDesc(kAE.typeAEList) result = [] for i in range(1, desc.AECountItems() + 1): succeeded, value = self._datatype.AEM_unpack(desc.AEGetNthDesc(i, kAE.typeWildCard)[1], codecs) if not succeeded: return False, value result.append(value) return True, result
e4b9eeb378f008a94ced58076c50b6d095a8c208 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10961/e4b9eeb378f008a94ced58076c50b6d095a8c208/typedefs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 17309, 12, 2890, 16, 3044, 16, 17437, 4672, 3044, 273, 3044, 18, 16985, 4249, 2765, 4217, 12, 79, 16985, 18, 723, 16985, 682, 13, 563, 273, 5378, 364, 277, 316, 1048, 12, 21, 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, 17309, 12, 2890, 16, 3044, 16, 17437, 4672, 3044, 273, 3044, 18, 16985, 4249, 2765, 4217, 12, 79, 16985, 18, 723, 16985, 682, 13, 563, 273, 5378, 364, 277, 316, 1048, 12, 21, 16, ...
new_cc += ', ' + to to_write.update({'email_cc' : case.email_cc and case.email_cc + new_cc})
new_cc.append(to) to_write.update({'email_cc' : case.email_cc or '' + ','.join(new_cc)})
def action_forward(self, cr, uid, ids, context=None): """ Forward the lead to a partner """ this = self.browse(cr, uid, ids[0], context=context) case_pool = self.pool.get(context.get('active_model')) res_id = context and context.get('active_id', False) or False case = case_pool.browse(cr, uid, res_id, context=context)
e368981d2e2655b33fecd446bd12baaef5e7f9f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/e368981d2e2655b33fecd446bd12baaef5e7f9f4/crm_forward_to_partner.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 67, 11565, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 3536, 17206, 326, 5871, 358, 279, 19170, 3536, 225, 333, 273, 365, 18, 25731, 12, 3353, 16, 4555, 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, 1301, 67, 11565, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 3536, 17206, 326, 5871, 358, 279, 19170, 3536, 225, 333, 273, 365, 18, 25731, 12, 3353, 16, 4555, 16, ...
for h in root.handlers:
for h in root.handlers[:]:
def fileConfig(fname, defaults=None): """ Read the logging configuration from a ConfigParser-format file. This can be called several times from an application, allowing an end user the ability to select from various pre-canned configurations (if the developer provides a mechanism to present the choices and load the chosen configuration). In versions of ConfigParser which have the readfp method [typically shipped in 2.x versions of Python], you can pass in a file-like object rather than a filename, in which case the file-like object will be read using readfp. """ import ConfigParser cp = ConfigParser.ConfigParser(defaults) if hasattr(cp, 'readfp') and hasattr(fname, 'readline'): cp.readfp(fname) else: cp.read(fname) #first, do the formatters... flist = cp.get("formatters", "keys") if len(flist): flist = string.split(flist, ",") formatters = {} for form in flist: sectname = "formatter_%s" % form opts = cp.options(sectname) if "format" in opts: fs = cp.get(sectname, "format", 1) else: fs = None if "datefmt" in opts: dfs = cp.get(sectname, "datefmt", 1) else: dfs = None f = logging.Formatter(fs, dfs) formatters[form] = f #next, do the handlers... #critical section... logging._acquireLock() try: try: #first, lose the existing handlers... logging._handlers.clear() #now set up the new ones... hlist = cp.get("handlers", "keys") if len(hlist): hlist = string.split(hlist, ",") handlers = {} fixups = [] #for inter-handler references for hand in hlist: sectname = "handler_%s" % hand klass = cp.get(sectname, "class") opts = cp.options(sectname) if "formatter" in opts: fmt = cp.get(sectname, "formatter") else: fmt = "" klass = eval(klass, vars(logging)) args = cp.get(sectname, "args") args = eval(args, vars(logging)) h = apply(klass, args) if "level" in opts: level = cp.get(sectname, "level") h.setLevel(logging._levelNames[level]) if len(fmt): h.setFormatter(formatters[fmt]) #temporary hack for FileHandler and MemoryHandler. if klass == logging.handlers.MemoryHandler: if "target" in opts: target = cp.get(sectname,"target") else: target = "" if len(target): #the target handler may not be loaded yet, so keep for later... fixups.append((h, target)) handlers[hand] = h #now all handlers are loaded, fixup inter-handler references... for fixup in fixups: h = fixup[0] t = fixup[1] h.setTarget(handlers[t]) #at last, the loggers...first the root... llist = cp.get("loggers", "keys") llist = string.split(llist, ",") llist.remove("root") sectname = "logger_root" root = logging.root log = root opts = cp.options(sectname) if "level" in opts: level = cp.get(sectname, "level") log.setLevel(logging._levelNames[level]) for h in root.handlers: root.removeHandler(h) hlist = cp.get(sectname, "handlers") if len(hlist): hlist = string.split(hlist, ",") for hand in hlist: log.addHandler(handlers[hand]) #and now the others... #we don't want to lose the existing loggers, #since other threads may have pointers to them. #existing is set to contain all existing loggers, #and as we go through the new configuration we #remove any which are configured. At the end, #what's left in existing is the set of loggers #which were in the previous configuration but #which are not in the new configuration. existing = root.manager.loggerDict.keys() #now set up the new ones... for log in llist: sectname = "logger_%s" % log qn = cp.get(sectname, "qualname") opts = cp.options(sectname) if "propagate" in opts: propagate = cp.getint(sectname, "propagate") else: propagate = 1 logger = logging.getLogger(qn) if qn in existing: existing.remove(qn) if "level" in opts: level = cp.get(sectname, "level") logger.setLevel(logging._levelNames[level]) for h in logger.handlers: logger.removeHandler(h) logger.propagate = propagate logger.disabled = 0 hlist = cp.get(sectname, "handlers") if len(hlist): hlist = string.split(hlist, ",") for hand in hlist: logger.addHandler(handlers[hand]) #Disable any old loggers. There's no point deleting #them as other threads may continue to hold references #and by disabling them, you stop them doing any logging. for log in existing: root.manager.loggerDict[log].disabled = 1 except: import traceback ei = sys.exc_info() traceback.print_exception(ei[0], ei[1], ei[2], None, sys.stderr) del ei finally: logging._releaseLock()
e9eaabc6279cab32ef2d35f61b4254a661679fe7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/e9eaabc6279cab32ef2d35f61b4254a661679fe7/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 585, 809, 12, 12749, 16, 3467, 33, 7036, 4672, 3536, 2720, 326, 2907, 1664, 628, 279, 25076, 17, 2139, 585, 18, 225, 1220, 848, 506, 2566, 11392, 4124, 628, 392, 2521, 16, 15632, 392, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 585, 809, 12, 12749, 16, 3467, 33, 7036, 4672, 3536, 2720, 326, 2907, 1664, 628, 279, 25076, 17, 2139, 585, 18, 225, 1220, 848, 506, 2566, 11392, 4124, 628, 392, 2521, 16, 15632, 392, ...
if os.path.isfile(check): self.log.verbose('Found file '+check+' appending to Input Sandbox') resolvedIS.append(check) if os.path.isdir(check): if re.search('/$',check):
if os.path.isfile( check ): self.log.verbose( 'Found file ' + check + ' appending to Input Sandbox' ) resolvedIS.append( check ) if os.path.isdir( check ): if re.search( '/$', check ):
def _resolveInputSandbox(self, inputSandbox): """ Internal function.
50b3322668816ba92ea3f9b253d993dc34c53a21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/50b3322668816ba92ea3f9b253d993dc34c53a21/Job.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 10828, 1210, 17881, 12, 2890, 16, 810, 17881, 4672, 3536, 3186, 445, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 10828, 1210, 17881, 12, 2890, 16, 810, 17881, 4672, 3536, 3186, 445, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
@keyword dir: The directory in which to store the file, relative to
@keyword dir: The directory in which to store the file, relative to
def __init__(self, recipe, *args, **keywords):
bbf56a2c6ce326846b9cfaed245edce8bd904567 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/bbf56a2c6ce326846b9cfaed245edce8bd904567/source.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 16100, 16, 380, 1968, 16, 2826, 11771, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 16100, 16, 380, 1968, 16, 2826, 11771, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
print "+ Text differs in '%s'" % type
print "+ Text differs (type '%s')" % type def prop_diff( self, name, value1, value2 ): """Called when a revprop is in one dump only.""" if self.__ignores.has_key( "PropDiff" ): return if self.__ignore_property.has_key( name ): return self.diffs = True if self.verbosity > 0: self.__print_node() if not self.__prophdr_printed: self.__prophdr_printed = True print " Properties:" print "+ Property '%s'" % name print " dump1: '%s'" % value1 print " dump2: '%s'" % value2 def prop_missing( self, dumpnr, name, value ): """Called when a revprop is in one dump only.""" if self.__ignores.has_key( "PropMissing" ): return if self.__ignore_property.has_key( name ): return self.diffs = True if self.verbosity > 0: self.__print_node() if not self.__prophdr_printed: self.__prophdr_printed = True print " Properties:" print "+ Property '%s' missing in dump%d" % ( name, dumpnr ) print " dump%d: '%s'" % ( 3-dumpnr, value )
def text_diff( self, type ): """Called when text differs."""
45baf7d2aaa614a5e0533f85af0f2b815f01c8ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13212/45baf7d2aaa614a5e0533f85af0f2b815f01c8ee/diff.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 977, 67, 5413, 12, 365, 16, 618, 262, 30, 3536, 8185, 1347, 977, 21944, 12123, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 977, 67, 5413, 12, 365, 16, 618, 262, 30, 3536, 8185, 1347, 977, 21944, 12123, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
if xbmc_rev >= 20015 and (environment != 'xbox' or xbmc_rev >= 20262):
if xbmc_rev >= 20015 and (environment != 'xbox' or xbmc_rev >= 20810):
def get_setting_videostream(feed=None,default='flashmed'): # SVN 20015 supports H.264 of which H.264 800 can play on all platforms try: xbmc_version = xbmc.getInfoLabel( "System.BuildVersion" ) xbmc_rev = int( xbmc_version.split( " " )[ 1 ].replace( "r", "" ) ) except: print "Revision info not available: %s" % xbmc_version xbmc_rev = 0 # check for xbox as it can't do HD environment = os.environ.get( "OS", "xbox" ) # If viewing BBC HD on an xbmc build that supports it play full HD if the screen is large enough if environment != 'xbox' and xbmc_rev > 20015 and feed and feed == 'BBC HD': Y = int(xbmc.getInfoLabel('System.ScreenHeight')) X = int(xbmc.getInfoLabel('System.ScreenWidth')) if Y > 576 and X > 720: # The screen is large enough for HD return 'h264 3200' else: # The screen is not large enough for HD return 'h264 1500' videostream = xbmcplugin.getSetting('video_stream') #Auto|Flash VP6|H.264 (800kb)|H.264 (1500kb)|H.264 (3200kb) if videostream: if videostream == 'Flash (512kb)' or videostream == '1': return 'flashmed' elif videostream == 'H.264 (800kb)' or videostream == '2': return 'h264 800' elif videostream == 'H.264 (1500kb)' or videostream == '3': return 'h264 1500' elif videostream == 'H.264 (3200kb)' or videostream == '4': return 'h264 3200' # Linux & Windows from SVN:20015 support H.264 # XBox from SVN:20262 supports H.264 if xbmc_rev >= 20015 and (environment != 'xbox' or xbmc_rev >= 20262): return 'h264 800' return default
1148069d75434cb6efe5345cf89aa2e635aa3267 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4862/1148069d75434cb6efe5345cf89aa2e635aa3267/default.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 8920, 67, 6768, 669, 793, 12, 7848, 33, 7036, 16, 1886, 2218, 13440, 2937, 11, 4672, 225, 468, 29537, 50, 4044, 3600, 6146, 670, 18, 23728, 434, 1492, 670, 18, 23728, 1725, 71...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 8920, 67, 6768, 669, 793, 12, 7848, 33, 7036, 16, 1886, 2218, 13440, 2937, 11, 4672, 225, 468, 29537, 50, 4044, 3600, 6146, 670, 18, 23728, 434, 1492, 670, 18, 23728, 1725, 71...
version = blink.__version__,
version = __version__,
def find_packages(toplevel): return [directory.replace('/', '.') for directory, subdirs, files in os.walk(toplevel) if '__init__.py' in files]
d64793cce1c212b2302de18dc0e44a074b5e2faa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3447/d64793cce1c212b2302de18dc0e44a074b5e2faa/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 10308, 12, 3669, 2815, 4672, 327, 306, 5149, 18, 2079, 2668, 19, 2187, 2611, 13, 364, 1867, 16, 720, 8291, 16, 1390, 316, 1140, 18, 11348, 12, 3669, 2815, 13, 309, 4940, 2738...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 10308, 12, 3669, 2815, 4672, 327, 306, 5149, 18, 2079, 2668, 19, 2187, 2611, 13, 364, 1867, 16, 720, 8291, 16, 1390, 316, 1140, 18, 11348, 12, 3669, 2815, 13, 309, 4940, 2738...
if chunks[0].strip() == '':
if chunks[0].strip() == '' and lines:
def _wrap_chunks(self, chunks): """_wrap_chunks(chunks : [string]) -> [string]
ab73d46e45eae94fb8be040ccb32d3510b8f58fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ab73d46e45eae94fb8be040ccb32d3510b8f58fa/textwrap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4113, 67, 14691, 12, 2890, 16, 6055, 4672, 3536, 67, 4113, 67, 14691, 12, 14691, 294, 306, 1080, 5717, 317, 306, 1080, 65, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4113, 67, 14691, 12, 2890, 16, 6055, 4672, 3536, 67, 4113, 67, 14691, 12, 14691, 294, 306, 1080, 5717, 317, 306, 1080, 65, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
fsum = '</BR>'+descrstr
fsum = '<br>'+descrstr
def _func_summary(self, functions, heading='Function Summary'): 'Return a summary of the functions in a class or module' functions = self._sort(functions) if len(functions) == 0: return '' str = self._table_header(heading, 'summary') for link in functions: func = link.target() fname = link.name() if not self._docmap.has_key(func): if WARN_MISSING: print 'WARNING: MISSING', func continue fdoc = self._docmap[func] rval = fdoc.returns() if rval.type(): rtype = epytext.to_html(rval.type()) else: rtype = '&nbsp;'
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, 644, 67, 7687, 12, 2890, 16, 4186, 16, 11053, 2218, 2083, 17967, 11, 4672, 296, 990, 279, 4916, 434, 326, 4186, 316, 279, 667, 578, 1605, 11, 4186, 273, 365, 6315, 3804, 12, 10722...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 644, 67, 7687, 12, 2890, 16, 4186, 16, 11053, 2218, 2083, 17967, 11, 4672, 296, 990, 279, 4916, 434, 326, 4186, 316, 279, 667, 578, 1605, 11, 4186, 273, 365, 6315, 3804, 12, 10722...
('add_ui', [Mpfr, UnsignedLong]), ('add_si', [Mpfr, Long]), ('add_d', [Mpfr, ctypes.c_double]), ('ui_sub', [UnsignedLong, Mpfr]), ('sub_ui', [Mpfr, UnsignedLong]), ('si_sub', [Long, Mpfr]), ('sub_si', [Mpfr, Long]), ('d_sub', [ctypes.c_double, Mpfr]), ('sub_d', [Mpfr, ctypes.c_double]), ('mul_ui', [Mpfr, UnsignedLong]), ('mul_si', [Mpfr, Long]), ('mul_d', [Mpfr, ctypes.c_double]), ('ui_div', [UnsignedLong, Mpfr]), ('div_ui', [Mpfr, UnsignedLong]), ('si_div', [Long, Mpfr]), ('div_si', [Mpfr, Long]), ('d_div', [ctypes.c_double, Mpfr]), ('div_d', [Mpfr, ctypes.c_double]),
('add_ui', [IMpfr, UnsignedLong]), ('add_si', [IMpfr, Long]), ('add_d', [IMpfr, ctypes.c_double]), ('ui_sub', [UnsignedLong, IMpfr]), ('sub_ui', [IMpfr, UnsignedLong]), ('si_sub', [Long, IMpfr]), ('sub_si', [IMpfr, Long]), ('d_sub', [ctypes.c_double, IMpfr]), ('sub_d', [IMpfr, ctypes.c_double]), ('mul_ui', [IMpfr, UnsignedLong]), ('mul_si', [IMpfr, Long]), ('mul_d', [IMpfr, ctypes.c_double]), ('ui_div', [UnsignedLong, IMpfr]), ('div_ui', [IMpfr, UnsignedLong]), ('si_div', [Long, IMpfr]), ('div_si', [IMpfr, Long]), ('d_div', [ctypes.c_double, IMpfr]), ('div_d', [IMpfr, ctypes.c_double]),
def error_on_failure(result, func, args): if result: raise ValueError("call failed") return result
b450c0023d8375a0580fdd1ed0db290a5d5cd85a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7048/b450c0023d8375a0580fdd1ed0db290a5d5cd85a/pympfr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 555, 67, 265, 67, 12251, 12, 2088, 16, 1326, 16, 833, 4672, 309, 563, 30, 1002, 2068, 2932, 1991, 2535, 7923, 327, 563, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 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, 555, 67, 265, 67, 12251, 12, 2088, 16, 1326, 16, 833, 4672, 309, 563, 30, 1002, 2068, 2932, 1991, 2535, 7923, 327, 563, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
location = response['location'] (scheme, authority, path, query, fragment) = parse_uri(location) if authority == None: location = urlparse.urljoin(absolute_uri, location)
def _request(self, conn, host, absolute_uri, request_uri, method, body, headers, redirections, cachekey): """Do the actual request using the connection object and also follow one level of redirects if necessary"""
ba0edec65783b668d994687975be2a627f3aafc2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13138/ba0edec65783b668d994687975be2a627f3aafc2/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2293, 12, 2890, 16, 1487, 16, 1479, 16, 4967, 67, 1650, 16, 590, 67, 1650, 16, 707, 16, 1417, 16, 1607, 16, 19611, 87, 16, 1247, 856, 4672, 3536, 3244, 326, 3214, 590, 1450, 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, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2293, 12, 2890, 16, 1487, 16, 1479, 16, 4967, 67, 1650, 16, 590, 67, 1650, 16, 707, 16, 1417, 16, 1607, 16, 19611, 87, 16, 1247, 856, 4672, 3536, 3244, 326, 3214, 590, 1450, 326...
currList = [] currList = self['list'].list for entry in currList: self.WlanList.append( (entry[1], entry[0]) )
for entry in self['list'].list: if entry[1] == "hidden...": self.WlanList.append(( "hidden...",_("enter hidden network SSID") )) else: self.WlanList.append( (entry[0], entry[0]) )
def buildWlanList(self): self.WlanList = [] currList = [] currList = self['list'].list for entry in currList: self.WlanList.append( (entry[1], entry[0]) )
ecd9f154cdf3b90ef00bc92707ab0a1a29b642af /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6652/ecd9f154cdf3b90ef00bc92707ab0a1a29b642af/plugin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 59, 6115, 682, 12, 2890, 4672, 365, 18, 59, 6115, 682, 273, 5378, 4306, 682, 273, 5378, 4306, 682, 273, 365, 3292, 1098, 29489, 1098, 364, 1241, 316, 4306, 682, 30, 365, 18, 59, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 59, 6115, 682, 12, 2890, 4672, 365, 18, 59, 6115, 682, 273, 5378, 4306, 682, 273, 5378, 4306, 682, 273, 365, 3292, 1098, 29489, 1098, 364, 1241, 316, 4306, 682, 30, 365, 18, 59, ...
def fl_set_xyplot_data_double(ob, x, y, n, title, xlabel, ylabel): """ fl_set_xyplot_data_double(ob, x, y, n, title, xlabel, ylabel) -> num. """ retval = _fl_set_xyplot_data_double(ob, x, y, n, title, xlabel, ylabel)
def fl_set_xyplot_data_double(pObject, x, y, n, title, xlabel, ylabel): """ fl_set_xyplot_data_double(pObject, x, y, n, title, xlabel, ylabel) -> num. """ retval = _fl_set_xyplot_data_double(pObject, x, y, n, title, xlabel, ylabel)
def fl_set_xyplot_data_double(ob, x, y, n, title, xlabel, ylabel): """ fl_set_xyplot_data_double(ob, x, y, n, title, xlabel, ylabel) -> num. """ retval = _fl_set_xyplot_data_double(ob, x, y, n, title, xlabel, ylabel) 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, 542, 67, 1698, 4032, 67, 892, 67, 9056, 12, 84, 921, 16, 619, 16, 677, 16, 290, 16, 2077, 16, 16576, 16, 16305, 4672, 3536, 1183, 67, 542, 67, 1698, 4032, 67, 892, 67, 90...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 542, 67, 1698, 4032, 67, 892, 67, 9056, 12, 84, 921, 16, 619, 16, 677, 16, 290, 16, 2077, 16, 16576, 16, 16305, 4672, 3536, 1183, 67, 542, 67, 1698, 4032, 67, 892, 67, 90...
self.floatframe.SetSize(wxSize(barsize[0], barsize[1] + self.titleheight)) self.floatframe.SetClientSize(wxSize(barsize[0], barsize[1]))
self.floatframe.SetClientSize(wxSize(50,200))
def Float(self, bool): "Floats or docks the toolbar programmatically." if bool: self.parentframe = wxPyTypeCast(self.GetParent(), 'wxFrame') clientsize = self.parentframe.GetClientSizeTuple() self.floatframe = wxMiniFrame(self.parentframe, -1, self.title, wxDefaultPosition, wxDefaultSize, wxTHICK_FRAME) self.Reparent(self.floatframe) self.parentframe.SetToolBar(None) self.floating = 1 size = self.parentframe.GetSize() self.parentframe.SetSize(wxSize(0,0)) self.parentframe.SetSize(size) self.floatframe.SetToolBar(self) self.oldcolor = self.GetBackgroundColour() barsize = self.GetSizeTuple() self.floatframe.SetSize(wxSize(barsize[0], barsize[1] + self.titleheight)) self.floatframe.SetClientSize(wxSize(barsize[0], barsize[1])) newpos = self.parentframe.GetPosition() newpos.y = newpos.y + self.titleheight self.floatframe.SetPosition(newpos) self.floatframe.Show(true) EVT_CLOSE(self.floatframe, self.OnDock)
3017f78d673acd86b210bd8d3747d45bb46d5fcd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/3017f78d673acd86b210bd8d3747d45bb46d5fcd/floatbar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5450, 12, 2890, 16, 1426, 4672, 315, 4723, 87, 578, 5822, 87, 326, 12748, 5402, 26500, 1230, 1199, 309, 1426, 30, 365, 18, 2938, 3789, 273, 7075, 9413, 559, 9735, 12, 2890, 18, 967, 30...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5450, 12, 2890, 16, 1426, 4672, 315, 4723, 87, 578, 5822, 87, 326, 12748, 5402, 26500, 1230, 1199, 309, 1426, 30, 365, 18, 2938, 3789, 273, 7075, 9413, 559, 9735, 12, 2890, 18, 967, 30...
self.prefixes = [ "$USERPROFILE\\Application Data\\OpenOffice.org\\3", "~\\Application Data\\OpenOffice.org2" ]
self.prefixes = [ "$APPDATA\\OpenOffice.org\\3", "$APPDATA\\OpenOffice.org2" ]
def __init__(self): Cleaner.__init__(self) self.options = {} self.add_option('cache', _('Cache'), _('Delete the cache')) self.add_option('recent_documents', _('Recent documents list'), _("Delete the list of recently used documents"))
2f13667495ebbcb44ec480374702c6886d344578 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7853/2f13667495ebbcb44ec480374702c6886d344578/CleanerBackend.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 9645, 264, 16186, 2738, 972, 12, 2890, 13, 365, 18, 2116, 273, 2618, 365, 18, 1289, 67, 3482, 2668, 2493, 2187, 389, 2668, 1649, 19899, 389, 2668, 2613, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9645, 264, 16186, 2738, 972, 12, 2890, 13, 365, 18, 2116, 273, 2618, 365, 18, 1289, 67, 3482, 2668, 2493, 2187, 389, 2668, 1649, 19899, 389, 2668, 2613, ...
parent = readmodule_ex(package, path, inpackage)
parent = _readmodule(package, path, inpackage)
def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in which we are searching for a submodule, and then PATH must be the package search path; otherwise, we are searching for a top-level module, and PATH is combined with sys.path. ''' # Compute the full module name (prepending inpackage if set) if inpackage: fullmodule = "%s.%s" % (inpackage, module) else: fullmodule = module # Check in the cache if fullmodule in _modules: return _modules[fullmodule] # Initialize the dict for this module's contents dict = {} # Check if it is a built-in module; we don't do much for these if module in sys.builtin_module_names and not inpackage: _modules[module] = dict return dict # Check for a dotted module name i = module.rfind('.') if i >= 0: package = module[:i] submodule = module[i+1:] parent = readmodule_ex(package, path, inpackage) if inpackage: package = "%s.%s" % (inpackage, package) return readmodule_ex(submodule, parent['__path__'], package) # Search the path for the module f = None if inpackage: f, file, (suff, mode, type) = imp.find_module(module, path) else: f, file, (suff, mode, type) = imp.find_module(module, path + sys.path) if type == imp.PKG_DIRECTORY: dict['__path__'] = [file] path = [file] + path f, file, (suff, mode, type) = imp.find_module('__init__', [file]) _modules[fullmodule] = dict if type != imp.PY_SOURCE: # not Python source, can't do anything with this module f.close() return dict classstack = [] # stack of (class, indent) pairs g = tokenize.generate_tokens(f.readline) try: for tokentype, token, start, end, line in g: if token == 'def': lineno, thisindent = start tokentype, meth_name, start, end, line = g.next() if tokentype != NAME: continue # Syntax error # close all classes indented at least as much while classstack and \ classstack[-1][1] >= thisindent: del classstack[-1] if classstack: # it's a class method cur_class = classstack[-1][0] cur_class._addmethod(meth_name, lineno) else: # it's a function dict[meth_name] = Function(module, meth_name, file, lineno) elif token == 'class': lineno, thisindent = start tokentype, class_name, start, end, line = g.next() if tokentype != NAME: continue # Syntax error # close all classes indented at least as much while classstack and \ classstack[-1][1] >= thisindent: del classstack[-1] # parse what follows the class name tokentype, token, start, end, line = g.next() inherit = None if token == '(': names = [] # List of superclasses # there's a list of superclasses level = 1 super = [] # Tokens making up current superclass while True: tokentype, token, start, end, line = g.next() if token in (')', ',') and level == 1: n = "".join(super) if n in dict: # we know this super class n = dict[n] else: c = n.split('.') if len(c) > 1: # super class is of the form # module.class: look in module for # class m = c[-2] c = c[-1] if m in _modules: d = _modules[m] if c in d: n = d[c] names.append(n) if token == '(': level += 1 elif token == ')': level -= 1 if level == 0: break elif token == ',' and level == 1: pass else: super.append(token) inherit = names cur_class = Class(module, class_name, inherit, file, lineno) dict[class_name] = cur_class classstack.append((cur_class, thisindent)) elif token == 'import' and start[1] == 0: modules = _getnamelist(g) for mod, mod2 in modules: try: # Recursively read the imported module if not inpackage: readmodule_ex(mod, path) else: try: readmodule_ex(mod, path, inpackage) except ImportError: readmodule_ex(mod) except: # If we can't find or parse the imported module, # too bad -- don't die here. pass elif token == 'from' and start[1] == 0: mod, token = _getname(g) if not mod or token != "import": continue names = _getnamelist(g) try: # Recursively read the imported module d = readmodule_ex(mod, path, inpackage) except: # If we can't find or parse the imported module, # too bad -- don't die here. continue # add any classes that were defined in the imported module # to our name space if they were mentioned in the list for n, n2 in names: if n in d: dict[n2 or n] = d[n] elif n == '*': # only add a name if not already there (to mimic # what Python does internally) also don't add # names that start with _ for n in d: if n[0] != '_' and not n in dict: dict[n] = d[n] except StopIteration: pass f.close() return dict
69689ec153ac01a51540a5bb3eafceb7eb9c7ba7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/69689ec153ac01a51540a5bb3eafceb7eb9c7ba7/pyclbr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 2978, 67, 338, 12, 2978, 16, 589, 22850, 6487, 316, 5610, 33, 7036, 4672, 9163, 1994, 279, 1605, 585, 471, 327, 279, 3880, 434, 3318, 18, 225, 5167, 364, 14057, 316, 7767, 471, 25...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 2978, 67, 338, 12, 2978, 16, 589, 22850, 6487, 316, 5610, 33, 7036, 4672, 9163, 1994, 279, 1605, 585, 471, 327, 279, 3880, 434, 3318, 18, 225, 5167, 364, 14057, 316, 7767, 471, 25...
console = ['hg'])
**py2exe_opts)
def finalize_options(self): self.set_undefined_options('install', ('install_lib', 'install_dir')) install_data.finalize_options(self)
cd040e3371957662388c50ae45b8a97d093b5197 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/cd040e3371957662388c50ae45b8a97d093b5197/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12409, 67, 2116, 12, 2890, 4672, 365, 18, 542, 67, 5978, 67, 2116, 2668, 5425, 2187, 7707, 5425, 67, 2941, 2187, 296, 5425, 67, 1214, 26112, 3799, 67, 892, 18, 30343, 67, 2116, 12, 289...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12409, 67, 2116, 12, 2890, 4672, 365, 18, 542, 67, 5978, 67, 2116, 2668, 5425, 2187, 7707, 5425, 67, 2941, 2187, 296, 5425, 67, 1214, 26112, 3799, 67, 892, 18, 30343, 67, 2116, 12, 289...
def end_fault(self):
def end_fault(self, data):
def end_fault(self): self._type = "fault"
80ead46c3b0b9513bc116e8fe08faa2f91145a91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/80ead46c3b0b9513bc116e8fe08faa2f91145a91/xmlrpclib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 679, 67, 643, 12, 2890, 16, 501, 4672, 365, 6315, 723, 273, 315, 643, 6, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 679, 67, 643, 12, 2890, 16, 501, 4672, 365, 6315, 723, 273, 315, 643, 6, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
struct = 7
struct = 3
def GetValues(self): name = self.IndexName.GetValue() index = int(self.Index.GetValue(), 16) if self.radioButton1.GetValue(): struct = 1 number = None elif self.radioButton2.GetValue(): struct = 3 number = int(self.Number.GetValue()) elif self.radioButton3.GetValue(): struct = 7 number = int(self.Number.GetValue()) return index, name, struct, number
1a6aace7b6747da8083b4daf8d638cbc84d696a3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/116/1a6aace7b6747da8083b4daf8d638cbc84d696a3/commondialogs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 1972, 12, 2890, 4672, 508, 273, 365, 18, 29276, 18, 967, 620, 1435, 770, 273, 509, 12, 2890, 18, 1016, 18, 967, 620, 9334, 2872, 13, 309, 365, 18, 17006, 3616, 21, 18, 967, 620,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 1972, 12, 2890, 4672, 508, 273, 365, 18, 29276, 18, 967, 620, 1435, 770, 273, 509, 12, 2890, 18, 1016, 18, 967, 620, 9334, 2872, 13, 309, 365, 18, 17006, 3616, 21, 18, 967, 620,...
self.self_closing_pat = re.compile(r'<([a-z]+)\s+([^>]+)/>',
self.self_closing_pat = re.compile(r'<([a-z1-6]+)\s+([^>]+)/>',
def __init__(self, *args): QWebView.__init__(self, *args) self.debug_javascript = False self.shortcuts = Shortcuts(SHORTCUTS, 'shortcuts/viewer') self.self_closing_pat = re.compile(r'<([a-z]+)\s+([^>]+)/>', re.IGNORECASE) self.setSizePolicy(QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)) self._size_hint = QSize(510, 680) self.initial_pos = 0.0 self.to_bottom = False self.document = Document(self.shortcuts, parent=self) self.setPage(self.document) self.manager = None self._reference_mode = False self._ignore_scrollbar_signals = False self.loading_url = None self.loadFinished.connect(self.load_finished) self.connect(self.document, SIGNAL('linkClicked(QUrl)'), self.link_clicked) self.connect(self.document, SIGNAL('linkHovered(QString,QString,QString)'), self.link_hovered) self.connect(self.document, SIGNAL('selectionChanged()'), self.selection_changed) self.connect(self.document, SIGNAL('animated_scroll_done()'), self.animated_scroll_done, Qt.QueuedConnection) copy_action = self.pageAction(self.document.Copy) copy_action.setIcon(QIcon(I('convert.svg'))) d = self.document self.unimplemented_actions = list(map(self.pageAction, [d.DownloadImageToDisk, d.OpenLinkInNewWindow, d.DownloadLinkToDisk, d.OpenImageInNewWindow, d.OpenLink])) self.dictionary_action = QAction(QIcon(I('dictionary.png')), _('&Lookup in dictionary'), self) self.dictionary_action.setShortcut(Qt.CTRL+Qt.Key_L) self.dictionary_action.triggered.connect(self.lookup) self.goto_location_action = QAction(_('Go to...'), self) self.goto_location_menu = m = QMenu(self) self.goto_location_actions = a = { 'Next Page': self.next_page, 'Previous Page': self.previous_page, 'Section Top' : partial(self.scroll_to, 0), 'Document Top': self.goto_document_start, 'Section Bottom':partial(self.scroll_to, 1), 'Document Bottom': self.goto_document_end, 'Next Section': self.goto_next_section, 'Previous Section': self.goto_previous_section, } for name, key in [(_('Next Section'), 'Next Section'), (_('Previous Section'), 'Previous Section'), (None, None), (_('Document Start'), 'Document Top'), (_('Document End'), 'Document Bottom'), (None, None), (_('Section Start'), 'Section Top'), (_('Section End'), 'Section Bottom'), (None, None), (_('Next Page'), 'Next Page'), (_('Previous Page'), 'Previous Page')]: if key is None: m.addSeparator() else: m.addAction(name, a[key], self.shortcuts.get_sequences(key)[0]) self.goto_location_action.setMenu(self.goto_location_menu)
6c62c10ac2d7567c6fa073acba39aa5e7fd9d24b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/6c62c10ac2d7567c6fa073acba39aa5e7fd9d24b/documentview.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 2238, 4079, 1767, 16186, 2738, 972, 12, 2890, 16, 380, 1968, 13, 365, 18, 4148, 67, 11242, 273, 1083, 365, 18, 24744, 87, 273, 225, 7925...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 2238, 4079, 1767, 16186, 2738, 972, 12, 2890, 16, 380, 1968, 13, 365, 18, 4148, 67, 11242, 273, 1083, 365, 18, 24744, 87, 273, 225, 7925...
lines = []
def _receive_data(self): """ Read the response from a command. """
7cdd5c3d68d5adfce1961b30d323910f37b90467 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14505/7cdd5c3d68d5adfce1961b30d323910f37b90467/manager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 18149, 67, 892, 12, 2890, 4672, 3536, 2720, 326, 766, 628, 279, 1296, 18, 3536, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 18149, 67, 892, 12, 2890, 4672, 3536, 2720, 326, 766, 628, 279, 1296, 18, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
rval.sort() return rval
def listKeys(self, config): """Return sorted keys of config. """ try: rval = config.keys() except (AttributeError, TypeError): return [] rval.sort() return rval
06eade0995d8174cd945dadb36f33f74d675fd22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11316/06eade0995d8174cd945dadb36f33f74d675fd22/permissions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 2396, 12, 2890, 16, 642, 4672, 3536, 990, 3115, 1311, 434, 642, 18, 3536, 775, 30, 14267, 273, 642, 18, 2452, 1435, 1335, 261, 1499, 668, 16, 3580, 4672, 327, 5378, 14267, 18, 380...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 2396, 12, 2890, 16, 642, 4672, 3536, 990, 3115, 1311, 434, 642, 18, 3536, 775, 30, 14267, 273, 642, 18, 2452, 1435, 1335, 261, 1499, 668, 16, 3580, 4672, 327, 5378, 14267, 18, 380...
timestamped_pathnames = [(fp.get(pn, 0), pn) for pn in random_pathnames]
timestamped_pathnames = [] while not timestamped_pathnames: random_pathnames = [PlayerRow(*x).filename for x in random.sample(self.liststore, poolsize)] timestamped_pathnames = [(fp.get(pn, 0), pn) for pn in random_pathnames if pn]
def invoke_end_of_track_policy(self): # This is where we implement the playlist modes. mode_text = self.pl_mode.get_active_text() if self.is_playing == False: print "Assertion failed in: invoke_end_of_track_policy" return if mode_text == ln.manual: # For Manual mode just stop the player at the end of the track. print "Stopping in accordance with manual mode" self.stop.clicked() elif mode_text == ln.play_all: if self.music_filename == "": self.handle_playlist_control() else: self.next.clicked() treeselection = self.treeview.get_selection() if self.is_playing == False: treeselection.select_path(0) # park on the first menu item elif mode_text == ln.loop_all or mode_text == ln.cue_up: iter = self.next_real_track(self.iter_playing) if iter is None: iter = self.first_real_track() self.stop.clicked() if iter is not None: treeselection = self.treeview.get_selection() treeselection.select_iter(iter) if mode_text == ln.loop_all: self.play.clicked() else: treeselection.select_path(0) elif mode_text == ln.random: # Not truly random. Effort is made to break the appearance of # having a set play order to a long term listener without # re-playing the same track too soon. self.stop.clicked()
3d9375bec1d446da67450b9cb10aaa58bdac2237 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7615/3d9375bec1d446da67450b9cb10aaa58bdac2237/IDJCmedia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4356, 67, 409, 67, 792, 67, 4101, 67, 5086, 12, 2890, 4672, 468, 1220, 353, 1625, 732, 2348, 326, 16428, 12382, 18, 1965, 67, 955, 273, 365, 18, 412, 67, 3188, 18, 588, 67, 3535, 67,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4356, 67, 409, 67, 792, 67, 4101, 67, 5086, 12, 2890, 4672, 468, 1220, 353, 1625, 732, 2348, 326, 16428, 12382, 18, 1965, 67, 955, 273, 365, 18, 412, 67, 3188, 18, 588, 67, 3535, 67,...
if self.dicts[i]['POnset'] == 'impulsive': Sub(pick, "onset").text = 'impulsive' elif self.dicts[i]['POnset'] == 'emergent': Sub(pick, "onset").text = 'emergent'
Sub(pick, "onset").text = self.dicts[i]['POnset']
def threeDLoc2XML(self): """ Returns output of 3dloc as xml file """ xml = Element("event") Sub(Sub(xml, "event_id"), "value").text = self.xmlEventID Sub(Sub(xml, "event_type"), "value").text = "manual" # we save P picks on Z-component and S picks on N-component # XXX standard values for unset keys!!!???!!!??? for i in range(len(self.streams)): if self.dicts[i].has_key('P'): pick = Sub(xml, "pick") wave = Sub(pick, "waveform") wave.set("networkCode", self.streams[i][0].stats.network) wave.set("stationCode", self.streams[i][0].stats.station) wave.set("channelCode", self.streams[i][0].stats.channel) wave.set("locationCode", "") date = Sub(pick, "time") # prepare time of pick picktime = self.streams[i][0].stats.starttime picktime += (self.dicts[i]['P'] / self.streams[i][0].stats.sampling_rate) Sub(date, "value").text = (picktime.isoformat() + '.%06i' % picktime.microsecond) if self.dicts[i].has_key('PErr1') and self.dicts[i].has_key('PErr2'): temp = float(self.dicts[i].has_key('PErr2') - self.dicts[i].has_key('PErr1')) temp /= self.streams[i][0].stats.sampling_rate Sub(date, "uncertainty").text = str(temp) else: Sub(date, "uncertainty") Sub(pick, "phaseHint").text = "P" if self.dicts[i].has_key('POnset'): if self.dicts[i]['POnset'] == 'impulsive': Sub(pick, "onset").text = 'impulsive' elif self.dicts[i]['POnset'] == 'emergent': Sub(pick, "onset").text = 'emergent' else: Sub(pick, "onset") if self.dicts[i].has_key('PPol'): if self.dicts[i]['PPol'] == 'Up' or self.dicts[i]['PPol'] == 'PoorUp': Sub(pick, "polarity").text = 'positive' elif self.dicts[i]['PPol'] == 'Down' or self.dicts[i]['PPol'] == 'PoorDown': Sub(pick, "polarity").text = 'negative' else: Sub(pick, "polarity") if self.dicts[i].has_key('PWeight'): Sub(pick, "weight").text = '%i' % self.dicts[i]['PWeight'] else: Sub(pick, "weight") Sub(Sub(pick, "min_amp"), "value").text = "0.00000" #XXX what is min_amp??? Sub(pick, "phase_compu").text = "IPU0" Sub(Sub(pick, "phase_res"), "value").text = "0.17000" Sub(Sub(pick, "phase_weight"), "value").text = "1.00000" Sub(Sub(pick, "phase_delay"), "value").text = "0.00000" Sub(Sub(pick, "azimuth"), "value").text = "1.922043" Sub(Sub(pick, "incident"), "value").text = "96.00000" Sub(Sub(pick, "epi_dist"), "value").text = "44.938843" Sub(Sub(pick, "hyp_dist"), "value").text = "45.30929"
58ecfe19bef44aacd9e7b0124f02593f5139b455 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/58ecfe19bef44aacd9e7b0124f02593f5139b455/obspyck.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8925, 40, 1333, 22, 4201, 12, 2890, 4672, 3536, 2860, 876, 434, 890, 72, 1829, 487, 2025, 585, 3536, 2025, 273, 225, 3010, 2932, 2575, 7923, 2592, 12, 1676, 12, 2902, 16, 315, 2575, 67...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8925, 40, 1333, 22, 4201, 12, 2890, 4672, 3536, 2860, 876, 434, 890, 72, 1829, 487, 2025, 585, 3536, 2025, 273, 225, 3010, 2932, 2575, 7923, 2592, 12, 1676, 12, 2902, 16, 315, 2575, 67...
Traceback (most recent call last)
Traceback (most recent call last):
def times_called(self, n): """Set the number of times an object can be called.
8c7a3c2aa1061ea467f7d7442344e84dbabefbcf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3602/8c7a3c2aa1061ea467f7d7442344e84dbabefbcf/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4124, 67, 11777, 12, 2890, 16, 290, 4672, 3536, 694, 326, 1300, 434, 4124, 392, 733, 848, 506, 2566, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4124, 67, 11777, 12, 2890, 16, 290, 4672, 3536, 694, 326, 1300, 434, 4124, 392, 733, 848, 506, 2566, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
""" SMTP 'help' command. Returns help text from server """
""" SMTP 'help' command. Returns help text from server """
def help(self): """ SMTP 'help' command. Returns help text from server """
735724c0fe173a9243fb0784590ae4f126a95e94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/735724c0fe173a9243fb0784590ae4f126a95e94/smtplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2809, 12, 2890, 4672, 3536, 18102, 296, 5201, 11, 1296, 18, 2860, 2809, 977, 628, 1438, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 2809, 12, 2890, 4672, 3536, 18102, 296, 5201, 11, 1296, 18, 2860, 2809, 977, 628, 1438, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
e=e+1
def __getitem__(self,index):
afb0beb00ba813cff48fdf0ea19af5e4f3d75908 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/afb0beb00ba813cff48fdf0ea19af5e4f3d75908/Zope.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 31571, 972, 12, 2890, 16, 1615, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 31571, 972, 12, 2890, 16, 1615, 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, -10...
self.path("secondlife-bin","bin/"+self.binary_name())
self.path("Ascent","bin/"+self.binary_name())
def construct(self): super(LinuxManifest, self).construct() self.path("licenses-linux.txt","licenses.txt") self.path("res/"+self.icon_name(),self.icon_name()) if self.prefix("linux_tools", dst=""): self.path("client-readme.txt","README-linux.txt") self.path("client-readme-voice.txt","README-linux-voice.txt") self.path("client-readme-joystick.txt","README-linux-joystick.txt") self.path("wrapper.sh",self.wrapper_name()) self.path("handle_secondlifeprotocol.sh") self.path("register_secondlifeprotocol.sh") self.end_prefix("linux_tools")
b3e955cc286f9952a8d0b96b335157bbb6b3ad62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8599/b3e955cc286f9952a8d0b96b335157bbb6b3ad62/viewer_manifest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4872, 12, 2890, 4672, 2240, 12, 19475, 9121, 16, 365, 2934, 10062, 1435, 365, 18, 803, 2932, 80, 16548, 17, 20132, 18, 5830, 15937, 80, 16548, 18, 5830, 7923, 225, 365, 18, 803, 2932, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4872, 12, 2890, 4672, 2240, 12, 19475, 9121, 16, 365, 2934, 10062, 1435, 365, 18, 803, 2932, 80, 16548, 17, 20132, 18, 5830, 15937, 80, 16548, 18, 5830, 7923, 225, 365, 18, 803, 2932, ...
cur_price_unit=price_unit
cur_price_unit = price_unit
def _unit_compute_inv(self, cr, uid, taxes, price_unit, address_id=None, product=None, partner=None): taxes = self._applicable(cr, uid, taxes, price_unit, address_id, product, partner)
30660ef5901974ea94d34a0078c7411e8a79b0f6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/30660ef5901974ea94d34a0078c7411e8a79b0f6/account.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4873, 67, 9200, 67, 5768, 12, 2890, 16, 4422, 16, 4555, 16, 5320, 281, 16, 6205, 67, 4873, 16, 1758, 67, 350, 33, 7036, 16, 3017, 33, 7036, 16, 19170, 33, 7036, 4672, 5320, 281,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4873, 67, 9200, 67, 5768, 12, 2890, 16, 4422, 16, 4555, 16, 5320, 281, 16, 6205, 67, 4873, 16, 1758, 67, 350, 33, 7036, 16, 3017, 33, 7036, 16, 19170, 33, 7036, 4672, 5320, 281,...
def listen (self, num):
def listen(self, num):
def listen (self, num): self.accepting = 1 if os.name == 'nt' and num > 5: num = 1 return self.socket.listen (num)
52c4de7c23c31563e4f0316b68865e17bb8c0f33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/52c4de7c23c31563e4f0316b68865e17bb8c0f33/asyncore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6514, 12, 2890, 16, 818, 4672, 365, 18, 9436, 310, 273, 404, 309, 1140, 18, 529, 422, 296, 496, 11, 471, 818, 405, 1381, 30, 818, 273, 404, 327, 365, 18, 7814, 18, 18085, 261, 2107, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6514, 12, 2890, 16, 818, 4672, 365, 18, 9436, 310, 273, 404, 309, 1140, 18, 529, 422, 296, 496, 11, 471, 818, 405, 1381, 30, 818, 273, 404, 327, 365, 18, 7814, 18, 18085, 261, 2107, ...
s += ' '+elt[1] s += '\n%s' % (' '*indent)
add_piece(spacing, pieces, ' '+elt[1]) add_piece(spacing, pieces, '\n%s' % (' '*indent))
# Put a blank line before class & def statements.
454a81e4466ce668f6d7db2f1e17d3cffb6f2373 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/454a81e4466ce668f6d7db2f1e17d3cffb6f2373/docparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 4399, 279, 7052, 980, 1865, 667, 473, 1652, 6317, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 4399, 279, 7052, 980, 1865, 667, 473, 1652, 6317, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
class FrameDelayedCallback: """ waits N frames and then calls a callback """ def __init__(self, name, frames, callback, cancelFunc=None): self._name = name self._frames = frames self._callback = callback self._cancelFunc = cancelFunc self._taskName = uniqueName('%s-%s' % (self.__class__.__name__, self._name)) self._startTask() def destroy(self): self._stopTask() def finish(self): self._callback() self.destroy() def _startTask(self): taskMgr.add(self._frameTask, self._taskName) self._counter = 0 def _stopTask(self): taskMgr.remove(self._taskName) def _frameTask(self, task): if self._cancelFunc(): self.destroy() return task.done self._counter += 1 if self._counter >= self._frames: self.finish() return task.done return task.cont
def __call__(self, *args, **kwArgs): self._args = args self._kwArgs = kwArgs self._delayedCall = DelayedCall(self._callFunctor, self._name, self._delay)
b13cd12e4aadf18c66b83f8872334da45c1aedf0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7242/b13cd12e4aadf18c66b83f8872334da45c1aedf0/PythonUtil.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 380, 1968, 16, 2826, 9987, 2615, 4672, 365, 6315, 1968, 273, 833, 365, 6315, 9987, 2615, 273, 5323, 2615, 365, 6315, 10790, 329, 1477, 273, 20165, 329, 147...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1001, 1991, 972, 12, 2890, 16, 380, 1968, 16, 2826, 9987, 2615, 4672, 365, 6315, 1968, 273, 833, 365, 6315, 9987, 2615, 273, 5323, 2615, 365, 6315, 10790, 329, 1477, 273, 20165, 329, 147...
player.socket.sysmessage(text)
player.socket.sysmessage(text, 0x3A) player.deltag(name) player.deltag('guildmessages')
def onLogin(player): if player.hastag('guildmessages'): count = int(player.gettag('guildmessages')) for i in range(0, count): name = 'guildmessage' + str(i) text = unicode(player.gettag(name)) player.socket.sysmessage(text) # Make sure that this event is removed as soon as we don't are in a guild anymore if not player.guild: # Clean voting and or permissions tags = player.tags for tag in tags: if tag.startswith('vote_'): player.deltag(tag) elif tag.startswith('permissions_'): player.deltag(tag) events = player.events while 'guilds.member' in events: events.remove('guilds.member') player.events = events else: # Remove voting tags just in case if player.guild.leader: player.deltag('vote_%u' % player.guild.serial) members = player.guild.members online = [] for member in members: if member != player and member.socket: online.append(member) if len(online) > 1: player.socket.sysmessage('There are %u other members of your guild logged on.' % len(online), 0x30) elif len(online) == 1: player.socket.sysmessage('There is one other member of your guild logged on.', 0x30) else: player.socket.sysmessage('There is no other member of your guild logged on.', 0x30) # Private messaging tags = player.tags for tag in tags: if tag.startswith('privmsg'): serial = int(tag[7:]) char = wolfpack.findchar(serial) if char: chunks = getPrivateMessage(player, char) time_now = localtime() time_message = localtime(chunks[0]) # Hide the date if it's from the same day if time_now[0] != time_message[0] or time_now[1] != time_message[1] or time_now[2] != time_message[2]: player.socket.sysmessage('[%s] %s: %s' % (strftime(FORMAT_DATETIME, time_message), char.name, chunks[2]), chunks[1]) else: player.socket.sysmessage('[%s] %s: %s' % (strftime(FORMAT_TIME, time_message), char.name, chunks[2]), chunks[1]) player.deltag(tag)
509e6e0e7ad5c5166f8fba8b034425afc9fdeaea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/509e6e0e7ad5c5166f8fba8b034425afc9fdeaea/member.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 5358, 12, 14872, 4672, 309, 7291, 18, 76, 689, 346, 2668, 75, 680, 6833, 11, 4672, 1056, 273, 509, 12, 14872, 18, 588, 2692, 2668, 75, 680, 6833, 26112, 225, 364, 277, 316, 1048, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 5358, 12, 14872, 4672, 309, 7291, 18, 76, 689, 346, 2668, 75, 680, 6833, 11, 4672, 1056, 273, 509, 12, 14872, 18, 588, 2692, 2668, 75, 680, 6833, 26112, 225, 364, 277, 316, 1048, ...
Class which supports an async version of the `apply()` builtin
Class which supports an async version of applying functions to arguments.
def worker(inqueue, outqueue, initializer=None, initargs=()): put = outqueue.put get = inqueue.get if hasattr(inqueue, '_writer'): inqueue._writer.close() outqueue._reader.close() if initializer is not None: initializer(*initargs) while 1: try: task = get() except (EOFError, IOError): debug('worker got EOFError or IOError -- exiting') break if task is None: debug('worker got sentinel -- exiting') break job, i, func, args, kwds = task try: result = (True, func(*args, **kwds)) except Exception as e: result = (False, e) put((job, i, result))
6eb90134e6b0faa268d442f34915444d72ffc7d0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/6eb90134e6b0faa268d442f34915444d72ffc7d0/pool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4322, 12, 267, 4000, 16, 596, 4000, 16, 12562, 33, 7036, 16, 1208, 1968, 33, 1435, 4672, 1378, 273, 596, 4000, 18, 458, 336, 273, 316, 4000, 18, 588, 309, 3859, 12, 267, 4000, 16, 20...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4322, 12, 267, 4000, 16, 596, 4000, 16, 12562, 33, 7036, 16, 1208, 1968, 33, 1435, 4672, 1378, 273, 596, 4000, 18, 458, 336, 273, 316, 4000, 18, 588, 309, 3859, 12, 267, 4000, 16, 20...
import pyvisfile.silo._internal as _internal
import sys
def _ignore_extra_int_vector_warning(): from warnings import filterwarnings filterwarnings("ignore", module="pyvisfile.silo", category=RuntimeWarning, lineno=43)
bcdcc0cf4d66f4619dbb85f174a3a5a5ac2d35a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12867/bcdcc0cf4d66f4619dbb85f174a3a5a5ac2d35a5/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6185, 67, 7763, 67, 474, 67, 7737, 67, 8551, 13332, 628, 5599, 1930, 1034, 12103, 1034, 12103, 2932, 6185, 3113, 1605, 1546, 2074, 3516, 768, 18, 25119, 83, 3113, 3150, 33, 5576, 62...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6185, 67, 7763, 67, 474, 67, 7737, 67, 8551, 13332, 628, 5599, 1930, 1034, 12103, 1034, 12103, 2932, 6185, 3113, 1605, 1546, 2074, 3516, 768, 18, 25119, 83, 3113, 3150, 33, 5576, 62...
if newaddr == user:
if newaddr == cpuser:
def main(): doc = Document() doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) parts = Utils.GetPathPieces() lenparts = parts and len(parts) if not parts or lenparts < 1: title = _('CGI script error') doc.SetTitle(title) doc.AddItem(Header(2, title)) doc.addError(_('Invalid options to CGI script.')) doc.AddItem('<hr>') doc.AddItem(MailmanLogo()) print doc.Format() return # get the list and user's name listname = parts[0].lower() # open list try: mlist = MailList.MailList(listname, lock=0) except Errors.MMListError, e: # Avoid cross-site scripting attacks safelistname = Utils.websafe(listname) title = _('CGI script error') doc.SetTitle(title) doc.AddItem(Header(2, title)) doc.addError(_('No such list <em>%(safelistname)s</em>')) doc.AddItem('<hr>') doc.AddItem(MailmanLogo()) print doc.Format() syslog('error', 'No such list "%s": %s\n', listname, e) return # The total contents of the user's response cgidata = cgi.FieldStorage(keep_blank_values=1) # Set the language for the page. If we're coming from the listinfo cgi, # we might have a 'language' key in the cgi data. That was an explicit # preference to view the page in, so we should honor that here. If that's # not available, use the list's default language. language = cgidata.getvalue('language', mlist.preferred_language) i18n.set_language(language) doc.set_language(language) if lenparts < 2: user = cgidata.getvalue('email') if not user: # If we're coming from the listinfo page and we left the email # address field blank, it's not an error. listinfo.html names the # button UserOptions; we can use that as the descriminator. if not cgidata.getvalue('UserOptions'): doc.addError(_('No address given')) loginpage(mlist, doc, None, cgidata) print doc.Format() return else: user = Utils.LCDomain(Utils.UnobscureEmail(SLASH.join(parts[1:]))) # Avoid cross-site scripting attacks safeuser = Utils.websafe(user) # Sanity check the user, but be careful about leaking membership # information when we're using private rosters. if not mlist.isMember(user) and mlist.private_roster == 0: doc.addError(_('No such member: %(safeuser)s.')) loginpage(mlist, doc, None, cgidata) print doc.Format() return # Find the case preserved email address (the one the user subscribed with) lcuser = user.lower() try: cpuser = mlist.getMemberCPAddress(lcuser) except Errors.NotAMemberError: # This happens if the user isn't a member but we've got private rosters cpuser = None if lcuser == cpuser: cpuser = None # And now we know the user making the request, so set things up to for the # user's stored preferred language, overridden by any form settings for # their new language preference. userlang = cgidata.getvalue('language', mlist.getMemberLanguage(user)) doc.set_language(userlang) i18n.set_language(userlang) # See if this is VARHELP on topics. varhelp = None if cgidata.has_key('VARHELP'): varhelp = cgidata['VARHELP'].value elif os.environ.get('QUERY_STRING'): # POST methods, even if their actions have a query string, don't get # put into FieldStorage's keys :-( qs = cgi.parse_qs(os.environ['QUERY_STRING']).get('VARHELP') if qs and type(qs) == types.ListType: varhelp = qs[0] if varhelp: topic_details(mlist, doc, user, cpuser, userlang, varhelp) return # Are we processing an unsubscription request from the login screen? if cgidata.has_key('login-unsub'): # Because they can't supply a password for unsubscribing, we'll need # to do the confirmation dance. if mlist.isMember(user): mlist.ConfirmUnsubscription(user, userlang) doc.addError(_('The confirmation email has been sent.'), tag='') else: # Not a member if mlist.private_roster == 0: # Public rosters doc.addError(_('No such member: %(safeuser)s.')) else: syslog('mischief', 'Unsub attempt of non-member w/ private rosters: %s', user) doc.addError(_('The confirmation email has been sent.'), tag='') loginpage(mlist, doc, user, cgidata) print doc.Format() return # Are we processing a password reminder from the login screen? if cgidata.has_key('login-remind'): if mlist.isMember(user): mlist.MailUserPassword(user) doc.addError( _('A reminder of your password has been emailed to you.'), tag='') else: # Not a member if mlist.private_roster == 0: # Public rosters doc.addError(_('No such member: %(safeuser)s.')) else: syslog('mischief', 'Reminder attempt of non-member w/ private rosters: %s', user) doc.addError( _('A reminder of your password has been emailed to you.'), tag='') loginpage(mlist, doc, user, cgidata) print doc.Format() return # Authenticate, possibly using the password supplied in the login page password = cgidata.getvalue('password', '').strip() if not mlist.WebAuthenticate((mm_cfg.AuthUser, mm_cfg.AuthListAdmin, mm_cfg.AuthSiteAdmin), password, user): # Not authenticated, so throw up the login page again. If they tried # to authenticate via cgi (instead of cookie), then print an error # message. if cgidata.has_key('password'): doc.addError(_('Authentication failed.')) # So as not to allow membership leakage, prompt for the email # address and the password here. if mlist.private_roster <> 0: syslog('mischief', 'Login failure with private rosters: %s', user) user = None loginpage(mlist, doc, user, cgidata) print doc.Format() return # From here on out, the user is okay to view and modify their membership # options. The first set of checks does not require the list to be # locked. if cgidata.has_key('logout'): print mlist.ZapCookie(mm_cfg.AuthUser, user) loginpage(mlist, doc, user, cgidata) print doc.Format() return if cgidata.has_key('emailpw'): mlist.MailUserPassword(user) options_page( mlist, doc, user, cpuser, userlang, _('A reminder of your password has been emailed to you.')) print doc.Format() return if cgidata.has_key('othersubs'): hostname = mlist.host_name title = _('List subscriptions for %(user)s on %(hostname)s') doc.SetTitle(title) doc.AddItem(Header(2, title)) doc.AddItem(_('''Click on a link to visit your options page for the requested mailing list.''')) # Troll through all the mailing lists that match host_name and see if # the user is a member. If so, add it to the list. onlists = [] for gmlist in lists_of_member(mlist, user) + [mlist]: url = gmlist.GetOptionsURL(user) link = Link(url, gmlist.real_name) onlists.append((gmlist.real_name, link)) onlists.sort() items = OrderedList(*[link for name, link in onlists]) doc.AddItem(items) print doc.Format() return if cgidata.has_key('change-of-address'): # We could be changing the user's full name, email address, or both. # Watch out for non-ASCII characters in the member's name. membername = cgidata.getvalue('fullname') # Canonicalize the member's name membername = Utils.canonstr(membername, language) newaddr = cgidata.getvalue('new-address') confirmaddr = cgidata.getvalue('confirm-address') oldname = mlist.getMemberName(user) set_address = set_membername = 0 # See if the user wants to change their email address globally globally = cgidata.getvalue('changeaddr-globally') # We will change the member's name under the following conditions: # - membername has a value # - membername has no value, but they /used/ to have a membername if membername and membername <> oldname: # Setting it to a new value set_membername = 1 if not membername and oldname: # Unsetting it set_membername = 1 # We will change the user's address if both newaddr and confirmaddr # are non-blank, have the same value, and aren't the currently # subscribed email address (when compared case-sensitively). If both # are blank, but membername is set, we ignore it, otherwise we print # an error. msg = '' if newaddr and confirmaddr: if newaddr <> confirmaddr: options_page(mlist, doc, user, cpuser, userlang, _('Addresses did not match!')) print doc.Format() return if newaddr == user: options_page(mlist, doc, user, cpuser, userlang, _('You are already using that email address')) print doc.Format() return # If they're requesting to subscribe an address which is already a # member, and they're /not/ doing it globally, then refuse. # Otherwise, we'll agree to do it globally (with a warning # message) and let ApprovedChangeMemberAddress() handle already a # member issues. if mlist.isMember(newaddr): safenewaddr = Utils.websafe(newaddr) if globally: listname = mlist.real_name msg += _("""\
e6a123f6ce2d3738b4b32a74a94f003eeb012109 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/e6a123f6ce2d3738b4b32a74a94f003eeb012109/options.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 997, 273, 4319, 1435, 997, 18, 542, 67, 4923, 12, 7020, 67, 7066, 18, 5280, 67, 4370, 67, 15547, 13, 225, 2140, 273, 6091, 18, 967, 743, 16539, 8610, 1435, 562, 6019, 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, 2774, 13332, 997, 273, 4319, 1435, 997, 18, 542, 67, 4923, 12, 7020, 67, 7066, 18, 5280, 67, 4370, 67, 15547, 13, 225, 2140, 273, 6091, 18, 967, 743, 16539, 8610, 1435, 562, 6019, 273,...
The error occurs only when printed::
The error only occurs upon printing::
... def __repr__(self):
e938c63a3dc6e28872c4936a1b94a0df66c03e36 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e938c63a3dc6e28872c4936a1b94a0df66c03e36/lazy_format.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1372, 565, 1652, 1001, 12715, 972, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1372, 565, 1652, 1001, 12715, 972, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
return prefix + urllib.quote_plus(device_name, safe='')
u8bytes = encodings.utf_8.encode(unicode(device_name))[0] quoted = urllib.quote_plus(u8bytes, safe='') return unicode(prefix + quoted)
def devbrush_quote(device_name, prefix=DEVBRUSH_NAME_PREFIX): """ Quotes an arbitrary device name for use as the basename of a device-specific brush. """ return prefix + urllib.quote_plus(device_name, safe='')
e32b920524207704731316f024a1e29679db4078 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7129/e32b920524207704731316f024a1e29679db4078/brushmanager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4461, 2848, 1218, 67, 6889, 12, 5964, 67, 529, 16, 1633, 33, 15301, 7192, 57, 2664, 67, 1985, 67, 6307, 4672, 3536, 4783, 6366, 392, 11078, 2346, 508, 364, 999, 487, 326, 4882, 434, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4461, 2848, 1218, 67, 6889, 12, 5964, 67, 529, 16, 1633, 33, 15301, 7192, 57, 2664, 67, 1985, 67, 6307, 4672, 3536, 4783, 6366, 392, 11078, 2346, 508, 364, 999, 487, 326, 4882, 434, 27...
print `info`
def _render_diff(self, req, db, page): req.perm.assert_permission('WIKI_VIEW')
758a6dc8e15517f12680b33f7fcb928f34d0a85b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/758a6dc8e15517f12680b33f7fcb928f34d0a85b/web_ui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5902, 67, 5413, 12, 2890, 16, 1111, 16, 1319, 16, 1363, 4672, 1111, 18, 12160, 18, 11231, 67, 9827, 2668, 23109, 47, 45, 67, 12145, 6134, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5902, 67, 5413, 12, 2890, 16, 1111, 16, 1319, 16, 1363, 4672, 1111, 18, 12160, 18, 11231, 67, 9827, 2668, 23109, 47, 45, 67, 12145, 6134, 2, -100, -100, -100, -100, -100, -100, -1...
tuple = self.frame.pluginhandler.OutgoingBuddySearchEvent(text) if tuple != None: text = tuple[0]
feedback = self.frame.pluginhandler.OutgoingBuddySearchEvent(text) if feedback != None: text = feedback[0]
def OnSearch(self): text = self.frame.SearchEntry.get_text().strip() if not text: return users = [] room = None if self.frame.SearchMethod.get_active_text() == _("Global"): mode = 0 elif self.frame.SearchMethod.get_active_text() == _("Rooms"): mode = 1 name = self.frame.RoomSearchCombo.child.get_text() # Space after Joined Rooms is important, so it doesn't conflict # with any possible real room if name != _("Joined Rooms ") and not name.isspace(): room = name elif self.frame.SearchMethod.get_active_text() == _("Buddies"): mode = 2 elif self.frame.SearchMethod.get_active_text() == _("User"): mode = 3 user = self.frame.UserSearchCombo.child.get_text().strip() if user != "" and not user.isspace(): users = [user] else: return else: mode = 0 tuple = None if mode == 0: tuple = self.frame.pluginhandler.OutgoingGlobalSearchEvent(text) if tuple != None: text = tuple[0] elif mode == 1: tuple = self.frame.pluginhandler.OutgoingRoomSearchEvent(room, text) if tuple != None: (room, text) = tuple elif mode == 2: tuple = self.frame.pluginhandler.OutgoingBuddySearchEvent(text) if tuple != None: text = tuple[0] elif mode == 3: tuple = self.frame.pluginhandler.OutgoingUserSearchEvent(users) if tuple != None: users = tuple else: print "Unknown search mode, not using plugin system. Fix me!" tuple = True if tuple != None: self.DoSearch(text, mode, users, room) self.frame.SearchEntry.set_text("") #else: # print "search got cancelled by plugin system"
0cfa47d3d1a1e177de2ad2bba1679b92474cea16 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8738/0cfa47d3d1a1e177de2ad2bba1679b92474cea16/search.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 2979, 12, 2890, 4672, 977, 273, 365, 18, 3789, 18, 2979, 1622, 18, 588, 67, 955, 7675, 6406, 1435, 225, 309, 486, 977, 30, 327, 3677, 273, 5378, 7725, 273, 599, 309, 365, 18, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 2979, 12, 2890, 4672, 977, 273, 365, 18, 3789, 18, 2979, 1622, 18, 588, 67, 955, 7675, 6406, 1435, 225, 309, 486, 977, 30, 327, 3677, 273, 5378, 7725, 273, 599, 309, 365, 18, 3...
print("test", test, "failed --", msg) sys.stdout.flush()
print("test", test, "failed --", msg, file=sys.stderr) sys.stderr.flush()
def runtest_inner(test, verbose, quiet, testdir=None, huntrleaks=False, debug=False): support.unload(test) testdir = findtestdir(testdir) if verbose: capture_stdout = None else: capture_stdout = io.StringIO() test_time = 0.0 refleak = False # True if the test leaked references. try: if test.startswith('test.'): abstest = test else: # Always import it from the test package abstest = 'test.' + test with saved_test_environment(test, verbose, quiet) as environment: start_time = time.time() the_package = __import__(abstest, globals(), locals(), []) the_module = getattr(the_package, test) # Old tests run to completion simply as a side-effect of # being imported. For tests based on unittest or doctest, # explicitly invoke their test_main() function (if it exists). indirect_test = getattr(the_module, "test_main", None) if indirect_test is not None: indirect_test() if huntrleaks: refleak = dash_R(the_module, test, indirect_test, huntrleaks) test_time = time.time() - start_time except support.ResourceDenied as msg: if not quiet: print(test, "skipped --", msg) sys.stdout.flush() return RESOURCE_DENIED, test_time except unittest.SkipTest as msg: if not quiet: print(test, "skipped --", msg) sys.stdout.flush() return SKIPPED, test_time except KeyboardInterrupt: raise except support.TestFailed as msg: print("test", test, "failed --", msg) sys.stdout.flush() return FAILED, test_time except: type, value = sys.exc_info()[:2] print("test", test, "crashed --", str(type) + ":", value) sys.stdout.flush() if verbose or debug: traceback.print_exc(file=sys.stdout) sys.stdout.flush() return FAILED, test_time else: if refleak: return FAILED, test_time if environment.changed: return ENV_CHANGED, test_time return PASSED, test_time
28dcad5e1519aca5240a87f1c1637269410e4235 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/28dcad5e1519aca5240a87f1c1637269410e4235/regrtest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 3813, 67, 7872, 12, 3813, 16, 3988, 16, 10902, 16, 1842, 1214, 33, 7036, 16, 366, 318, 313, 298, 581, 87, 33, 8381, 16, 1198, 33, 8381, 4672, 2865, 18, 318, 945, 12, 3813, 13, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 3813, 67, 7872, 12, 3813, 16, 3988, 16, 10902, 16, 1842, 1214, 33, 7036, 16, 366, 318, 313, 298, 581, 87, 33, 8381, 16, 1198, 33, 8381, 4672, 2865, 18, 318, 945, 12, 3813, 13, ...
editRedoText = "<u><b>Redo</b></u> (Ctrl + Y)</b></p><br> "\
import platform if platform.is_macintosh(): redo_accel = "(Ctrl + Shift + Z)" else: redo_accel = "(Ctrl + Y)" editRedoText = "<u><b>Redo</b></u> %s</b></p><br> "\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "fileopen", self.fileOpenAction.iconSet().pixmap() ) self.fileOpenAction.setWhatsThis( fileOpenText ) #### Save File #### fileSaveText = "<u><b>Save File</b></u> (Ctrl + S)</b></p><br> "\ "<p><img source=\"filesave\"><br> "\ "Saves the current file."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "filesave", self.fileSaveAction.iconSet().pixmap() ) self.fileSaveAction.setWhatsThis( fileSaveText ) ############################################## # Edit Toolbar ############################################## #### Make Checkpoint ### editMakeCheckpointText = "<u><b>Make Checkpoint</b></u>"\ "<p><img source=\"editMakeCheckpoint\"><br> "\ "Make Undo checkpoint."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editMakeCheckpoint", self.editMakeCheckpointAction.iconSet().pixmap() ) self.editMakeCheckpointAction.setWhatsThis( editMakeCheckpointText ) #### Automatic Checkpointing ### editAutoCheckpointingText = "<u><b>Automatic Checkpointing</b></u>"\ "<p>Enables/Disables <b>Automatic Checkpointing</b>. When enabled, the program "\ "maintains the Undo stack automatically. When disabled, the user is required to "\ "manually set Undo checkpoints using the <b>Set Checkpoint</b> button: </p>"\ "<p><img source=\"editMakeCheckpoint\"></p>"\ "<p><b>Automatic Checkpointing</b> can impact program performance. By disabling "\ "Automatic Checkpointing, the program will run faster.</p>"\ "<p><b><i>Remember that you must set your own Undo checkpoints manually when "\ "Automatic Checkpointing is disabled.</i></b>"\ "</p>" self.editAutoCheckpointingAction.setWhatsThis( editAutoCheckpointingText ) #### Clear Undo Stack ### editClearUndoStackText = "<u><b>Clear Undo Stack</b></u>"\ "<p>Clears all Undo checkpoints on the Undo stack, freeing up memory."\ "</p>" self.editClearUndoStackAction.setWhatsThis( editClearUndoStackText ) #### Undo #### editUndoText = "<u><b>Undo</b></u> (Ctrl + Z)</b></p><br> "\ "<p><img source=\"editUndo\"><br> "\ "Reverses the last edit or command to the active part. "\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editUndo", self.editUndoAction.iconSet().pixmap() ) self.editUndoAction.setWhatsThis( editUndoText ) #### Redo #### editRedoText = "<u><b>Redo</b></u> (Ctrl + Y)</b></p><br> "\ "<p><img source=\"editRedo\"> <br>"\ "Re-applies the actions or commands on which you have used "\ "the Undo command."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editRedo", self.editRedoAction.iconSet().pixmap() ) self.editRedoAction.setWhatsThis( editRedoText ) #### Cut #### editCutText = "<u><b>Cut</b></u> (Ctrl + X)</b></p><br> "\ "<p><img source=\"editCut\"><br> "\ "Removes the selected object(s) and stores the cut data on the"\ "clipboard."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editCut", self.editCutAction.iconSet().pixmap() ) self.editCutAction.setWhatsThis( editCutText ) #### Copy #### editCopyText = "<u><b>Copy</b></u> (Ctrl + C)</b></p><br> "\ "<p><img source=\"editCopy\"><br> "\ "Places a copy of the selected chunk(s) on the clipboard "\ "while leaving the original chunk(s) unaffected."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editCopy", self.editCopyAction.iconSet().pixmap() ) self.editCopyAction.setWhatsThis( editCopyText ) #### Paste #### editPasteText = "<u><b>Paste</b></u> (Ctrl + V)</b></p><br> "\ "<p><img source=\"editPaste\"><br> "\ "<b>Paste</b> places the user in <b>Build</b> mode where copied chunks on "\ "the clipboard can be pasted into the model by double clicking in empty space. "\ "If the current clipboard chunk has a <b><i>hotspot</i></b>, it can be bonded to "\ "another chunk by single clicking on one of the chunk's bondpoints."\ "</p>"\ "<p>A <b><i>Hotspot</i></b> is a green bondpoint on a clipboard chunk indicating "\ "it will be the active bondpoint which will connect to another chunk's bondpoint. "\ "To specify a hotspot on the clipboard chunk, click on one of its bondpoints in the "\ "<b><i>MMKit's Thumbview</i></b>."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editPaste", self.editPasteAction.iconSet().pixmap() ) self.editPasteAction.setWhatsThis( editPasteText ) #### Delete #### editDeleteText = "<u><b>Delete</b></u> (DEL)</b></p><br> "\ "<p><img source=\"editDelete\"><br> "\ "Deletes the selected object(s). "\ "For this Alpha release, deleted objects may be permanently lost, or they might be recoverable using Undo.</p>" #bruce 060212 revised above text (and fixed spelling error); should be revised again before A7 release QMimeSourceFactory.defaultFactory().setPixmap( "editDelete", self.editDeleteAction.iconSet().pixmap() ) self.editDeleteAction.setWhatsThis( editDeleteText ) ############################################## # View Toolbar ############################################## #### Home View #### setViewHomeActionText = "<u><b>Home</b></u> (Home)<br>"\ "<p><img source=\"setViewHome\"><br> "\ "When you create a new model, it appears in a default view orientation (FRONT view). When you open an existing model, it appears in the orientation it was last saved. You can change the default orientation by selecting <b>Set Home View to Current View</b> from the <b>View</b> menu.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewHome", self.setViewHomeAction.iconSet().pixmap() ) self.setViewHomeAction.setWhatsThis( setViewHomeActionText ) #### Fit to Window #### setViewFitToWindowActionText = "<u><b>Fit To Window</b></u><br>"\ "<p><img source=\"setViewFitToWindow\"><br> "\ "Refits the model to the screen so you can view the entire model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewFitToWindow", self.setViewFitToWindowAction.iconSet().pixmap() ) self.setViewFitToWindowAction.setWhatsThis( setViewFitToWindowActionText ) #### Recenter #### setViewRecenterActionText = "<u><b>Recenter</b></u><br>"\ "<p><img source=\"setViewRecenter\"><br> "\ "Changes the view center and zoom factor so that the origin is in the "\ "center of the view and you can view the entire model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewRecenter", self.setViewRecenterAction.iconSet().pixmap() ) self.setViewRecenterAction.setWhatsThis( setViewRecenterActionText ) #### Zoom Tool #### setzoomToolActionText = "<u><b>Zoom Tool</b></u><br>"\ "<p><img source=\"setzoomTool\"><br> "\ "Allows the user to zoom into a specific area of the model by specifying a rectangular area. "\ "This is done by holding down the left button and dragging the mouse.</p>"\ "<p>A mouse with a mouse wheel can also be used to zoom in and out "\ "at any time, without using the Zoom Tool.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setzoomTool", self.zoomToolAction.iconSet().pixmap() ) self.zoomToolAction.setWhatsThis( setzoomToolActionText ) #### Pan Tool #### setpanToolActionText = "<u><b>Pan Tool</b></u><br>"\ "<p><img source=\"setpanTool\"><br> "\ "Allows X-Y panning using the left mouse button.</p>"\ "<p>Users with a 3-button mouse can pan the model at any time by pressing "\ "the middle mouse button while holding down the Shift key.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setpanTool", self.panToolAction.iconSet().pixmap() ) self.panToolAction.setWhatsThis( setpanToolActionText ) #### Rotate Tool #### setrotateToolActionText = "<u><b>Rotate Tool</b></u><br>"\ "<p><img source=\"setrotateTool\"><br> "\ "Allows free rotation using the left mouse button.</p>"\ "<p>Users with a 3-button mouse can rotate the model at any time by pressing "\ "the middle mouse button and dragging the mouse.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setrotateTool", self.rotateToolAction.iconSet().pixmap() ) self.rotateToolAction.setWhatsThis( setrotateToolActionText ) #### Orthographic Projection #### setViewOrthoActionText = "<u><b>Orthographic Projection</b></u><br>"\ "<p>Sets nonperspective (or parallel) projection, with no foreshortening."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewOrtho", self.setViewOrthoAction.iconSet().pixmap() ) self.setViewOrthoAction.setWhatsThis( setViewOrthoActionText ) #### Perspective Projection #### setViewPerspecActionText = "<u><b>Perspective Projection</b></u><br>"\ "<p>Set perspective projection, drawing objects slightly larger "\ "that are closer to the viewer."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewPerspec", self.setViewPerspecAction.iconSet().pixmap() ) self.setViewPerspecAction.setWhatsThis( setViewPerspecActionText ) #### Normal To #### setViewNormalToActionText = "<u><b>Set View Normal To</b></u><br>"\ "<p><img source=\"setViewNormalTo\"><br> "\ "Orients view to the normal vector of the plane defined by "\ "3 or more selected atoms, or a jig's axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewNormalTo", self.setViewNormalToAction.iconSet().pixmap() ) self.setViewNormalToAction.setWhatsThis( setViewNormalToActionText ) #### Parallel To #### setViewParallelToActionText = "<u><b>Set View Parallel To</b></u><br>"\ "<p><img source=\"setViewParallelTo\"><br> "\ "Orients view parallel to the vector defined by 2 selected atoms."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewParallelTo", self.setViewParallelToAction.iconSet().pixmap() ) self.setViewParallelToAction.setWhatsThis( setViewParallelToActionText ) #### Save Named View #### saveNamedViewActionText = "<u><b>Save Named View</b></u><br>"\ "<p><img source=\"saveNamedView\"><br> "\ "Saves the current view as a custom <b>named view</b> and places it in the Model Tree.</p>" \ "<p>The view can be restored by selecting <b>Change View</b> from its context menu in the Model Tree."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "saveNamedView", self.saveNamedViewAction.iconSet().pixmap() ) self.saveNamedViewAction.setWhatsThis( saveNamedViewActionText ) #### Front View #### setViewFrontActionText = "<u><b>Front View</b></u><br>"\ "<p><img source=\"setViewFront\"><br> "\ "Orients the view to the Front View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewFront", self.setViewFrontAction.iconSet().pixmap() ) self.setViewFrontAction.setWhatsThis( setViewFrontActionText ) #### Back View #### setViewBackActionText = "<u><b>Back View</b></u><br>"\ "<p><img source=\"setViewBack\"><br> "\ "Orients the view to the Back View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewBack", self.setViewBackAction.iconSet().pixmap() ) self.setViewBackAction.setWhatsThis( setViewBackActionText ) #### Top View #### setViewTopActionText = "<u><b>Top View</b></u><br>"\ "<p><img source=\"setViewTop\"><br> "\ "Orients the view to the Top View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewTop", self.setViewTopAction.iconSet().pixmap() ) self.setViewTopAction.setWhatsThis( setViewTopActionText ) #### Bottom View #### setViewBottomActionText = "<u><b>Bottom View</b></u><br>"\ "<p><img source=\"setViewBottom\"><br> "\ "Orients the view to the Bottom View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewBottom", self.setViewBottomAction.iconSet().pixmap() ) self.setViewBottomAction.setWhatsThis( setViewBottomActionText ) #### Left View #### setViewLeftActionText = "<u><b>Left View</b></u><br>"\ "<p><img source=\"setViewLeft\"><br> "\ "Orients the view to the Left View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewLeft", self.setViewLeftAction.iconSet().pixmap() ) self.setViewLeftAction.setWhatsThis( setViewLeftActionText ) #### Right View #### setViewRightActionText = "<u><b>Right View</b></u><br>"\ "<p><img source=\"setViewRight\"><br> "\ "Orients the view to the Right View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewRight", self.setViewRightAction.iconSet().pixmap() ) self.setViewRightAction.setWhatsThis( setViewRightActionText ) #### Rotate View 180 #### setViewOppositeActionText = "<u><b>Rotate View 180</b></u><br>"\ "<p><img source=\"setViewOpposite\"><br> "\ "Rotates the view 180 degrees."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewOpposite", self.setViewOppositeAction.iconSet().pixmap() ) self.setViewOppositeAction.setWhatsThis( setViewOppositeActionText ) #### Rotate View +90 #### setViewPlus90ActionText = "<u><b>Rotate View +90</b></u><br>"\ "<p><img source=\"setViewPlus90\"><br> "\ "Increment the current view by 90 degrees around the vertical axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewPlus90", self.setViewPlus90Action.iconSet().pixmap() ) self.setViewPlus90Action.setWhatsThis( setViewPlus90ActionText ) #### Rotate View -90 #### setViewMinus90ActionText = "<u><b>Rotate View -90</b></u><br>"\ "<p><img source=\"setViewMinus90\"><br> "\ "Decrement the current view by 90 degrees around the vertical axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewMinus90", self.setViewMinus90Action.iconSet().pixmap() ) self.setViewMinus90Action.setWhatsThis( setViewMinus90ActionText ) ############################################## # Grids Toolbar ############################################## #### Surface 100 #### orient100ActionText = "<u><b>Surface 100</b></u><br>"\ "<p><img source=\"orient100Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,0,0) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient100Action", self.orient100Action.iconSet().pixmap() ) self.orient100Action.setWhatsThis(orient100ActionText ) #### Surface 110 #### orient110ActionText = "<u><b>Surface 110</b></u><br>"\ "<p><img source=\"orient110Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,1,0) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient110Action", self.orient110Action.iconSet().pixmap() ) self.orient110Action.setWhatsThis(orient110ActionText ) #### Surface 111 #### orient111ActionText = "<u><b>Surface 111</b></u><br>"\ "<p><img source=\"orient111Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,1,1) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient111Action", self.orient111Action.iconSet().pixmap() ) self.orient111Action.setWhatsThis(orient111ActionText ) ############################################## # Molecular Display toolbar ############################################## #### Display Default #### dispDefaultActionText = "<u><b>Display Default</b></u><br>"\ "<p><img source=\"dispDefaultAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Default</b> , rendering them in the <b>Current Display Mode</b>."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to the <b>Default Display Mode</b>. " \ "All chunks with their display setting set to <b>Default</b> will be rendered in the "\ "<b>Default Display Mode</b>."\ "</p>"\ "<p>The <b>Default Display Mode</b> can be changed via the "\ "<b>Edit > Preferences</b> menu and selecting the <b>General</b> tab."\ "</p>"\ "<p>The <b>Current or Default Display Mode</b> is displayed in the status bar in the "\ "lower right corner of the main window."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDefaultAction", self.dispDefaultAction.iconSet().pixmap() ) self.dispDefaultAction.setWhatsThis(dispDefaultActionText ) #### Display Invisible #### dispInvisActionText = "<u><b>Display Invisible</b></u><br>"\ "<p><img source=\"dispInvisAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Invisible</b>, making them invisible."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Invisible</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispInvisAction", self.dispInvisAction.iconSet().pixmap() ) self.dispInvisAction.setWhatsThis(dispInvisActionText ) #### Display Lines #### dispLinesActionText = "<u><b>Display Lines</b></u><br>"\ "<p><img source=\"dispLinesAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ " <b>Lines</b>. Only bonds are rendered as colored lines."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Lines</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispLinesAction", self.dispLinesAction.iconSet().pixmap() ) self.dispLinesAction.setWhatsThis(dispLinesActionText ) #### Display Tubes #### dispTubesActionText = "<u><b>Display Tubes</b></u><br>"\ "<p><img source=\"dispTubesAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Tubes</b>. Atoms and bonds are rendered as colored tubes."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Tubes</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispTubesAction", self.dispTubesAction.iconSet().pixmap() ) self.dispTubesAction.setWhatsThis(dispTubesActionText ) #### Display Ball and Stick (was CPK) #### dispCPKActionText = "<u><b>Display Ball and Stick</b></u><br>"\ "<p><img source=\"dispCPKAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Ball and Stick</b> mode. Atoms are rendered "\ "as spheres and bonds are rendered as narrow cylinders."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Ball and Stick</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>"\ "<p>The scale of the spheres and cylinders can be changed from the "\ "<b>Atoms</b> and <b>Bonds</b> pages of the <b>Preferences</b> dialog."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispCPKAction", self.dispCPKAction.iconSet().pixmap() ) self.dispCPKAction.setWhatsThis(dispCPKActionText ) #### Display CPK (was VdW) #### [bruce extended and slightly corrected text, 060307] dispVdWActionText = "<u><b>Display CPK</b></u><br>"\ "<p><img source=\"dispVdWAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>CPK</b> mode. Atoms are rendered as spheres with "\ "a size equal to 0.78 of their VdW radius, corresponding "\ "to a contact force of approximately 0.1 nN with neighboring "\ "nonbonded atoms. Bonds are not rendered."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>CPK</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>"\ "<p>The scale of the spheres can be changed from the "\ "<b>Atoms</b> and <b>Bonds</b> pages of the <b>Preferences</b> dialog."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispVdWAction", self.dispVdWAction.iconSet().pixmap() ) self.dispVdWAction.setWhatsThis(dispVdWActionText ) ############################################## # Select toolbar ############################################## #### Select All #### selectAllActionText = "<u><b>Select All</b></u> (Ctrl + A)</b></p><br>"\ "<p><img source=\"selectAllAction\"><br> "\ "During <b>Select Atoms</b> mode, this will select all the atoms in "\ "the model. Otherwise, this will select all the chunks in the model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectAllAction", self.selectAllAction.iconSet().pixmap() ) self.selectAllAction.setWhatsThis(selectAllActionText ) #### Select None #### selectNoneActionText = "<u><b>Select None</b></u></p><br>"\ "<p><img source=\"selectNoneAction\"><br> "\ "Unselects everything currently selected.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectNoneAction", self.selectNoneAction.iconSet().pixmap() ) self.selectNoneAction.setWhatsThis(selectNoneActionText ) #### Invert Selection #### selectInvertActionText = "<u><b>Invert Selection</b></u> <br> (Ctrl + Shift + I)</b></p><br>"\ "<p><img source=\"selectInvertAction\"><br> "\ "Inverts the current selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectInvertAction", self.selectInvertAction.iconSet().pixmap() ) self.selectInvertAction.setWhatsThis(selectInvertActionText ) #### Select Connected #### selectConnectedActionText = "<u><b>Select Connected</b></u> (Ctrl + Shift + C)</b></p><br>"\ "<p><img source=\"selectConnectedAction\"><br> "\ "Selects all the atoms that can be reached by the currently selected atom "\ "via an unbroken chain of bonds. </p>"\ "<p>To use this feature, you must first be in "\ "<b>Select Atoms</b> mode and select at least one atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectConnectedAction", self.selectConnectedAction.iconSet().pixmap() ) self.selectConnectedAction.setWhatsThis(selectConnectedActionText ) #### Select Doubly #### selectDoublyActionText = "<u><b>Select Doubly</b></u></b></p><br>"\ "<p><img source=\"selectDoublyAction\"><br> "\ "Selects all the atoms that can be reached from a currently selected "\ "atom through two disjoint unbroken chains of bonds. Atoms singly "\ "connected to this group and unconnected to anything else are also "\ "included in the selection.</p>"\ "<p>To use this feature, you must first be in "\ "<b>Select Atoms</b> mode and select at least one atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectDoublyAction", self.selectDoublyAction.iconSet().pixmap() ) self.selectDoublyAction.setWhatsThis(selectDoublyActionText ) #### Expand Selection #### selectExpandActionText = "<u><b>Expand Selection</b></u> (Ctrl + D)</b></p><br>"\ "<p><img source=\"selectExpandAction\"><br> "\ "Selects any atom that is a neighbor of a currently selected atom."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectExpandAction", self.selectExpandAction.iconSet().pixmap() ) self.selectExpandAction.setWhatsThis(selectExpandActionText ) #### Contract Selection #### selectContractActionText = "<u><b>Contract Selection</b></u> (Ctrl + Shift + D)</b></p><br>"\ "<p><img source=\"selectContractAction\"><br> "\ "Deselects any atom that is a neighbor of a non-picked atom or has a bondpoint."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectContractAction", self.selectContractAction.iconSet().pixmap() ) self.selectContractAction.setWhatsThis(selectContractActionText ) ############################################## # Modify Toolbar ############################################## #### Minimize Selection #### modifyMinimizeSelActionText = "<u><b>Minimize Selection</b></u> (Ctrl + M)</b></p><br>"\ "<p><img source=\"modifyMinimizeSelAction\"><br> "\ "Arranges the atoms (<i>of the current selection</i>) to their chemically stable point of "\ "equilibrium in reference to the other atoms in the structure."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMinimizeSelAction", self.modifyMinimizeSelAction.iconSet().pixmap() ) self.modifyMinimizeSelAction.setWhatsThis(modifyMinimizeSelActionText ) #### Minimize All #### modifyMinimizeAllActionText = "<u><b>Minimize All</b></u></p><br>"\ "<p><img source=\"modifyMinimizeAllAction\"><br> "\ "Arranges the atoms (<i>of the entire part</i>) to their chemically stable point of "\ "equilibrium in reference to the other atoms in the structure."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMinimizeAllAction", self.modifyMinimizeAllAction.iconSet().pixmap() ) self.modifyMinimizeAllAction.setWhatsThis(modifyMinimizeAllActionText ) #### Hydrogenate #### modifyHydrogenateActionText = "<u><b>Hydrogenate</b></u> </b></p><br>"\ "<p><img source=\"modifyHydrogenateAction\"><br> "\ "Adds hydrogen atoms to all the bondpoints in the selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyHydrogenateAction", self.modifyHydrogenateAction.iconSet().pixmap() ) self.modifyHydrogenateAction.setWhatsThis(modifyHydrogenateActionText ) #### Dehydrogenate #### modifyDehydrogenateActionText = "<u><b>Dehydrogenate</b></u><br>"\ "<p><img source=\"modifyDehydrogenateAction\"><br> "\ "Removes all hydrogen atoms from the selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyDehydrogenateAction", self.modifyDehydrogenateAction.iconSet().pixmap() ) self.modifyDehydrogenateAction.setWhatsThis(modifyDehydrogenateActionText ) #### Passivate #### modifyPassivateActionText = "<u><b>Passivate</b></u> (Ctrl + P)</b></p><br>"\ "<p><img source=\"modifyPassivateAction\"><br> "\ "Changes the types of incompletely bonded atoms to atoms with the "\ "right number of bonds, using atoms with the best atomic radius."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyPassivateAction", self.modifyPassivateAction.iconSet().pixmap() ) self.modifyPassivateAction.setWhatsThis(modifyPassivateActionText ) #### Stretch #### modifyStretchActionText = "<u><b>Stretch</b></u><br>"\ "<p><img source=\"modifyStretchAction\"><br> "\ "Stretches the bonds of the selected chunk(s).</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyStretchAction", self.modifyStretchAction.iconSet().pixmap() ) self.modifyStretchAction.setWhatsThis(modifyStretchActionText ) #### Delete Bonds #### modifyDeleteBondsActionText = "<u><b>Delete Bonds</b></u><br>"\ "<p><img source=\"modifyDeleteBondsAction\"><br> "\ "Delete all bonds between selected and unselected atoms or chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyDeleteBondsAction", self.modifyDeleteBondsAction.iconSet().pixmap() ) self.modifyDeleteBondsAction.setWhatsThis(modifyDeleteBondsActionText ) #### Separate #### modifySeparateActionText = "<u><b>Separate</b></u><br>"\ "<p><img source=\"modifySeparateAction\"><br> "\ "Creates a new chunk from the currently selected atoms.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifySeparateAction", self.modifySeparateAction.iconSet().pixmap() ) self.modifySeparateAction.setWhatsThis(modifySeparateActionText ) #### Merge Chunks #### modifyMergeActionText = "<u><b>Merge Chunks</b></u><br>"\ "<p><img source=\"modifyMergeAction\"><br> "\ "Merges two or more chunks into a single chunk.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMergeAction", self.modifyMergeAction.iconSet().pixmap() ) self.modifyMergeAction.setWhatsThis(modifyMergeActionText ) #### Invert Chunks #### modifyInvertActionText = "<u><b>Invert</b></u><br>"\ "<p><img source=\"modifyInvertAction\"><br> "\ "Inverts the atoms of the selected chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyInvertAction", self.modifyInvertAction.iconSet().pixmap() ) self.modifyInvertAction.setWhatsThis(modifyInvertActionText ) #### Align to Common Axis #### modifyAlignCommonAxisActionText = "<u><b>Align To Common Axis</b></u><br>"\ "<p><img source=\"modifyAlignCommonAxis\"><br> "\ "Aligns one or more chunks to the axis of the first selected chunk."\ "You must select two or more chunks before using this feature."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyAlignCommonAxis", self. modifyAlignCommonAxisAction.iconSet().pixmap() ) self. modifyAlignCommonAxisAction.setWhatsThis( modifyAlignCommonAxisActionText ) ############################################## # Tools Toolbar ############################################## #### Select Chunks #### toolsSelectMoleculesActionText = "<u><b>Select Chunks</b></u><!-- [[Feature:Select Chunks Mode]] --><br>"\ "<p><img source=\" toolsSelectMoleculesAction\"><br> "\ "<b>Select Chunks</b> allows you to select/unselect chunks with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Click/Drag</b> - selects a chunk(s).</p>"\ "<p><b>Ctrl+Left Click/Drag</b> - removes chunk(s) from selection.</p>"\ "<p><b>Shift+Left Click/Drag</b> - adds chunk(s) to selection."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsSelectMoleculesAction", self. toolsSelectMoleculesAction.iconSet().pixmap() ) self. toolsSelectMoleculesAction.setWhatsThis( toolsSelectMoleculesActionText ) #### Select Atoms #### toolsSelectAtomsActionText = "<u><b>Select Atoms</b></u><!-- [[Feature:Select Atoms Mode]] --><br>"\ "<p><img source=\" toolsSelectAtomsAction\"><br> "\ "<b>Select Atoms</b> allows you to select/unselect atoms with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Click/Drag</b> - selects an atom(s).</p>"\ "<p><b>Ctrl+Left Click/Drag</b> - removes atom(s) from selection.</p>"\ "<p><b>Shift+Left Click/Drag</b> - adds atom(s) to selection."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsSelectAtomsAction", self. toolsSelectAtomsAction.iconSet().pixmap() ) self. toolsSelectAtomsAction.setWhatsThis( toolsSelectAtomsActionText ) #### Move Chunks #### toolsMoveMoleculeActionText = "<u><b>Move Chunks</b></u><!-- [[Feature:Move Chunks Mode]] --><br>"\ "<p><img source=\" toolsMoveMoleculeAction\"><br> "\ "Activates <b>Move Chunks</b> mode, allowing you to select, "\ "move and rotate one of more chunks with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Drag</b> - moves the selected chunk(s).</p>"\ "<p><b>Ctrl+Left Drag</b> - freely rotates selected chunk(s).</p>"\ "<p><b>Shift+Left Drag</b> - constrained movement and rotation of a chunk about its own axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsMoveMoleculeAction", self. toolsMoveMoleculeAction.iconSet().pixmap() ) self. toolsMoveMoleculeAction.setWhatsThis( toolsMoveMoleculeActionText ) #### Build Atoms Tool #### toolsDepositAtomActionText = "<u><b>Build Tool</b></u><!-- [[Feature:Build Mode]] --><br>"\ "<p><img source=\" toolsDepositAtomAction\"><br> "\ "<b>Build Mode</b> allows you to build structures by depositing objects "\ "from the Molecular Modeling Kit, including atoms, clipboard objects and parts "\ "from the nanoENGINEER-1 Library.</p>"\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsDepositAtomAction", self. toolsDepositAtomAction.iconSet().pixmap() ) self. toolsDepositAtomAction.setWhatsThis( toolsDepositAtomActionText ) #### Cookie Cutter #### toolsCookieCutActionText = "<u><b>Cookie Cutter Tool</b></u><!-- [[Feature:Cookie Cutter Mode]] --><br>"\ "<p><><img source=\" toolsCookieCutAction\"><br> "\ "Activates <b>Cookie Cutter</b> mode, allowing you to cut out 3-D shapes from a "\ "slab of diamond or lonsdaleite lattice.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsCookieCutAction", self. toolsCookieCutAction.iconSet().pixmap() ) self. toolsCookieCutAction.setWhatsThis( toolsCookieCutActionText ) #### Extrude Tool #### toolsExtrudeActionText = "<u><b>Extrude Tool</b></u><!-- [[Feature:Extrude Mode]] --><br>"\ "<p><img source=\" toolsExtrudeAction\"><br> "\ "Activates <b>Extrude</b> mode, allowing you to create a rod or ring using a chunk as "\ "a repeating unit.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsExtrudeAction", self. toolsExtrudeAction.iconSet().pixmap() ) self. toolsExtrudeAction.setWhatsThis( toolsExtrudeActionText ) #### Fuse Chunks Tool #### toolsFuseChunksActionText = "<u><b>Fuse Chunks Tool</b></u><!-- [[Feature:Fuse Chunks Mode]] --><br>"\ "<p><img source=\" toolsFuseChunksAction\"><br> "\ "<b>Fuse Chunks</b> can be used to interactively join two or more "\ "chunks by dragging chunks around and fusing them together. "\ "Two types of fusing are supported:<br><br>"\ "<b>Make Bonds</b> creates bonds between the existing bondpoints) "\ "of two or more chunks. Bonds are drawn (and undrawn) as chunks "\ "are moved together (and apart).<br><br>"\ "<b>Fuse Atoms</b> fuses overlapping atoms between chunks. Overlapping "\ "pairs of atoms are highlighted in green and blue to indicate which atoms "\ "will be fused.<br>"\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsFuseChunksAction", self. toolsFuseChunksAction.iconSet().pixmap() ) self.toolsFuseChunksAction.setWhatsThis( toolsFuseChunksActionText ) #### Fuse Atoms Tool #### toolsFuseAtomsActionText = "<u><b>Fuse Atoms Tool</b></u><!-- [[Feature:Fuse Atoms Mode]] (nim?) --><br>"\ "<p><img source=\" toolsFuseAtomsAction\"><br> "\ "<b>Fuse Atoms</b> fuses the overlapping atoms between two or more chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsFuseAtomsAction", self. toolsFuseAtomsAction.iconSet().pixmap() ) self.toolsFuseAtomsAction.setWhatsThis( toolsFuseAtomsActionText ) #### Movie Player #### simMoviePlayerActionText = "<u><b>Movie Player</b></u><br>"\ "<p><img source=\" simMoviePlayerAction\"><br> "\ "Plays the most recent trajectory (movie) file created by the <b>Simulator</b>.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simMoviePlayerAction", self. simMoviePlayerAction.iconSet().pixmap() ) self. simMoviePlayerAction.setWhatsThis( simMoviePlayerActionText ) #### Simulator #### simSetupActionText = "<u><b>Simulator</b></u><br>"\ "<p><img source=\" simSetupAction\"><br> "\ "Creates a trajectory (movie) file by calculating the inter-atomic potentials and bonding "\ "of the entire model. The user determines the number of frames in the movie, the time step, "\ "and the temperature for the simulation.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simSetupAction", self. simSetupAction.iconSet().pixmap() ) self. simSetupAction.setWhatsThis( simSetupActionText ) #### Plot Tool #### simPlotToolActionText = "<u><b>Plot Tool</b></u><br>"\ "<p><img source=\" simPlotToolAction\"><br> "\ "Plots a simulator trace file using GNUplot. A simulation must be run to create "\ "the trace file, and the part must have a jig that writes output to the trace file. <br><br>"\ "The following list of jigs write data to the trace file:<br>"\ "<b>Rotary Motors:</b> speed (GHz) and torque (nn-nm)<br>"\ "<b>Linear Motors:</b> displacement (pm)<br>"\ "<b>Anchors:</b> torque (nn-nm)<br>"\ "<b>Thermostats:</b> energy added (zJ)<br>"\ "<b>Thermometer:</b> temperature (K)<br>"\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simPlotToolAction", self. simPlotToolAction.iconSet().pixmap() ) self. simPlotToolAction.setWhatsThis( simPlotToolActionText ) ############################################## # Dashboard Buttons ############################################## #### Done #### toolsDoneActionText = "<u><b>Done</b></u><br>"\ "<p><img source=\" toolsDoneAction\"><br> "\ "Completes the current operation and enters Select Chunks mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsDoneAction", self. toolsDoneAction.iconSet().pixmap() ) self. toolsDoneAction.setWhatsThis( toolsDoneActionText ) #### Cancel #### toolsCancelActionText = "<u><b>Cancel</b></u><br>"\ "<p><img source=\" toolsCancelAction\"><br> "\ "Cancels the current operation and enters Select Chunks mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsCancelAction", self.toolsCancelAction.iconSet().pixmap() ) self. toolsCancelAction.setWhatsThis( toolsCancelActionText ) #### Back up #### toolsBackUpActionText = "<u><b>Back Up</b></u><br>"\ "<p><img source=\" toolsBackUpAction\"><br> "\ "Undoes the previous operation."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsBackUpAction", self.toolsBackUpAction.iconSet().pixmap() ) self. toolsBackUpAction.setWhatsThis( toolsBackUpActionText ) #### Start Over #### toolsStartOverActionText = "<u><b>Start Over</b></u><br>"\ "<p><img source=\"toolsStartOverAction\"><br> "\ "Cancels the current operation, leaving the user in the current mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "toolsStartOverAction", self.toolsStartOverAction.iconSet().pixmap() ) self.toolsStartOverAction.setWhatsThis(toolsStartOverActionText ) #### Add Layers #### ccAddLayerActionText = "<u><b>Add Layer</b></u><br>"\ "<p><img source=\"ccAddLayerAction\"><br> "\ "Adds a new layer of diamond lattice to the existing layer."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "ccAddLayerAction", self.ccAddLayerAction.iconSet().pixmap() ) self.ccAddLayerAction.setWhatsThis(ccAddLayerActionText ) ############################################## # Jigs ############################################## #### Anchor #### jigsAnchorActionText = "<u><b>Anchor</b></u><br>"\ "<p><img source=\"jigsAnchorAction\"><br> "\ "Attaches a <b>Anchor</b> to the selected atom(s), which "\ "constrains its motion during a minimization or simulation."\ "</p>"\ "<p>To create an Anchor, enter <b>Select Atoms</b> mode, "\ "select the atom(s) you want to anchor and then select this action. "\ "Anchors are drawn as a black wireframe box around each selected atom."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsAnchorAction", self.jigsAnchorAction.iconSet().pixmap() ) self.jigsAnchorAction.setWhatsThis(jigsAnchorActionText ) #### Rotary Motor #### jigsMotorActionText = "<u><b>Rotary Motor</b></u><br>"\ "<p><img source=\"jigsMotorAction\"><br> "\ "Attaches a <b>Rotary Motor</b> to the selected atoms. The Rotary Motor is used by "\ "the simulator to apply rotary motion to a set of atoms during a simulation run. You may "\ "specify the <b>torque (in nN*nm)</b> and <b>speed (in Ghz)</b> of the motor."\ "</p>"\ "<p>To create a Rotary Motor, enter <b>Select Atoms</b> mode, "\ "select the atoms you want to attach the motor to and then select this action."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsMotorAction", self.jigsMotorAction.iconSet().pixmap() ) self.jigsMotorAction.setWhatsThis(jigsMotorActionText ) #### Linear Motor #### jigsLinearMotorActionText = "<u><b>Linear Motor</b></u><br>"\ "<p><img source=\"jigsLinearMotorAction\"><br> "\ "Attaches a <b>Linear Motor</b> to the selected atoms. The Linear Motor is used by "\ "the simulator to apply linear motion to a set of atoms during a simulation run. You may "\ "specify the <b>force (in nN*nm)</b> and <b>stiffness (in N/m)</b> of the motor."\ "</p>"\ "<p>To create a Linear Motor, enter <b>Select Atoms</b> mode, "\ "select the atoms you want to attach the motor to and then select this action."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsLinearMotorAction", self.jigsLinearMotorAction.iconSet().pixmap() ) self.jigsLinearMotorAction.setWhatsThis(jigsLinearMotorActionText ) #### Thermostat #### jigsStatActionText = "<u><b>Thermostat</b></u><br>"\ "<p><img source=\"jigsStatAction\"><br> "\ "Attaches a <b>Langevin Thermostat</b> to a single selected atom, thereby associating "\ "the themostat to the entire molecule of which the selected atom is a member. The user "\ "specifies the temperature (in Kelvin)."\ "</p>"\ "<p>The Langevin Thermostat is used to set and hold the temperature "\ "of a molecule during a simulation run."\ "</p>"\ "<p>To create a Langevin Thermostat, enter <b>Select Atoms</b> mode, "\ "select a single atom and then select this action. The thermostat is drawn as a "\ "blue wireframe box around the selected atom."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsStatAction", self.jigsStatAction.iconSet().pixmap() ) self.jigsStatAction.setWhatsThis(jigsStatActionText ) #### Thermometer #### jigsThermoActionText = "<u><b>Thermometer</b></u><br>"\ "<p><img source=\"jigsThermoAction\"><br> "\ "Attaches a <b>Thermometer</b> to a single selected atom, thereby associating "\ "the themometer to the entire molecule of which the selected atom is a member. "\ "<p>The temperature of the molecule will be recorded and written to a trace file "\ "during a simulation run."\ "</p>"\ "<p>To create a Thermometer, enter <b>Select Atoms</b> mode, "\ "select a single atom and then select this action. The thermometer is drawn as a "\ "dark red wireframe box around the selected atom."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsThermoAction", self.jigsThermoAction.iconSet().pixmap() ) self.jigsThermoAction.setWhatsThis(jigsThermoActionText ) #### ESP Image #### jigsESPImageActionText = "<u><b>ESP Image</b></u></b></p><br>"\ "<p><img source=\"jigsESPImageAction\"><br> "\ "An <b>ESP Image</b> allows the user to visualize the electrostatic potential "\ "of points on the face of a square 2D surface. Nano-Hive's MPQC ESP Plane plug-in "\ "is used to calculate the electrostatic potential."\ "</p>"\ "<p>To create an ESP Image, enter <b>Select Atoms</b> mode, "\ "select three or more atoms and then select this jig. The ESP Image is drawn as a "\ "plane with a bounding volume."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsESPImageAction", self.jigsESPImageAction.iconSet().pixmap() ) self.jigsESPImageAction.setWhatsThis(jigsESPImageActionText ) #### Atom Set #### jigsAtomSetActionText = "<u><b>Atom Set</b></u></b></p><br>"\ "<p><img source=\"jigsAtomSetAction\"><br> "\ "An <b>Atom Set</b> jig provides a convienient way to save an atom "\ "selection which can be reselected later."\ "</p>"\ "<p>To create an Atom Set, enter <b>Select Atoms</b> mode, "\ "select any number of atoms and then select this jig. The Atom Set is "\ "drawn as a set of wireframe boxes around each atom in the selection."\ "</p>"\ "<p>To reselect the atoms in an Atom Set, select it's context "\ "menu in the Model Tree and click the menu item that states "\ "<b>Select this jig's atoms</b>."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsAtomSetAction", self.jigsAtomSetAction.iconSet().pixmap() ) self.jigsAtomSetAction.setWhatsThis(jigsAtomSetActionText ) #### Measure Distance #### jigsDistanceActionText = "<u><b>Measure Distance Jig</b></u></b></p><br>"\ "<p><img source=\"jigsDistanceAction\"><br> "\ "A <b>Measure Distance Jig</b> functions as a dimension to display the "\ "distance between two atoms."\ "</p>"\ "<p>To create the Measure Distance Jig, enter <b>Select Atoms</b> mode, "\ "select two atoms and then select this jig. The Measure Distance Jig is "\ "drawn as a pair of wireframe boxes around each atom connected by "\ "a line and a pair of numbers. The first number is the distance between the "\ "VdW radii (this can be a negative number for atoms that are close together). "\ "The second number is the distance between the nuclei."\ "</p>"\ "<p>The Measure Distance Jig will write the two distance values to the trace file "\ "for each frame of a simulation run and can be plotted using the Plot Tool."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsDistanceAction", self.jigsDistanceAction.iconSet().pixmap() ) self.jigsDistanceAction.setWhatsThis(jigsDistanceActionText ) #### Measure Angle #### jigsAngleActionText = "<u><b>Measure Angle Jig</b></u></b></p><br>"\ "<p><img source=\"jigsAngleAction\"><br> "\ "A <b>Measure Angle Jig</b> functions as a dimension to display the "\ "angle between three atoms.</p>"\ "<p>To create the Measure Angle Jig, enter <b>Select Atoms</b> mode, "\ "select three atoms and then select this jig. The Measure Angle Jig is "\ "drawn as a set of wireframe boxes around each atom and a number "\ "which is the angle between the three atoms."\ "</p>"\ "<p>The Measure Angle Jig will write the angle value to the trace file "\ "for each frame of a simulation run and can be plotted using the Plot Tool."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsAngleAction", self.jigsAngleAction.iconSet().pixmap() ) self.jigsAngleAction.setWhatsThis(jigsAngleActionText ) #### Measure Dihedral #### jigsDihedralActionText = "<u><b>Measure Dihedral Jig</b></u></b></p><br>"\ "<p><img source=\"jigsDihedralAction\"><br> "\ "A <b>Measure Dihedral Jig</b> functions as a dimension to display the "\ "dihedral angle of a four atom sequence.</p>"\ "<p>To create the Measure Dihedral Jig, enter <b>Select Atoms</b> mode, "\ "select four atoms and then select this jig. The Measure Dihedral Jig is "\ "drawn as a set of wireframe boxes around each atom and a number "\ "which is the dihedral angle value."\ "</p>"\ "<p>The Measure Dihedral Jig will write the dihedral angle value to the trace file "\ "for each frame of a simulation run and can be plotted using the Plot Tool."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsDihedralAction", self.jigsDihedralAction.iconSet().pixmap() ) self.jigsDihedralAction.setWhatsThis(jigsDihedralActionText ) #### GAMESS Jig #### jigsGamessActionText = "<u><b>GAMESS Jig</b></u></b></p><br>"\ "<p><img source=\"jigsGamessAction\"><br> "\ "A <b>GAMESS Jig</b> is used to tag a set of atoms for running a GAMESS "\ "calculation. <b>Energy</b> and <b>Geometry Optimization</b> calculations are supported."\ "</p>"\ "<p>To create the GAMESS Jig, enter <b>Select Atoms</b> mode, "\ "select the atoms to tag and then select this jig. The GAMESS Jig is drawn as a "\ "set of magenta wireframe boxes around each atom."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsGamessAction", self.jigsGamessAction.iconSet().pixmap() ) self.jigsGamessAction.setWhatsThis(jigsGamessActionText ) #### Grid Plane Jig #### jigsGridPlaneActionText = "<u><b>Grid Plane</b></u></b></p><br>"\ "<p><img source=\"jigsGridPlaneAction\"><br> "\ "A <b>Grid Plane</b> jig is a rectanglar plane that can display a square or SiC grid "\ "within its boundary. It is often used as an aid in constructing large lattice "\ "structures made of silicon carbide (SiC). It is also used as a visual aid in estimating "\ "distances between atoms and/or other structures."\ "</p>"\ "<p>To create the Grid Plane jig, enter <b>Select Atoms</b> mode, "\ "select three or more atoms and then select this jig. "\ "</p>"\ "<p>The Grid Plane jig is drawn as a rectanglar plane with a grid."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsGridPlaneAction", self.jigsGridPlaneAction.iconSet().pixmap() ) self.jigsGridPlaneAction.setWhatsThis(jigsGridPlaneActionText ) ############################################## # Display ############################################## #### Display Object Color #### dispObjectColorActionText = "<u><b>Object Color</b></u><br>"\ "<p><img source=\"dispObjectColorAction\"><br> "\ "Allows you to change the color of the selected object(s).</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispObjectColorAction", self.dispObjectColorAction.iconSet().pixmap() ) self.dispObjectColorAction.setWhatsThis(dispObjectColorActionText ) #### Display Background Color #### dispBGColorActionText = "<u><b>Background Color</b></u><br>"\ "<p><img source=\"dispBGColorAction\"><br> "\ "Allows you to change the background color of the main window.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispBGColorAction", self.dispBGColorAction.iconSet().pixmap() ) self.dispBGColorAction.setWhatsThis(dispBGColorActionText ) ############################################## # Help Toolbar ############################################## #### What's This #### helpWhatsThisText = "<u><b>What's This</b></u><br>"\ "<p><img source=\"helpWhatsThis\"><br> "\ "Click this option to invoke a small question mark that is attached to the mouse pointer. "\ "Click on a feature which you would like more information about. "\ "A popup box appears with information about the feature.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "helpWhatsThis", self.helpWhatsThisAction.iconSet().pixmap() ) self.helpWhatsThisAction.setWhatsThis( helpWhatsThisText ) ############################################## # Datum Display Toolbar ############################################## #### Display Trihedron #### dispTrihedronText = "<u><b>Display Trihedron</b></u><br>"\ "<p><img source=\"dispTrihedron\"><br> "\ "Toggles the trihedron on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispTrihedron", self.dispTrihedronAction.iconSet().pixmap() ) self.dispTrihedronAction.setWhatsThis(dispTrihedronText ) #### Display Csys #### dispCsysText = "<u><b>Display Csys Axis</b></u><br>"\ "<p><img source=\"dispCsys\"><br> "\ "Toggles the coordinate system axis on and off."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispCsys", self.dispCsysAction.iconSet().pixmap() ) self.dispCsysAction.setWhatsThis(dispCsysText ) #### Display Datum Lines #### dispDatumLinesText = "<u><b>Display Datum Lines</b></u><br>"\ "<p><img source=\"dispDatumLines\"><br> "\ "Toggles Datum Lines on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDatumLines", self.dispDatumLinesAction.iconSet().pixmap() ) self.dispDatumLinesAction.setWhatsThis(dispDatumLinesText ) #### Display Datum Planes #### dispDatumPlanesText = "<u><b>Display Datum Planes</b></u><br>"\ "<p><img source=\"dispDatumPlanes\"><br> "\ "Toggles Datum Planes on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDatumPlanes", self.dispDatumPlanesAction.iconSet().pixmap() ) self.dispDatumPlanesAction.setWhatsThis(dispDatumPlanesText ) #### Display Grid #### dispGridText = "<u><b>Display 3-D Grid</b></u><br>"\ "<p><img source=\"dispGrid\"><br> "\ "Toggles the 3-D grid on and off."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispGrid", self.dispGridAction.iconSet().pixmap() ) self.dispGridAction.setWhatsThis(dispGridText )
3354e3d14ce0a117e138989d7db0afe57c0bf728 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/3354e3d14ce0a117e138989d7db0afe57c0bf728/whatsthis.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 2888, 2323, 2503, 12, 2890, 4672, 225, 19709, 26487, 7, 468, 1387, 13288, 3215, 19709, 26487, 7, 225, 11849, 7, 3502, 1387, 11849, 7, 225, 585, 3678, 1528, 273, 3532, 89, 4438, 70, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2888, 2323, 2503, 12, 2890, 4672, 225, 19709, 26487, 7, 468, 1387, 13288, 3215, 19709, 26487, 7, 225, 11849, 7, 3502, 1387, 11849, 7, 225, 585, 3678, 1528, 273, 3532, 89, 4438, 70, ...
hlr_utils.result_insert(result,res_descr,rev_value,map_so,"x",axis)
hlr_utils.result_insert(result, res_descr, rev_value, map_so, "x", axis)
def wavelength_to_scalar_k(obj,**kwargs): """ This function converts a primary axis of a SOM or SO from wavelength to scalar_k. The wavelength axis for a SOM must be in units of Angstroms. The primary axis of a SO is assumed to be in units of Angstroms. A tuple of [wavelength, wavelength_err2] (assumed to be in units of Angstroms) can be converted to [scalar_k, scalar_k_err2]. Parameters: ---------- -> obj is the SOM, SO or tuple to be converted -> kwargs is a list of key word arguments that the function accepts: units= a string containing the expected units for this function. The default for this function is Angstroms Return: ------ <- A SOM or SO with a primary axis in scalar_k or a tuple converted to scalar_k Exceptions: ---------- <- TypeError is raised if the incoming object is not a type the function recognizes <- RuntimeError is raised if the SOM x-axis units are not Angstroms """ # import the helper functions import hlr_utils # set up for working through data (result,res_descr)=hlr_utils.empty_result(obj) (o_descr,d_descr)=hlr_utils.get_descr(obj) if o_descr == "list": raise TypeError, "Do not know how to handle given type: %s" %\ o_descr else: pass # Setup keyword arguments try: units = kwargs["units"] except KeyError: units = "Angstroms" # Primary axis for transformation. If a SO is passed, the function, will # assume the axis for transformation is at the 0 position if o_descr == "SOM": axis = hlr_utils.hlr_1D_units(obj, units) else: axis = 0 result=hlr_utils.copy_som_attr(result,res_descr,obj,o_descr) if res_descr == "SOM": result = hlr_utils.hlr_force_units(result, "1/Angstroms", axis) result.setAxisLabel(axis, "scalar wavevector") result.setYUnits("Counts/A-1") result.setYLabel("Intensity") else: pass # iterate through the values import axis_manip for i in range(hlr_utils.get_length(obj)): val = hlr_utils.get_value(obj,i,o_descr,"x",axis) err2 = hlr_utils.get_err2(obj,i,o_descr,"x",axis) value=axis_manip.wavelength_to_scalar_k(val, err2) if o_descr != "number": value1 = axis_manip.reverse_array_cp(value[0]) value2 = axis_manip.reverse_array_cp(value[1]) rev_value = (value1,value2) else: rev_value = value map_so = hlr_utils.get_map_so(obj,None,i) if map_so != None: map_so.y=axis_manip.reverse_array_cp(map_so.y) map_so.var_y=axis_manip.reverse_array_cp(map_so.var_y) else: pass hlr_utils.result_insert(result,res_descr,rev_value,map_so,"x",axis) return result
4af11b571f056b419760434ea5be641c11847a97 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/4af11b571f056b419760434ea5be641c11847a97/hlr_wavelength_to_scalar_k.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21410, 67, 869, 67, 8748, 67, 79, 12, 2603, 16, 636, 4333, 4672, 3536, 1220, 445, 7759, 279, 3354, 2654, 434, 279, 348, 1872, 578, 7460, 628, 21410, 358, 4981, 67, 79, 18, 1021, 21410,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21410, 67, 869, 67, 8748, 67, 79, 12, 2603, 16, 636, 4333, 4672, 3536, 1220, 445, 7759, 279, 3354, 2654, 434, 279, 348, 1872, 578, 7460, 628, 21410, 358, 4981, 67, 79, 18, 1021, 21410,...
fobj = self._inherit_fields[field]
fobj = self._inherit_fields[field][2]
def write(self, cr, user, ids, vals, context=None): readonly = None for field in vals: fobj = None if field in self._columns: fobj = self._columns[field] else: fobj = self._inherit_fields[field] if not fobj: continue groups = fobj.groups if groups: edit = False for group in groups: module = group.split(".")[0] grp = group.split(".")[1] cr.execute("select count(*) from res_groups_users_rel where gid in (select res_id from ir_model_data where name='%s' and module='%s' and model='%s') and uid=%s" % \ (grp, module, 'res.groups', user)) readonly = cr.fetchall() if readonly[0][0] >= 1: edit = True elif readonly[0][0] == 0: edit = False else: edit = False if not edit: vals.pop(field)
f7f2147992110592c2ae70e7a4eb4224b722ee5b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/f7f2147992110592c2ae70e7a4eb4224b722ee5b/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 4422, 16, 729, 16, 3258, 16, 5773, 16, 819, 33, 7036, 4672, 17102, 273, 599, 364, 652, 316, 5773, 30, 24705, 273, 599, 309, 652, 316, 365, 6315, 5112, 30, 24705, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 4422, 16, 729, 16, 3258, 16, 5773, 16, 819, 33, 7036, 4672, 17102, 273, 599, 364, 652, 316, 5773, 30, 24705, 273, 599, 309, 652, 316, 365, 6315, 5112, 30, 24705, ...
self.update_device_database_collections(blist, collections)
if i == 0: oncard = 'main' else: oncard = 'carda' self.update_device_database_collections(blist, collections, oncard)
def sync_booklists(self, booklists, end_session=True):
ad8911b65f3e8a940abc5b01e9dc878ce0f616c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/ad8911b65f3e8a940abc5b01e9dc878ce0f616c3/driver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3792, 67, 3618, 9772, 12, 2890, 16, 6978, 9772, 16, 679, 67, 3184, 33, 5510, 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,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3792, 67, 3618, 9772, 12, 2890, 16, 6978, 9772, 16, 679, 67, 3184, 33, 5510, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
if index+3 < len(text) \
elif index+3 < len(text) \
def parseRange(text, start): r""" >>> parseRange('[a]b', 1) (<RegexRange '[a]'>, 3) >>> parseRange('[a-z]b', 1) (<RegexRange '[a-z]'>, 5) >>> parseRange('[^a-z-]b', 1) (<RegexRange '[^a-z-]'>, 7) >>> parseRange('[^]-]b', 1) (<RegexRange '[^]-]'>, 5) """ index = start char_range = [] exclude = False if text[index] == '^': exclude = True index += 1 if text[index] == ']': char_range.append(RegexRangeCharacter(']')) index += 1 while index < len(text) and text[index] != ']': if index+1 < len(text) \ and text[index] == '-' and text[index+1] == ']': break if index+3 < len(text) \ and text[index+1] == '-' \ and text[index+2] != ']': char_range.append(RegexRangeItem(ord(text[index]), ord(text[index+2]))) index += 3 else: char_range.append(RegexRangeCharacter(text[index])) index += 1 if index < len(text) and text[index] == '-': char_range.append(RegexRangeCharacter('-')) index += 1 if index == len(text) or text[index] != ']': raise SyntaxError('Invalid range: %s' % text[start-1:index]) return RegexRange(char_range, exclude), index+1
5f9ba2af1fc98421432c133b649b495baaf09706 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9327/5f9ba2af1fc98421432c133b649b495baaf09706/parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 2655, 12, 955, 16, 787, 4672, 436, 8395, 4080, 1109, 2655, 2668, 63, 69, 65, 70, 2187, 404, 13, 261, 32, 6628, 2655, 5271, 69, 3864, 20401, 890, 13, 4080, 1109, 2655, 2668, 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, 1109, 2655, 12, 955, 16, 787, 4672, 436, 8395, 4080, 1109, 2655, 2668, 63, 69, 65, 70, 2187, 404, 13, 261, 32, 6628, 2655, 5271, 69, 3864, 20401, 890, 13, 4080, 1109, 2655, 2668, 63, ...
'random', 're', 'shutil', 'string', 'subprocess', 'sys', 'tempfile',
'random', 're', 'string', 'subprocess', 'sys', 'tempfile',
def testMembersChanged(self): self.mox.ReplayAll() members = [ 'CODEREVIEW_SETTINGS', 'CODEREVIEW_SETTINGS_FILE', 'CMDchange', 'CMDchanges', 'CMDcommit', 'CMDdelete', 'CMDdeleteempties', 'CMDdescription', 'CMDdiff', 'CMDhelp', 'CMDlint', 'CMDnothave', 'CMDopened', 'CMDpassthru', 'CMDpresubmit', 'CMDrename', 'CMDsettings', 'CMDstatus', 'CMDtry', 'CMDupload', 'ChangeInfo', 'Command', 'DEFAULT_LINT_IGNORE_REGEX', 'DEFAULT_LINT_REGEX', 'CheckHomeForFile', 'DoPresubmitChecks', 'ErrorExit', 'FILES_CACHE', 'FilterFlag', 'GenUsage', 'GenerateChangeName', 'GenerateDiff', 'GetCLs', 'GetCacheDir', 'GetCachedFile', 'GetChangelistInfoFile', 'GetChangesDir', 'GetCodeReviewSetting', 'GetEditor', 'GetFilesNotInCL', 'GetInfoDir', 'GetIssueDescription', 'GetModifiedFiles', 'GetRepositoryRoot', 'ListFiles', 'LoadChangelistInfoForMultiple', 'MISSING_TEST_MSG', 'OptionallyDoPresubmitChecks', 'REPOSITORY_ROOT', 'RunShell', 'RunShellWithReturnCode', 'SVN', 'SendToRietveld', 'TryChange', 'UnknownFiles', 'Warn', 'attrs', 'breakpad', 'defer_attributes', 'gclient_utils', 'getpass', 'main', 'need_change', 'need_change_and_args', 'no_args', 'os', 'random', 're', 'shutil', 'string', 'subprocess', 'sys', 'tempfile', 'time', 'upload', 'urllib2', ] # If this test fails, you should add the relevant test. self.compareMembers(gcl, members)
17e0ada14ef80731f7e2d93fd23a00dddfcf89f8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/17e0ada14ef80731f7e2d93fd23a00dddfcf89f8/gcl_unittest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 6918, 5033, 12, 2890, 4672, 365, 18, 81, 2409, 18, 26481, 1595, 1435, 4833, 273, 306, 296, 9086, 29340, 12145, 67, 19428, 2187, 296, 9086, 29340, 12145, 67, 19428, 67, 3776, 2187, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 6918, 5033, 12, 2890, 4672, 365, 18, 81, 2409, 18, 26481, 1595, 1435, 4833, 273, 306, 296, 9086, 29340, 12145, 67, 19428, 2187, 296, 9086, 29340, 12145, 67, 19428, 67, 3776, 2187, ...
('L,grAttrs', 'L,szName', 'L,phmod', 'L,pIAT', 'L,pINT', 'L,pBoundIAT', 'L,pUnloadIAT', 'L,dwTimeStamp'))
('I,grAttrs', 'I,szName', 'I,phmod', 'I,pIAT', 'I,pINT', 'I,pBoundIAT', 'I,pUnloadIAT', 'I,dwTimeStamp'))
def __init__(self, **args): for key, value in args.items(): setattr(self, key, value)
b1bfd27bf7c329d36f68dc5f4ed5adda7c025501 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4177/b1bfd27bf7c329d36f68dc5f4ed5adda7c025501/pefile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2826, 1968, 4672, 364, 498, 16, 460, 316, 833, 18, 3319, 13332, 9241, 12, 2890, 16, 498, 16, 460, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2826, 1968, 4672, 364, 498, 16, 460, 316, 833, 18, 3319, 13332, 9241, 12, 2890, 16, 498, 16, 460, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
def doIt(file) : """Generates a PDF document, save it into file, and returns Python source code.
def doIt(file, regenerate=0) : """Generates a PDF document, save it into file.
def doIt(file) : """Generates a PDF document, save it into file, and returns Python source code. file : either a filename or a file-like object. returns : the equivalent Python source code as a string of text. """'''
eda80a0d360373fab798a678a4eaeffb4f5946e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/eda80a0d360373fab798a678a4eaeffb4f5946e8/pycanvas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 7193, 12, 768, 16, 20821, 33, 20, 13, 294, 3536, 6653, 279, 12667, 1668, 16, 1923, 518, 1368, 585, 18, 225, 585, 294, 3344, 279, 1544, 578, 279, 585, 17, 5625, 733, 18, 225, 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, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 7193, 12, 768, 16, 20821, 33, 20, 13, 294, 3536, 6653, 279, 12667, 1668, 16, 1923, 518, 1368, 585, 18, 225, 585, 294, 3344, 279, 1544, 578, 279, 585, 17, 5625, 733, 18, 225, 113...
utils.WriteFile(destination, data=txt, gid=getents.confd_gid, mode=0640)
try: fd = utils.SafeWriteFile(destination, self._cfg_id, data=txt, close=False, gid=getents.confd_gid, mode=0640) except errors.LockError: raise errors.ConfigurationError("The configuration file has been" " modified since the last write, cannot" " update") try: self._cfg_id = utils.GetFileID(fd=fd) finally: os.close(fd)
def _WriteConfig(self, destination=None, feedback_fn=None): """Write the configuration data to persistent storage.
bd40759742e2c3f903bd17e6516c6705a9abcfb2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7542/bd40759742e2c3f903bd17e6516c6705a9abcfb2/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3067, 809, 12, 2890, 16, 2929, 33, 7036, 16, 10762, 67, 4293, 33, 7036, 4672, 3536, 3067, 326, 1664, 501, 358, 9195, 2502, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3067, 809, 12, 2890, 16, 2929, 33, 7036, 16, 10762, 67, 4293, 33, 7036, 4672, 3536, 3067, 326, 1664, 501, 358, 9195, 2502, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -...
def GetStatus(self): """Return the status of the device. """ self.Attach() if self.minor is None: retval = self.STATUS_UNKNOWN else: retval = self.STATUS_ONLINE return retval
def RemoveChildren(self, devices): """Remove member(s) from the md raid1.
39e9e213617d8af940346b587aa5f42c5e78d966 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/39e9e213617d8af940346b587aa5f42c5e78d966/bdev.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3581, 4212, 12, 2890, 16, 7166, 4672, 3536, 3288, 3140, 12, 87, 13, 628, 326, 3481, 767, 350, 21, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3581, 4212, 12, 2890, 16, 7166, 4672, 3536, 3288, 3140, 12, 87, 13, 628, 326, 3481, 767, 350, 21, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
return SymbolicComposition(self, SR(x))
return SymbolicComposition(self, SR(x_original))
def __call__(self, x, maximum_bits=20000): try: return x.floor() except AttributeError: if isinstance(x, (float, int, long, complex)): return Integer(int(math.floor(x)))
2cf36cd065e0c14848cc191fb4e60967c101792f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/2cf36cd065e0c14848cc191fb4e60967c101792f/calculus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 619, 16, 4207, 67, 6789, 33, 22, 2787, 4672, 775, 30, 327, 619, 18, 74, 5807, 1435, 1335, 6394, 30, 309, 1549, 12, 92, 16, 261, 5659, 16, 509, 16, 15...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 619, 16, 4207, 67, 6789, 33, 22, 2787, 4672, 775, 30, 327, 619, 18, 74, 5807, 1435, 1335, 6394, 30, 309, 1549, 12, 92, 16, 261, 5659, 16, 509, 16, 15...
case when product_os_platform = 'Mac OS/X' then 'Mac' else product_os_platform end as product_os_platform,
substring(product_os_platform, 1, 3) as product_os_platform,
def testAduByDay_fetchAduHistory1(): parameters = util.DotDict({ 'start_date': dt.datetime(2009, 12, 1), 'end_date': dt.datetime(2009, 12, 15), 'product': 'Firefox', 'version': '3.5.5', 'listOfOs_names': ['Windows', 'Mac'], }) sql = """ select date, case when product_os_platform = 'Mac OS/X' then 'Mac' else product_os_platform end as product_os_platform, sum(adu_count) from raw_adu ra where %(start_date)s <= date and date <= %(end_date)s and product_name = %(product)s and product_version = %(version)s and product_os_platform in ('Windows','Mac OS/X') group by date, product_os_platform order by 1""" sqlReturn = singleQueryReturn1 dummyCursor = expect.DummyObjectWithExpectations('dummyCursor') #dummyCursor.expect('tobecalled', args, kwargs, retvalue) dummyCursor.expect('execute', (sql, parameters), {}, sqlReturn) for x in sqlReturn: dummyCursor.expect('fetchone', (), {}, x) dummyCursor.expect('fetchone', (), {}, None, StopIteration) dummyConnection = expect.DummyObjectWithExpectations('dummyConnection') dummyConnection.expect('cursor', (), {}, dummyCursor) context = getDummyContext() adu = abd.AduByDay(context) adu.connection = dummyConnection result = adu.fetchAduHistory(parameters) expectedResult = expectedHistory1 assert result == expectedResult, "expected %s, but got %s" % (expectedResult, result)
612c2e11e9cfb9403a004763f4a74d126edb03c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12383/612c2e11e9cfb9403a004763f4a74d126edb03c4/testTopAduByDay.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1871, 89, 858, 4245, 67, 5754, 1871, 89, 5623, 21, 13332, 1472, 273, 1709, 18, 10412, 5014, 12590, 296, 1937, 67, 712, 4278, 3681, 18, 6585, 12, 6976, 29, 16, 2593, 16, 404, 3631...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1871, 89, 858, 4245, 67, 5754, 1871, 89, 5623, 21, 13332, 1472, 273, 1709, 18, 10412, 5014, 12590, 296, 1937, 67, 712, 4278, 3681, 18, 6585, 12, 6976, 29, 16, 2593, 16, 404, 3631...
self.contactSelection.select_iter(vcard.iter) self.view_contact(True)
print iter self.contactSelection.select_iter(iter) self.iter = iter self.vcard = vcard self.parse_contact() self.editButton_clicked()
def newButton_clicked(self, widget): vcard = vobject.vCard() vcard.add("n") vcard.add("fn") vcard.add("tel") vcard.add("email") vcard.add("url") vcard.tel.type_paramlist = ["HOME", "VOICE", "PREF"] vcard.email.type_paramlist = ["HOME", "INTERNET", "PREF"] vcard.serialize() vcard.filename = None vcard.iter = self.contactData.append([_("Unnamed"), "", vcard]) self.contactSelection.unselect_all() self.contactSelection.select_iter(vcard.iter) self.view_contact(True) self.is_new = True self.undoButton.hide() self.namechangeButton_clicked(None)
d146007907c6581d8d80f2f60d1a7f1efdee1728 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2651/d146007907c6581d8d80f2f60d1a7f1efdee1728/arkadas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 3616, 67, 7475, 329, 12, 2890, 16, 3604, 4672, 29760, 273, 331, 1612, 18, 90, 6415, 1435, 29760, 18, 1289, 2932, 82, 7923, 29760, 18, 1289, 2932, 4293, 7923, 29760, 18, 1289, 2932, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 3616, 67, 7475, 329, 12, 2890, 16, 3604, 4672, 29760, 273, 331, 1612, 18, 90, 6415, 1435, 29760, 18, 1289, 2932, 82, 7923, 29760, 18, 1289, 2932, 4293, 7923, 29760, 18, 1289, 2932, ...
EPS.__init__(self, atoms, **parameters)
EPS.__init__(self, atoms, scale=scale, **parameters)
def __init__(self, atoms, **parameters): for k, v in self.default_settings.items(): setattr(self, k, parameters.pop(k, v)) EPS.__init__(self, atoms, **parameters)
3657db7705a38b36a0d94487d81a8904cb5bf5dd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5735/3657db7705a38b36a0d94487d81a8904cb5bf5dd/pov.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 9006, 16, 2826, 3977, 4672, 364, 417, 16, 331, 316, 365, 18, 1886, 67, 4272, 18, 3319, 13332, 9241, 12, 2890, 16, 417, 16, 1472, 18, 5120, 12, 79, 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, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 9006, 16, 2826, 3977, 4672, 364, 417, 16, 331, 316, 365, 18, 1886, 67, 4272, 18, 3319, 13332, 9241, 12, 2890, 16, 417, 16, 1472, 18, 5120, 12, 79, 16, ...
if i==0: continue
if i==0: v.append(c0) continue
def __compute_general_case(self, X): """ General case (except weight 2, trivial character, where this is wrong!) $\chi$ is a primitive character of conductor $L$ $\psi$ is a primitive character of conductor $M$ We have $MLt \mid N$, and $$ E_k(chi,psi,t) = c_0 + sum_{m \geq 1}[sum_{n|m} psi(n) * chi(m/n) * n^(k-1)] q^{mt}, $$ with $c_0=0$ if $L>1$, and $c_0=L(1-k,psi)/2$ if $L=1$ (that second $L$ is an $L$-function $L$). """ c0, chi, psi, K, n, t, L, M = self.__defining_parameters() zero = K(0) k = self.weight() v = [c0] for i in X: if i==0: continue if i%t != 0: v.append(zero) else: m = i//t v.append(sum([psi(n)*chi(m/n)*n**(k-1) for \ n in rings.divisors(m)])) return v
f9fb1a64c34d6355e6ab054e3c07cff20c82fcc0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/f9fb1a64c34d6355e6ab054e3c07cff20c82fcc0/element.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9200, 67, 12259, 67, 3593, 12, 2890, 16, 1139, 4672, 3536, 9544, 648, 261, 14137, 3119, 576, 16, 433, 20109, 3351, 16, 1625, 333, 353, 7194, 24949, 271, 64, 24010, 8, 353, 279, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9200, 67, 12259, 67, 3593, 12, 2890, 16, 1139, 4672, 3536, 9544, 648, 261, 14137, 3119, 576, 16, 433, 20109, 3351, 16, 1625, 333, 353, 7194, 24949, 271, 64, 24010, 8, 353, 279, 8...
return ur'%s%s%s' % (match.group(1), re.sub(r_gallery, simple_replacer, match.group(2)), match.group(3))
return ur'%s%s%s' % (match.group(1), re.sub(r_gallery_item, simple_replacer, match.group(2)), match.group(3))
def gallery_replacer(match): return ur'%s%s%s' % (match.group(1), re.sub(r_gallery, simple_replacer, match.group(2)), match.group(3))
d768a34ea49467cbda95e66a191c45dc75c61219 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/d768a34ea49467cbda95e66a191c45dc75c61219/wikipedia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13624, 67, 26745, 10598, 12, 1916, 4672, 327, 8896, 11, 9, 87, 9, 87, 9, 87, 11, 738, 261, 1916, 18, 1655, 12, 21, 3631, 283, 18, 1717, 12, 86, 67, 21454, 16, 4143, 67, 26745, 1059...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 13624, 67, 26745, 10598, 12, 1916, 4672, 327, 8896, 11, 9, 87, 9, 87, 9, 87, 11, 738, 261, 1916, 18, 1655, 12, 21, 3631, 283, 18, 1717, 12, 86, 67, 21454, 16, 4143, 67, 26745, 1059...
with open(tricky) as f:
with open(tricky, encoding='utf-8') as f:
def test_parse_errors(self): cf = self.newconfig() self.parse_error(cf, configparser.ParsingError, "[Foo]\n" "{}val-without-opt-name\n".format(self.delimiters[0])) self.parse_error(cf, configparser.ParsingError, "[Foo]\n" "{}val-without-opt-name\n".format(self.delimiters[1])) e = self.parse_error(cf, configparser.MissingSectionHeaderError, "No Section!\n") self.assertEqual(e.args, ('<???>', 1, "No Section!\n")) if not self.allow_no_value: e = self.parse_error(cf, configparser.ParsingError, "[Foo]\n wrong-indent\n") self.assertEqual(e.args, ('<???>',)) # read_file on a real file tricky = support.findfile("cfgparser.3") if self.delimiters[0] == '=': error = configparser.ParsingError expected = (tricky,) else: error = configparser.MissingSectionHeaderError expected = (tricky, 1, ' # INI with as many tricky parts as possible\n') with open(tricky) as f: e = self.parse_error(cf, error, f) self.assertEqual(e.args, expected)
d12a420acc4e056ec3a4deec1d730647a845ee11 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/d12a420acc4e056ec3a4deec1d730647a845ee11/test_cfgparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2670, 67, 4324, 12, 2890, 4672, 6080, 273, 365, 18, 2704, 1425, 1435, 365, 18, 2670, 67, 1636, 12, 8522, 16, 642, 4288, 18, 13963, 668, 16, 5158, 42, 5161, 13944, 82, 6, 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, 1842, 67, 2670, 67, 4324, 12, 2890, 4672, 6080, 273, 365, 18, 2704, 1425, 1435, 365, 18, 2670, 67, 1636, 12, 8522, 16, 642, 4288, 18, 13963, 668, 16, 5158, 42, 5161, 13944, 82, 6, 74...
child._link_parent = wref(self)
def _set_children(self, children): self._children = tuple(children) prev = None for child in self._children: child._link_left = wref(prev) prev = child prev = None for child in reversed(self._children): child._link_right = wref(prev) prev = child child._link_parent = wref(self)
c331078fa75c2fa94c322f347f0fc0b2c540d9fc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3683/c331078fa75c2fa94c322f347f0fc0b2c540d9fc/text.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 542, 67, 5906, 12, 2890, 16, 2325, 4672, 365, 6315, 5906, 273, 3193, 12, 5906, 13, 2807, 273, 599, 364, 1151, 316, 365, 6315, 5906, 30, 1151, 6315, 1232, 67, 4482, 273, 341, 1734,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 542, 67, 5906, 12, 2890, 16, 2325, 4672, 365, 6315, 5906, 273, 3193, 12, 5906, 13, 2807, 273, 599, 364, 1151, 316, 365, 6315, 5906, 30, 1151, 6315, 1232, 67, 4482, 273, 341, 1734,...
p = Parser(integer.Integer, R, LookupNameMaker({self.variable_name(): self.gen()}, R))
p = Parser(Integer, R, LookupNameMaker({self.variable_name(): self.gen()}, R))
def __call__(self, x=None, check=True, is_gen = False, construct=False, absprec = None): r""" Coerce \code{x} into this univariate polynomial ring, possibly non-canonically. Stacked polynomial rings coerce into constants if possible. First, the univariate case: sage: R.<x> = QQ[] sage: S.<u> = R[] sage: S(u + 2) u + 2 sage: S(x + 3) x + 3 sage: S(x + 3).degree() 0
86e337277a93c263616bd04bf0a0d4f8b7ec4127 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/86e337277a93c263616bd04bf0a0d4f8b7ec4127/polynomial_ring.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 619, 33, 7036, 16, 866, 33, 5510, 16, 353, 67, 4507, 273, 1083, 16, 4872, 33, 8381, 16, 2417, 4036, 273, 599, 4672, 436, 8395, 7695, 2765, 521, 710, 95...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 619, 33, 7036, 16, 866, 33, 5510, 16, 353, 67, 4507, 273, 1083, 16, 4872, 33, 8381, 16, 2417, 4036, 273, 599, 4672, 436, 8395, 7695, 2765, 521, 710, 95...
if self.execing: self.checkNotifications()
try: if self.execing: self.checkNotifications() except: print "******************************* A SEVERE ERROR HAPPENED... Someone who understands the code... please fix :) *******"
def checkNotificationsIfExecing(self): if self.execing: self.checkNotifications()
48f2728ecdeabde7de0f497f8a69dbddcb047b90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/48f2728ecdeabde7de0f497f8a69dbddcb047b90/InfoBarGenerics.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 14111, 2047, 1905, 310, 12, 2890, 4672, 309, 365, 18, 4177, 310, 30, 365, 18, 1893, 14111, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 14111, 2047, 1905, 310, 12, 2890, 4672, 309, 365, 18, 4177, 310, 30, 365, 18, 1893, 14111, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
The structure determines the type of chamfering that is done. If the structure is equal to 'cityblock' a structure is generated
The metric determines the type of chamfering that is done. If the metric is equal to 'taxicab' a structure is generated
def distance_transform_cdt(input, structure = 'chessboard', return_distances = True, return_indices = False, distances = None, indices = None): """Distance transform for chamfer type of transforms. The structure determines the type of chamfering that is done. If the structure is equal to 'cityblock' a structure is generated using generate_binary_structure with a squared distance equal to 1. If the structure is equal to 'chessboard', a structure is generated using generate_binary_structure with a squared distance equal to the rank of the array. These choices correspond to the common interpretations of the cityblock and the chessboard distance metrics in two dimensions. In addition to the distance transform, the feature transform can be calculated. In this case the index of the closest background element is returned along the first axis of the result. The return_distances, and return_indices flags can be used to indicate if the distance transform, the feature transform, or both must be returned. The distances and indices arguments can be used to give optional output arrays that must be of the correct size and type (both int32). """ if (not return_distances) and (not return_indices): msg = 'at least one of distances/indices must be specified' raise RuntimeError, msg ft_inplace = isinstance(indices, numpy.ndarray) dt_inplace = isinstance(distances, numpy.ndarray) input = numpy.asarray(input) if structure == 'cityblock': rank = input.ndim structure = generate_binary_structure(rank, 1) elif structure == 'chessboard': rank = input.ndim structure = generate_binary_structure(rank, rank) else: try: structure = numpy.asarray(structure) except: raise RuntimeError, 'invalid structure provided' for s in structure.shape: if s != 3: raise RuntimeError, 'structure sizes must be equal to 3' if not structure.flags.contiguous: structure = structure.copy() if dt_inplace: if distances.dtype.type != numpy.int32: raise RuntimeError, 'distances must be of int32 type' if distances.shape != input.shape: raise RuntimeError, 'distances has wrong shape' dt = distances dt[...] = numpy.where(input, -1, 0).astype(numpy.int32) else: dt = numpy.where(input, -1, 0).astype(numpy.int32) rank = dt.ndim if return_indices: sz = numpy.product(dt.shape,axis=0) ft = numpy.arange(sz, dtype = numpy.int32) ft.shape = dt.shape else: ft = None _nd_image.distance_transform_op(structure, dt, ft) dt = dt[tuple([slice(None, None, -1)] * rank)] if return_indices: ft = ft[tuple([slice(None, None, -1)] * rank)] _nd_image.distance_transform_op(structure, dt, ft) dt = dt[tuple([slice(None, None, -1)] * rank)] if return_indices: ft = ft[tuple([slice(None, None, -1)] * rank)] ft = numpy.ravel(ft) if ft_inplace: if indices.dtype.type != numpy.int32: raise RuntimeError, 'indices must of int32 type' if indices.shape != (dt.ndim,) + dt.shape: raise RuntimeError, 'indices has wrong shape' tmp = indices else: tmp = numpy.indices(dt.shape, dtype = numpy.int32) for ii in range(tmp.shape[0]): rtmp = numpy.ravel(tmp[ii, ...])[ft] rtmp.shape = dt.shape tmp[ii, ...] = rtmp ft = tmp # construct and return the result result = [] if return_distances and not dt_inplace: result.append(dt) if return_indices and not ft_inplace: result.append(ft) if len(result) == 2: return tuple(result) elif len(result) == 1: return result[0] else: return None
eb496ec9285627c61d69cd83f49719a3d9b46e74 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12971/eb496ec9285627c61d69cd83f49719a3d9b46e74/morphology.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3888, 67, 6547, 67, 4315, 88, 12, 2630, 16, 3695, 273, 296, 343, 403, 3752, 2187, 327, 67, 25834, 273, 1053, 16, 327, 67, 6836, 273, 1083, 16, 12491, 273, 599, 16, 4295, 273, 599, 46...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3888, 67, 6547, 67, 4315, 88, 12, 2630, 16, 3695, 273, 296, 343, 403, 3752, 2187, 327, 67, 25834, 273, 1053, 16, 327, 67, 6836, 273, 1083, 16, 12491, 273, 599, 16, 4295, 273, 599, 46...