rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
returned_lines += 1
returned_lines += 1
def create_returns(self, cr, uid, ids, context): """ Creates return picking. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: List of ids selected @param context: A standard dictionary @return: A dictionary which of fields with values. """ record_id = context and context.get('active_id', False) or False move_obj = self.pool.get('stock.move') pick_obj = self.pool.get('stock.picking') uom_obj = self.pool.get('product.uom') wf_service = netsvc.LocalService("workflow") pick = pick_obj.browse(cr, uid, record_id) data = self.read(cr, uid, ids[0]) new_picking = None date_cur = time.strftime('%Y-%m-%d %H:%M:%S') set_invoice_state_to_none = True returned_lines = 0 for move in pick.move_lines: if not new_picking: if pick.type=='out': new_type = 'in' elif pick.type=='in': new_type = 'out' else: new_type = 'internal' new_picking = pick_obj.copy(cr, uid, pick.id, {'name':'%s (return)' % pick.name, 'move_lines':[], 'state':'draft', 'type':new_type, 'date':date_cur, 'invoice_state':data['invoice_state'],}) new_location=move.location_dest_id.id if move.state=='done': new_qty = data['return%s' % move.id] returned_qty = move.product_qty for rec in move.move_history_ids2: returned_qty -= rec.product_qty if returned_qty != new_qty: set_invoice_state_to_none = False
efa0acb9cd92500502f3689f3efb3b43430de046 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/efa0acb9cd92500502f3689f3efb3b43430de046/stock_return_picking.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 6154, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 4672, 3536, 10210, 327, 6002, 310, 18, 632, 891, 365, 30, 1021, 733, 4407, 18, 632, 891, 4422, 30, 432, 2063, 3347, 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, 752, 67, 6154, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 4672, 3536, 10210, 327, 6002, 310, 18, 632, 891, 365, 30, 1021, 733, 4407, 18, 632, 891, 4422, 30, 432, 2063, 3347, 63...
self._preTest()
def __call__(self, result=None): if result is None: result = self.defaultTestResult() writer = CaptureWriter() self._preTest() writer.capture() try: unittest.FunctionTestCase.__call__(self, result) finally: writer.release() self._postTest(result) self.checkOutput(writer.get_captured(), result)
aed56f283c1818e545c1de12c58c1ae08eb13b71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/aed56f283c1818e545c1de12c58c1ae08eb13b71/util.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 563, 33, 7036, 4672, 309, 563, 353, 599, 30, 563, 273, 365, 18, 1886, 4709, 1253, 1435, 2633, 273, 18477, 2289, 1435, 225, 2633, 18, 19250, 1435, 775, 30...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 563, 33, 7036, 4672, 309, 563, 353, 599, 30, 563, 273, 365, 18, 1886, 4709, 1253, 1435, 2633, 273, 18477, 2289, 1435, 225, 2633, 18, 19250, 1435, 775, 30...
upd0.append(field+'='+self._columns[field]._symbol_set[0])
upd0.append('"'+field+'"='+self._columns[field]._symbol_set[0])
def _update_function_stored(self, cr, user, ids, context=None): if not context: context={} f=filter(lambda a: isinstance(self._columns[a], fields.function) and self._columns[a].store, self._columns) if f: result=self.read(cr, user, ids, fields=f, context=context) for res in result: upd0=[] upd1=[] for field in res: if field not in f: continue upd0.append(field+'='+self._columns[field]._symbol_set[0]) upd1.append(self._columns[field]._symbol_set[1](res[field])) upd1.append(res['id']) cr.execute('update '+self._table+' set '+string.join(upd0,',')+ ' where id = %d', upd1) return True
be2ceb24bde4a569bfb092c4888d20f47c553384 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12853/be2ceb24bde4a569bfb092c4888d20f47c553384/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2725, 67, 915, 67, 22601, 12, 2890, 16, 4422, 16, 729, 16, 3258, 16, 819, 33, 7036, 4672, 309, 486, 819, 30, 819, 12938, 284, 33, 2188, 12, 14661, 279, 30, 1549, 12, 2890, 6315,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2725, 67, 915, 67, 22601, 12, 2890, 16, 4422, 16, 729, 16, 3258, 16, 819, 33, 7036, 4672, 309, 486, 819, 30, 819, 12938, 284, 33, 2188, 12, 14661, 279, 30, 1549, 12, 2890, 6315,...
progress.setFull(len(self.sourceMods))
progress.setFull(1+len(self.sourceMods))
def initData(self,progress): """Get script links from source files.""" if not self.isActive: return self.classestemp = set() id_data = self.id_data recAttrs_class = self.recAttrs_class loadFactory = LoadFactory(False,*recAttrs_class.keys()) longTypes = self.longTypes & set(x.classType for x in self.recAttrs_class) progress.setFull(len(self.sourceMods)) cachedMasters = {} for index,srcMod in enumerate(self.sourceMods): temp_id_data = {} if srcMod not in modInfos: continue srcInfo = modInfos[srcMod] srcFile = ModFile(srcInfo,loadFactory) masters = srcInfo.header.masters srcFile.load(True) srcFile.convertToLongFids(longTypes) mapper = srcFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in srcFile.tops: continue self.srcClasses.add(recClass) self.classestemp.add(recClass) for record in srcFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) temp_id_data[fid] = dict((attr,record.__getattribute__(attr)) for attr in recAttrs) for master in masters: if not master in modInfos: continue # or break filter mods if master in cachedMasters: masterFile = cachedMasters[master] else: masterInfo = modInfos[master] masterFile = ModFile(masterInfo,loadFactory) masterFile.load(True) masterFile.convertToLongFids(longTypes) cachedMasters[master] = masterFile mapper = masterFile.getLongMapper() for recClass,recAttrs in recAttrs_class.iteritems(): if recClass.classType not in masterFile.tops: continue if recClass not in self.classestemp: continue for record in masterFile.tops[recClass.classType].getActiveRecords(): fid = mapper(record.fid) if fid not in temp_id_data: continue for attr, value in temp_id_data[fid].iteritems(): if value == record.__getattribute__(attr): continue else: if fid not in id_data: id_data[fid] = dict() try: id_data[fid][attr] = temp_id_data[fid][attr] except KeyError: id_data[fid].setdefault(attr,value) progress.plus() temp_id_data = None self.longTypes = self.longTypes & set(x.classType for x in self.srcClasses) self.isActive = bool(self.srcClasses)
1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/1ff0958e86fd2e39ae9dca6669fae76aa5f3ddab/bosh.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 751, 12, 2890, 16, 8298, 4672, 3536, 967, 2728, 4716, 628, 1084, 1390, 12123, 309, 486, 365, 18, 291, 3896, 30, 327, 365, 18, 1106, 395, 30752, 273, 444, 1435, 612, 67, 892, 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, 1208, 751, 12, 2890, 16, 8298, 4672, 3536, 967, 2728, 4716, 628, 1084, 1390, 12123, 309, 486, 365, 18, 291, 3896, 30, 327, 365, 18, 1106, 395, 30752, 273, 444, 1435, 612, 67, 892, 273,...
wc.log.debug(wc.LOG_DNS, "DNS answer %s", answer)
wc.log.debug(wc.LOG_DNS, "%s DNS answer %s", self, wc.strformat.indent(answer))
def process_read (self): if not self.callback: self.close() # Assume that the entire answer comes in one packet if self.tcp: if len(self.recv_buffer) < 2: return header = self.recv_buffer[:2] (l,) = struct.unpack("!H", header) if len(self.recv_buffer) < 2+l: return self.read(2) # header wire = self.read(l) try: self.socket.shutdown(1) except socket.error: pass else: wire = self.read(1024) response = wc.dns.message.from_wire( wire, keyring=self.query.keyring, request_mac=self.query.mac) wc.log.debug(wc.LOG_DNS, "got DNS response %s", response) if not self.query.is_response(response): wc.log.warn(wc.LOG_DNS, 'Wrong response %s to query %s', response, self.query) # Oops, this doesn't answer the right question. This can # happen because we're using UDP, and UDP replies might end # up in the wrong place: open conn A, send question to A, # timeout, send question to A, receive answer, close our # object, then open a new conn B, send question to B, # but get the OLD answer to A as a reply. This doesn't happen # with TCP but then TCP is slower.
384651e9b114042a1232a3d9263caae3a28b34ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/384651e9b114042a1232a3d9263caae3a28b34ab/dns_lookups.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 896, 261, 2890, 4672, 309, 486, 365, 18, 3394, 30, 365, 18, 4412, 1435, 468, 15983, 716, 326, 7278, 5803, 14535, 316, 1245, 4414, 309, 365, 18, 14832, 30, 309, 562, 12, 2890,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 896, 261, 2890, 4672, 309, 486, 365, 18, 3394, 30, 365, 18, 4412, 1435, 468, 15983, 716, 326, 7278, 5803, 14535, 316, 1245, 4414, 309, 365, 18, 14832, 30, 309, 562, 12, 2890,...
gLogger.error(errMessage,pathSURL)
gLogger.error( errMessage, pathSURL )
def pinFile(self,path,lifetime=60*60*24): """ Pin a file with a given lifetime """ res = self.checkArgumentFormat(path) if not res['OK']: return res urls = res['Value']
70e66af095cb6701e39b1e701e4a2ce4d012b4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/70e66af095cb6701e39b1e701e4a2ce4d012b4f7/SRM2Storage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7092, 812, 12, 2890, 16, 803, 16, 17155, 33, 4848, 14, 4848, 14, 3247, 4672, 3536, 14999, 279, 585, 598, 279, 864, 12486, 3536, 400, 273, 365, 18, 1893, 1379, 1630, 12, 803, 13, 309, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7092, 812, 12, 2890, 16, 803, 16, 17155, 33, 4848, 14, 4848, 14, 3247, 4672, 3536, 14999, 279, 585, 598, 279, 864, 12486, 3536, 400, 273, 365, 18, 1893, 1379, 1630, 12, 803, 13, 309, ...
logger.notifyChannel('init', netsvc.LOG_DEBUG, 'setting default value of new column %s of table %s'% (k, self._table))
logger.notifyChannel('orm', netsvc.LOG_DEBUG, 'setting default value of new column %s of table %s'% (k, self._table))
def _auto_init(self, cr, context={}): store_compute = False logger = netsvc.Logger() create = False todo_end = [] self._field_create(cr, context=context) if not hasattr(self, "_auto") or self._auto: cr.execute("SELECT relname FROM pg_class WHERE relkind in ('r','v') AND relname='%s'" % self._table) if not cr.rowcount: cr.execute("CREATE TABLE \"%s\" (id SERIAL NOT NULL, PRIMARY KEY(id)) WITH OIDS" % self._table) create = True cr.commit() if self._parent_store: cr.execute("""SELECT c.relname FROM pg_class c, pg_attribute a WHERE c.relname=%s AND a.attname=%s AND c.oid=a.attrelid """, (self._table, 'parent_left')) if not cr.rowcount: if 'parent_left' not in self._columns: logger.notifyChannel('init', netsvc.LOG_ERROR, 'create a column parent_left on object %s: fields.integer(\'Left Parent\', select=1)' % (self._table, )) if 'parent_right' not in self._columns: logger.notifyChannel('init', netsvc.LOG_ERROR, 'create a column parent_right on object %s: fields.integer(\'Right Parent\', select=1)' % (self._table, )) if self._columns[self._parent_name].ondelete<>'cascade': logger.notifyChannel('init', netsvc.LOG_ERROR, "the columns %s on object must be set as ondelete='cascasde'" % (self._name, self._parent_name)) cr.execute('ALTER TABLE "%s" ADD COLUMN "parent_left" INTEGER' % (self._table,)) cr.execute('ALTER TABLE "%s" ADD COLUMN "parent_right" INTEGER' % (self._table,)) cr.commit() store_compute = True
ab41714295af23aa5c95790777fbe2e65dff8efa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/ab41714295af23aa5c95790777fbe2e65dff8efa/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6079, 67, 2738, 12, 2890, 16, 4422, 16, 819, 12938, 4672, 1707, 67, 9200, 273, 225, 1083, 1194, 273, 21954, 4227, 18, 3328, 1435, 752, 273, 1083, 10621, 67, 409, 273, 5378, 365, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6079, 67, 2738, 12, 2890, 16, 4422, 16, 819, 12938, 4672, 1707, 67, 9200, 273, 225, 1083, 1194, 273, 21954, 4227, 18, 3328, 1435, 752, 273, 1083, 10621, 67, 409, 273, 5378, 365, 6...
self.logger.info("Installing GPG keys.")
def Install(self, packages, states): """ Try and fix everything that RPMng.VerifyPackages() found wrong for each Package Entry. This can result in individual RPMs being installed (for the first time), deleted, downgraded or upgraded.
806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10284, 12, 2890, 16, 5907, 16, 5493, 4672, 3536, 6161, 471, 2917, 7756, 716, 534, 12728, 3368, 18, 8097, 11425, 1435, 1392, 7194, 364, 1517, 7508, 3841, 18, 225, 1220, 848, 563, 316, 732...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10284, 12, 2890, 16, 5907, 16, 5493, 4672, 3536, 6161, 471, 2917, 7756, 716, 534, 12728, 3368, 18, 8097, 11425, 1435, 1392, 7194, 364, 1517, 7508, 3841, 18, 225, 1220, 848, 563, 316, 732...
logo = None
def create(self, cr, uid, ids, data, context=None): logo = None if not context: context={} context = context.copy()
6624124758ebd759cd9b4edda57eebdd213305a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/6624124758ebd759cd9b4edda57eebdd213305a8/report_sxw.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 501, 16, 819, 33, 7036, 4672, 309, 486, 819, 30, 819, 12938, 819, 273, 819, 18, 3530, 1435, 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, 752, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 501, 16, 819, 33, 7036, 4672, 309, 486, 819, 30, 819, 12938, 819, 273, 819, 18, 3530, 1435, 2, -100, -100, -100, -100, -100, -100, -1...
if not k.startswith('__'):
if k.startswith('__'): req.args[k[2:]] = req.args[k] else:
def match_request(self, req): if re.match(r'/newticket/?$', req.path_info) is not None: if req.method != 'POST': for k in req.args.keys(): if not k.startswith('__'): req.args['field_'+k] = req.args[k] del req.args[k] return True match = re.match(r'/ticket/([0-9]+)$', req.path_info) if match: req.args['id'] = match.group(1) return True
d389efdc01ff928464048a3ba104311ae73eb282 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2831/d389efdc01ff928464048a3ba104311ae73eb282/web_ui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 845, 67, 2293, 12, 2890, 16, 1111, 4672, 309, 283, 18, 1916, 12, 86, 11, 19, 2704, 16282, 23239, 8, 2187, 1111, 18, 803, 67, 1376, 13, 353, 486, 599, 30, 309, 1111, 18, 2039, 480, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 845, 67, 2293, 12, 2890, 16, 1111, 4672, 309, 283, 18, 1916, 12, 86, 11, 19, 2704, 16282, 23239, 8, 2187, 1111, 18, 803, 67, 1376, 13, 353, 486, 599, 30, 309, 1111, 18, 2039, 480, ...
def callback(name, data): self.count += 1
def test_callback_not_called_when_filter_not_satisfied(self): """ After registerring a callback function with a filter function, the callback should not be called if a packet which does not satisfy the callback's filter arrives. """ self.dispatch.register("test1", self.callback_check.call, lambda data: False) self.dispatch.run(oneshot=True) self.assertFalse(self.callback_check.called) def test_multiple_callbacks(self): """ Many callbacks should be called on the same packet if each callback's filter method is satisfied. """ callbacks = [] for i in range(0,10): check = CallbackCheck() callbacks.append(check) self.dispatch.register("test%d" % i, check.call, lambda data: True)
def callback(name, data): self.count += 1
b1256d007b5a91772fd4089d827f91d6126e2cca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10631/b1256d007b5a91772fd4089d827f91d6126e2cca/test_dispatch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 3394, 67, 902, 67, 11777, 67, 13723, 67, 2188, 67, 902, 67, 12973, 21501, 12, 2890, 4672, 3536, 7360, 960, 376, 20245, 279, 1348, 445, 598, 279, 1034, 445, 16, 326, 1348, 141...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3394, 67, 902, 67, 11777, 67, 13723, 67, 2188, 67, 902, 67, 12973, 21501, 12, 2890, 4672, 3536, 7360, 960, 376, 20245, 279, 1348, 445, 598, 279, 1034, 445, 16, 326, 1348, 141...
for env in mathEnvironments: for node in Evaluate("//xhtml:div[@class='" + env + "']", context=ctxt): c = Context(node, processorNss=NSS) formula = "\\begin{" + env + "*}\n" for t in Evaluate(".//xhtml:span[@class='formule']//text()", context=c): formula += t.nodeValue t.parentNode.removeChild(t) formula += "\n\\end{" + env + "*}" image, mathml = gen.makeImage(formula.replace(u'\u02c6', '^').strip()) for t in Evaluate(".//xhtml:span[@class='formule']", context=c): t.parentNode.removeChild(t) img = node.ownerDocument.createElementNS(XHTML_NAMESPACE, "img") img.setAttributeNS(XHTML_NAMESPACE, "src", image) img.setAttributeNS(XHTML_NAMESPACE, "alt", formula) node.appendChild(img) if mathml: node.appendChild(node.ownerDocument.importNode(mathml, True))
def insert_math_images(file): file = os.path.abspath(file) doc = NonvalidatingReader.parseUri(file) ctxt = Context(doc, processorNss=NSS) # Check that verbatim math is used for node in Evaluate("//xhtml:span[@class='verbatimmath']/@lxir:value", context=ctxt): verbatimmath = node.value assert(verbatimmath == u'true', "Need verbatim math mode for math conversion") # Check that the document class is known latexClass = None symbols = [] for node in Evaluate("//xhtml:span[@class='ClassOrPackageUsed']/@lxir:name", context=ctxt): if latexClasses.has_key(node.value): latexClass = latexClasses[node.value] elif node.value in symbolPackages: symbols.append(node.value[:-4]) assert(latexClass, "Unknown document class used") # Get All macro text macros = [] for node in Evaluate("//xhtml:span[@class='macro']//text()", context=ctxt): macros.append(node.nodeValue) gen = ImageGenerator(file, latexClass, macros, symbols) for env in mathEnvironments: for node in Evaluate("//xhtml:div[@class='" + env + "']", context=ctxt): c = Context(node, processorNss=NSS) formula = "\\begin{" + env + "*}\n" for t in Evaluate(".//xhtml:span[@class='formule']//text()", context=c): formula += t.nodeValue t.parentNode.removeChild(t) formula += "\n\\end{" + env + "*}" image, mathml = gen.makeImage(formula.replace(u'\u02c6', '^').strip()) # remove the empty text node(s) for t in Evaluate(".//xhtml:span[@class='formule']", context=c): t.parentNode.removeChild(t) img = node.ownerDocument.createElementNS(XHTML_NAMESPACE, "img") img.setAttributeNS(XHTML_NAMESPACE, "src", image) img.setAttributeNS(XHTML_NAMESPACE, "alt", formula) node.appendChild(img) if mathml: node.appendChild(node.ownerDocument.importNode(mathml, True)) # Convert All math images for node in Evaluate("//xhtml:span[@class='formule']", context=ctxt): c = Context(node, processorNss=NSS) formula = "" for t in Evaluate(".//xhtml:span[@class='text']//text()", context=c): formula += t.nodeValue t.parentNode.removeChild(t) image, mathml = gen.makeImage(formula.replace(u'\u02c6', '^').strip()) # remove the empty text node(s) for t in Evaluate(".//xhtml:span[@class='text']", context=c): t.parentNode.removeChild(t) img = node.ownerDocument.createElementNS(XHTML_NAMESPACE, "img") img.setAttributeNS(XHTML_NAMESPACE, "src", image) img.setAttributeNS(XHTML_NAMESPACE, "alt", formula) node.appendChild(img) if mathml: node.appendChild(node.ownerDocument.importNode(mathml, True)) base, ext = os.path.splitext(file) output = base + "_images" + ext o = open(output, "w") Print(doc, stream = o) o.close()
98766ff7dfce3319a8b5c9595d97eb7753a816de /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5321/98766ff7dfce3319a8b5c9595d97eb7753a816de/lxirimages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2243, 67, 15949, 67, 7369, 12, 768, 4672, 585, 273, 1140, 18, 803, 18, 5113, 803, 12, 768, 13, 997, 273, 3858, 877, 1776, 2514, 18, 2670, 3006, 12, 768, 13, 14286, 273, 1772, 12, 243...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2243, 67, 15949, 67, 7369, 12, 768, 4672, 585, 273, 1140, 18, 803, 18, 5113, 803, 12, 768, 13, 997, 273, 3858, 877, 1776, 2514, 18, 2670, 3006, 12, 768, 13, 14286, 273, 1772, 12, 243...
if self.w._lazy_conn: _changeItemSelected(self.w.list_conn_trigger, self.w._lazy_conn)
if _changeItemSelected(self.w.list_conn_trigger, self.w._lazy_conn):
def loadForm(self): self.w.list_conn_trigger.clear() self.w.list_conn_trigger.addItems([c[1] for c in storage.connections()])
845e5b4de5d1a131f28332cb98a331f613feab18 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8560/845e5b4de5d1a131f28332cb98a331f613feab18/gui_option.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 1204, 12, 2890, 4672, 365, 18, 91, 18, 1098, 67, 4646, 67, 10668, 18, 8507, 1435, 365, 18, 91, 18, 1098, 67, 4646, 67, 10668, 18, 1289, 3126, 3816, 71, 63, 21, 65, 364, 276, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1262, 1204, 12, 2890, 4672, 365, 18, 91, 18, 1098, 67, 4646, 67, 10668, 18, 8507, 1435, 365, 18, 91, 18, 1098, 67, 4646, 67, 10668, 18, 1289, 3126, 3816, 71, 63, 21, 65, 364, 276, ...
def annotate_row(context, row, number, line, annotations):
def annotate_row(context, row, number, line, data):
def annotate_row(context, row, number, line, annotations): """Return the XHTML markup for the table cell that contains the annotation data.
8e2faee4180bd7c5142d6afe4c447ca6fa911bc9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2831/8e2faee4180bd7c5142d6afe4c447ca6fa911bc9/api.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13795, 67, 492, 12, 2472, 16, 1027, 16, 1300, 16, 980, 16, 501, 4672, 3536, 990, 326, 30551, 9813, 364, 326, 1014, 2484, 716, 1914, 326, 3204, 501, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13795, 67, 492, 12, 2472, 16, 1027, 16, 1300, 16, 980, 16, 501, 4672, 3536, 990, 326, 30551, 9813, 364, 326, 1014, 2484, 716, 1914, 326, 3204, 501, 18, 2, -100, -100, -100, -100, -100,...
self.updateLatest(cu)
self.updateLatest()
def migrate(self): schema.setupTempTables(self.db) cu = self.db.cursor() # needed for signature recalculation repos = trovestore.TroveStore(self.db) self.dropViews() self.fixRedirects(repos) self.fixDuplicatePaths(repos) self.fixPermissions() self.updateLatest(cu) return True
a545f6a947fbebeb20c86394ef3de07148b2a062 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/a545f6a947fbebeb20c86394ef3de07148b2a062/migrate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13187, 12, 2890, 4672, 1963, 18, 8401, 7185, 6905, 12, 2890, 18, 1966, 13, 15985, 273, 365, 18, 1966, 18, 9216, 1435, 468, 3577, 364, 3372, 283, 29916, 13686, 273, 23432, 90, 25626, 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, 13187, 12, 2890, 4672, 1963, 18, 8401, 7185, 6905, 12, 2890, 18, 1966, 13, 15985, 273, 365, 18, 1966, 18, 9216, 1435, 468, 3577, 364, 3372, 283, 29916, 13686, 273, 23432, 90, 25626, 18, ...
elif (rc == gtk.RESPONSE_DELETE_EVENT): continue elif (rc == gtk.RESPONSE_CLOSE): continue
def on_rm_select_pvs(self, button): if self.section_list == None: return #need tto check if list > 0 if len(self.section_list) == 0: return selection = self.treeview.get_selection() model,iter = selection.get_selected() vgname = model.get_value(iter, PATH_COL).strip() #need to check if section is 'unused' for item in self.section_list: if item.is_vol_utilized == FALSE: continue pvname = item.get_path().strip() retval = self.warningMessage(CONFIRM_PV_VG_REMOVE % (pvname,vgname)) if (retval == gtk.RESPONSE_NO): continue elif (rc == gtk.RESPONSE_DELETE_EVENT): continue elif (rc == gtk.RESPONSE_CLOSE): continue
e7461d803bbf2997f9fd5976cc4acfbf1fd33236 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3880/e7461d803bbf2997f9fd5976cc4acfbf1fd33236/InputController.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 8864, 67, 4025, 67, 84, 6904, 12, 2890, 16, 3568, 4672, 309, 365, 18, 3464, 67, 1098, 422, 599, 30, 327, 468, 14891, 268, 869, 866, 309, 666, 405, 374, 309, 562, 12, 2890, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 8864, 67, 4025, 67, 84, 6904, 12, 2890, 16, 3568, 4672, 309, 365, 18, 3464, 67, 1098, 422, 599, 30, 327, 468, 14891, 268, 869, 866, 309, 666, 405, 374, 309, 562, 12, 2890, ...
return self.__process(node, type)
data, result = self.__process(node, type) return result
def process(self, node, type=None): """ Process an object graph representation of the xml L{node}. @param node: An XML tree. @type node: L{sax.Element} @param type: The I{optional} schema type. @type type: L{schema.SchemaProperty} @return: A suds object. @rtype: L{Object} """ self.reset() return self.__process(node, type)
dbe83d91b69b7810580d22427c226c67e95f2a55 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5377/dbe83d91b69b7810580d22427c226c67e95f2a55/unmarshaller.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 12, 2890, 16, 756, 16, 618, 33, 7036, 4672, 3536, 4389, 392, 733, 2667, 4335, 434, 326, 2025, 511, 95, 2159, 5496, 632, 891, 756, 30, 1922, 3167, 2151, 18, 632, 723, 756, 30, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 12, 2890, 16, 756, 16, 618, 33, 7036, 4672, 3536, 4389, 392, 733, 2667, 4335, 434, 326, 2025, 511, 95, 2159, 5496, 632, 891, 756, 30, 1922, 3167, 2151, 18, 632, 723, 756, 30, 5...
return "I: %s new jobs added\n" % self.rebuildd.read_new_jobs()
return "I: %s new jobs added\n" % self.rebuildd.get_new_jobs()
def exec_cmd_job_reload(self, *args): """Load new jobs"""
b7b12cd3302b4502f7a037cb0ba485ec7a9a8081 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5334/b7b12cd3302b4502f7a037cb0ba485ec7a9a8081/RebuilddNetworkClient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1196, 67, 4172, 67, 4688, 67, 17517, 12, 2890, 16, 380, 1968, 4672, 3536, 2563, 394, 6550, 8395, 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, 1196, 67, 4172, 67, 4688, 67, 17517, 12, 2890, 16, 380, 1968, 4672, 3536, 2563, 394, 6550, 8395, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
pipeline.CondorDAGJob.__init__(self,self.__universe,self.__executable) pipeline.AnalysisJob.__init__(self,cp,dax)
CondorDAGJob.__init__(self,self.__universe,self.__executable) AnalysisJob.__init__(self,cp,dax)
def __init__(self,log_dir,cp,dax=False): """ cp = ConfigParser object from which options are read. """ self.__executable = cp.get('condor','ldbdc') self.__universe = 'scheduler' pipeline.CondorDAGJob.__init__(self,self.__universe,self.__executable) pipeline.AnalysisJob.__init__(self,cp,dax)
d8527fb5a97c5a6ffce3b8a85d0783e0570ce11e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3589/d8527fb5a97c5a6ffce3b8a85d0783e0570ce11e/pipeline.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1330, 67, 1214, 16, 4057, 16, 72, 651, 33, 8381, 4672, 3536, 3283, 273, 25076, 733, 628, 1492, 702, 854, 855, 18, 3536, 365, 16186, 17751, 273, 3283, 18,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1330, 67, 1214, 16, 4057, 16, 72, 651, 33, 8381, 4672, 3536, 3283, 273, 25076, 733, 628, 1492, 702, 854, 855, 18, 3536, 365, 16186, 17751, 273, 3283, 18,...
"CVSRevision":"$Revision: 1.140 $",
"CVSRevision":"$Revision: 1.141 $",
def callingparams(self): """Returns list of parameters to save with results.""" #Test whether k has been set try: self.k except (NameError, AttributeError): self.k=None try: self.mass except (NameError, AttributeError): self.mass=None #Form dictionary of inputs params = {"ystart":self.ystart, "tstart":self.tstart, "tend":self.tend, "tstep_wanted":self.tstep_wanted, "tstep_min":self.tstep_min, "k":self.k, #model dependent params "mass":self.mass, "eps":self.eps, "dxsav":self.dxsav, "solver":self.solver, "classname":self.__class__.__name__, "CVSRevision":"$Revision: 1.140 $", "datetime":datetime.datetime.now() } return params
4059ce2a31b6d232a72b8c3cade58c8f34fba381 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7283/4059ce2a31b6d232a72b8c3cade58c8f34fba381/cosmomodels.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4440, 2010, 12, 2890, 4672, 3536, 1356, 666, 434, 1472, 358, 1923, 598, 1686, 12123, 468, 4709, 2856, 417, 711, 2118, 444, 775, 30, 365, 18, 79, 1335, 261, 461, 668, 16, 6394, 4672, 36...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4440, 2010, 12, 2890, 4672, 3536, 1356, 666, 434, 1472, 358, 1923, 598, 1686, 12123, 468, 4709, 2856, 417, 711, 2118, 444, 775, 30, 365, 18, 79, 1335, 261, 461, 668, 16, 6394, 4672, 36...
sage: sage.symbolic.units.base_units(var('x')) x
sage: sage.symbolic.units.base_units(var('x')) x
def base_units(unit): """ Converts unit to base SI units. INPUT: - ``unit`` OUTPUT: - `symbolic expression` EXAMPLES:: sage: sage.symbolic.units.base_units(units.length.foot) 381/1250*meter If unit is already a base unit, it just returns that unit:: sage: sage.symbolic.units.base_units(units.length.meter) meter Derived units get broken down into their base parts:: sage: sage.symbolic.units.base_units(units.force.newton) kilogram*meter/second^2 sage: sage.symbolic.units.base_units(units.volume.liter) 1/1000*meter^3 Returns variable if 'unit' is not a unit:: sage: sage.symbolic.units.base_units(var('x')) x """ from sage.misc.all import sage_eval if not unit_to_type.has_key(str(unit)): return unit elif unit_to_type[str(unit)] == 'si_prefixes' or unit_to_type[str(unit)] == 'unit_multipliers': return sage_eval(unitdict[unit_to_type[str(unit)]][str(unit)]) else: v = SR.var(unit_to_type[str(unit)]) if unit_derivations.has_key(str(v)): base = unit_derivations_expr(v) for i in base.variables(): base = base.subs({i:SR.var(value_to_unit[str(i)]['1'])}) return base*sage_eval(unitdict[str(v)][str(unit)]) else: base = SR.var(value_to_unit[str(v)]['1'])*sage_eval(unitdict[str(v)][str(unit)]) return base
36d2f28c044694ad73a4a70a9d869366d0e39ec4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/36d2f28c044694ad73a4a70a9d869366d0e39ec4/units.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1026, 67, 7705, 12, 4873, 4672, 3536, 20377, 2836, 358, 1026, 5705, 4971, 18, 225, 12943, 30, 225, 300, 12176, 4873, 10335, 225, 11550, 30, 225, 300, 1375, 9009, 12164, 2652, 68, 225, 56...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1026, 67, 7705, 12, 4873, 4672, 3536, 20377, 2836, 358, 1026, 5705, 4971, 18, 225, 12943, 30, 225, 300, 12176, 4873, 10335, 225, 11550, 30, 225, 300, 1375, 9009, 12164, 2652, 68, 225, 56...
key = (polynomial, name, embedding, embedding.parent() if embedding is not None else None)
key = (polynomial, polynomial.base_ring(), name, embedding, embedding.parent() if embedding is not None else None)
def NumberField(polynomial, name=None, check=True, names=None, cache=True, embedding=None): r""" Return *the* number field defined by the given irreducible polynomial and with variable with the given name. If check is True (the default), also verify that the defining polynomial is irreducible and over `\QQ`. INPUT: - ``polynomial`` - a polynomial over `\QQ` or a number field, or a list of polynomials. - ``name`` - a string (default: 'a'), the name of the generator - ``check`` - bool (default: True); do type checking and irreducibility checking. - ``embedding`` - image of the generator in an ambient field (default: None) EXAMPLES:: sage: z = QQ['z'].0 sage: K = NumberField(z^2 - 2,'s'); K Number Field in s with defining polynomial z^2 - 2 sage: s = K.0; s s sage: s*s 2 sage: s^2 2 Constructing a relative number field:: sage: K.<a> = NumberField(x^2 - 2) sage: R.<t> = K[] sage: L.<b> = K.extension(t^3+t+a); L Number Field in b with defining polynomial t^3 + t + a over its base field sage: L.absolute_field('c') Number Field in c with defining polynomial x^6 + 2*x^4 + x^2 - 2 sage: a*b a*b sage: L(a) a sage: L.lift_to_base(b^3 + b) -a Constructing another number field:: sage: k.<i> = NumberField(x^2 + 1) sage: R.<z> = k[] sage: m.<j> = NumberField(z^3 + i*z + 3) sage: m Number Field in j with defining polynomial z^3 + i*z + 3 over its base field Number fields are globally unique:: sage: K.<a>= NumberField(x^3-5) sage: a^3 5 sage: L.<a>= NumberField(x^3-5) sage: K is L True Having different defining polynomials makes the fields different:: sage: x = polygen(QQ, 'x'); y = polygen(QQ, 'y') sage: k.<a> = NumberField(x^2 + 3) sage: m.<a> = NumberField(y^2 + 3) sage: k Number Field in a with defining polynomial x^2 + 3 sage: m Number Field in a with defining polynomial y^2 + 3 One can also define number fields with specified embeddings, may be used for arithmetic and deduce relations with other number fields which would not be valid for an abstract number field:: sage: K.<a> = NumberField(x^3-2, embedding=1.2) sage: RR.coerce_map_from(K) Composite map: From: Number Field in a with defining polynomial x^3 - 2 To: Real Field with 53 bits of precision Defn: Generic morphism: From: Number Field in a with defining polynomial x^3 - 2 To: Real Lazy Field Defn: a -> 1.259921049894873? then Conversion via _mpfr_ method map: From: Real Lazy Field To: Real Field with 53 bits of precision sage: RR(a) 1.25992104989487 sage: 1.1 + a 2.35992104989487 sage: b = 1/(a+1); b 1/3*a^2 - 1/3*a + 1/3 sage: RR(b) 0.442493334024442 sage: L.<b> = NumberField(x^6-2, embedding=1.1) sage: L(a) b^2 sage: a + b b^2 + b Note that the image only needs to be specified to enough precision to distinguish roots, and is exactly computed to any needed precision:: sage: RealField(200)(a) 1.2599210498948731647672106072782283505702514647015079800820 One can embed into any other field:: sage: K.<a> = NumberField(x^3-2, embedding=CC.gen()-0.6) sage: CC(a) -0.629960524947436 + 1.09112363597172*I sage: L = Qp(5) sage: f = polygen(L)^3 - 2 sage: K.<a> = NumberField(x^3-2, embedding=f.roots()[0][0]) sage: a + L(1) 4 + 2*5^2 + 2*5^3 + 3*5^4 + 5^5 + 4*5^6 + 2*5^8 + 3*5^9 + 4*5^12 + 4*5^14 + 4*5^15 + 3*5^16 + 5^17 + 5^18 + 2*5^19 + O(5^20) sage: L.<b> = NumberField(x^6-x^2+1/10, embedding=1) sage: K.<a> = NumberField(x^3-x+1/10, embedding=b^2) sage: a+b b^2 + b sage: CC(a) == CC(b)^2 True sage: K.coerce_embedding() Generic morphism: From: Number Field in a with defining polynomial x^3 - x + 1/10 To: Number Field in b with defining polynomial x^6 - x^2 + 1/10 Defn: a -> b^2 The ``QuadraticField`` and ``CyclotomicField`` constructors create an embedding by default unless otherwise specified. :: sage: K.<zeta> = CyclotomicField(15) sage: CC(zeta) 0.913545457642601 + 0.406736643075800*I sage: L.<sqrtn3> = QuadraticField(-3) sage: K(sqrtn3) 2*zeta^5 + 1 sage: sqrtn3 + zeta 2*zeta^5 + zeta + 1 An example involving a variable name that defines a function in PARI:: sage: theta = polygen(QQ, 'theta') sage: M.<z> = NumberField([theta^3 + 4, theta^2 + 3]); M Number Field in z0 with defining polynomial theta^3 + 4 over its base field TESTS:: sage: x = QQ['x'].gen() sage: y = ZZ['y'].gen() sage: K = NumberField(x^3 + x + 3, 'a'); K Number Field in a with defining polynomial x^3 + x + 3 sage: K.defining_polynomial().parent() Univariate Polynomial Ring in x over Rational Field :: sage: L = NumberField(y^3 + y + 3, 'a'); L Number Field in a with defining polynomial y^3 + y + 3 sage: L.defining_polynomial().parent() Univariate Polynomial Ring in y over Rational Field """ if name is None and names is None: raise TypeError, "You must specify the name of the generator." if not names is None: name = names if isinstance(polynomial, (list, tuple)): return NumberFieldTower(polynomial, name) name = sage.structure.parent_gens.normalize_names(1, name) if not isinstance(polynomial, polynomial_element.Polynomial): try: polynomial = polynomial.polynomial(QQ) except (AttributeError, TypeError): raise TypeError, "polynomial (=%s) must be a polynomial."%repr(polynomial) # convert ZZ to QQ R = polynomial.base_ring() Q = polynomial.parent().base_extend(R.fraction_field()) polynomial = Q(polynomial) if cache: key = (polynomial, name, embedding, embedding.parent() if embedding is not None else None) if _nf_cache.has_key(key): K = _nf_cache[key]() if not K is None: return K if isinstance(R, NumberField_generic): S = R.extension(polynomial, name, check=check) if cache: _nf_cache[key] = weakref.ref(S) return S if polynomial.degree() == 2: K = NumberField_quadratic(polynomial, name, check, embedding) else: K = NumberField_absolute(polynomial, name, None, check, embedding) if cache: _nf_cache[key] = weakref.ref(K) return K
ffc4f74e53bad32ff8ff94222b32b3c59eda3d8b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/ffc4f74e53bad32ff8ff94222b32b3c59eda3d8b/number_field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3588, 974, 12, 3915, 13602, 16, 508, 33, 7036, 16, 866, 33, 5510, 16, 1257, 33, 7036, 16, 1247, 33, 5510, 16, 15853, 33, 7036, 4672, 436, 8395, 2000, 380, 5787, 14, 1300, 652, 2553, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3588, 974, 12, 3915, 13602, 16, 508, 33, 7036, 16, 866, 33, 5510, 16, 1257, 33, 7036, 16, 1247, 33, 5510, 16, 15853, 33, 7036, 4672, 436, 8395, 2000, 380, 5787, 14, 1300, 652, 2553, ...
self.__init_tree(build_dir, version)
kernel = self.__init_tree(version)
def execute(self, iterations = 1, threads = None, dir = None, version = None): if not threads: threads = self.job.cpu_count()*2 if dir: build_dir = dir else: build_dir = os.path.join(self.tmpdir, "src") if not os.path.exists(build_dir): os.makedirs(build_dir)
c165c11c6c397f0e290ddf6858a3e6d088599bf5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10349/c165c11c6c397f0e290ddf6858a3e6d088599bf5/kernbench.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 2890, 16, 11316, 273, 404, 16, 7403, 273, 599, 16, 1577, 273, 599, 16, 1177, 273, 599, 4672, 309, 486, 7403, 30, 7403, 273, 365, 18, 4688, 18, 11447, 67, 1883, 1435, 14, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 2890, 16, 11316, 273, 404, 16, 7403, 273, 599, 16, 1577, 273, 599, 16, 1177, 273, 599, 4672, 309, 486, 7403, 30, 7403, 273, 365, 18, 4688, 18, 11447, 67, 1883, 1435, 14, 22...
self.progressbar.set_text(_('Converting file %d of %d (%s)') % ( done, total, remaining ))
self.progressbar.set_text(_('Converting file %d of %d (%s)') % ( done + 1, total, remaining ))
def display_progress(self, remaining): done = self.converter.finished_tasks total = done + len(self.converter.waiting_tasks) + len(self.converter.running_tasks) self.progressbar.set_text(_('Converting file %d of %d (%s)') % ( done, total, remaining ))
3ed10da09b8d0bd8f95ce62549f8af605cc1b6ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2369/3ed10da09b8d0bd8f95ce62549f8af605cc1b6ec/soundconverter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 67, 8298, 12, 2890, 16, 4463, 4672, 2731, 273, 365, 18, 15747, 18, 13527, 67, 9416, 2078, 273, 2731, 397, 562, 12, 2890, 18, 15747, 18, 20241, 67, 9416, 13, 397, 562, 12, 2890, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 67, 8298, 12, 2890, 16, 4463, 4672, 2731, 273, 365, 18, 15747, 18, 13527, 67, 9416, 2078, 273, 2731, 397, 562, 12, 2890, 18, 15747, 18, 20241, 67, 9416, 13, 397, 562, 12, 2890, ...
data[k] = Array([], "s")
data[k] = dbus.Array([], "s")
def dsanitize(data): # Clean up a dict so that it can be transmitted through D-Bus for k, v in data.items(): # Manually specify an arbitrary content type for empty Python arrays # because D-Bus can't handle the type conversion for empty arrays if not v and isinstance(v, list): data[k] = Array([], "s") # D-Bus has no concept of a null or empty value so we have to convert # None types to something else. I use an empty string because it has # the same behavior as None in a Python conditional expression elif v == None: data[k] = "" return data
2ef80d59841862f471b673a34088d2d1449dd10f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8234/2ef80d59841862f471b673a34088d2d1449dd10f/dbuswrapper.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3780, 13502, 12, 892, 4672, 468, 9645, 731, 279, 2065, 1427, 716, 518, 848, 506, 906, 7948, 3059, 463, 17, 7086, 364, 417, 16, 331, 316, 501, 18, 3319, 13332, 468, 8660, 3452, 4800, 39...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3780, 13502, 12, 892, 4672, 468, 9645, 731, 279, 2065, 1427, 716, 518, 848, 506, 906, 7948, 3059, 463, 17, 7086, 364, 417, 16, 331, 316, 501, 18, 3319, 13332, 468, 8660, 3452, 4800, 39...
def setup_effect(self, group, key, dropdown): self.effects_dd = dropdown model = gtk.ListStore(str) model.append([_("None")]) model.append([_("Simple")]) model.append([_("Classic")]) model.append([_("Fade")]) model.append([_("Spotlight")]) model.append([_("Zoom")]) model.append([_("Squish")]) model.append([_("3D Turn")]) model.append([_("3D Spotlight Turn")]) model.append([_("Glow")]) model.append([_("Custom")]) dropdown.set_model(model) cell = gtk.CellRendererText() dropdown.pack_start(cell) dropdown.add_attribute(cell,'text',0) self.load_effect(group,key,dropdown) dropdown.connect("changed", self.effect_changed, (group, key)) self.client.notify_add(group, key, self.reload_effect, dropdown) def load_effect(self, group, key, dropdown): effect_settings = self.client.get_int(group, key) hover_effect = effect_settings & 15 bundle = 0 for i in range(5): bundle = bundle << 4 | hover_effect if (bundle == effect_settings): if (hover_effect == 15): active = 0 else: active = hover_effect+1 else: active = 10 dropdown.set_active(int(active)) def reload_effect(self, group, key, value, dropdown): self.load_effect(group, key, dropdown) def effect_changed(self, dropdown, groupkey): group, key = groupkey new_effects = 0 effect = 0 if(dropdown.get_active() != 10): if(dropdown.get_active() == 0): effect = 15 else: effect = dropdown.get_active() - 1 for i in range(5): new_effects = new_effects << 4 | effect self.client.set_int(group, key, new_effects) print "effects set to: ", "%0.8X" % new_effects else: pass
def setup_effect(self, group, key, dropdown): self.effects_dd = dropdown model = gtk.ListStore(str) model.append([_("None")]) model.append([_("Simple")]) model.append([_("Classic")]) model.append([_("Fade")]) model.append([_("Spotlight")]) model.append([_("Zoom")]) model.append([_("Squish")]) model.append([_("3D Turn")]) model.append([_("3D Spotlight Turn")]) model.append([_("Glow")]) model.append([_("Custom")]) ##Always last dropdown.set_model(model) cell = gtk.CellRendererText() dropdown.pack_start(cell) dropdown.add_attribute(cell,'text',0)
cda6825fcbcd2773b2384f6e9d1beaef78ebdf8b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8416/cda6825fcbcd2773b2384f6e9d1beaef78ebdf8b/awnClass.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 67, 13867, 12, 2890, 16, 1041, 16, 498, 16, 13972, 4672, 365, 18, 13867, 87, 67, 449, 273, 13972, 938, 273, 22718, 18, 682, 2257, 12, 701, 13, 938, 18, 6923, 3816, 67, 2932, 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, 3875, 67, 13867, 12, 2890, 16, 1041, 16, 498, 16, 13972, 4672, 365, 18, 13867, 87, 67, 449, 273, 13972, 938, 273, 22718, 18, 682, 2257, 12, 701, 13, 938, 18, 6923, 3816, 67, 2932, 70...
end_time = time.time() self.fps = nsteps / (end_time - start_time)
env.call_qApp_processEvents() end_time = time.time() self.fps = nsteps / (end_time - start_time + .001 ) def animateView(self, q2, s2, p2, z2, animate=True): "Animate current view to quat (viewpoint) q2, scale s2, pov p2, and zoom factor z2" if not animate or not env.prefs[animateStandardViews_prefs_key]: self.quat = Q(q2) self.pov = V(p2[0], p2[1], p2[2]) self.zoomFactor = z2 self.scale = s2 self.gl_update() return wxyz1 = V(self.quat.w, self.quat.x, self.quat.y, self.quat.z) s1 = self.scale pov1 = V(self.pov[0], self.pov[1], self.pov[2]) z1 = self.zoomFactor wxyz2 = V(q2.w, q2.x, q2.y, q2.z) pov2 = V(p2[0], p2[1], p2[2]) if dot(wxyz1, wxyz2) < 0: wxyz2 = V(-q2.w, -q2.x, -q2.y, -q2.z) off = wxyz2 -wxyz1 nsteps = int(max(self.fps, 2)) off *= (1.0/nsteps) wxyz = wxyz1 scale_inc = (s2 - s1) / nsteps zoom_inc = (z2 - z1) / nsteps pov_inc = pov2 - pov1 pov_inc *= (1.0/nsteps) pov = pov1 start_time = time.time() for i in range(1, nsteps): wxyz += off self.quat = Q(norm(wxyz)) self.pov += pov_inc self.zoomFactor += zoom_inc self.scale += scale_inc self.gl_update() env.call_qApp_processEvents() self.quat = Q(q2) self.pov = V(p2[0], p2[1], p2[2]) self.zoomFactor = z2 self.scale = s2 self.gl_update() env.call_qApp_processEvents() end_time = time.time() self.fps = nsteps / (end_time - start_time + .001 )
def rotateView(self, q2): "Rotate current view to quat (viewpoint) q2" # Check User Preference "General | Standard Views: Animate" if not env.prefs[animateStandardViews_prefs_key]: self.quat = Q(q2) self.gl_update() return wxyz1 = V(self.quat.w, self.quat.x, self.quat.y, self.quat.z) wxyz2 = V(q2.w, q2.x, q2.y, q2.z) # The rotation path may turn either the "short way" (less than 180) or the "long way" (more than 180). # Long paths can be prevented by negating one end (if the dot product is negative). if dot(wxyz1, wxyz2) < 0: wxyz2 = V(-q2.w, -q2.x, -q2.y, -q2.z) off = wxyz2 -wxyz1
dc06c760dbe5ded748eaa71389af2211878d2189 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/dc06c760dbe5ded748eaa71389af2211878d2189/GLPane.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8534, 1767, 12, 2890, 16, 1043, 22, 4672, 315, 16357, 783, 1476, 358, 25847, 261, 1945, 1153, 13, 1043, 22, 6, 225, 468, 2073, 2177, 29125, 315, 12580, 571, 8263, 31117, 30, 1922, 4988, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8534, 1767, 12, 2890, 16, 1043, 22, 4672, 315, 16357, 783, 1476, 358, 25847, 261, 1945, 1153, 13, 1043, 22, 6, 225, 468, 2073, 2177, 29125, 315, 12580, 571, 8263, 31117, 30, 1922, 4988, ...
class PyUITest(PyUITestSuite, unittest.TestCase):
class PyUITest(pyautolib.PyUITestSuite, unittest.TestCase):
def _LocateBinDirs(): script_dir = os.path.dirname(__file__) chrome_src = os.path.join(script_dir, os.pardir, os.pardir, os.pardir) bin_dirs = { 'linux2': [ os.path.join(chrome_src, 'out', 'Debug'), os.path.join(chrome_src, 'sconsbuild', 'Debug'), os.path.join(chrome_src, 'out', 'Release'), os.path.join(chrome_src, 'sconsbuild', 'Release')], 'darwin': [ os.path.join(chrome_src, 'xcodebuild', 'Debug'), os.path.join(chrome_src, 'xcodebuild', 'Release')], 'win32': [ os.path.join(chrome_src, 'chrome', 'Debug'), os.path.join(chrome_src, 'chrome', 'Release')], 'cygwin': [ os.path.join(chrome_src, 'chrome', 'Debug'), os.path.join(chrome_src, 'chrome', 'Release')], } sys.path += bin_dirs.get(sys.platform, [])
76bb9c355cc9d34bc3d489125d9764598d533289 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/76bb9c355cc9d34bc3d489125d9764598d533289/pyauto.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1333, 340, 9913, 9872, 13332, 2728, 67, 1214, 273, 1140, 18, 803, 18, 12287, 12, 972, 768, 972, 13, 18167, 67, 4816, 273, 1140, 18, 803, 18, 5701, 12, 4263, 67, 1214, 16, 1140, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1333, 340, 9913, 9872, 13332, 2728, 67, 1214, 273, 1140, 18, 803, 18, 12287, 12, 972, 768, 972, 13, 18167, 67, 4816, 273, 1140, 18, 803, 18, 5701, 12, 4263, 67, 1214, 16, 1140, ...
class Spin_crystal_type_B(Crystal):
class Spin_crystal_type_B(ClassicalCrystal):
def CrystalOfSpins(type): r""" Return the spin crystal of the given type INPUT: T -- A CartanType (either B or D) Kashiwara and Nakashima represent the elements by sequences of signs +/-. In this implementation, the elements are represented by positive integers, but their notation can be recovered using signature() EXAMPLES: sage: C = CrystalOfSpins(['B',3]) sage: C.list() [1, 2, 3, 4, 5, 6, 7, 8] sage: [x.signature() for x in C] ['+++', '++-', '+-+', '+--', '-++', '-+-', '--+', '---'] """ type = CartanType(type) if type[0] == 'B': return Spin_crystal_type_B(type) else: raise NotImplementedError
4ebf3b778be18b7ddbea4dea1e6874f37ab5a20d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/4ebf3b778be18b7ddbea4dea1e6874f37ab5a20d/spins.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14998, 31365, 951, 3389, 2679, 12, 723, 4672, 436, 8395, 2000, 326, 12490, 4422, 31365, 434, 326, 864, 618, 225, 12943, 30, 399, 1493, 432, 17695, 304, 559, 261, 73, 2927, 605, 578, 463,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14998, 31365, 951, 3389, 2679, 12, 723, 4672, 436, 8395, 2000, 326, 12490, 4422, 31365, 434, 326, 864, 618, 225, 12943, 30, 399, 1493, 432, 17695, 304, 559, 261, 73, 2927, 605, 578, 463,...
datatype = cal.get_datatype(prop_name)
datatype = cal.get_record_datatype(prop_name)
def test_load(self): """Test loading a simple calendar.""" cal = self.cal1
b6f5514e167db805f5da2918c44193ec6d0268fc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/b6f5514e167db805f5da2918c44193ec6d0268fc/test_ical.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 945, 12, 2890, 4672, 3536, 4709, 7153, 279, 4143, 5686, 12123, 1443, 273, 365, 18, 771, 21, 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, 1842, 67, 945, 12, 2890, 4672, 3536, 4709, 7153, 279, 4143, 5686, 12123, 1443, 273, 365, 18, 771, 21, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
raw = q>0 and code[q-1] == 'r'
raw = q>0 and code[q-1] in ['r', 'R']
def strip_string_literals(code): r""" Returns a string with all literal quotes replaced with labels and a dict of labels for re-subsitution. This makes parsing much easier. EXAMPLES: sage: from sage.misc.preparser import strip_string_literals sage: s, literals = strip_string_literals(r'''['a', "b", 'c', "d\""]''') sage: s '[%(L1)s, %(L2)s, %(L3)s, %(L4)s]' sage: literals {'L4': '"d\\""', 'L2': '"b"', 'L3': "'c'", 'L1': "'a'"} sage: print s % literals ['a', "b", 'c', "d\""] sage: print strip_string_literals(r'-"\\\""-"\\"-')[0] -%(L1)s-%(L2)s- Triple-quotes are handled as well. sage: s, literals = strip_string_literals("[a, '''b''', c, '']") sage: s '[a, %(L1)s, c, %(L2)s]' sage: print s % literals [a, '''b''', c, ''] Comments are subsituted too: sage: s, literals = strip_string_literals("code '#' # ccc 't'"); s 'code %(L1)s #%(L2)s' sage: s % literals "code '#' # ccc 't'" """ new_code = [] literals = {} counter = 0 start = q = 0 in_quote = False raw = False while True: sig_q = code.find("'", q) dbl_q = code.find('"', q) hash_q = code.find('#', q) q = min(sig_q, dbl_q) if q == -1: q = max(sig_q, dbl_q) if not in_quote and hash_q != -1 and (q == -1 or hash_q < q): # it's a comment newline = code.find('\n', hash_q) if newline == -1: newline = len(code) counter += 1 label = "L%s" % counter literals[label] = code[hash_q+1:newline] new_code.append(code[start:hash_q].replace('%','%%')) new_code.append("#%%(%s)s" % label) start = q = newline elif q == -1: new_code.append(code[start:].replace('%','%%')) break elif in_quote: if not raw and code[q-1] == '\\': k = 2 while code[q-k] == '\\': k += 1 if k % 2 == 0: q += 1 if code[q:q+len(in_quote)] == in_quote: counter += 1 label = "L%s" % counter literals[label] = code[start:q+len(in_quote)] new_code.append("%%(%s)s" % label) q += len(in_quote) start = q in_quote = False else: q += 1 else: raw = q>0 and code[q-1] == 'r' if len(code) >= q+3 and (code[q+1] == code[q] == code[q+2]): in_quote = code[q]*3 else: in_quote = code[q] new_code.append(code[start:q].replace('%', '%%')) start = q q += len(in_quote) return "".join(new_code), literals
2188d72beeca6598b0398cab7b2f6a0feb1f7f89 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/2188d72beeca6598b0398cab7b2f6a0feb1f7f89/preparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2569, 67, 1080, 67, 80, 11235, 12, 710, 4672, 436, 8395, 2860, 279, 533, 598, 777, 7158, 10681, 8089, 598, 3249, 471, 279, 2065, 434, 3249, 364, 283, 17, 22284, 305, 1421, 18, 1220, 72...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2569, 67, 1080, 67, 80, 11235, 12, 710, 4672, 436, 8395, 2860, 279, 533, 598, 777, 7158, 10681, 8089, 598, 3249, 471, 279, 2065, 434, 3249, 364, 283, 17, 22284, 305, 1421, 18, 1220, 72...
'CLOT':('eid', 'weight', 'value', 'enchantPoints'),
def __init__(self,types=None,aliases=None): """Initialize.""" #--type_stats[type] = ... #--AMMO: (eid, weight, value, damage, speed, epoints) #--ARMO: (eid, weight, value, health, strength) #--WEAP: (eid, weight, value, health, damage, speed, reach, epoints) self.type_stats = {'ALCH':{},'AMMO':{},'APPA':{},'ARMO':{},'BOOK':{},'CLOT':{},'INGR':{},'KEYM':{},'LIGH':{},'MISC':{},'SGST':{},'SLGM':{},'WEAP':{}} self.type_attrs = { 'ALCH':('eid', 'weight', 'value'), 'AMMO':('eid', 'speed', 'flags', 'value', 'clipRounds'), 'APPA':('eid', 'weight', 'value', 'quality'), 'ARMO':('eid', 'weight', 'value', 'health', 'ar'), 'BOOK':('eid', 'weight', 'value'), 'CLOT':('eid', 'weight', 'value', 'enchantPoints'), 'INGR':('eid', 'weight', 'value'), 'KEYM':('eid', 'weight', 'value'), 'LIGH':('eid', 'weight', 'value', 'duration'), 'MISC':('eid', 'weight', 'value'), 'SGST':('eid', 'weight', 'value', 'uses'), 'SLGM':('eid', 'weight', 'value'), 'WEAP':('eid', 'weight', 'value', 'health', 'damage', 'clipsize', 'minSpread', 'spread', 'baseVatsToHitChance', 'minRange', 'maxRange', 'fireRate', 'overrideActionPoint', 'overrideDamageToWeaponMult', 'attackShotsPerSec', 'reloadTime', 'jamTime', 'criticalDamage', 'criticalMultiplier'), } self.aliases = aliases or {} #--For aliasing mod names
f5ea6d671bff44ebfcea2d8a00654e900df7c41f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/f5ea6d671bff44ebfcea2d8a00654e900df7c41f/bosh.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2352, 33, 7036, 16, 13831, 33, 7036, 4672, 3536, 7520, 12123, 468, 413, 723, 67, 5296, 63, 723, 65, 273, 1372, 468, 413, 2192, 5980, 30, 261, 73, 350, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2352, 33, 7036, 16, 13831, 33, 7036, 4672, 3536, 7520, 12123, 468, 413, 723, 67, 5296, 63, 723, 65, 273, 1372, 468, 413, 2192, 5980, 30, 261, 73, 350, ...
seglists |= segments.segmentlistdict([(ifo, segments.segmentlist([row.get_out()])) for ifo in row.get_ifos()])
seglists.extend(segments.segmentlistdict([(ifo, segments.segmentlist([row.get_out()])) for ifo in row.get_ifos()]))
def get_out_segmentlistdict(self, process_ids = None): """ Return a segmentlistdict mapping instrument to out segment list. If process_ids is a list of process IDs, then only rows with matching IDs are included otherwise all rows are included. """ seglists = segments.segmentlistdict() for row in self: if process_ids is None or row.process_id in process_ids: seglists |= segments.segmentlistdict([(ifo, segments.segmentlist([row.get_out()])) for ifo in row.get_ifos()]) return seglists
a25ca2c7dcef7a6492d883347ee7bdf5c1314b78 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5758/a25ca2c7dcef7a6492d883347ee7bdf5c1314b78/lsctables.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 659, 67, 9273, 1098, 1576, 12, 2890, 16, 1207, 67, 2232, 273, 599, 4672, 3536, 2000, 279, 3267, 1098, 1576, 2874, 10353, 358, 596, 3267, 666, 18, 225, 971, 1207, 67, 2232, 353...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 659, 67, 9273, 1098, 1576, 12, 2890, 16, 1207, 67, 2232, 273, 599, 4672, 3536, 2000, 279, 3267, 1098, 1576, 2874, 10353, 358, 596, 3267, 666, 18, 225, 971, 1207, 67, 2232, 353...
group.add_option("--webkit", action="append_const", const="third_party/WebKit", dest="PATH", help="Shorthand for -s third_party/WebKit")
def WebKitRevision(options, opt, value, parser): if parser.rargs and not parser.rargs[0].startswith('-'): options.sub_rep.append('third_party/WebKit@%s' % parser.rargs.pop(0)) else: options.sub_rep.append('third_party/WebKit') group.add_option("-W", "--webkit", action="callback", callback=WebKitRevision, metavar="BRANCH", help="Shorthand for -s third_party/WebKit@BRANCH. " "BRANCH is optional and is the branch the current " "checkout will be diff'ed against.")
def TryChange(argv, file_list, swallow_exception, prog=None): """ Args: argv: Arguments and options. file_list: Default value to pass to --file. swallow_exception: Whether we raise or swallow exceptions. """ # Parse argv parser = optparse.OptionParser(usage=USAGE, version=__version__, prog=prog) parser.add_option("-v", "--verbose", action="count", default=0, help="Prints debugging infos") group = optparse.OptionGroup(parser, "Result and status") group.add_option("-u", "--user", default=getpass.getuser(), help="Owner user name [default: %default]") group.add_option("-e", "--email", default=os.environ.get('TRYBOT_RESULTS_EMAIL_ADDRESS', os.environ.get('EMAIL_ADDRESS')), help="Email address where to send the results. Use either " "the TRYBOT_RESULTS_EMAIL_ADDRESS environment " "variable or EMAIL_ADDRESS to set the email address " "the try bots report results to [default: %default]") group.add_option("-n", "--name", help="Descriptive name of the try job") group.add_option("--issue", type='int', help="Update rietveld issue try job status") group.add_option("--patchset", type='int', help="Update rietveld issue try job status. This is " "optional if --issue is used, In that case, the " "latest patchset will be used.") group.add_option("--dry_run", action='store_true', help="Just prints the diff and quits") group.add_option("-R", "--rietveld_url", default="codereview.appspot.com", metavar="URL", help="The root code review url. Default:%default") parser.add_option_group(group) group = optparse.OptionGroup(parser, "Try job options") group.add_option("-b", "--bot", action="append", help="Only use specifics build slaves, ex: '--bot win' to " "run the try job only on the 'win' slave; see the try " "server waterfall for the slave's name") group.add_option("-r", "--revision", help="Revision to use for the try job; default: the " "revision will be determined by the try server; see " "its waterfall for more info") group.add_option("-c", "--clobber", action="store_true", help="Force a clobber before building; e.g. don't do an " "incremental build") # TODO(maruel): help="Select a specific configuration, usually 'debug' or " # "'release'" group.add_option("--target", help=optparse.SUPPRESS_HELP) group.add_option("--project", help="Override which project to use. Projects are defined " "server-side to define what default bot set to use") # Override the list of tests to run, use multiple times to list many tests # (or comma separated) group.add_option("-t", "--tests", action="append", help=optparse.SUPPRESS_HELP) parser.add_option_group(group) group = optparse.OptionGroup(parser, "Patch to run") group.add_option("-f", "--file", default=file_list, dest="files", metavar="FILE", action="append", help="Use many times to list the files to include in the " "try, relative to the repository root") group.add_option("--diff", help="File containing the diff to try") group.add_option("--url", help="Url where to grab a patch") group.add_option("--root", help="Root to use for the patch; base subdirectory for " "patch created in a subdirectory") group.add_option("-p", "--patchlevel", type='int', metavar="LEVEL", help="Used as -pN parameter to patch") group.add_option("-s", "--sub_rep", action="append", default=[], help="Subcheckout to use in addition. This is mainly " "useful for gclient-style checkouts. Use @rev or " "@branch or @branch1..branch2 to specify the " "revision/branch to diff against.") # Mostly chromium-specific try: group.add_option("--webkit", action="append_const", const="third_party/WebKit", dest="PATH", help="Shorthand for -s third_party/WebKit") except optparse.OptionError: # append_const is not supported on 2.4. Too bad. pass group.add_option("--no_gclient", action="store_true", help="Disable automatic search for gclient checkout.") group.add_option("-E", "--exclude", action="append", default=['ChangeLog'], metavar='REGEXP', help="Regexp patterns to exclude files. Default: %default") parser.add_option_group(group) group = optparse.OptionGroup(parser, "Access the try server by HTTP") group.add_option("--use_http", action="store_const", const=_SendChangeHTTP, dest="send_patch", help="Use HTTP to talk to the try server [default]") group.add_option("-H", "--host", help="Host address") group.add_option("-P", "--port", help="HTTP port") group.add_option("--proxy", help="HTTP proxy") parser.add_option_group(group) group = optparse.OptionGroup(parser, "Access the try server with SVN") group.add_option("--use_svn", action="store_const", const=_SendChangeSVN, dest="send_patch", help="Use SVN to talk to the try server") group.add_option("-S", "--svn_repo", metavar="SVN_URL", help="SVN url to use to write the changes in; --use_svn is " "implied when using --svn_repo") parser.add_option_group(group) options, args = parser.parse_args(argv) if len(args) == 1 and args[0] == 'help': parser.print_help() if not swallow_exception: if options.verbose == 0: logging.basicConfig(level=logging.ERROR) elif options.verbose == 1: logging.basicConfig(level=logging.WARNING) elif options.verbose == 2: logging.basicConfig(level=logging.INFO) elif options.verbose > 2: logging.basicConfig(level=logging.DEBUG) logging.debug(argv) if options.rietveld_url: # Try to extract the review number if possible and fix the protocol. if not '://' in options.rietveld_url: options.rietveld_url = 'http://' + options.rietveld_url match = re.match(r'^(.*)/(\d+)$', options.rietveld_url) if match: if options.issue or options.patchset: parser.error('Cannot use both --issue and use a review number url') options.issue = int(match.group(2)) options.rietveld_url = match.group(1) try: # Always include os.getcwd() in the checkout settings. checkouts = [] checkouts.append(GuessVCS(options, os.getcwd())) checkouts[0].AutomagicalSettings() for item in options.sub_rep: checkout = GuessVCS(options, os.path.join(checkouts[0].checkout_root, item)) if checkout.checkout_root in [c.checkout_root for c in checkouts]: parser.error('Specified the root %s two times.' % checkout.checkout_root) checkouts.append(checkout) can_http = options.port and options.host can_svn = options.svn_repo # If there was no transport selected yet, now we must have enough data to # select one. if not options.send_patch and not (can_http or can_svn): parser.error('Please specify an access method.') # Convert options.diff into the content of the diff. if options.url: if options.files: parser.error('You cannot specify files and --url at the same time.') options.diff = urllib.urlopen(options.url).read() elif options.diff: if options.files: parser.error('You cannot specify files and --diff at the same time.') options.diff = gclient_utils.FileRead(options.diff, 'rb') elif options.issue and options.patchset is None: # Retrieve the patch from rietveld when the diff is not specified. # When patchset is specified, it's because it's done by gcl/git-try. try: import simplejson except ImportError: parser.error('simplejson library is missing, please install.') api_url = '%s/api/%d' % (options.rietveld_url, options.issue) logging.debug(api_url) contents = simplejson.loads(urllib.urlopen(api_url).read()) options.patchset = contents['patchsets'][-1] diff_url = ('%s/download/issue%d_%d.diff' % (options.rietveld_url, options.issue, options.patchset)) diff = GetMungedDiff('', urllib.urlopen(diff_url).readlines()) options.diff = ''.join(diff) else: # Use this as the base. root = checkouts[0].checkout_root diffs = [] for checkout in checkouts: diff = checkout.GenerateDiff().splitlines(True) path_diff = gclient_utils.PathDifference(root, checkout.checkout_root) # Munge it. diffs.extend(GetMungedDiff(path_diff, diff)) options.diff = ''.join(diffs) if not options.bot: # Get try slaves from PRESUBMIT.py files if not specified. # Even if the diff comes from options.url, use the local checkout for bot # selection. try: import presubmit_support root_presubmit = checkouts[0].ReadRootFile('PRESUBMIT.py') options.bot = presubmit_support.DoGetTrySlaves( checkouts[0].GetFileNames(), checkouts[0].checkout_root, root_presubmit, False, sys.stdout) except ImportError: pass # If no bot is specified, either the default pool will be selected or the # try server will refuse the job. Either case we don't need to interfere. if options.name is None: if options.issue: options.name = 'Issue %s' % options.issue else: options.name = 'Unnamed' print('Note: use --name NAME to change the try job name.') if not options.email: parser.error('Using an anonymous checkout. Please use --email or set ' 'the TRYBOT_RESULTS_EMAIL_ADDRESS environment variable.') else: print('Results will be emailed to: ' + options.email) # Send the patch. if options.send_patch: # If forced. options.send_patch(options) PrintSuccess(options) return 0 try: if can_http: _SendChangeHTTP(options) PrintSuccess(options) return 0 except NoTryServerAccess: if not can_svn: raise _SendChangeSVN(options) PrintSuccess(options) return 0 except (InvalidScript, NoTryServerAccess), e: if swallow_exception: return 1 print e return 1 return 0
45decbf64222f7f5ce1852a8ab388c33d53a154d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/45decbf64222f7f5ce1852a8ab388c33d53a154d/trychange.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6161, 3043, 12, 19485, 16, 585, 67, 1098, 16, 1352, 5965, 67, 4064, 16, 11243, 33, 7036, 4672, 3536, 6634, 30, 5261, 30, 13599, 471, 702, 18, 585, 67, 1098, 30, 2989, 460, 358, 1342, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6161, 3043, 12, 19485, 16, 585, 67, 1098, 16, 1352, 5965, 67, 4064, 16, 11243, 33, 7036, 4672, 3536, 6634, 30, 5261, 30, 13599, 471, 702, 18, 585, 67, 1098, 30, 2989, 460, 358, 1342, ...
raise Errors.RepoError, 'Repository %s already added, not adding again' % (repoid)
raise Errors.RepoError, 'Repository %s already added, not adding again' % (repoobj.id)
def add(self, repoobj): if self.repos.has_key(repoobj.id): raise Errors.RepoError, 'Repository %s already added, not adding again' % (repoid) self.repos[repoobj.id] = repoobj
d8393bf9b3f3bc5e229f4d1bd0c7498cb5bf19a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/d8393bf9b3f3bc5e229f4d1bd0c7498cb5bf19a3/repos.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 12, 2890, 16, 3538, 2603, 4672, 309, 365, 18, 15564, 18, 5332, 67, 856, 12, 7422, 2603, 18, 350, 4672, 1002, 9372, 18, 8791, 668, 16, 296, 3305, 738, 87, 1818, 3096, 16, 486, 65...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 12, 2890, 16, 3538, 2603, 4672, 309, 365, 18, 15564, 18, 5332, 67, 856, 12, 7422, 2603, 18, 350, 4672, 1002, 9372, 18, 8791, 668, 16, 296, 3305, 738, 87, 1818, 3096, 16, 486, 65...
ee.update(params, self.volunteer)
e.update(params, self.volunteer)
def test_event_update(self): ee = EditEventPage() event = self.test_event_create()
e17fb36a75d0fb53fe2c59bea9dfea049f4713c1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5139/e17fb36a75d0fb53fe2c59bea9dfea049f4713c1/events_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2575, 67, 2725, 12, 2890, 4672, 14657, 273, 15328, 1133, 1964, 1435, 871, 273, 365, 18, 3813, 67, 2575, 67, 2640, 1435, 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, 1842, 67, 2575, 67, 2725, 12, 2890, 4672, 14657, 273, 15328, 1133, 1964, 1435, 871, 273, 365, 18, 3813, 67, 2575, 67, 2640, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
this = apply(_quickfix.new_SocketException, args) try: self.this.append(this) except: self.this = this def errorToWhat(*args): return apply(_quickfix.SocketException_errorToWhat, args)
this = _quickfix.new_SocketException(*args) try: self.this.append(this) except: self.this = this def errorToWhat(*args): return _quickfix.SocketException_errorToWhat(*args)
def __init__(self, *args): this = apply(_quickfix.new_SocketException, args) try: self.this.append(this) except: self.this = this
7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 2230, 24899, 19525, 904, 18, 2704, 67, 4534, 503, 16, 833, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 365...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 2230, 24899, 19525, 904, 18, 2704, 67, 4534, 503, 16, 833, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 365...
results.append(uri)
results.append(result_uri)
def lookup_xcap_server(self, uri, timeout=3.0, lifetime=15.0): """ Performs a TXT query against xcap.<uri.host> and returns all results that look like HTTP URIs. """ log_context = dict(context='lookup_xcap_server', uri=uri) notification_center = NotificationCenter()
77e1f83eebecaa1bdfc3345b4aa12efa4bcdeeb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5703/77e1f83eebecaa1bdfc3345b4aa12efa4bcdeeb6/lookup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3689, 67, 92, 5909, 67, 3567, 12, 2890, 16, 2003, 16, 2021, 33, 23, 18, 20, 16, 12486, 33, 3600, 18, 20, 4672, 3536, 27391, 279, 30827, 843, 5314, 619, 5909, 22782, 1650, 18, 2564, 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, 3689, 67, 92, 5909, 67, 3567, 12, 2890, 16, 2003, 16, 2021, 33, 23, 18, 20, 16, 12486, 33, 3600, 18, 20, 4672, 3536, 27391, 279, 30827, 843, 5314, 619, 5909, 22782, 1650, 18, 2564, 3...
sage: a.save()
sage: a.save('sage.gif')
def graphics_array(self, ncols=3): """ Return a graphics array with the given number of columns with plots of the frames of this animation.
3fb70e537645114a76fb0d2132f72dc84f03fa76 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/3fb70e537645114a76fb0d2132f72dc84f03fa76/animate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17313, 67, 1126, 12, 2890, 16, 21330, 33, 23, 4672, 3536, 2000, 279, 17313, 526, 598, 326, 864, 1300, 434, 2168, 598, 17931, 434, 326, 7793, 434, 333, 8794, 18, 2, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17313, 67, 1126, 12, 2890, 16, 21330, 33, 23, 4672, 3536, 2000, 279, 17313, 526, 598, 326, 864, 1300, 434, 2168, 598, 17931, 434, 326, 7793, 434, 333, 8794, 18, 2, -100, -100, -100, -1...
date_xml += ['<day number="%d" string="%d"/>' % (x+1, (som+datetime.timedelta(days=x)).day
date_xml += ['<day string="%d" number="%02d-%02d"/>' % ( (som+datetime.timedelta(days=x)).day, (som+datetime.timedelta(days=x)).month, (som+datetime.timedelta(days=x)).day,
def create_xml(self, cr, uid, ids, data, context): pool = pooler.get_pool(cr.dbname) # Computing the dates (start of month: som, and end of month: eom) som = datetime.datetime.strptime(data['form']['start_date'],'%Y-%m-%d') eom = datetime.datetime.strptime(data['form']['end_date'],'%Y-%m-%d')
f0c5f018aa2d77220809bd720b33c934ddc93a00 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/f0c5f018aa2d77220809bd720b33c934ddc93a00/order_statistics_all_reports.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 2902, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 501, 16, 819, 4672, 2845, 273, 2845, 264, 18, 588, 67, 6011, 12, 3353, 18, 20979, 13, 282, 468, 14169, 310, 326, 7811, 261,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 2902, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 501, 16, 819, 4672, 2845, 273, 2845, 264, 18, 588, 67, 6011, 12, 3353, 18, 20979, 13, 282, 468, 14169, 310, 326, 7811, 261,...
tls_group = tls_desc.construct_tls_group_with_atoms(struct)
try: tls_group = tls_desc.construct_tls_group_with_atoms(struct) except: print console.formatExceptionInfo()
def LoadStructure(struct_source): """Loads Structure, chooses a unique struct_id string. Also, search the REMARK records for TLS group records. If they are found, then add the TLS group ADP magnitude to the B facors of the ATOM records. """ console.debug_stdoutln(">Entering: tlsmd_analysis.py->LoadStructure()...") ## DEBUG ## determine the argument type if isinstance(struct_source, str): file_path = struct_source console.kvformat("LOADING STRUCTURE", file_path) ## LOGLINE fobj = open(file_path, "r") elif hasattr(struct_source, "__iter__") and hasattr(struct_source, "seek"): console.kvformat("LOADING STRUCTURE", str(struct_source)) ## LOGLINE fobj = struct_source else: raise ValueError ## load struct struct = FileIO.LoadStructure(file = fobj, distance_bonds = True) console.kvformat("HEADER", struct.header) ## LOGLINE 9 console.kvformat("TITLE", struct.title) ## LOGLINE 10 console.kvformat("EXPERIMENTAL METHOD", struct.experimental_method) ## LOGLINE 11 ## set the structure ID if conf.globalconf.struct_id is not None: struct_id = conf.globalconf.struct_id else: struct_id = struct.structure_id conf.globalconf.struct_id = struct_id struct.structure_id = struct_id console.endln() ## LOGLINE ## if there are REFMAC5 TLS groups in the REMARK records of ## the PDB file, then add those in tls_file = TLS.TLSFile() tls_file.set_file_format(TLS.TLSFileFormatPDB()) ## return to the beginning of the file and read the REMARK/TLS records fobj.seek(0) tls_file.load(fobj) if len(tls_file.tls_desc_list) > 0: console.stdoutln("ADDING TLS GROUP Bequiv TO ATOM TEMPERATURE FACTORS") console.stdoutln(" NUM TLS GROUPS: %d" % (len(tls_file.tls_desc_list))) ## assume REFMAC5 groups where Utotal = Utls + Biso(temp_factor) for tls_desc in tls_file.tls_desc_list: tls_group = tls_desc.construct_tls_group_with_atoms(struct) console.stdoutln(" TLS GROUP: %s" % (tls_group.name)) for atm, Utls in tls_group.iter_atm_Utls(): bresi = atm.temp_factor atm.temp_factor = bresi + (Constants.U2B * numpy.trace(Utls) / 3.0) atm.U = (Constants.B2U * bresi * numpy.identity(3, float)) + Utls console.endln() ## LOGLINE return struct
ef9521776d5daf6fa81385392320ed8b02e14a3f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10674/ef9521776d5daf6fa81385392320ed8b02e14a3f/tlsmd_analysis.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4444, 6999, 12, 1697, 67, 3168, 4672, 3536, 7968, 13348, 16, 24784, 281, 279, 3089, 1958, 67, 350, 533, 18, 8080, 16, 1623, 326, 2438, 12693, 3853, 364, 8098, 1041, 3853, 18, 225, 971, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4444, 6999, 12, 1697, 67, 3168, 4672, 3536, 7968, 13348, 16, 24784, 281, 279, 3089, 1958, 67, 350, 533, 18, 8080, 16, 1623, 326, 2438, 12693, 3853, 364, 8098, 1041, 3853, 18, 225, 971, ...
def redirect_request(self, req, fp, code, msg, headers):
def redirect_request(self, req, fp, code, msg, headers, newurl):
def redirect_request(self, req, fp, code, msg, headers): """Return a Request or None in response to a redirect.
0389295dcdc72df81a037d2712afea600aad9445 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0389295dcdc72df81a037d2712afea600aad9445/urllib2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3136, 67, 2293, 12, 2890, 16, 1111, 16, 4253, 16, 981, 16, 1234, 16, 1607, 16, 394, 718, 4672, 3536, 990, 279, 1567, 578, 599, 316, 766, 358, 279, 3136, 18, 2, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3136, 67, 2293, 12, 2890, 16, 1111, 16, 4253, 16, 981, 16, 1234, 16, 1607, 16, 394, 718, 4672, 3536, 990, 279, 1567, 578, 599, 316, 766, 358, 279, 3136, 18, 2, -100, -100, -100, -100...
def set_window_title(self):
def update_title(self):
def set_window_title(self): if len(self.image_list) == 0: self.window.set_title("Mirage") else: if self.slideshow_mode == True: self.window.set_title("Mirage - [" + str(self.curr_img_in_list+1) + ' ' + _('of') + ' ' + str(len(self.image_list)) + "] " + os.path.basename(self.currimg_name) + ' - ' + _('Slideshow Mode')) else: self.window.set_title("Mirage - [" + str(self.curr_img_in_list+1) + ' ' + _('of') + ' ' + str(len(self.image_list)) + "] " + os.path.basename(self.currimg_name))
681ff2956bbe575389c88847543556c56536fcbf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/681ff2956bbe575389c88847543556c56536fcbf/mirage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 2649, 12, 2890, 4672, 309, 562, 12, 2890, 18, 2730, 67, 1098, 13, 422, 374, 30, 365, 18, 5668, 18, 542, 67, 2649, 2932, 49, 481, 410, 7923, 469, 30, 309, 365, 18, 2069, 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, 1089, 67, 2649, 12, 2890, 4672, 309, 562, 12, 2890, 18, 2730, 67, 1098, 13, 422, 374, 30, 365, 18, 5668, 18, 542, 67, 2649, 2932, 49, 481, 410, 7923, 469, 30, 309, 365, 18, 2069, 4...
self.f = open(self.filename, "w+")
if self.use_buffering: self.f = open(self.filename, "w+", buffering=1024*16) else: self.f = open(self.filename, "w+")
def _create_file(self): self.f = open(self.filename, "w+")
fbbde735081577bdb2264c7168a11b905d6f8a29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/fbbde735081577bdb2264c7168a11b905d6f8a29/test_file2k.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 67, 768, 12, 2890, 4672, 365, 18, 74, 273, 1696, 12, 2890, 18, 3459, 16, 315, 91, 15, 7923, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 67, 768, 12, 2890, 4672, 365, 18, 74, 273, 1696, 12, 2890, 18, 3459, 16, 315, 91, 15, 7923, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
util.fix_up_logger(_logger)
def get_logger(): return _logger
d0c4249efd999fb9e6eb58df6994d7a1c4feea40 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/d0c4249efd999fb9e6eb58df6994d7a1c4feea40/mp_distributing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 4901, 13332, 327, 389, 4901, 225, 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, 67, 4901, 13332, 327, 389, 4901, 225, 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...
Return the e x e matrix `D` with `b^i` along the
Return the `e x e` matrix `D` with `b^i` along the
def D(b): """ Return the e x e matrix `D` with `b^i` along the diagonal. EXAMPLE:: sage: sr = mq.SR(1, 2, 1, 4) sage: sr.mix_columns_matrix() # indirect doctest [ a + 1 0 0 0 a 0 0 0] [ 0 a^2 + 1 0 0 0 a^2 0 0] [ 0 0 a 0 0 0 a + 1 0] [ 0 0 0 a^2 0 0 0 a^2 + 1] [ a 0 0 0 a + 1 0 0 0] [ 0 a^2 0 0 0 a^2 + 1 0 0] [ 0 0 a + 1 0 0 0 a 0] [ 0 0 0 a^2 + 1 0 0 0 a^2] """ D = Matrix(self.base_ring(), self._e, self._e) for i in range(self._e): D[i, i] = b**(2**i) return D
d2531bfd55e8dc010cd9c1e87cc62d2c514562d4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/d2531bfd55e8dc010cd9c1e87cc62d2c514562d4/sr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 463, 12, 70, 4672, 3536, 2000, 326, 1375, 73, 619, 425, 68, 3148, 1375, 40, 68, 598, 1375, 70, 66, 77, 68, 7563, 326, 15425, 18, 225, 5675, 21373, 2866, 225, 272, 410, 30, 9133, 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, 463, 12, 70, 4672, 3536, 2000, 326, 1375, 73, 619, 425, 68, 3148, 1375, 40, 68, 598, 1375, 70, 66, 77, 68, 7563, 326, 15425, 18, 225, 5675, 21373, 2866, 225, 272, 410, 30, 9133, 273,...
sys.stderr.write( "module name in title doesn't match" " <declaremodule>; no <short-synopsis>\n")
ewrite("module name in title doesn't match" " <declaremodule/>; no <short-synopsis/>\n")
def create_module_info(doc, section): # Heavy. node = extract_first_element(section, "modulesynopsis") if node is None: return node._node.name = "synopsis" lastchild = node.childNodes[-1] if lastchild.nodeType == TEXT \ and lastchild.data[-1:] == ".": lastchild.data = lastchild.data[:-1] modauthor = extract_first_element(section, "moduleauthor") if modauthor: modauthor._node.name = "author" modauthor.appendChild(doc.createTextNode( modauthor.getAttribute("name"))) modauthor.removeAttribute("name") platform = extract_first_element(section, "platform") if section.tagName == "section": modinfo_pos = 2 modinfo = doc.createElement("moduleinfo") moddecl = extract_first_element(section, "declaremodule") name = None if moddecl: modinfo.appendChild(doc.createTextNode("\n ")) name = moddecl.attributes["name"].value namenode = doc.createElement("name") namenode.appendChild(doc.createTextNode(name)) modinfo.appendChild(namenode) type = moddecl.attributes.get("type") if type: type = type.value modinfo.appendChild(doc.createTextNode("\n ")) typenode = doc.createElement("type") typenode.appendChild(doc.createTextNode(type)) modinfo.appendChild(typenode) versionadded = extract_first_element(section, "versionadded") if versionadded: modinfo.setAttribute("added", versionadded.getAttribute("version")) title = get_first_element(section, "title") if title: children = title.childNodes if len(children) >= 2 \ and children[0].nodeType == ELEMENT \ and children[0].tagName == "module" \ and children[0].childNodes[0].data == name: # this is it; morph the <title> into <short-synopsis> first_data = children[1] if first_data.data[:4] == " ---": first_data.data = string.lstrip(first_data.data[4:]) title._node.name = "short-synopsis" if children[-1].nodeType == TEXT \ and children[-1].data[-1:] == ".": children[-1].data = children[-1].data[:-1] section.removeChild(title) section.removeChild(section.childNodes[0]) title.removeChild(children[0]) modinfo_pos = 0 else: sys.stderr.write( "module name in title doesn't match" " <declaremodule>; no <short-synopsis>\n") else: sys.stderr.write( "Unexpected condition: <section> without <title>\n") modinfo.appendChild(doc.createTextNode("\n ")) modinfo.appendChild(node) if title and not contents_match(title, node): # The short synopsis is actually different, # and needs to be stored: modinfo.appendChild(doc.createTextNode("\n ")) modinfo.appendChild(title) if modauthor: modinfo.appendChild(doc.createTextNode("\n ")) modinfo.appendChild(modauthor) if platform: modinfo.appendChild(doc.createTextNode("\n ")) modinfo.appendChild(platform) modinfo.appendChild(doc.createTextNode("\n ")) section.insertBefore(modinfo, section.childNodes[modinfo_pos]) section.insertBefore(doc.createTextNode("\n "), modinfo) # # The rest of this removes extra newlines from where we cut out # a lot of elements. A lot of code for minimal value, but keeps # keeps the generated SGML from being too funny looking. # section.normalize() children = section.childNodes for i in range(len(children)): node = children[i] if node.nodeType == ELEMENT \ and node.tagName == "moduleinfo": nextnode = children[i+1] if nextnode.nodeType == TEXT: data = nextnode.data if len(string.lstrip(data)) < (len(data) - 4): nextnode.data = "\n\n\n" + string.lstrip(data)
080c1b5af693afd471728e7fa66f744a61e75ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/080c1b5af693afd471728e7fa66f744a61e75ed4/docfixer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 2978, 67, 1376, 12, 2434, 16, 2442, 4672, 468, 8264, 23935, 18, 756, 273, 2608, 67, 3645, 67, 2956, 12, 3464, 16, 315, 6400, 878, 29522, 7923, 309, 756, 353, 599, 30, 327, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 2978, 67, 1376, 12, 2434, 16, 2442, 4672, 468, 8264, 23935, 18, 756, 273, 2608, 67, 3645, 67, 2956, 12, 3464, 16, 315, 6400, 878, 29522, 7923, 309, 756, 353, 599, 30, 327, 7...
self.reader.Update() return self.reader.GetOutput()
data = self.reader.GetOutput() return data
def loadVti(self, filename): """ Loads the specified DataSet from disk and returns it as vtkImageData @param filename The file where Dataset is loaded from """ if not self.reader or self.filename != filename: self.filename = filename self.reader = vtk.vtkXMLImageDataReader() self.reader.AddObserver("ProgressEvent", lib.messenger.send) lib.messenger.connect(self.reader, 'ProgressEvent', self.updateProgress) filepath = os.path.join(self.path, filename) if not self.reader.CanReadFile(filepath): Logging.error("Cannot read file", "Cannot read XML Image Data File %s"%filename) self.reader.SetFileName(filepath) self.reader.Update() self.updateProgress(None, None) self.reader.Update() return self.reader.GetOutput()
2b95dc758905ae4e3f30b693c09f07c4ad99568a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2877/2b95dc758905ae4e3f30b693c09f07c4ad99568a/BXCDataSource.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 58, 9096, 12, 2890, 16, 1544, 4672, 3536, 4444, 87, 326, 1269, 14065, 628, 4234, 471, 1135, 518, 487, 13659, 2040, 751, 632, 891, 1544, 202, 1986, 585, 1625, 10778, 353, 4203, 628,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 58, 9096, 12, 2890, 16, 1544, 4672, 3536, 4444, 87, 326, 1269, 14065, 628, 4234, 471, 1135, 518, 487, 13659, 2040, 751, 632, 891, 1544, 202, 1986, 585, 1625, 10778, 353, 4203, 628,...
self.assertEqual(def_ser, tmp_def_ser)
self.assertEqual(def_ser, deserialize(tmp_def_ser))
def test_webaccess_firerole_serialization(self): """firerole - role definition correctly serialized""" def_ser = serialize(compile_role_definition(self.role_definition)) tmp_def_ser = acc_get_role_definition(self.role_id) self.assertEqual(def_ser, tmp_def_ser)
8956de977b93f6afa55f2ffc76a674a88f913d10 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/8956de977b93f6afa55f2ffc76a674a88f913d10/webaccess_regression_tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4875, 3860, 67, 74, 481, 264, 790, 67, 8818, 1588, 12, 2890, 4672, 3536, 74, 481, 264, 790, 300, 2478, 2379, 8783, 5343, 8395, 1652, 67, 550, 273, 4472, 12, 11100, 67, 4615, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4875, 3860, 67, 74, 481, 264, 790, 67, 8818, 1588, 12, 2890, 4672, 3536, 74, 481, 264, 790, 300, 2478, 2379, 8783, 5343, 8395, 1652, 67, 550, 273, 4472, 12, 11100, 67, 4615, ...
try: (isFid, value) = record.__getattribute__(self.attr) except AttributeError: value = None
value = record.__getattribute__(self.attr) if value is None: return (isFid, value) = value
def dumpData(self,record,out): try: (isFid, value) = record.__getattribute__(self.attr) except AttributeError: value = None if value is not None: out.packRef(self.subType,value)
5b407d242e4b2cf20b3166a8b10177f3b047cc62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/5b407d242e4b2cf20b3166a8b10177f3b047cc62/bosh.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 751, 12, 2890, 16, 3366, 16, 659, 4672, 460, 273, 1409, 16186, 588, 4589, 972, 12, 2890, 18, 1747, 13, 309, 460, 353, 599, 30, 327, 261, 291, 42, 350, 16, 460, 13, 273, 460, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 751, 12, 2890, 16, 3366, 16, 659, 4672, 460, 273, 1409, 16186, 588, 4589, 972, 12, 2890, 18, 1747, 13, 309, 460, 353, 599, 30, 327, 261, 291, 42, 350, 16, 460, 13, 273, 460, ...
classes = [Link(c.name(),c) for c in self._docmap.keys() if c.is_class()]
uids = self._docmap.keys() classes = [Link(c.name(),c) for c in uids if c.is_class()]
def _write_project_toc(self, public, private): """ @return: An HTML page containing the table of contents page for the whole project. This page lists the classes, exceptions, functions, and variables defined by any module or package in the project. @rtype: C{string} """ # Header and name. str = self._header('Everything') str += ('<center><font size="+1"><b>Everything</b>' + '</font></center>\n<hr>\n') public.write(str); private.write(str)
21a6d8c30a29a133335836c07a6da6e2f0b95f2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/21a6d8c30a29a133335836c07a6da6e2f0b95f2a/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 67, 4406, 67, 1391, 12, 2890, 16, 1071, 16, 3238, 4672, 3536, 632, 2463, 30, 1922, 3982, 1363, 4191, 326, 1014, 434, 2939, 1363, 364, 326, 7339, 1984, 18, 225, 1220, 1363, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 67, 4406, 67, 1391, 12, 2890, 16, 1071, 16, 3238, 4672, 3536, 632, 2463, 30, 1922, 3982, 1363, 4191, 326, 1014, 434, 2939, 1363, 364, 326, 7339, 1984, 18, 225, 1220, 1363, 6...
class ApplicationManager(Folder,CacheManager): """System management""" __roles__=('Manager',) isPrincipiaFolderish=1 Database=DatabaseManager() Versions=VersionManager() manage=manage_main=HTMLFile('cpContents', globals()) manage_undoForm=HTMLFile('undo', globals()) def version_txt(self): if not hasattr(self, '_v_version_txt'): self._v_version_txt=version_txt() return self._v_version_txt def sys_version(self): return sys.version def sys_platform(self): return sys.platform _objects=( {'id': 'Database', 'meta_type': Database.meta_type}, {'id': 'Versions', 'meta_type': Versions.meta_type}, {'id': 'Products', 'meta_type': 'Product Management'}, )
class DebugManager(Fake, SimpleItem.Item, Acquisition.Implicit): """Debug and profiling information""" manage=manage_main=HTMLFile('debug', globals()) id ='DebugInfo' name=title='Debug Information' meta_type = name icon='p_/DebugManager_icon'
def locked_in_version(self): return 0
09e6a202ddf687c78c33a7a6774b6900b16fb69b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/09e6a202ddf687c78c33a7a6774b6900b16fb69b/ApplicationManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8586, 67, 267, 67, 1589, 12, 2890, 4672, 327, 374, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8586, 67, 267, 67, 1589, 12, 2890, 4672, 327, 374, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
'balance_start': fields.function(_get_starting_balance, method=True, string='Opening Balance', type='float',digits=(16,2), help="Opening balance based on cashBox"),
'balance_start': fields.function(_get_starting_balance, store=True, method=True, string='Opening Balance', type='float',digits=(16,2), help="Opening balance based on cashBox"),
def _end_balance(self, cursor, user, ids, name, attr, context=None): res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users')
c909e8af22db1f6cfa821df04c7e550448da427b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c909e8af22db1f6cfa821df04c7e550448da427b/account_cash_statement.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 409, 67, 12296, 12, 2890, 16, 3347, 16, 729, 16, 3258, 16, 508, 16, 1604, 16, 819, 33, 7036, 4672, 400, 67, 7095, 67, 2603, 273, 365, 18, 6011, 18, 588, 2668, 455, 18, 7095, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 409, 67, 12296, 12, 2890, 16, 3347, 16, 729, 16, 3258, 16, 508, 16, 1604, 16, 819, 33, 7036, 4672, 400, 67, 7095, 67, 2603, 273, 365, 18, 6011, 18, 588, 2668, 455, 18, 7095, 6...
if self.callback:
if self.callback and callCallback:
def updateListBoxItems(self): if not self.listbox: return if self.oldText == "" and len(self.listboxItems) != self.listbox.count(): self.listboxItems = [(str(self.listbox.item(i).text()), QListWidgetItem(self.listbox.item(i))) for i in range(self.listbox.count())] text = str(self.text()) self.oldText = text if text == "": items = [(t, QListWidgetItem(i)) for (t,i) in self.listboxItems] elif self.useRE: pattern = re.compile(text) items = [(itemText, QListWidgetItem(item)) for (itemText, item) in self.listboxItems if pattern.match(itemText)] else: items = [(itemText, QListWidgetItem(item)) for (itemText, item) in self.listboxItems if text in itemText] self.listbox.clear() for (t, item) in items: self.listbox.addItem(item) if self.callback: self.callback()
4dd2601ce487793400c1f7e5247f0850daac5006 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6366/4dd2601ce487793400c1f7e5247f0850daac5006/OWGUIEx.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 682, 3514, 3126, 12, 2890, 4672, 309, 486, 365, 18, 1098, 2147, 30, 327, 309, 365, 18, 1673, 1528, 422, 1408, 471, 562, 12, 2890, 18, 1098, 2147, 3126, 13, 480, 365, 18, 1098, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 682, 3514, 3126, 12, 2890, 4672, 309, 486, 365, 18, 1098, 2147, 30, 327, 309, 365, 18, 1673, 1528, 422, 1408, 471, 562, 12, 2890, 18, 1098, 2147, 3126, 13, 480, 365, 18, 1098, ...
if headers.has_key('www-authenticate'): stuff = headers['www-authenticate'] import re match = re.match('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff) if match: scheme, realm = match.groups() if scheme.lower() == 'basic': name = 'retry_' + self.type + '_basic_auth' if data is None: return getattr(self,name)(url, realm) else: return getattr(self,name)(url, realm, data)
if not headers.has_key('www-authenticate'): URLopener.http_error_default(self, url, fp, errmsg, headers) stuff = headers['www-authenticate'] import re match = re.match('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff) if not match: URLopener.http_error_default(self, url, fp, errcode, errmsg, headers) scheme, realm = match.groups() if scheme.lower() != 'basic': URLopener.http_error_default(self, url, fp, errcode, errmsg, headers) name = 'retry_' + self.type + '_basic_auth' if data is None: return getattr(self,name)(url, realm) else: return getattr(self,name)(url, realm, data)
def http_error_401(self, url, fp, errcode, errmsg, headers, data=None): """Error 401 -- authentication required. See this URL for a description of the basic authentication scheme: http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt""" if headers.has_key('www-authenticate'): stuff = headers['www-authenticate'] import re match = re.match('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff) if match: scheme, realm = match.groups() if scheme.lower() == 'basic': name = 'retry_' + self.type + '_basic_auth' if data is None: return getattr(self,name)(url, realm) else: return getattr(self,name)(url, realm, data)
0ef205f9c5e4a66f4da9e2208d192b9e4407eae6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0ef205f9c5e4a66f4da9e2208d192b9e4407eae6/urllib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1062, 67, 1636, 67, 27002, 12, 2890, 16, 880, 16, 4253, 16, 393, 710, 16, 17460, 16, 1607, 16, 501, 33, 7036, 4672, 3536, 668, 14052, 1493, 5107, 1931, 18, 2164, 333, 1976, 364, 279, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1062, 67, 1636, 67, 27002, 12, 2890, 16, 880, 16, 4253, 16, 393, 710, 16, 17460, 16, 1607, 16, 501, 33, 7036, 4672, 3536, 668, 14052, 1493, 5107, 1931, 18, 2164, 333, 1976, 364, 279, ...
def fisher_rvs(mu, sigma, size=None):
def fisher_rvs(mu, sigma, size=1):
def fisher_rvs(mu, sigma, size=None): """ Return a random (polar, azimuthal) angle drawn from the Fisher distribution. Assume that the concentration parameter (kappa) is large so that we can use a Rayleigh distribution about the north pole and rotate it to be centered at the (polar, azimuthal) coordinate mu. Assume kappa = 1 / sigma**2 pol PDF: kappa / (2 * np.sinh(kappa)) * np.exp(kappa * np.cos(theta)) * np.sin(theta)) az PDF: uniform(0, 2*pi) """ rayleigh_rv = \ np.array((np.random.rayleigh(scale=sigma, size=size), np.random.uniform(low=0, high=2*LAL_PI, size=size)))\ .reshape((2, size)).T # guarantee 2D and transpose a, b = new_z_to_euler(mu) return rotate_euler(rayleigh_rv, a, b, 0)
d4e5cf55a233130a9e8e244eb51db7232816cc27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/d4e5cf55a233130a9e8e244eb51db7232816cc27/sphericalutils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 31721, 67, 4962, 87, 12, 13297, 16, 7299, 16, 963, 33, 21, 4672, 3536, 2000, 279, 2744, 261, 3915, 297, 16, 23090, 287, 13, 5291, 19377, 628, 326, 478, 31721, 7006, 18, 15983, 716...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 31721, 67, 4962, 87, 12, 13297, 16, 7299, 16, 963, 33, 21, 4672, 3536, 2000, 279, 2744, 261, 3915, 297, 16, 23090, 287, 13, 5291, 19377, 628, 326, 478, 31721, 7006, 18, 15983, 716...
node.append(field) return etree.tostring(res, encoding="utf-8").replace('\t', '')
if fields[field].get('select'): fields_to_search.add(field) for view in (form_view, tree_view): view_root = etree.fromstring(view['arch']) fields_to_search = fields_to_search.union(view_root.xpath("//field[@select=1]/@name")) tree_view_root = view_root search_view = etree.Element("search", attrib={'string': tree_view_root.get("string", "")}) field_group = etree.Element("group") search_view.append(field_group) for field_name in fields_to_search: field_group.append(etree.Element("field", attrib={'name': field_name})) return etree.tostring(search_view, encoding="utf-8").replace('\t', '')
def encode(s): if isinstance(s, unicode): return s.encode('utf8') return s
4226a3adb2b2399221dd425cec1a3bc929d37605 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4226a3adb2b2399221dd425cec1a3bc929d37605/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 12, 87, 4672, 309, 1549, 12, 87, 16, 5252, 4672, 327, 272, 18, 3015, 2668, 3158, 28, 6134, 327, 272, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 12, 87, 4672, 309, 1549, 12, 87, 16, 5252, 4672, 327, 272, 18, 3015, 2668, 3158, 28, 6134, 327, 272, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
self.browser['queue_name'] = queue_name
self.browser["queue_name"] = queue_name
def _post_to_server(self, queue_name, status, patch, results_file): if results_file: # We might need to re-wind the file if we've already tried to post it. results_file.seek(0)
f3e267b4dcbf3edb5ac4abe8328f5b954acd1494 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/f3e267b4dcbf3edb5ac4abe8328f5b954acd1494/statusserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2767, 67, 869, 67, 3567, 12, 2890, 16, 2389, 67, 529, 16, 1267, 16, 4729, 16, 1686, 67, 768, 4672, 309, 1686, 67, 768, 30, 468, 1660, 4825, 1608, 358, 283, 17, 10094, 326, 585, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 389, 2767, 67, 869, 67, 3567, 12, 2890, 16, 2389, 67, 529, 16, 1267, 16, 4729, 16, 1686, 67, 768, 4672, 309, 1686, 67, 768, 30, 468, 1660, 4825, 1608, 358, 283, 17, 10094, 326, 585, ...
test(r"""pat.match(p) != None""", 1)
test(r"""pat.match(p) is not None""", 1)
def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1)
43203310e1400f4f6211972756449af0de8cca51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/43203310e1400f4f6211972756449af0de8cca51/test_sre.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23559, 67, 2107, 12, 1916, 2603, 4672, 509, 67, 1132, 273, 509, 12, 1916, 2603, 18, 1655, 12, 20, 3719, 327, 609, 12, 474, 67, 1132, 397, 404, 13, 225, 2, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 23559, 67, 2107, 12, 1916, 2603, 4672, 509, 67, 1132, 273, 509, 12, 1916, 2603, 18, 1655, 12, 20, 3719, 327, 609, 12, 474, 67, 1132, 397, 404, 13, 225, 2, -100, -100, -100, -100, -10...
tt = line
# Look for a machine, default, or macdef top-level keyword
497ec60f8026a1c85dc136dad1a40ccfc822ced7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/497ec60f8026a1c85dc136dad1a40ccfc822ced7/netrc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 10176, 364, 279, 5228, 16, 805, 16, 578, 5318, 536, 1760, 17, 2815, 4932, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 10176, 364, 279, 5228, 16, 805, 16, 578, 5318, 536, 1760, 17, 2815, 4932, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
flickrHost = "flickr.com"
flickrHost = "api.flickr.com"
def __parseXMLElement(element, thisNode): """Recursive call to process this XMLNode.""" thisNode.elementName = element.nodeName
a3c7c43ec6f2e835bd0743496e41b11599a4450e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11023/a3c7c43ec6f2e835bd0743496e41b11599a4450e/flickrapi.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2670, 15223, 12, 2956, 16, 333, 907, 4672, 3536, 10483, 745, 358, 1207, 333, 3167, 907, 12123, 333, 907, 18, 2956, 461, 273, 930, 18, 2159, 461, 2, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2670, 15223, 12, 2956, 16, 333, 907, 4672, 3536, 10483, 745, 358, 1207, 333, 3167, 907, 12123, 333, 907, 18, 2956, 461, 273, 930, 18, 2159, 461, 2, -100, -100, -100, -100, -100, ...
return self.read(cr, uid, uid,
return self.read(cr, uid, new_id,
def user_data(self, cr, uid, context=None): ''' Gets the purely user part of the current config_user instance, without the fields inherited from res.config ''' return self.read(cr, uid, uid, users._columns.keys(), context=context)
b35d51a3e5f603ea3bd0bd84308d8069a56c09ec /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/b35d51a3e5f603ea3bd0bd84308d8069a56c09ec/res_user.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 729, 67, 892, 12, 2890, 16, 4422, 16, 4555, 16, 819, 33, 7036, 4672, 9163, 11881, 326, 16618, 715, 729, 1087, 434, 326, 783, 642, 67, 1355, 791, 16, 2887, 326, 1466, 12078, 628, 400, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 729, 67, 892, 12, 2890, 16, 4422, 16, 4555, 16, 819, 33, 7036, 4672, 9163, 11881, 326, 16618, 715, 729, 1087, 434, 326, 783, 642, 67, 1355, 791, 16, 2887, 326, 1466, 12078, 628, 400, ...
if gv_outside is typedesc.gv_defl_outside:
if gv_outside is typedesc.gv_null:
def getgenvar(self, builder): typedesc = self.typedesc assert typedesc is not None gv_outside = self.content_boxes[-1].genvar if gv_outside is typedesc.gv_defl_outside: gv_outside = builder.genop_malloc_fixedsize(typedesc.alloctoken) self.content_boxes[-1].genvar = gv_outside # xxx jitstate please return gv_outside
f2d05f392a22baf599eedc1f9655abea4a0ee9b8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/f2d05f392a22baf599eedc1f9655abea4a0ee9b8/rcontainer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 4507, 1401, 12, 2890, 16, 2089, 4672, 9092, 742, 273, 365, 18, 11585, 742, 1815, 9092, 742, 353, 486, 599, 11404, 67, 659, 5564, 273, 365, 18, 1745, 67, 15918, 18919, 21, 8009, 45...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4507, 1401, 12, 2890, 16, 2089, 4672, 9092, 742, 273, 365, 18, 11585, 742, 1815, 9092, 742, 353, 486, 599, 11404, 67, 659, 5564, 273, 365, 18, 1745, 67, 15918, 18919, 21, 8009, 45...
result += "<b>(ref coll)</b> "
result += "<b>(ref collection)</b><br>\n<ul>"
def RenderItem(repoView, item): result = "" # For Kinds, display their attributes (except for the internal ones # like notFoundAttributes): isKind = item.isItemOf(repoView.findPath("//Schema/Core/Kind")) isBlock = item.isItemOf(repoView.findPath("//parcels/osaf/framework/blocks/Block")) path = "<a href=%s>[top]</a>" % toLink("/") i = 2 for part in item.itsPath[1:-1]: path += " &gt; <a href=%s>%s</a>" % (toLink(item.itsPath[:i]), part) i += 1 name = item.itsName if name is None: name = unicode(item.itsPath[-1]) result += "<div class='path'>%s &gt; <span class='itemname'>%s</span>" % (path, name) try: result += " (<a href=%s>%s</a>)" % (toLink(item.itsKind.itsPath), item.itsKind.itsName) except: pass if isKind: result += " | Run a <a href=%s?mode=kindquery>Kind Query</a>" % toLink(item.itsPath) if isBlock: result += " | <a href=%s?mode=blocks>Render block tree</a>" % toLink(item.itsPath) result += "</div>\n" try: displayName = item.displayName result += "<div class='subheader'><b>Display Name:</b> %s</div>\n" % displayName except: pass result += "<div class='children'><b>Child items:</b><br> " children = {} for child in item.iterChildren(): name = child.itsName if name is None: name = unicode(child.itsUUID) children[name] = child keys = children.keys() keys.sort(lambda x, y: cmp(string.lower(x), string.lower(y))) output = [] for key in keys: child = children[key] name = child.itsName displayName = "" if name is None: name = unicode(child.itsUUID) displayName = child.getItemDisplayName() children[name] = child output.append(" &nbsp; <a href=%s>%s </a> %s" % (toLink(child.itsPath), key, displayName)) if not output: result += " &nbsp; None" else: result += ("<br>".join(output)) result += "</div>\n" if isKind: result += "<table width=100% border=0 cellpadding=4 cellspacing=0>\n" result += "<tr class='toprow'>" result += "<td colspan=7><b>Attributes defined for this kind:</b></td>" result += "</tr>\n" result += "<tr class='headingsrow'>\n" result += "<td valign=top><b>Attribute</b> (inherited from)</td>\n" result += "<td valign=top><b>Description / Issues</b></td>\n" result += "<td valign=top><b>Cardinality</b></td>\n" result += "<td valign=top><b>Type</b></td>\n" result += "<td valign=top><b>Initial&nbsp;Value</b></td>\n" # result += "<td valign=top><b>Required?</b></td>\n" result += "<td valign=top><b>RedirectTo</b></td>\n" result += "</tr>\n" count = 0 displayedAttrs = { } for name, attr, kind in item.iterAttributes(): if name is None: name = "Anonymous" displayedAttrs[name] = (attr, kind) keys = displayedAttrs.keys() keys.sort(lambda x, y: cmp(string.lower(x), string.lower(y))) for key in keys: attribute, kind = displayedAttrs[key] result += oddEvenRow(count) other = attribute.getAttributeValue('otherName', default="") if other: other = " (inverse: '%s')" % other else: other = "" if kind is not item: inherited = " (from <a href=%s>%s</a>)" % (toLink(kind.itsPath), kind.itsName) else: inherited = "" result += "<td valign=top><a href=%s>%s</a>%s%s</td>\n" % \ (toLink(attribute.itsPath), key, inherited, other) result += "<td valign=top>%s" % \ (attribute.getAttributeValue('description', default = "&nbsp;")) result += "</td>\n" cardinality = attribute.getAttributeValue('cardinality', default='single') result += "<td valign=top>%s</td>\n" % ( cardinality ) attrType = attribute.getAttributeValue('type', default=None) if attrType: result += "<td valign=top><a href=%s>%s</a></td>\n" % \ (toLink(attrType.itsPath), attrType.itsName) else: result += "<td valign=top>N/A</td>\n" if attribute.hasLocalAttributeValue('initialValue'): result += "<td valign=top>%s</td>\n" % (attribute.initialValue,) else: result += "<td valign=top>N/A</td>\n" # if attribute.required: result += "<td valign=top>Yes</td>\n" # else: result += "<td valign=top>No</td>\n" redirectTo = attribute.getAttributeValue('redirectTo', default="&nbsp;") result += "<td valign=top>%s</td>\n" % redirectTo result += "</tr>\n" count += 1 result += "</table>\n" result += "<br />\n" result += "<table width=100% border=0 cellpadding=4 cellspacing=0>\n" result += "<tr class='toprow'>\n" result += "<td colspan=2><b>Attribute values for this item:</b></td>\n" result += "</tr>\n" result += "<tr class='headingsrow'>\n" result += "<td valign=top><b>Attribute</b></td>\n" result += "<td valign=top><b>Value</b></td>\n" result += "</tr>\n" count = 0 displayedAttrs = { } for (name, value) in item.iterAttributeValues(): if name is None: name = "Anonymous" displayedAttrs[name] = value keys = displayedAttrs.keys() keys.sort(lambda x, y: cmp(string.lower(x), string.lower(y))) for name in keys: value = displayedAttrs[name] if name == "attributes" or \ name == "notFoundAttributes" or \ name == "inheritedAttributes": pass elif name == "originalValues": pass elif isinstance(value, RefList): result += oddEvenRow(count) result += "<td valign=top>" result += "%s" % name result += "</td><td valign=top>" result += "<b>(ref coll)</b> " output = [] for j in value: output.append("<a href=%s>%s</a>" % \ (toLink(j.itsPath), getattr(j, "blockName", j.getItemDisplayName()))) result += (", ".join(output)) result += "</td></tr>\n" count += 1 elif isinstance(value, list): result += oddEvenRow(count) result += "<td valign=top>" result += "%s" % name result += "</td><td valign=top>" result += "<ul>" for j in value: try: result += "<li>%s <a href=%s>%s</a><br>\n" % (j.itsName, toLink(j.itsPath), j.itsPath) except: result += "<li>%s (%s)<br>\n" % (clean(j), clean(type(j))) result += "</ul>" result += "</td></tr>\n" count += 1 elif isinstance(value, dict): result += oddEvenRow(count) result += "<td valign=top>" result += "%s" % name result += "</td><td valign=top>" for key in value.keys(): try: result += "%s: %s <a href=%s>%s</a><br>" % \ (key, value[key].itsName, toLink( value[key].itsPath), value[key].itsPath) except: try: result += "%s: %s (%s)<br>" % (key, clean(value[key]), clean(type(value[key]))) except: result += "%s: <i>(Can't display)</i> (%s)<br>" % \ (key, clean(type(value[key]))) result += "</td></tr>\n" count += 1 elif isinstance(value, Lob): result += oddEvenRow(count) result += "<td valign=top>" result += "%s" % name result += "</td><td valign=top>" mimeType = value.mimetype if mimeType.startswith("image/"): result += "<img src=/lobs/%s/%s><br>" % (item.itsUUID, name) result += "(%s)<br>" % mimeType else: try: theType = TypeHandler.typeHandler(repoView, value) typeName = theType.getImplementationType().__name__ result += "<b>(%s)</b> " % typeName content = value.getReader().read() result += clean(content) except Exception, e: result += clean(e) result += "(Couldn't read Lob content)" result += "</td></tr>\n" count += 1 elif isinstance(value, Item): result += oddEvenRow(count) result += "<td valign=top>" result += "%s" % name result += "</td><td valign=top>" result += "<b>(itemref)</b> " result += "<a href=%s>%s</a><br>" % (toLink(value.itsPath), value.getItemDisplayName()) result += "</td></tr>\n" count += 1 elif isinstance(value, URL): result += oddEvenRow(count) result += "<td valign=top>" result += "%s" % name result += "</td><td valign=top>" theType = TypeHandler.typeHandler(repoView, value) typeName = theType.getImplementationType().__name__ result += "<b>(%s)</b> " % typeName result += ' <a href="%s">%s</a><br>' %(value, value) result += "</td></tr>\n" count += 1 elif isinstance(value, AbstractSet) or isinstance(value,PersistentSet): result += oddEvenRow(count) result += "<td valign=top>" result += "%s" % name result += "</td><td valign=top>" theType = TypeHandler.typeHandler(repoView, value) typeName = theType.getImplementationType().__name__ result += "<b>(%s)</b> " % typeName result += "<ul>" for j in value: result +="<li>%s <a href=%s>%s</a><br>\n" % (j.getItemDisplayName(), toLink(j.itsPath), j.itsPath) result += "</ul>" result += "</td></tr>\n" count += 1 else: result += oddEvenRow(count) result += "<td valign=top>" result += "%s" % name result += "</td><td valign=top>" theType = TypeHandler.typeHandler(repoView, value) typeName = theType.getImplementationType().__name__ result += "<b>(%s)</b> " % typeName try: result += "<a href=%s>%s</a><br>" % (toLink(value.itsPath), value.getItemDisplayName()) except: if name == "password": result += "<i>(hidden)</i><br>" else: result += "%s<br>" % (clean(value)) result += "</td></tr>\n" count += 1 result += "</table>\n" if isBlock: try: widget = item.widget except: pass else: result += RenderObject(repoView, widget, "%s/%s" % (item.itsPath, "widget"), "Widget") if isKind: # Cloud info result += "<br />\n" result += RenderClouds(repoView, item) if isinstance(item, pim.AbstractCollection): result += "<table width=100% border=0 cellpadding=4 cellspacing=0>\n" result += "<tr class='toprow'>\n" result += "<td><b>Collection Sources:</b></td>\n" result += "</tr>\n" result += "<tr class='oddrow'>\n" result += "<td>%s</td>\n" % _getSourceTree(item) result += "</tr>\n" result += "</table>\n" if isinstance(item, ContentItem): result += "<table width=100% border=0 cellpadding=4 cellspacing=0>\n" result += "<tr class='toprow'>\n" result += "<td><b>Additional information:</b></td>\n" result += "</tr>\n" result += "<tr class='oddrow'>\n" result += "<td>Item version: %d<br>Is item dirty: %s<br>Shared state: %s</td>\n" % (item.getVersion(), item.isDirty(), item.sharedState) result += "</tr>\n" result += "</table>\n" return result
fbd4d7013e58e7b429ff4bbc64a0e168422bc6f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/fbd4d7013e58e7b429ff4bbc64a0e168422bc6f3/repo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6987, 1180, 12, 7422, 1767, 16, 761, 4672, 225, 563, 273, 1408, 225, 468, 2457, 5851, 87, 16, 2562, 3675, 1677, 261, 14137, 364, 326, 2713, 5945, 468, 3007, 19372, 2498, 4672, 353, 5677,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6987, 1180, 12, 7422, 1767, 16, 761, 4672, 225, 563, 273, 1408, 225, 468, 2457, 5851, 87, 16, 2562, 3675, 1677, 261, 14137, 364, 326, 2713, 5945, 468, 3007, 19372, 2498, 4672, 353, 5677,...
instance.status = status self._WriteConfig()
if instance.status != status: instance.status = status self._WriteConfig()
def _SetInstanceStatus(self, instance_name, status): """Set the instance's status to a given value.
455a344534b076aca01c626ddf1c81946cd899de /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/455a344534b076aca01c626ddf1c81946cd899de/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 694, 1442, 1482, 12, 2890, 16, 791, 67, 529, 16, 1267, 4672, 3536, 694, 326, 791, 1807, 1267, 358, 279, 864, 460, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 694, 1442, 1482, 12, 2890, 16, 791, 67, 529, 16, 1267, 4672, 3536, 694, 326, 791, 1807, 1267, 358, 279, 864, 460, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jQuery(" return(msg); }, HelloWorld: function (name) { return("Hello " + name); } }, { info: {consumes:['build_message'], author: 'John (J5) Palmieri <johnp@redhat.com>', version: '0.1', name: 'Goodbye World Message' }, run: function (data) {
end = i
def __init__(self, debug=False): self.__debug = debug # if debug is False condense javascript to optimize self.__extension_cache = {} #lets put a dummy in for now to test self.__extension_cache['build_message'] = """ [{ info: {consumes:['build_message'], author: 'John (J5) Palmieri <johnp@redhat.com>', version: '0.1', name: 'Hello World Message' }, run: function (data) { msg = this.HelloWorld(data.task_id); jQuery("#" + data.uid).css('background-color', 'blue'); return(msg); }, HelloWorld: function (name) { return("Hello " + name); } }, { info: {consumes:['build_message'], author: 'John (J5) Palmieri <johnp@redhat.com>', version: '0.1', name: 'Goodbye World Message' }, run: function (data) { msg = this.GoodbyeWorld(data.task_id); jQuery("#" + data.uid).css('background-color', 'red'); return(msg); }, GoodbyeWorld: function (name) { return("Goodbye " + name); } } ] """
27ec9ed03663e715b7c0422359e98616637fde6d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12732/27ec9ed03663e715b7c0422359e98616637fde6d/extensions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1198, 33, 8381, 4672, 365, 16186, 4148, 273, 1198, 468, 309, 1198, 353, 1083, 6941, 3558, 11341, 358, 10979, 365, 16186, 6447, 67, 2493, 273, 2618, 225, 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, 1001, 2738, 972, 12, 2890, 16, 1198, 33, 8381, 4672, 365, 16186, 4148, 273, 1198, 468, 309, 1198, 353, 1083, 6941, 3558, 11341, 358, 10979, 365, 16186, 6447, 67, 2493, 273, 2618, 225, 46...
self.link[(fro,to,label)].getWeight(state),
self.link[(fro,to,label)].getWeight(state) * 100,
def showLinks(self,stateId=None): "Show all the links in the Concept Network" for (fro,to,label) in self.link: if label: if not stateId: print "%10s -(%10s %d)-> %10s" % (fro.getSymbol(), label.getSymbol(), self.link[(fro,to,label)].getWeight(), to.getSymbol()) else: state = self.getState(stateId) print "%10s -(%10s %d)-> %10s" % (fro.getSymbol(), label.getSymbol(), self.link[(fro,to,label)].getWeight(state), to.getSymbol()) else: print "%10s ------(%d)-------> %10s" % (fro.getSymbol(), self.link[(fro,to,label)].getWeight(), to.getSymbol())
dfea1e89aa0e485e5816da0800e22495e3d7f634 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13131/dfea1e89aa0e485e5816da0800e22495e3d7f634/ConceptNetwork.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 7100, 12, 2890, 16, 2019, 548, 33, 7036, 4672, 315, 5706, 777, 326, 4716, 316, 326, 27842, 5128, 6, 364, 261, 74, 303, 16, 869, 16, 1925, 13, 316, 365, 18, 1232, 30, 309, 1433,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 7100, 12, 2890, 16, 2019, 548, 33, 7036, 4672, 315, 5706, 777, 326, 4716, 316, 326, 27842, 5128, 6, 364, 261, 74, 303, 16, 869, 16, 1925, 13, 316, 365, 18, 1232, 30, 309, 1433,...
urwid.AttrWrap(self.columns, "background"),
urwid.AttrWrap(self.columns, "background"),
def __init__(self, dbg): self.debugger = dbg Attr = urwid.AttrWrap
e032f4d4e7d00a05fe0f27b0ce4695345bb987e0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12738/e032f4d4e7d00a05fe0f27b0ce4695345bb987e0/debugger.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 28966, 4672, 365, 18, 4148, 693, 273, 28966, 11289, 273, 8896, 30902, 18, 3843, 2964, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 28966, 4672, 365, 18, 4148, 693, 273, 28966, 11289, 273, 8896, 30902, 18, 3843, 2964, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return if extract:
elif extract:
def main(): import getopt if len(sys.argv) <= 1: usage() return 0 verbose = 2 repo = [] strict = 0 nodigest = 0 payload = 1 wait = 0 verify = 1 small = 0 explode = 0 diff = 0 extract = 0 checksrpms = 0 rpmdbpath = "/var/lib/rpm/" checkarch = 0 buildroot = "" checkrpmdb = 0 (opts, args) = getopt.getopt(sys.argv[1:], "hqv?", ["help", "verbose", "quiet", "strict", "digest", "nodigest", "payload", "nopayload", "wait", "noverify", "small", "explode", "diff", "extract", "checksrpms", "checkarch", "rpmdbpath=", "checkrpmdb", "buildroot="]) for (opt, val) in opts: if opt in ("-?", "-h", "--help"): usage() return 0 elif opt in ("-v", "--verbose"): verbose += 1 elif opt in ("-q", "--quiet"): verbose = 0 elif opt == "--strict": strict = 1 elif opt == "--digest": nodigest = 0 elif opt == "--nodigest": nodigest = 1 elif opt == "--payload": payload = 1 elif opt == "--nopayload": payload = 0 elif opt == "--wait": wait = 1 elif opt == "--noverify": verify = 0 elif opt == "--small": small = 1 elif opt == "--explode": explode = 1 elif opt == "--diff": diff = 1 elif opt == "--extract": extract = 1 elif opt == "--checksrpms": checksrpms = 1 elif opt == "--checkarch": checkarch = 1 elif opt == "--rpmdbpath": rpmdbpath = val if rpmdbpath[-1:] != "/": rpmdbpath += "/" elif opt == "--checkrpmdb": checkrpmdb = 1 elif opt == "--buildroot": #if not val.startswith("/"): # print "buildroot should start with a /" # return buildroot = os.path.abspath(val) if diff: diff = diffTwoSrpms(args[0], args[1], explode) if diff != "": print diff return if extract: for a in args: extractRpm(a, buildroot) return if checksrpms: checkSrpms() return if checkarch: checkArch(args[0]) return if checkrpmdb: readRpmdb(rpmdbpath, verbose) return keepdata = 1 hdrtags = rpmtag if verify == 0 and nodigest == 1: keepdata = 0 if small: for i in importanttags.keys(): value = rpmtag[i] importanttags[i] = value importanttags[value[0]] = value hdrtags = importanttags #for _ in xrange(50): for a in args: b = [a] if not a.endswith(".rpm") and not isUrl(a) and os.path.isdir(a): b = [] for c in os.listdir(a): fn = "%s/%s" % (a, c) if c.endswith(".rpm"): # and os.path.isfile(fn): b.append(fn) for a in b: rpm = verifyRpm(a, verify, strict, payload, nodigest, hdrtags, keepdata) if rpm == None: continue #f = rpm["requirename"] #if f: # print rpm.getFilename() # print f if strict or wait: repo.append(rpm) del rpm if strict: for rpm in repo: rpm.filenames = rpm.getFilenames() checkDirs(repo) checkSymlinks(repo) checkProvides(repo, checkrequires=1) if wait: import time print "ready" time.sleep(30)
13be26721e21a4e961a8227db7d74cd35a0477dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/13be26721e21a4e961a8227db7d74cd35a0477dd/oldpyrpm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 1930, 336, 3838, 309, 562, 12, 9499, 18, 19485, 13, 1648, 404, 30, 4084, 1435, 327, 374, 3988, 273, 576, 3538, 273, 5378, 5490, 273, 374, 14003, 360, 395, 273, 374, 2385, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1930, 336, 3838, 309, 562, 12, 9499, 18, 19485, 13, 1648, 404, 30, 4084, 1435, 327, 374, 3988, 273, 576, 3538, 273, 5378, 5490, 273, 374, 14003, 360, 395, 273, 374, 2385, ...
_fl_create_browser = cfuncproto(so_libforms, "fl_create_browser",
_fl_create_browser = cfuncproto(so_libforms, "fl_create_browser",
def fl_add_box(type, x, y, w, h, label): """ fl_add_box(type, x, y, w, h, label) -> object """ retval = _fl_add_box(type, x, y, w, h, label) return retval
9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 1289, 67, 2147, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 4672, 3536, 1183, 67, 1289, 67, 2147, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 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, 1183, 67, 1289, 67, 2147, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 4672, 3536, 1183, 67, 1289, 67, 2147, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 13, ...
warmrunnerdesc.state.set_param_threshold(3) warmrunnerdesc.state.set_param_trace_eagerness(2) warmrunnerdesc.state.set_param_trace_limit(trace_limit) warmrunnerdesc.state.set_param_inlining(inline) warmrunnerdesc.state.set_param_optimizer(OPTIMIZER_FULL)
for jd in warmrunnerdesc.jitdrivers_sd: jd.warmstate.set_param_threshold(3) jd.warmstate.set_param_trace_eagerness(2) jd.warmstate.set_param_trace_limit(trace_limit) jd.warmstate.set_param_inlining(inline) jd.warmstate.set_param_optimizer(OPTIMIZER_FULL)
def entry_point(argv): args = %s res = function(*args) print res return 0
62ea1f2bee89a5fd1d77644fdeb1bf52fd205855 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/62ea1f2bee89a5fd1d77644fdeb1bf52fd205855/support.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1241, 67, 1153, 12, 19485, 4672, 833, 273, 738, 87, 400, 273, 445, 30857, 1968, 13, 1172, 400, 327, 374, 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, 1241, 67, 1153, 12, 19485, 4672, 833, 273, 738, 87, 400, 273, 445, 30857, 1968, 13, 1172, 400, 327, 374, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.ax.barh(x_vals, values, height=widths, color=color, label=label, align="center", linewidth=0)
patches = self.ax.barh(x_vals, values, height=widths, color=color, align="center", linewidth=0)
def finalize(self, orientation="vertical"): colors = default_colors() for bins, values, color, label in itertools.izip(self.bin_sets, self.value_sets, colors, self.data_labels): x_vals = bins.centres() widths = bins.upper() - bins.lower()
2405e5e19f7efc631612d7570532eb87635fed99 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5758/2405e5e19f7efc631612d7570532eb87635fed99/plotutils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12409, 12, 2890, 16, 9820, 1546, 17824, 6, 4672, 5740, 273, 805, 67, 9724, 1435, 364, 8963, 16, 924, 16, 2036, 16, 1433, 316, 13315, 18, 452, 625, 12, 2890, 18, 4757, 67, 4424, 16, 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, 12409, 12, 2890, 16, 9820, 1546, 17824, 6, 4672, 5740, 273, 805, 67, 9724, 1435, 364, 8963, 16, 924, 16, 2036, 16, 1433, 316, 13315, 18, 452, 625, 12, 2890, 18, 4757, 67, 4424, 16, 3...
u = urllib2.urlopen("http://www.python.org", timeout=None)
u = _urlopen_with_retry("http://www.python.org", timeout=None)
def test_http_NoneNodefault(self): u = urllib2.urlopen("http://www.python.org", timeout=None) self.assertTrue(u.fp._sock.fp._sock.gettimeout() is None)
6534a4ed2b25b245b424847a6f61ed4524fa5f72 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/6534a4ed2b25b245b424847a6f61ed4524fa5f72/test_urllib2net.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2505, 67, 7036, 907, 643, 12, 2890, 4672, 582, 273, 389, 295, 18589, 67, 1918, 67, 9620, 2932, 2505, 2207, 5591, 18, 8103, 18, 3341, 3113, 2021, 33, 7036, 13, 365, 18, 11231,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2505, 67, 7036, 907, 643, 12, 2890, 4672, 582, 273, 389, 295, 18589, 67, 1918, 67, 9620, 2932, 2505, 2207, 5591, 18, 8103, 18, 3341, 3113, 2021, 33, 7036, 13, 365, 18, 11231,...
"""Prints the results of running each routine on a set of test data. Data format is a list of tuples, each containing three elements: dmsStr to test, a comment, and isOK (true if the dmsStr is valid, false if not)
"""Print the results of running each routine on a set of test data. Data format is a list of tuples, each containing two elements: dmsStr to test, a comment
def _printTest(dmsSet = None): """Prints the results of running each routine on a set of test data. Data format is a list of tuples, each containing three elements: dmsStr to test, a comment, and isOK (true if the dmsStr is valid, false if not) The output is in the format used by _assertTest, but please use this with great caution. You must examine the output very carefully to confirm it is correct before updating _assertTest! """ print "Exercising RO string utilities" if not dmsSet: dmsSet = ( ("::", ""), ("-::", ""), (" +1", ""), ("-2.999998639", ""), # 3:00:00 = 3:00:00.0 = 3:00:00.00 = 2:59:59.9951 ("-2.999998583", ""), # 3:00:00 = 3:00:00.0 = 2:59:59.99 = 2:59:59.9949 ("-2.999986139", ""), # 3:00:00 = 3:00:00.0 = 2:59:59.95 = 2:59:59.9501 ("-2.999986083", ""), # 3:00:00 = 2:59:59.9 = 2:59:59.95 = 2:59:59.9499 ("-2.999861139", ""), # 2:59:59 = 2:59:59.5 = 2:59:59.50 = 2:59:59.5001 ("-2.999861083", ""), # 2:59:59 = 2:59:59.5 = 2:59:59.50 = 2:59:59.4999 ("-123::", ""), ("-123:4", ""), ("-123:45", ""), ("-123:4.56789", ""), ("-123:45.6789", ""), ("1:2:", ""), ("1:2:3", ""), ("1:2:3.456789", ""), ("1:23:4", ""), ("1:23:45", ""), ("123:45:6.789", ""), ("123:45:56.789", ""), ("-0::12.34", "bug test; the sign must be retained"), ("-::12.34", "a weird gray area, but it works"), ("::12.34", ""), ("1:23.4567", ""), ("-1.234567", ""), ("-1:abadstr", "invalid characters"), ("-1:2343:24", "too many minutes digits"), ("1:-1:24", "minus sign in wrong place"), ) for testStr, commentStr in dmsSet: # note: if splitDMSStr succeeds, then the other calls all should succeed if checkDMSStr(testStr): try: itemList = splitDMSStr(testStr) deg = degFromDMSStr (testStr) sec = secFromDMSStr (testStr) neatStr = neatenDMSStr (testStr) outDMSStr = [] for prec in range(3): outDMSStr.append(dmsStrFromDeg(deg, precision=prec)) print "[%r, %r, 1, %r, %r, %r, %r, %r]," % (testStr, commentStr, itemList, deg, sec, neatStr, outDMSStr) except StandardError, e: print "unexpected failure on %r (%s); error = %s" % (testStr, commentStr, e) else: print "[%r, %r, 0, %r, %r, %r, %r, %r]," % tuple([testStr, commentStr] + [None]*5)
a5c12743960cc44ddb0aa0f21361c8697521f18c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6354/a5c12743960cc44ddb0aa0f21361c8697521f18c/StringUtil.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1188, 4709, 12, 72, 959, 694, 273, 599, 4672, 3536, 5108, 326, 1686, 434, 3549, 1517, 12245, 603, 279, 444, 434, 1842, 501, 18, 1910, 740, 353, 279, 666, 434, 10384, 16, 1517, 419...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1188, 4709, 12, 72, 959, 694, 273, 599, 4672, 3536, 5108, 326, 1686, 434, 3549, 1517, 12245, 603, 279, 444, 434, 1842, 501, 18, 1910, 740, 353, 279, 666, 434, 10384, 16, 1517, 419...
self.layer.min_set(self.src_index, value.real)
self.min_adjustment.value = value.real
def entry_cb(self, entry, *args): if self.updating: return
30093beb2981ba47380749a3f1c597965f66f39e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11090/30093beb2981ba47380749a3f1c597965f66f39e/gvrasterpropdlg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1241, 67, 7358, 12, 2890, 16, 1241, 16, 380, 1968, 4672, 309, 365, 18, 5533, 1776, 30, 327, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1241, 67, 7358, 12, 2890, 16, 1241, 16, 380, 1968, 4672, 309, 365, 18, 5533, 1776, 30, 327, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
for the export command, with the following additions:: %s basename of file being printed %d dirname of file being printed, or '.' if in repository root %p root-relative path name of file being printed
for the export command, with the following additions: :``%s``: basename of file being printed :``%d``: dirname of file being printed, or '.' if in repository root :``%p``: root-relative path name of file being printed
def cat(ui, repo, file1, *pats, **opts): """output the current or given revision of files Print the specified files as they were at the given revision. If no revision is given, the parent of the working directory is used, or tip if no revision is checked out. Output may be to a file, in which case the name of the file is given using a format string. The formatting rules are the same as for the export command, with the following additions:: %s basename of file being printed %d dirname of file being printed, or '.' if in repository root %p root-relative path name of file being printed """ ctx = repo[opts.get('rev')] err = 1 m = cmdutil.match(repo, (file1,) + pats, opts) for abs in ctx.walk(m): fp = cmdutil.make_file(repo, opts.get('output'), ctx.node(), pathname=abs) data = ctx[abs].data() if opts.get('decode'): data = repo.wwritedata(abs, data) fp.write(data) err = 0 return err
28ec828fb013ded4b818b9dd4333727d97e8cf75 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/28ec828fb013ded4b818b9dd4333727d97e8cf75/commands.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6573, 12, 4881, 16, 3538, 16, 585, 21, 16, 380, 84, 2323, 16, 2826, 4952, 4672, 3536, 2844, 326, 783, 578, 864, 6350, 434, 1390, 225, 3038, 326, 1269, 1390, 487, 2898, 4591, 622, 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, 6573, 12, 4881, 16, 3538, 16, 585, 21, 16, 380, 84, 2323, 16, 2826, 4952, 4672, 3536, 2844, 326, 783, 578, 864, 6350, 434, 1390, 225, 3038, 326, 1269, 1390, 487, 2898, 4591, 622, 326, ...
def count(sub, start=0, end=-1):
def count(self, sub, start=0, end=-1):
def count(sub, start=0, end=-1): """ This runs in O(len(sub)) """ try: index(sub, start, end) return 1 except ValueError: return 0
df8b146eb0ed4ec51ea2ff8cec3b642c375153e2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5397/df8b146eb0ed4ec51ea2ff8cec3b642c375153e2/collections_.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1056, 12, 2890, 16, 720, 16, 787, 33, 20, 16, 679, 29711, 21, 4672, 3536, 1220, 7597, 316, 531, 12, 1897, 12, 1717, 3719, 3536, 775, 30, 770, 12, 1717, 16, 787, 16, 679, 13, 327, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1056, 12, 2890, 16, 720, 16, 787, 33, 20, 16, 679, 29711, 21, 4672, 3536, 1220, 7597, 316, 531, 12, 1897, 12, 1717, 3719, 3536, 775, 30, 770, 12, 1717, 16, 787, 16, 679, 13, 327, 4...
palette = dialog.getExtendedContinuousPalette("palette")
self.contPalette = palette = dialog.getExtendedContinuousPalette("palette")
def setColor(self, index=0): self.selectedSchemaIndex = index dialog = self.createColorDialog() self.colorCombo.setPalettes("palette", dialog) self.colorCombo.setCurrentIndex(self.selectedSchemaIndex) palette = dialog.getExtendedContinuousPalette("palette") unknown = dialog.getColor("unknown").rgb() underflow = dialog.getColor("underflow").rgb() overflow = dialog.getColor("overflow").rgb()
33d0959f4b506460be4561ab6d51b876cdf2524b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/33d0959f4b506460be4561ab6d51b876cdf2524b/OWDistanceMap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16207, 12, 2890, 16, 770, 33, 20, 4672, 365, 18, 8109, 3078, 1016, 273, 770, 6176, 273, 365, 18, 2640, 2957, 6353, 1435, 365, 18, 3266, 16156, 18, 542, 14320, 278, 1078, 2932, 26474, 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, 16207, 12, 2890, 16, 770, 33, 20, 4672, 365, 18, 8109, 3078, 1016, 273, 770, 6176, 273, 365, 18, 2640, 2957, 6353, 1435, 365, 18, 3266, 16156, 18, 542, 14320, 278, 1078, 2932, 26474, 3...
CppText += IndentText + "glEnd();\n" CppText += IndentText + "glLineWidth(%s);\n" % ArgText[0] CppText += IndentText + "glBegin(GL_LINES);\n"
CppText += IndentText + "if (tt_PenSize != (float) (%s))\n%s{\n" % (ArgText[0], IndentText) CppText += NextIndent + "wrapper_glFlushVertices();\n" CppText += NextIndent + "tt_PenSize = (float) (%s);\n" % ArgText[0] CppText += NextIndent + "glLineWidth(tt_PenSize);\n" CppText += IndentText + "}\n"
def GetCppBuiltInInstruction(self, pInstruct, iIndent): IndentText = " " * (iIndent * self.IndentSize) NextIndent = " " * ((iIndent+1) * self.IndentSize) NumTypeGL = self.LogoState.NumType[0] NumTypeMath = "" if self.LogoState.NumType == 'float': NumTypeMath = "f" CppText = "" # get the C++ code for each argument in this instruction ArgText = [] for arg in pInstruct.Arguments: if arg.ArgType == ParamType.LISTCODE: ArgText.append("") else: text = self.GetCppArgument(arg) if text is None: return None ArgText.append(text) # now handle the particular instruction if pInstruct.pProc.FullName == ".setspecial": # .SETSPECIAL return "" elif pInstruct.pProc.FullName == "abs": # ABS CppText += "fabs%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "and": # AND bFirst = True for argtext in ArgText: if bFirst is True: bFirst = False else: CppText += " && " CppText += "(%s)" % argtext elif pInstruct.pProc.FullName == "arctan": # ARCTAN if len(ArgText) == 1: CppText += "atan%s(%s) * tt_DegreeRad" % (NumTypeMath, ArgText[0]) else: CppText += "atan2%s(%s, %s) * tt_DegreeRad" % (NumTypeMath, ArgText[1], ArgText[0]) elif pInstruct.pProc.FullName == "array": # ARRAY CppText += "CArray<%s,1>(" % self.LogoState.NumType if len(pInstruct.Arguments) == 1: CppText += "(int) (%s), 1" % ArgText[0] else: CppText += "(int) (%s), (int) (%s)" % (ArgText[0], ArgText[1]) CppText += ")" elif pInstruct.pProc.FullName == "back": # BACK return self.GetCppBuiltinMove(IndentText, pInstruct.Arguments[0], "-") elif pInstruct.pProc.FullName == "butfirst": # BUTFIRST CppText += "%s.ButFirst()" % ArgText[0] elif pInstruct.pProc.FullName == "butlast": # BUTLAST CppText += "%s.ButLast()" % ArgText[0] elif pInstruct.pProc.FullName == "clean": # CLEAN CppText += IndentText + "wrapper_Clean();\n" elif pInstruct.pProc.FullName == "clearscreen": # CLEARSCREEN # just move to HOME position and call clean CppText += IndentText + "tt_TurtlePos[0] = tt_TurtlePos[1] = 0.5;\n" CppText += IndentText + "tt_TurtleDir = 0.0;\n" CppText += IndentText + "wrapper_Clean();\n" elif pInstruct.pProc.FullName == "cos": # COS CppText += "cos%s((%s) * tt_RadDegree)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "count": # COUNT CppText += "%s.Length()" % ArgText[0] elif pInstruct.pProc.FullName == "difference": # DIFFERENCE CppText += "(%s) - (%s)" % (ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName in ("do.while", "do.until"): # DO.WHILE, DO.UNTIL CppText += IndentText + "do {\n" for instruct in pInstruct.Arguments[0].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext if pInstruct.pProc.FullName == "do.while": CppText += IndentText + "} while (%s);\n" % ArgText[1] else: CppText += IndentText + "} while (!(%s));\n" % ArgText[1] elif pInstruct.pProc.FullName == "emptyp": # EMPTYP CppText += "%s.Length() == 0" % ArgText[0] elif pInstruct.pProc.FullName == "erasescreen": # ERASESCREEN CppText += IndentText + "wrapper_Erase();\n" elif pInstruct.pProc.FullName == "exp": # EXP CppText += "exp%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "first": # FIRST CppText += "%s[0]" % ArgText[0] elif pInstruct.pProc.FullName == "for": # FOR my_temp = self.LogoState.TempIdx self.LogoState.TempIdx += 1 varname = pInstruct.pMakeVar.CppName # write code to set the start and limit values for the FOR loop CppText += IndentText + "%s start%02i = %s;\n" % (self.LogoState.NumType, my_temp, ArgText[1]) CppText += IndentText + "%s limit%02i = %s;\n" % (self.LogoState.NumType, my_temp, ArgText[2]) # write code to set the step size if pInstruct.Arguments[3].ArgType == ParamType.NUMBER: CodeList = pInstruct.Arguments[4].Elements[0].pInstruct CppText += IndentText + "%s step%02i = %s;\n" % (self.LogoState.NumType, my_temp, ArgText[3]) else: CodeList = pInstruct.Arguments[3].Elements[0].pInstruct CppText += IndentText + "%s step%02i = start%02i <= limit%02i ? 1.0 : -1.0;\n" % (self.LogoState.NumType, my_temp, my_temp, my_temp) # now write the FOR loop CppText += IndentText + "for (%s = start%02i; (%s - limit%02i) * step%02i <= 0.0; %s += step%02i)\n" % (varname, my_temp, varname, my_temp, my_temp, varname, my_temp) CppText += IndentText + "{\n" for instruct in CodeList: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" elif pInstruct.pProc.FullName == "forever": # FOREVER my_counter = self.LogoState.LoopIdx self.LogoState.LoopIdx += 1 CppText += IndentText + "for (int loop%02i=1; ; loop%02i++)\n%s{\n" % (my_counter, my_counter, IndentText) for instruct in pInstruct.Arguments[0].Elements[0].pInstruct: self.LogoState.InnerLoopIdx = my_counter codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" self.LogoState.InnerLoopIdx = -1 elif pInstruct.pProc.FullName == "forward": # FORWARD return self.GetCppBuiltinMove(IndentText, pInstruct.Arguments[0], "+") elif pInstruct.pProc.FullName == "fput": # FPUT CppText += "CList<%s>(%s, %s)" % (self.LogoState.NumType, ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "gaussian": # GAUSSIAN CppText += "tt_Gaussian()" elif pInstruct.pProc.FullName == "goto": # GOTO CppText += IndentText + "goto tag_%s;\n" % ArgText[0][1:-1] elif pInstruct.pProc.FullName == "heading": # HEADING CppText += "(tt_TurtleDir < 0.0 ? 360.0+fmod(tt_TurtleDir,360.0) : fmod(tt_TurtleDir,360.0))" elif pInstruct.pProc.FullName == "home": # HOME CppText += IndentText + "tt_TurtlePos[0] = tt_TurtlePos[1] = 0.5;\n" CppText += IndentText + "tt_TurtleDir = 0.0;\n" elif pInstruct.pProc.FullName in ("if", "ifelse"): # IF, IFELSE CppText += IndentText + "if (%s)\n" % ArgText[0] + IndentText + "{\n" for instruct in pInstruct.Arguments[1].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext if pInstruct.pProc.FullName == "if": CppText += IndentText + "}\n" else: CppText += IndentText + "} else {\n" for instruct in pInstruct.Arguments[2].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" elif pInstruct.pProc.FullName in ("iftrue", "iffalse"): # IFTRUE, IFFALSE if pInstruct.pProc.FullName == "iftrue": CppText += IndentText + "if (tt_TestValue)\n" + IndentText + "{\n" else: CppText += IndentText + "if (!tt_TestValue)\n" + IndentText + "{\n" for instruct in pInstruct.Arguments[0].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" elif pInstruct.pProc.FullName == "int": # INT CppText += "(int) (%s)" % ArgText[0] elif pInstruct.pProc.FullName == "item": # ITEM if pInstruct.Arguments[1].ArgType == ParamType.LISTNUM: CppText += "%s[(int) (%s)-1]" % (ArgText[1], ArgText[0]) elif pInstruct.Arguments[1].ArgType == ParamType.ARRAY: CppText += "%s.Get((int) (%s))" % (ArgText[1], ArgText[0]) elif pInstruct.pProc.FullName == "label": # LABEL CppText += IndentText + "glEnd();\n" CppText += IndentText + "sprintf(tt_LabelText, \"" bFirst = True for arg in pInstruct.Arguments: if bFirst is True: bFirst = False else: CppText += " " if arg.ArgType == ParamType.QUOTEDWORD or arg.ArgType == ParamType.BOOLEAN: CppText += "%s" elif arg.ArgType == ParamType.NUMBER: CppText += "%g" else: print "Syntax error: Invalid parameter type %i (%s) in LABEL instruction." % (arg.ArgType, ParamType.Names[arg.ArgType]) return None CppText += "\"" for i in range(len(pInstruct.Arguments)): arg = pInstruct.Arguments[i] CppText += ", " if arg.ArgType == ParamType.QUOTEDWORD: CppText += ArgText[i] elif arg.ArgType == ParamType.NUMBER: CppText += "(double) (%s)" % ArgText[i] elif arg.ArgType == ParamType.BOOLEAN: CppText += '(%s) ? "True" : "False"' % ArgText[i] CppText += ");\n" CppText += IndentText + "DrawPointText(tt_Font, tt_JustifyVert, tt_JustifyHorz, tt_FontHeight, tt_TurtlePos[0], tt_TurtlePos[1], tt_LabelText);\n" CppText += IndentText + "glBegin(GL_LINES);\n" elif pInstruct.pProc.FullName == "last": # LAST CppText += "%s.Last()" % ArgText[0] elif pInstruct.pProc.FullName == "left": # LEFT CppText += IndentText + "tt_TurtleDir -= %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "list": # LIST CppText += "CList<%s>(" % self.LogoState.NumType if len(pInstruct.Arguments) <= 4: for i in range(len(pInstruct.Arguments)): if i != 0: CppText += ", " CppText += ArgText[i] else: CppText += "%i" % len(pInstruct.Arguments) for i in range(len(pInstruct.Arguments)): CppText += ", (double) %s" % ArgText[i] CppText += ")" elif pInstruct.pProc.FullName == "ln": # LN CppText += "log%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName in ("localmake", "make"): # LOCALMAKE, MAKE CppText += IndentText + pInstruct.pMakeVar.CppName + " = " + ArgText[1] + ";\n" elif pInstruct.pProc.FullName == "log10": # LOG10 CppText += "log10%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "lput": # FPUT CppText += "CList<%s>(%s, %s)" % (self.LogoState.NumType, ArgText[1], ArgText[0]) elif pInstruct.pProc.FullName == "mdarray": # MDARRAY if pInstruct.ReturnArrayDim is None: print "Internal error: unknown array dimensions for 'MDARRAY %s'" % ArgText[0] return None if pInstruct.ReturnArrayDim < 2 or pInstruct.ReturnArrayDim > 3: print "Logical error: MDARRAY cannot create an array with %i dimensions" % pInstruct.ReturnArrayDim return None listargtext = self.GetCppListnumExpansion(pInstruct.Arguments[0], pInstruct.ReturnArrayDim, "MDARRAY") if listargtext == None: return None CppText += "CArray<%s,%i>(%s)" % (self.LogoState.NumType, pInstruct.ReturnArrayDim, listargtext) elif pInstruct.pProc.FullName == "mditem": # MDITEM if pInstruct.Arguments[1].Elements[0].Type != ElemType.VAR_VALUE: print "Syntax error: MDITEM requires a variable for the array input, but '%s' was given" % pInstruct.Arguments[1].Elements[0].Text return None ArrayDim = pInstruct.Arguments[1].Elements[0].pVariable.ArrayDim if ArrayDim < 2: print "Logical error: Array '%s' in MDITEM instruction has fewer than 2 dimensions" % pInstruct.Arguments[1].Elements[0].Text return None listargtext = self.GetCppListnumExpansion(pInstruct.Arguments[0], ArrayDim, "MDITEM") if listargtext == None: return None CppText += "%s.Get(%s)" % (ArgText[1], listargtext) elif pInstruct.pProc.FullName == "mdsetitem": # MDSETITEM if pInstruct.Arguments[1].Elements[0].Type != ElemType.VAR_VALUE: print "Syntax error: MDSETITEM requires a variable for the array input, but '%s' was given" % pInstruct.Arguments[1].Elements[0].Text return None ArrayDim = pInstruct.Arguments[1].Elements[0].pVariable.ArrayDim if ArrayDim < 2: print "Logical error: Array '%s' in MDSETITEM instruction has fewer than 2 dimensions" % pInstruct.Arguments[1].Elements[0].Text return None listargtext = self.GetCppListnumExpansion(pInstruct.Arguments[0], ArrayDim, "MDSETITEM") if listargtext == None: return None CppText += IndentText + "%s.Set(%s, %s);\n" % (ArgText[1], ArgText[2], listargtext) elif pInstruct.pProc.FullName == "minus": # MINUS CppText += "-(%s)" % ArgText[0] elif pInstruct.pProc.FullName == "not": # NOT CppText += "!(%s)" % ArgText[0] elif pInstruct.pProc.FullName == "or": # OR bFirst = True for argtext in ArgText: if bFirst is True: bFirst = False else: CppText += " || " CppText += "(%s)" % argtext elif pInstruct.pProc.FullName == "output": # OUTPUT CppText += IndentText + "return %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "penup": # PENUP CppText += IndentText + "tt_PenDown = false;\n" elif pInstruct.pProc.FullName == "pendown": # PENDOWN CppText += IndentText + "tt_PenDown = true;\n" elif pInstruct.pProc.FullName == "penerase": # PENERASE CppText += IndentText + "tt_PenPaint = false;\n" CppText += IndentText + "glColor3ubv(tt_ColorBackground);\n" elif pInstruct.pProc.FullName == "penpaint": # PENPAINT CppText += IndentText + "tt_PenPaint = true;\n" CppText += IndentText + "glColor3ubv(tt_ColorPen);\n" elif pInstruct.pProc.FullName == "pick": # PICK CppText += "%s.Pick()" % ArgText[0] elif pInstruct.pProc.FullName == "pos": # POS CppText += "CList<%s>(tt_TurtlePos[0], tt_TurtlePos[1])" % self.LogoState.NumType elif pInstruct.pProc.FullName == "power": # POWER CppText += "pow%s(%s, %s)" % (NumTypeMath, ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "product": # PRODUCT CppText += "(%s)" % ArgText[0] for argtext in ArgText[1:]: CppText += " * (%s)" % argtext elif pInstruct.pProc.FullName == "quotient": # QUOTIENT if len(ArgText) == 1: CppText += "1.0 / (%s)" % ArgText[0] else: CppText += "(%s) / (%s)" % (ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "radarctan": # RADARCTAN if len(ArgText) == 1: CppText += "atan%s(%s)" % (NumTypeMath, ArgText[0]) else: CppText += "atan2%s(%s, %s)" % (NumTypeMath, ArgText[1], ArgText[0]) elif pInstruct.pProc.FullName == "radcos": # RADCOS CppText += "cos%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "radsin": # RADSIN CppText += "sin%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "random": # RANDOM if len(ArgText) == 1: CppText += "tt_Random((int) (%s))" % ArgText[0] else: CppText += "tt_Random((int) (%s), (int) (%s))" % (ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "remainder": # REMAINDER CppText += "(int) (%s) %% (int) (%s)" % (ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "repcount": # REPCOUNT if self.LogoState.InnerLoopIdx == -1: print "Syntax error: REPCOUNT instruction used outside of a FOREVER or REPEAT loop" return None CppText += "loop%02i" % self.LogoState.InnerLoopIdx elif pInstruct.pProc.FullName == "repeat": # REPEAT my_counter = self.LogoState.LoopIdx self.LogoState.LoopIdx += 1 CppText += IndentText + "for (int loop%02i=1; loop%02i <= %s; loop%02i++)\n" % (my_counter, my_counter, ArgText[0], my_counter) CppText += IndentText + "{\n" for instruct in pInstruct.Arguments[1].Elements[0].pInstruct: self.LogoState.InnerLoopIdx = my_counter codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" self.LogoState.InnerLoopIdx = -1 elif pInstruct.pProc.FullName == "rerandom": # RERANDOM if len(ArgText) == 0: CppText += IndentText + "srand(0);\n" else: CppText += IndentText + "srand((int) (%s));\n" % ArgText[0] elif pInstruct.pProc.FullName == "reverse": # REVERSE CppText += "%s.Reverse()" % ArgText[0] elif pInstruct.pProc.FullName == "right": # RIGHT CppText += IndentText + "tt_TurtleDir += %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "round": # ROUND CppText += "round%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "setbackground": # SETBACKGROUND codetext = self.GetCppBuiltinSetColor(IndentText, pInstruct.Arguments[0], "tt_ColorBackground") if codetext is None: return None CppText += codetext CppText += IndentText + "if (tt_PenPaint == false)\n" CppText += IndentText + " " * self.IndentSize + "glColor3ubv(tt_ColorBackground);\n" elif pInstruct.pProc.FullName == "setfont": # SETFONT CppText += IndentText + "tt_Font = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setfontheight": # SETFONTHEIGHT CppText += IndentText + "tt_FontHeight = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setheading": # SETHEADING CppText += IndentText + "tt_TurtleDir = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setitem": # SETITEM if pInstruct.Arguments[1].Elements[0].Type != ElemType.VAR_VALUE: print "Syntax error: destination array for SETITEM instruction can only be a variable" return None if pInstruct.Arguments[1].Elements[0].pVariable.ArrayDim != 1: print "Logical error: Array '%s' in SETITEM instruction is not 1-dimensional" % pInstruct.Arguments[1].Elements[0].Text return None CppText += IndentText + "%s.Set(%s, (int) (%s));\n" % (ArgText[1], ArgText[2], ArgText[0]) elif pInstruct.pProc.FullName == "setjustifyvert": # SETJUSTIFYVERT CppText += IndentText + "tt_JustifyVert = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setjustifyhorz": # SETJUSTIFYHORZ CppText += IndentText + "tt_JustifyHorz = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setpencolor": # SETPENCOLOR codetext = self.GetCppBuiltinSetColor(IndentText, pInstruct.Arguments[0], "tt_ColorPen") if codetext is None: return None CppText += codetext CppText += IndentText + "if (tt_PenPaint == true)\n" CppText += NextIndent + "glColor3ubv(tt_ColorPen);\n" elif pInstruct.pProc.FullName == "setpensize": # SETPENSIZE CppText += IndentText + "glEnd();\n" CppText += IndentText + "glLineWidth(%s);\n" % ArgText[0] CppText += IndentText + "glBegin(GL_LINES);\n" elif pInstruct.pProc.FullName == "setpos": # SETPOS Arg = pInstruct.Arguments[0] elem0type = Arg.Elements[0].Type UpdateTurtle = "" if elem0type == ElemType.NUMBER: if len(Arg.Elements) != 2: print "Syntax error: SETPOS instruction takes an immediate list with exactly 2 numbers, but %i were given." % len(Arg.Elements) return None for i in range(2): UpdateTurtle += NextIndent + "tt_TurtlePos[%i] = %s;\n" % (i, Arg.Elements[i].Text) elif elem0type == ElemType.VAR_VALUE: UpdateTurtle += NextIndent + "tt_TurtlePos[0] = %s[0];\n" % (Arg.Elements[0].pVariable.CppName) UpdateTurtle += NextIndent + "tt_TurtlePos[1] = %s[1];\n" % (Arg.Elements[0].pVariable.CppName) elif elem0type == ElemType.FUNC_CALL: my_temp = self.LogoState.TempIdx self.LogoState.TempIdx += 1 codetext = self.GetCppInstruction(Arg.Elements[0].pInstruct, 0, False) if codetext is None: return None UpdateTurtle += NextIndent + "CList<%s> templist%02i = %s;\n" % (self.LogoState.NumType, my_temp, codetext) UpdateTurtle += NextIndent + "tt_TurtlePos[0] = templist%02i[0];\n" % my_temp UpdateTurtle += NextIndent + "tt_TurtlePos[1] = templist%02i[1];\n" % my_temp else: print "Internal error: invalid element type %i '%s' in a List argument for SETPOS." % (elem0type, ElemType.Names[elem0type]) return None CppText += self.GetCppBuiltinJump(IndentText, UpdateTurtle) elif pInstruct.pProc.FullName == "setscrunch": # SETSCRUNCH CppText += IndentText + "tt_ScrunchXY[0] = %s;\n" % ArgText[0] CppText += IndentText + "tt_ScrunchXY[1] = %s;\n" % ArgText[1] elif pInstruct.pProc.FullName == "setxy": # SETXY UpdateTurtle = NextIndent + "tt_TurtlePos[0] = %s;\n" % ArgText[0] UpdateTurtle += NextIndent + "tt_TurtlePos[1] = %s;\n" % ArgText[1] CppText += self.GetCppBuiltinJump(IndentText, UpdateTurtle) elif pInstruct.pProc.FullName == "setx": # SETX UpdateTurtle = NextIndent + "tt_TurtlePos[0] = %s;\n" % ArgText[0] CppText += self.GetCppBuiltinJump(IndentText, UpdateTurtle) elif pInstruct.pProc.FullName == "sety": # SETY UpdateTurtle = NextIndent + "tt_TurtlePos[1] = %s;\n" % ArgText[0] CppText += self.GetCppBuiltinJump(IndentText, UpdateTurtle) elif pInstruct.pProc.FullName == "sin": # SIN CppText += "sin%s((%s) * tt_RadDegree)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "sqrt": # SQRT CppText += "sqrt%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "stop": # STOP CppText += IndentText + "return;\n" elif pInstruct.pProc.FullName == "sum": # SUM CppText += "(%s)" % ArgText[0] for argtext in ArgText[1:]: CppText += " + (%s)" % argtext elif pInstruct.pProc.FullName == "tag": # TAG CppText += "tag_%s:\n" % ArgText[0][1:-1] elif pInstruct.pProc.FullName == "test": # TEST CppText += IndentText + "tt_TestValue = (bool) (%s);\n" % ArgText[0] elif pInstruct.pProc.FullName == "towards": # TOWARDS Arg = pInstruct.Arguments[0] elem0type = Arg.Elements[0].Type if elem0type == ElemType.NUMBER: if len(Arg.Elements) != 2: print "Syntax error: TOWARDS instruction takes an immediate list with exactly 2 numbers, but %i were given." % len(Arg.Elements) return None CppText += "(atan2(%s - tt_TurtlePos[0], %s - tt_TurtlePos[1])*tt_DegreeRad)" % (Arg.Elements[0].Text, Arg.Elements[1].Text) elif elem0type == ElemType.VAR_VALUE: CppText += "tt_Towards(%s)" % Arg.Elements[0].pVariable.CppName elif elem0type == ElemType.FUNC_CALL: codetext = self.GetCppInstruction(Arg.Elements[0].pInstruct, 0, False) if codetext is None: return None CppText += "tt_Towards(%s)" % codetext else: print "Internal error: invalid element type %i '%s' in a List argument for TOWARDS." % (elem0type, ElemType.Names[elem0type]) return None elif pInstruct.pProc.FullName == "wait": # WAIT CppText += IndentText + "SDL_Delay((int) ((%s) * 1000 / 60));\n" % ArgText[0] elif pInstruct.pProc.FullName in ("while", "until"): # WHILE, UNTIL if pInstruct.pProc.FullName == "while": CppText += IndentText + "while (%s) {\n" % ArgText[0] else: CppText += IndentText + "while (!(%s)) {\n" % ArgText[0] for instruct in pInstruct.Arguments[1].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" elif pInstruct.pProc.FullName == "window": # WINDOW CppText += IndentText + "tt_UseWrap = false;\n" elif pInstruct.pProc.FullName == "wrap": # WRAP CppText += IndentText + "tt_UseWrap = true;\n" elif pInstruct.pProc.FullName == "xcor": # XCOR CppText += "tt_TurtlePos[0]" elif pInstruct.pProc.FullName == "ycor": # YCOR CppText += "tt_TurtlePos[1]" else: print "Internal error: built-in instruction named '%s' is not implemented" % pInstruct.Name return None return CppText
bababbffcfffb2cb7b8c7a966a17e88685da5c1d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2419/bababbffcfffb2cb7b8c7a966a17e88685da5c1d/tt_cppwriter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 39, 11858, 16409, 382, 11983, 12, 2890, 16, 293, 382, 1697, 16, 277, 7790, 4672, 28653, 1528, 273, 315, 315, 380, 261, 77, 7790, 380, 365, 18, 7790, 1225, 13, 4804, 7790, 273, 315...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 39, 11858, 16409, 382, 11983, 12, 2890, 16, 293, 382, 1697, 16, 277, 7790, 4672, 28653, 1528, 273, 315, 315, 380, 261, 77, 7790, 380, 365, 18, 7790, 1225, 13, 4804, 7790, 273, 315...
d = (np.dot(q.reshape(-1), self.Ho)).reshape(-1,3)
d = (q.reshape(-1)* self.Ho).reshape(-1,3)
def update(self, r, f, r_old, f_old): a = np.zeros(self.memory + 1, 'd') self.tmp = self.atoms if not self.ITR: self.ITR = 1 self.s = [1.] # The 0'th element is not actually used # The point is to use 1-indexation self.y = [1.] self.rho = [1.] else: a1 = abs (np.vdot(f, f_old)) a2 = np.vdot(f_old, f_old) reset_flag = self.check_for_reset(a1, a2) if not reset_flag: ITR = self.ITR if(ITR > self.memory): self.s.pop(1) self.y.pop(1) self.rho.pop(1) ITR = self.memory self.s.append(r - r_old) self.y.append(-(f - f_old)) self.rho.append(1 / np.vdot(self.y[ITR],self.s[ITR])) self.ITR += 1 else: self.ITR = 1 self.s = [1.] self.y = [1.] self.rho = [1.] self.dump((self.ITR, self.s, self.y, self.rho, r_old, f_old)) r_old = r.copy() f_old = f.copy() if self.ITR <= self.memory: BOUND = self.ITR else: BOUND = self.memory q = -1.0 * f for j in range(1,BOUND): k = (BOUND - j) a[k] = self.rho[k] * np.vdot(self.s[k], q) q -= a[k] * self.y[k] d = (np.dot(q.reshape(-1), self.Ho)).reshape(-1,3) #d = self.Ho * q for j in range(1,BOUND): B = self.rho[j] * np.vdot(self.y[j], d) d = d + self.s[j] * (a[j] - B) self.d = -1.0 * d
3b8a479a1213ddf0aa0f4ea71d26373fec347d2a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5572/3b8a479a1213ddf0aa0f4ea71d26373fec347d2a/lbfgs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 16, 436, 16, 284, 16, 436, 67, 1673, 16, 284, 67, 1673, 4672, 279, 273, 1130, 18, 22008, 12, 2890, 18, 7858, 397, 404, 16, 296, 72, 6134, 365, 18, 5645, 273, 365, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 16, 436, 16, 284, 16, 436, 67, 1673, 16, 284, 67, 1673, 4672, 279, 273, 1130, 18, 22008, 12, 2890, 18, 7858, 397, 404, 16, 296, 72, 6134, 365, 18, 5645, 273, 365, 1...
if err.errno == errno.ECONNREFUSED:
if err[0] == errno.ECONNREFUSED:
def test_get_memory_info(self): ip = "127.0.0.1" port = find_unused_port() # open a socket accepting connections; once connection takes # place allocates some memory and send some data arg = "import socket;" \ "sock = socket.socket();" \ "sock.bind(('%s', %s));" %(ip, port) + \ "sock.listen(1);" \ "conn, addr = sock.accept();" \ "string = 's' * 1024000;" \ "conn.sendall('sentinel - memory allocated');" \ "raw_input();" self.proc = subprocess.Popen([PYTHON, "-c", arg], stdout=DEVNULL) wait_for_pid(self.proc.pid) p = psutil.Process(self.proc.pid)
195c492bff7cc339c0390f2b8da91e3117503e8b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7296/195c492bff7cc339c0390f2b8da91e3117503e8b/test_psutil.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 588, 67, 7858, 67, 1376, 12, 2890, 4672, 2359, 273, 315, 14260, 18, 20, 18, 20, 18, 21, 6, 1756, 273, 1104, 67, 14375, 67, 655, 1435, 468, 1696, 279, 2987, 25806, 5921, 31,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 588, 67, 7858, 67, 1376, 12, 2890, 4672, 2359, 273, 315, 14260, 18, 20, 18, 20, 18, 21, 6, 1756, 273, 1104, 67, 14375, 67, 655, 1435, 468, 1696, 279, 2987, 25806, 5921, 31,...
Subwidgets Class ---------- ----- label Label frame Frame"""
Subwidgets Class ---------- ----- label Label frame Frame"""
def __init__ (self,master=None,cnf={}, **kw):
86af7ef7e3f4448abc89aa941517a84075d99a38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/86af7ef7e3f4448abc89aa941517a84075d99a38/Tix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 7525, 33, 7036, 16, 10305, 74, 28793, 2826, 9987, 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,...
[ 1, 1, 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, 1001, 2738, 972, 261, 2890, 16, 7525, 33, 7036, 16, 10305, 74, 28793, 2826, 9987, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return "cannot use -d with -i or -o"
return "cannot use "+flag+" with -i or -o"
def change(ui, repo, *pats, **opts): """create or edit a change list Create or edit a change list. A change list is a group of files to be reviewed and submitted together, plus a textual description of the change. Change lists are referred to by simple alphanumeric names. Changes must be reviewed before they can be submitted. In the absence of options, the change command opens the change list for editing in the default editor. """ dirty = {} if len(pats) > 0 and GoodCLName(pats[0]): name = pats[0] if len(pats) != 1: return "cannot specify CL name and file patterns" pats = pats[1:] cl, err = LoadCL(ui, repo, name, web=True) if err != '': return err if not cl.local and (opts["stdin"] or not opts["stdout"]): return "cannot change non-local CL " + name else: name = "new" cl = CL("new") dirty[cl] = True files = ChangedFiles(ui, repo, pats, opts) taken = TakenFiles(ui, repo) files = Sub(files, taken) if opts["delete"]: if name == "new": return "cannot use -d with file patterns" if opts["stdin"] or opts["stdout"]: return "cannot use -d with -i or -o" if not cl.local: return "cannot change non-local CL " + name PostMessage(cl.name, "*** Abandoned ***", send_mail="checked") EditDesc(cl.name, closed="checked") cl.Delete(ui, repo) return if opts["stdin"]: s = sys.stdin.read() clx, line, err = ParseCL(s, name) if err != '': return "error parsing change list: line %d: %s" % (line, err) if clx.desc is not None: cl.desc = clx.desc; dirty[cl] = True if clx.reviewer is not None: cl.reviewer = clx.reviewer dirty[cl] = True if clx.cc is not None: cl.cc = clx.cc dirty[cl] = True if clx.files is not None: cl.files = clx.files dirty[cl] = True if not opts["stdin"] and not opts["stdout"]: if name == "new": cl.files = files err = EditCL(ui, repo, cl) if err != "": return err dirty[cl] = True for d, _ in dirty.items(): d.Flush(ui, repo) if opts["stdout"]: ui.write(cl.EditorText()) elif name == "new": if ui.quiet: ui.write(cl.name) else: ui.write("CL created: " + cl.url + "\n") return
552488c0a2c9ad31e3e6aba82b8e2a038e34c4ef /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5761/552488c0a2c9ad31e3e6aba82b8e2a038e34c4ef/codereview.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2549, 12, 4881, 16, 3538, 16, 380, 84, 2323, 16, 2826, 4952, 4672, 3536, 2640, 578, 3874, 279, 2549, 666, 225, 1788, 578, 3874, 279, 2549, 666, 18, 432, 2549, 666, 353, 279, 1041, 434,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2549, 12, 4881, 16, 3538, 16, 380, 84, 2323, 16, 2826, 4952, 4672, 3536, 2640, 578, 3874, 279, 2549, 666, 225, 1788, 578, 3874, 279, 2549, 666, 18, 432, 2549, 666, 353, 279, 1041, 434,...
plot(getinjpar(injection,4),getinjpar(injection,8),'go')
plot(getinjpar(injection,4),getinjpar(injection,8),'go',scalex=False,scaley=False)
def plot2Dkernel(xdat,ydat,Nx,Ny): xax=linspace(min(xdat),max(xdat),Nx) yax=linspace(min(ydat),max(ydat),Ny) x,y=numpy.meshgrid(xax,yax) samp=array([xdat,ydat]) kde=stats.kde.gaussian_kde(samp) grid_coords = numpy.append(x.reshape(-1,1),y.reshape(-1,1),axis=1) z = kde(grid_coords.T) z = z.reshape(Nx,Ny) asp=xax.ptp()/yax.ptp()
1c7e777c94d676d98831f95002598d58404c4fe8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/1c7e777c94d676d98831f95002598d58404c4fe8/OddsPostProc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3207, 22, 40, 8111, 12, 92, 3404, 16, 93, 3404, 16, 50, 92, 16, 50, 93, 4672, 619, 651, 33, 80, 15738, 12, 1154, 12, 92, 3404, 3631, 1896, 12, 92, 3404, 3631, 50, 92, 13, 677, 65...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3207, 22, 40, 8111, 12, 92, 3404, 16, 93, 3404, 16, 50, 92, 16, 50, 93, 4672, 619, 651, 33, 80, 15738, 12, 1154, 12, 92, 3404, 3631, 1896, 12, 92, 3404, 3631, 50, 92, 13, 677, 65...
f = _open(self._datfile, 'w')
f = _open(self._datfile, 'w', self._mode)
def __init__(self, file): self._dirfile = file + _os.extsep + 'dir' self._datfile = file + _os.extsep + 'dat' self._bakfile = file + _os.extsep + 'bak' # Mod by Jack: create data file if needed try: f = _open(self._datfile, 'r') except IOError: f = _open(self._datfile, 'w') f.close() self._update()
9a4db735787248d7f31c0dc487c69422200a5b4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9a4db735787248d7f31c0dc487c69422200a5b4a/dumbdbm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 585, 4672, 365, 6315, 1214, 768, 273, 585, 397, 389, 538, 18, 408, 10814, 397, 296, 1214, 11, 365, 6315, 3404, 768, 273, 585, 397, 389, 538, 18, 408, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 585, 4672, 365, 6315, 1214, 768, 273, 585, 397, 389, 538, 18, 408, 10814, 397, 296, 1214, 11, 365, 6315, 3404, 768, 273, 585, 397, 389, 538, 18, 408, 1...
MagInsideRe = 9999
AvgMagInsideRe = 9999
def bfunc(x): """ This function gives value of b_n given the Sersic index""" return 0.868242*x -0.142058 # Khosroshahi et al. 2000 approximation
d866044f44b87f5a6f30f0d6f8623f92f577f91b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8867/d866044f44b87f5a6f30f0d6f8623f92f577f91b/writehtmlfunc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 324, 644, 12, 92, 4672, 3536, 1220, 445, 14758, 460, 434, 324, 67, 82, 864, 326, 348, 414, 335, 770, 8395, 327, 374, 18, 5292, 28, 3247, 22, 14, 92, 300, 20, 18, 3461, 3462, 8204, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 324, 644, 12, 92, 4672, 3536, 1220, 445, 14758, 460, 434, 324, 67, 82, 864, 326, 348, 414, 335, 770, 8395, 327, 374, 18, 5292, 28, 3247, 22, 14, 92, 300, 20, 18, 3461, 3462, 8204, ...
s.putS(otsu, dims, org, i2r, 'otsu')
tmp= 'otsu_' + dateT s.putS(otsu, dims, org, i2r, tmp)
def pipeline(self, data):
ceadca5dbd9521ee74d7149cac4f8ecaae8eecbc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12580/ceadca5dbd9521ee74d7149cac4f8ecaae8eecbc/PyPipelineServer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5873, 12, 2890, 16, 501, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5873, 12, 2890, 16, 501, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
from twisted.internet import ssl contextFactory = ssl.ClientContextFactory() blocking_call_from_thread(reactor.connectSSL, self.server, self.port, self.factory, contextFactory)
from gnutls.interfaces.twisted import X509Credentials cred = X509Credentials() blocking_call_from_thread(reactor.connectTLS, self.server, self.port, self.factory, cred)
def connect(self): """ This methods establishes the conection to the remote server.
07daa8964f967bb9247b50df102a110dfa699831 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/07daa8964f967bb9247b50df102a110dfa699831/dsage_interface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3077, 12, 2890, 4672, 3536, 1220, 2590, 18312, 281, 326, 356, 794, 358, 326, 2632, 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, ...
[ 1, 1, 1, 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, 3077, 12, 2890, 4672, 3536, 1220, 2590, 18312, 281, 326, 356, 794, 358, 326, 2632, 1438, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
backupfile = backupfile[:-len(file_extension)]+counter+file_extension
backupfile = backupfile[:-len(file_extension)]+str(counter)+file_extension
def backup(filelist, file_extension, backup_path = "backup", should_archive = True, archive_path = "archive"): """ Back up all files in a file list, dumping them into the backup path directory arguments: filelist, the list of files to be backed up (absolute file path) backup_path, the relative directory to copy the files. Default: "backup" directory """ if not os.path.isdir(backup_path): os.mkdir(backup_path) if should_archive: # Archiving mechanism so that backups will not be continuously overwritten backup_entries = os.listdir(backup_path) if backup_entries: if not os.path.isdir(archive_path): # Does the archive path exist? os.mkdir(archive_path) curr_archive = os.path.join(archive_path,backup_path) # Start with archive/backup/ else: # If archive/backup/ exists, create archive/backupN where N is unique in the archive folder # Heuristic: N is the number of items in the archive path curr_archive = os.path.join(archive_path,backup_path+str(len(os.listdir(archive_path)))) if os.path.exists(curr_archive): # If archive path collision heuristic fails... print "Warning:",curr_archive,"exists! Renaming archive's folders..." # Plan A # If the path exists, rename every path in the archive directory to conform to heuristic # i.e. folder0 = backup, folder1 = backup1, etc archive_files = os.listdir(archive_path) archive_files.sort() # Set directory all the subsequent folder renamings are derived from rename_root = os.path.join(archive_path,backup_path) for x in range(len(os.listdir(archive_path))): old_path = os.path.join(archive_path,archive_files[x]) new_path = rename_root if x != 0: new_path = new_path + str(x) if old_path != new_path: os.rename(old_path,new_path) # Plan B: Give up. if os.path.exists(curr_archive): print "Error: Folder",curr_archive,"already exists and script cannot resolve the problem." print "Quitting script..." sys.exit() os.mkdir(curr_archive) [shutil.copy2(os.path.join(backup_path,x),os.path.join(curr_archive,x)) for x in backup_entries] [os.remove(os.path.join(backup_path,x)) for x in backup_entries] inventory = [] # used to check if there are any backup collisions MAX_N_CHECKS = 100 for x in filelist: backupfile = os.path.join(backup_path,os.path.basename(x)) counter = 0 # This junky loop resolves backup file collisions. # Tries renaming file.dae as file#.dae, where # is in [0,MAX_N_CHECKS) while backupfile in inventory and counter < MAX_N_CHECKS: backupfile = backupfile[:-len(file_extension)]+counter+file_extension counter = counter + 1 if counter == MAX_N_CHECKS: print "Warning: Couldn't find a unique file ID in",MAX_N_CHECKS,"tries for", backupfile # copy original file to backup file location shutil.copy2(x,backupfile) inventory.append(backupfile)
afe823fdcbb724b0945aca0d39ca6842434ccb6e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11176/afe823fdcbb724b0945aca0d39ca6842434ccb6e/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5114, 12, 7540, 5449, 16, 585, 67, 6447, 16, 5114, 67, 803, 273, 315, 9572, 3113, 1410, 67, 10686, 273, 1053, 16, 5052, 67, 803, 273, 315, 10686, 6, 4672, 3536, 4297, 731, 777, 1390, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5114, 12, 7540, 5449, 16, 585, 67, 6447, 16, 5114, 67, 803, 273, 315, 9572, 3113, 1410, 67, 10686, 273, 1053, 16, 5052, 67, 803, 273, 315, 10686, 6, 4672, 3536, 4297, 731, 777, 1390, ...
if cfp: cfp.close()
def load_network(self, filename): """Given a filename, read it as a DVN file and return a tuple with (pmsDict, connectionList, glyphPosDict) if successful. If not successful, an exception will be raised.
bc90c85f3b9a8a64eaf9d53d5160b2a32d03aa33 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4494/bc90c85f3b9a8a64eaf9d53d5160b2a32d03aa33/network_manager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 5185, 12, 2890, 16, 1544, 4672, 3536, 6083, 279, 1544, 16, 855, 518, 487, 279, 463, 58, 50, 585, 471, 327, 279, 3193, 598, 261, 84, 959, 5014, 16, 1459, 682, 16, 9440, 1616...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 5185, 12, 2890, 16, 1544, 4672, 3536, 6083, 279, 1544, 16, 855, 518, 487, 279, 463, 58, 50, 585, 471, 327, 279, 3193, 598, 261, 84, 959, 5014, 16, 1459, 682, 16, 9440, 1616...
return [outshp]
return [outshp]
def infer_shape(self, node, input_shapes): imshp = input_shapes[0] kshp = input_shapes[1]
aaea1d322c657ba643c240526cb3f00d5d2d997d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/aaea1d322c657ba643c240526cb3f00d5d2d997d/conv.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12455, 67, 4867, 12, 2890, 16, 756, 16, 810, 67, 17648, 4672, 709, 674, 84, 273, 810, 67, 17648, 63, 20, 65, 417, 674, 84, 273, 810, 67, 17648, 63, 21, 65, 2, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12455, 67, 4867, 12, 2890, 16, 756, 16, 810, 67, 17648, 4672, 709, 674, 84, 273, 810, 67, 17648, 63, 20, 65, 417, 674, 84, 273, 810, 67, 17648, 63, 21, 65, 2, -100, -100, -100, -10...
from distutils.fancy_getopt import longopt_xlate print msg + ":" for opt in self.user_options: opt_name = opt[0] if opt_name[-1] == "=": opt_name = opt_name[0:-1] opt_name = string.translate (opt_name, longopt_xlate) val = getattr (self, opt_name) print " %s: %s" % (opt_name, val)
if DEBUG: from distutils.fancy_getopt import longopt_xlate print msg + ":" for opt in self.user_options: opt_name = opt[0] if opt_name[-1] == "=": opt_name = opt_name[0:-1] opt_name = string.translate (opt_name, longopt_xlate) val = getattr (self, opt_name) print " %s: %s" % (opt_name, val)
def dump_dirs (self, msg): from distutils.fancy_getopt import longopt_xlate print msg + ":" for opt in self.user_options: opt_name = opt[0] if opt_name[-1] == "=": opt_name = opt_name[0:-1] opt_name = string.translate (opt_name, longopt_xlate) val = getattr (self, opt_name) print " %s: %s" % (opt_name, val)
6fb6de4e077df187fc919e444cdbe6c1700aac4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6fb6de4e077df187fc919e444cdbe6c1700aac4f/install.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 67, 8291, 261, 2890, 16, 1234, 4672, 628, 2411, 5471, 18, 74, 12514, 67, 588, 3838, 1930, 1525, 3838, 67, 18402, 340, 1172, 1234, 397, 6153, 364, 2153, 316, 365, 18, 1355, 67, 21...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 67, 8291, 261, 2890, 16, 1234, 4672, 628, 2411, 5471, 18, 74, 12514, 67, 588, 3838, 1930, 1525, 3838, 67, 18402, 340, 1172, 1234, 397, 6153, 364, 2153, 316, 365, 18, 1355, 67, 21...
monthes_match = '' for month_name in self._monthes.keys(): monthes_match = monthes_match + month_name + '|' monthes_match = r'\b(' + monthes_match[0:-1] + r')\b' return monthes_match
months_match = '' for month_name in self._months.keys(): months_match = months_match + month_name + '|' months_match = r'\b(' + months_match[0:-1] + r')\b' return months_match
def _get_month_names_match(self): """Retruns part of a patter that matches month in a date"""
7d8dc154ff7d7f300975482f7a4589aa11b83f8d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2139/7d8dc154ff7d7f300975482f7a4589aa11b83f8d/search_engine_query_parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 7496, 67, 1973, 67, 1916, 12, 2890, 4672, 3536, 7055, 20152, 1087, 434, 279, 293, 9293, 716, 1885, 3138, 316, 279, 1509, 8395, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 7496, 67, 1973, 67, 1916, 12, 2890, 4672, 3536, 7055, 20152, 1087, 434, 279, 293, 9293, 716, 1885, 3138, 316, 279, 1509, 8395, 2, -100, -100, -100, -100, -100, -100, -100, ...
res['value'].update({'purchase_price': purchase_price})
res['value'].update({'purchase_price': purchase_price * rate})
def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False): res = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty=qty, uom=uom, qty_uos=qty_uos, uos=uos, name=name, partner_id=partner_id, lang=lang, update_tax=update_tax, date_order=date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag) if product: purchase_price = self.pool.get('product.product').browse(cr, uid, product).standard_price res['value'].update({'purchase_price': purchase_price}) return res
69c31f245b86f2a9eee5c3f2bad9c1ab458210f8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/69c31f245b86f2a9eee5c3f2bad9c1ab458210f8/sale_margin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3017, 67, 350, 67, 3427, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 846, 335, 5449, 16, 3017, 16, 26667, 33, 20, 16, 582, 362, 33, 8381, 16, 26667, 67, 89, 538, 33, 20, 16, 582, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3017, 67, 350, 67, 3427, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 846, 335, 5449, 16, 3017, 16, 26667, 33, 20, 16, 582, 362, 33, 8381, 16, 26667, 67, 89, 538, 33, 20, 16, 582, ...
role = endmatch.group(suffix)[1:-1]
role = endmatch.group('suffix')[1:-1]
def interpreted(self, before, after, endmatch, role, position, lineno, escaped, rawsource, text): suffix = self.groups.interpreted_or_phrase_ref.suffix if endmatch.group(suffix): if role: msg = self.reporter.warning('Multiple roles in interpreted ' 'text at line %s.' % lineno) return (before + rawsource, [], after, [msg]) role = endmatch.group(suffix)[1:-1] position = 'suffix' if role: atts = {'role': role, 'position': position} else: atts = {} return before, [nodes.interpreted(rawsource, text, **atts)], after, []
72a0c19a34dcc90353f2d799116ebcadd510f22a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/72a0c19a34dcc90353f2d799116ebcadd510f22a/states.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19898, 12, 2890, 16, 1865, 16, 1839, 16, 679, 1916, 16, 2478, 16, 1754, 16, 7586, 16, 8345, 16, 1831, 3168, 16, 977, 4672, 3758, 273, 365, 18, 4650, 18, 24713, 329, 67, 280, 67, 9429...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19898, 12, 2890, 16, 1865, 16, 1839, 16, 679, 1916, 16, 2478, 16, 1754, 16, 7586, 16, 8345, 16, 1831, 3168, 16, 977, 4672, 3758, 273, 365, 18, 4650, 18, 24713, 329, 67, 280, 67, 9429...
return True
return True
def __utf8_bisearch(ucs, table): """ auxiliary function for binary search in interval table. """ min = 0 max = len(table) - 1 if ucs < table[min][0] or ucs > table[max][1]: return False while max >= min: mid = (min + max) / 2; if ucs > table[mid][1]: min = mid + 1; elif ucs < table[mid][0]: max = mid - 1; else: return True return False
096d834b46c55c13b5d5e4c6905b63b29c47adc0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5445/096d834b46c55c13b5d5e4c6905b63b29c47adc0/i18n.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 3158, 28, 67, 70, 784, 991, 12, 89, 2143, 16, 1014, 4672, 3536, 9397, 20606, 445, 364, 3112, 1623, 316, 3673, 1014, 18, 3536, 225, 1131, 273, 374, 943, 273, 562, 12, 2121, 13, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 3158, 28, 67, 70, 784, 991, 12, 89, 2143, 16, 1014, 4672, 3536, 9397, 20606, 445, 364, 3112, 1623, 316, 3673, 1014, 18, 3536, 225, 1131, 273, 374, 943, 273, 562, 12, 2121, 13, ...
['D.%s' % col for col in columns])
', '.join(['D.%s' % col for col in columns]), strwords)
def findDocuments(self, words): if not words: return [] columns = ['document_id', 'title', 'size', 'text', 'url', 'mime_type'] args = {'words' : '(' + ','.join([repr(word) for word in words]) + ')', 'lenwords' : len(words)} # XXX: what is the HAVING clause supposed to do ? query = """SELECT %s FROM documents D, document_scores DS WHERE DS.db_document_id=D.db_document_id AND DS.word IN %%(words)s GROUP BY DS.db_document_id HAVING count(DS.db_document_id) = %%(lenwords)s""" % ( ['D.%s' % col for col in columns]) # for each row, build a dict from list of couples (attrname, value) # and build a DBEntity from this dict results = [Document(**dict(zip(columns, row))) for row in self._execute(query, args)] return results
013cee40d00fb45a04c0c6648b9968fad3dabf28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2259/013cee40d00fb45a04c0c6648b9968fad3dabf28/querier.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 12922, 12, 2890, 16, 4511, 4672, 309, 486, 4511, 30, 327, 5378, 2168, 273, 10228, 5457, 67, 350, 2187, 296, 2649, 2187, 296, 1467, 2187, 296, 955, 2187, 296, 718, 2187, 296, 11757,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 12922, 12, 2890, 16, 4511, 4672, 309, 486, 4511, 30, 327, 5378, 2168, 273, 10228, 5457, 67, 350, 2187, 296, 2649, 2187, 296, 1467, 2187, 296, 955, 2187, 296, 718, 2187, 296, 11757,...
class wList(object):
class wObject(object): def _prepare_key_map(self, map): for entry in map: keys = entry[0] for i in xrange(len(keys)): k = keys[i] if type(k) == str: keys[i] = ord(k) def _dispatch_key(self, map, key_code): for entry in map: keys, fn, param = entry if key_code in keys: if param == None: fn() else: fn(eval(param)) return True return False class wList(wObject):
def __repr__(self): return str(self.__dict__)
affc93cbe3f6b537071ce09bfb1649908c4d1d07 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3866/affc93cbe3f6b537071ce09bfb1649908c4d1d07/slap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12715, 972, 12, 2890, 4672, 327, 609, 12, 2890, 16186, 1576, 972, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 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, 12715, 972, 12, 2890, 4672, 327, 609, 12, 2890, 16186, 1576, 972, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
conf.set('prefs', 'listwrap', self.listwrap)
conf.set('prefs', 'listwrap_mode', self.listwrap_mode)
def save_settings(self): rect = self.window.get_allocation() conf = ConfigParser.ConfigParser() conf.add_section('window') conf.set('window', 'w', rect.width) conf.set('window', 'h', rect.height) conf.set('window', 'toolbar', self.toolbar_show) conf.set('window', 'statusbar', self.statusbar_show) conf.add_section('prefs') conf.set('prefs', 'quality', self.zoom_quality) conf.set('prefs', 'bgcolor-red', self.bgcolor.red) conf.set('prefs', 'bgcolor-green', self.bgcolor.green) conf.set('prefs', 'bgcolor-blue', self.bgcolor.blue) conf.set('prefs', 'open_all', self.open_all_images) conf.set('prefs', 'use_last_dir', self.use_last_dir) conf.set('prefs', 'last_dir', self.last_dir) conf.set('prefs', 'fixed_dir', self.fixed_dir) conf.set('prefs', 'open_mode', self.open_mode) conf.set('prefs', 'last_mode', self.last_mode) conf.set('prefs', 'mousewheel_nav', self.mousewheel_nav) conf.set('prefs', 'listwrap', self.listwrap) if os.path.exists(os.path.expanduser('~/.config/mirage/')) == False: os.mkdir(os.path.expanduser('~/.config/mirage/')) conf.write(file(os.path.expanduser('~/.config/mirage/miragerc'), 'w')) return
5298dd3c59ec2b58930e739bd9a37bef9637074c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/5298dd3c59ec2b58930e739bd9a37bef9637074c/mirage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 67, 4272, 12, 2890, 4672, 4917, 273, 365, 18, 5668, 18, 588, 67, 29299, 1435, 2195, 273, 25076, 18, 809, 2678, 1435, 2195, 18, 1289, 67, 3464, 2668, 5668, 6134, 2195, 18, 542, 26...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 67, 4272, 12, 2890, 4672, 4917, 273, 365, 18, 5668, 18, 588, 67, 29299, 1435, 2195, 273, 25076, 18, 809, 2678, 1435, 2195, 18, 1289, 67, 3464, 2668, 5668, 6134, 2195, 18, 542, 26...
if testfiles: for filename in testfiles: if filename.endswith(".py"): dirname, filename = os.path.split(filename) sys.path.insert(0, dirname) m = __import__(filename[:-3]) del sys.path[0] failures, _ = testmod(m) else: failures, _ = testfile(filename, module_relative=False) if failures: return 1 else: r = unittest.TextTestRunner() r.run(DocTestSuite())
if not testfiles: name = os.path.basename(sys.argv[0]) if '__loader__' in globals() and name.endswith('.py'): name, _ = os.path.splitext(name) print("usage: {0} [-v] file ...".format(name)) return 2 for filename in testfiles: if filename.endswith(".py"): dirname, filename = os.path.split(filename) sys.path.insert(0, dirname) m = __import__(filename[:-3]) del sys.path[0] failures, _ = testmod(m) else: failures, _ = testfile(filename, module_relative=False) if failures: return 1
def _test(): testfiles = [arg for arg in sys.argv[1:] if arg and arg[0] != '-'] if testfiles: for filename in testfiles: if filename.endswith(".py"): # It is a module -- insert its dir into sys.path and try to # import it. If it is part of a package, that possibly won't work # because of package imports. dirname, filename = os.path.split(filename) sys.path.insert(0, dirname) m = __import__(filename[:-3]) del sys.path[0] failures, _ = testmod(m) else: failures, _ = testfile(filename, module_relative=False) if failures: return 1 else: r = unittest.TextTestRunner() r.run(DocTestSuite()) return 0
6bf9851224d124966cdaed923ddf0ec87e0ee7bd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/6bf9851224d124966cdaed923ddf0ec87e0ee7bd/doctest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3813, 13332, 1842, 2354, 273, 306, 3175, 364, 1501, 316, 2589, 18, 19485, 63, 21, 26894, 309, 1501, 471, 1501, 63, 20, 65, 480, 2400, 3546, 309, 1842, 2354, 30, 364, 1544, 316, 18...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3813, 13332, 1842, 2354, 273, 306, 3175, 364, 1501, 316, 2589, 18, 19485, 63, 21, 26894, 309, 1501, 471, 1501, 63, 20, 65, 480, 2400, 3546, 309, 1842, 2354, 30, 364, 1544, 316, 18...