rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
as = atom.service.AtomService('code.google.com') self.assertEquals(as.server, 'code.google.com') (host, port, ssl, path) = atom.service.ProcessUrl(as, | atom_service = atom.service.AtomService('code.google.com') self.assertEquals(atom_service.server, 'code.google.com') (host, port, ssl, path) = atom.service.ProcessUrl(atom_service, | def testParseHttpsUrl(self): as = atom.service.AtomService('code.google.com') self.assertEquals(as.server, 'code.google.com') (host, port, ssl, path) = atom.service.ProcessUrl(as, 'https://www.google.com/service/subservice?name=value&newname=newvalue') | baf155b351712dae1750dc47f55d4629c7ccf76a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10620/baf155b351712dae1750dc47f55d4629c7ccf76a/service_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3201,
22077,
1489,
12,
2890,
4672,
3179,
67,
3278,
273,
3179,
18,
3278,
18,
3641,
1179,
2668,
710,
18,
9536,
18,
832,
6134,
365,
18,
11231,
8867,
12,
7466,
67,
3278,
18,
3567,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3201,
22077,
1489,
12,
2890,
4672,
3179,
67,
3278,
273,
3179,
18,
3278,
18,
3641,
1179,
2668,
710,
18,
9536,
18,
832,
6134,
365,
18,
11231,
8867,
12,
7466,
67,
3278,
18,
3567,
16... |
print self._main_prefix | def total_space(self, end_session=True): msz = csz = 0 print self._main_prefix if not iswindows: if self._main_prefix is not None: stats = os.statvfs(self._main_prefix) msz = stats.f_frsize * (stats.f_blocks + stats.f_bavail - stats.f_bfree) if self._card_prefix is not None: stats = os.statvfs(self._card_prefix) csz = stats.f_frsize * (stats.f_blocks + stats.f_bavail - stats.f_bfree) else: msz = self._windows_space(self._main_prefix)[0] csz = self._windows_space(self._card_prefix)[0] | fe94bb088cd05b51e223d64cf22923bff91634de /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/fe94bb088cd05b51e223d64cf22923bff91634de/device.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2078,
67,
2981,
12,
2890,
16,
679,
67,
3184,
33,
5510,
4672,
4086,
94,
273,
2873,
94,
273,
374,
309,
486,
353,
13226,
30,
309,
365,
6315,
5254,
67,
3239,
353,
486,
599,
30,
3177,
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,
2078,
67,
2981,
12,
2890,
16,
679,
67,
3184,
33,
5510,
4672,
4086,
94,
273,
2873,
94,
273,
374,
309,
486,
353,
13226,
30,
309,
365,
6315,
5254,
67,
3239,
353,
486,
599,
30,
3177,
273... | |
extracter = Extracter(filename, movie_data["screenshot"], handle_result) | extracter = Extracter(filename, movie_data["screenshot"], handle_result) | def fillMovieData(self, filename, movie_data, callback): confirmMainThread() dir = os.path.join (config.get(prefs.ICON_CACHE_DIRECTORY), "extracted") try: os.makedirs(dir) except: pass screenshot = os.path.join (dir, os.path.basename(filename) + ".png") movie_data["screenshot"] = nextFreeFilename(screenshot) | e1525c9d9702d597df70f25448a0a053e7addb24 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/e1525c9d9702d597df70f25448a0a053e7addb24/gstreamerrenderer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
16727,
13120,
751,
12,
2890,
16,
1544,
16,
21360,
67,
892,
16,
1348,
4672,
6932,
6376,
3830,
1435,
1577,
273,
1140,
18,
803,
18,
5701,
261,
1425,
18,
588,
12,
1484,
2556,
18,
217... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
16727,
13120,
751,
12,
2890,
16,
1544,
16,
21360,
67,
892,
16,
1348,
4672,
6932,
6376,
3830,
1435,
1577,
273,
1140,
18,
803,
18,
5701,
261,
1425,
18,
588,
12,
1484,
2556,
18,
217... |
build_params = self.build_params.get_parameters() | build_params = self.build_params.get_parameters(force_tuple_creation=True) | def generate_python_call(self): """code to call the python method""" build_params = self.build_params.get_parameters() if build_params[0][0] == '"': build_params[0] = '(char *) ' + build_params[0] args = self.before_call.declare_variable('PyObject*', 'args') self.before_call.write_code('%s = Py_BuildValue(%s);' % (args, ', '.join(build_params))) self.before_call.add_cleanup_code('Py_DECREF(%s);' % args) self.before_call.write_code('py_retval = PyObject_CallObject(m_callback, %s);' % args) self.before_call.write_error_check('py_retval == NULL') self.before_call.add_cleanup_code('Py_DECREF(py_retval);') | a3176224892e128014d6fc4c868a0059e407b22c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7746/a3176224892e128014d6fc4c868a0059e407b22c/ns3modulegen_core_customizations.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
8103,
67,
1991,
12,
2890,
4672,
3536,
710,
358,
745,
326,
5790,
707,
8395,
1361,
67,
2010,
273,
365,
18,
3510,
67,
2010,
18,
588,
67,
3977,
12,
5734,
67,
8052,
67,
17169,
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,
2103,
67,
8103,
67,
1991,
12,
2890,
4672,
3536,
710,
358,
745,
326,
5790,
707,
8395,
1361,
67,
2010,
273,
365,
18,
3510,
67,
2010,
18,
588,
67,
3977,
12,
5734,
67,
8052,
67,
17169,
3... |
self.tkconsole.text.after(50, self.poll_subprocess) | if not self.tkconsole.closing: self.tkconsole.text.after(self.tkconsole.pollinterval, self.poll_subprocess) | def poll_subprocess(self): clt = self.rpcclt if clt is None: return try: response = clt.pollresponse(self.active_seq, wait=0.05) except (EOFError, IOError, KeyboardInterrupt): # lost connection or subprocess terminated itself, restart # [the KBI is from rpc.SocketIO.handle_EOF()] if self.tkconsole.closing: return response = None self.restart_subprocess() self.tkconsole.endexecuting() if response: self.tkconsole.resetoutput() self.active_seq = None how, what = response console = self.tkconsole.console if how == "OK": if what is not None: print >>console, `what` elif how == "EXCEPTION": if self.tkconsole.getvar("<<toggle-jit-stack-viewer>>"): self.remote_stack_viewer() elif how == "ERROR": errmsg = "PyShell.ModifiedInterpreter: Subprocess ERROR:\n" print >>sys.__stderr__, errmsg, what print >>console, errmsg, what # we received a response to the currently active seq number: self.tkconsole.endexecuting() # Reschedule myself in 50 ms self.tkconsole.text.after(50, self.poll_subprocess) | 88957d8d0d9bf6d45603171927aa82d921bf9697 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/88957d8d0d9bf6d45603171927aa82d921bf9697/PyShell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
67,
1717,
2567,
12,
2890,
4672,
927,
88,
273,
365,
18,
7452,
830,
88,
309,
927,
88,
353,
599,
30,
327,
775,
30,
766,
273,
927,
88,
18,
13835,
2740,
12,
2890,
18,
3535,
67,
54... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
67,
1717,
2567,
12,
2890,
4672,
927,
88,
273,
365,
18,
7452,
830,
88,
309,
927,
88,
353,
599,
30,
327,
775,
30,
766,
273,
927,
88,
18,
13835,
2740,
12,
2890,
18,
3535,
67,
54... |
for i in o.outputs: version.append(i.type.c_code_cache_version()) rval.append((o.op, tuple((i.type, graphpos(i)) for i in o.inputs))) op_pos[o] = opos env_computed_set.update(o.outputs) | for o in node.outputs: version.append(o.type.c_code_cache_version()) rval.append((node.op, tuple((i.type, graphpos(i, node_pos, ipos)) for ipos,i in enumerate(node.inputs)))) op_pos[node] = node_pos env_computed_set.update(node.outputs) | def graphpos(i): if isinstance(i, graph.Constant): return i.signature() elif i in env_inputs_set: return env_inputs_set[i] else: if i.owner is None: assert all( all(out is not None for out in o.outputs) for o in order) assert all( input.owner is None for input in self.env.inputs) raise Exception('what is this?', (i, type(i), i.clients, self.env)) return (op_pos[i.owner], i.owner.outputs.index(i)) | 108452181131c54a6ca942cb49e275060b133272 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/108452181131c54a6ca942cb49e275060b133272/cc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2667,
917,
12,
77,
4672,
309,
1549,
12,
77,
16,
2667,
18,
6902,
4672,
327,
277,
18,
8195,
1435,
1327,
277,
316,
1550,
67,
10029,
67,
542,
30,
327,
1550,
67,
10029,
67,
542,
63,
77,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2667,
917,
12,
77,
4672,
309,
1549,
12,
77,
16,
2667,
18,
6902,
4672,
327,
277,
18,
8195,
1435,
1327,
277,
316,
1550,
67,
10029,
67,
542,
30,
327,
1550,
67,
10029,
67,
542,
63,
77,
... |
def __init__(self, tableName, alias=None): | def __init__(self, table, alias=None): if hasattr(table, "sqlmeta"): tableName = table.sqlmeta.table else: tableName = table table = None | def __init__(self, tableName, alias=None): Table.__init__(self, tableName) if alias is None: self._alias_lock.acquire() try: AliasTable._alias_counter += 1 alias = "%s_alias%d" % (tableName, AliasTable._alias_counter) finally: self._alias_lock.release() self.alias = alias | 9d7628fb686eebb4753c1205f5724749c16a6c20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6718/9d7628fb686eebb4753c1205f5724749c16a6c20/sqlbuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1014,
16,
2308,
33,
7036,
4672,
309,
3859,
12,
2121,
16,
315,
4669,
3901,
6,
4672,
4775,
273,
1014,
18,
4669,
3901,
18,
2121,
469,
30,
4775,
273,
1014,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1014,
16,
2308,
33,
7036,
4672,
309,
3859,
12,
2121,
16,
315,
4669,
3901,
6,
4672,
4775,
273,
1014,
18,
4669,
3901,
18,
2121,
469,
30,
4775,
273,
1014,
... |
abc | TypeError: exceptions must be classes, or instances, not str | >>> def throw(g,exc): | 4c20bc40d73a7f4a977475e4fa02f7c8a43d796a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/4c20bc40d73a7f4a977475e4fa02f7c8a43d796a/test_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
604,
12,
75,
16,
10075,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
604,
12,
75,
16,
10075,
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,... |
MapBuffer.write('\n\n%s (Fix Memory Address, BaseAddress=0x%010X, EntryPoint=0x%010X)\n' % (ModuleName, BaseAddress, BaseAddress + ModuleInfo.Image.EntryPoint)) | MapBuffer.write('\n\n%s (Fixed Memory Address, BaseAddress=0x%010X, EntryPoint=0x%010X)\n' % (ModuleName, BaseAddress, BaseAddress + ModuleInfo.Image.EntryPoint)) | def _RebaseModule (self, MapBuffer, BaseAddress, ModuleList, AddrIsOffset = True, ModeIsSmm = False): if ModeIsSmm: AddrIsOffset = False InfFileNameList = ModuleList.keys() #InfFileNameList.sort() for InfFile in InfFileNameList: sys.stdout.write (".") sys.stdout.flush() ModuleInfo = ModuleList[InfFile] ModuleName = ModuleInfo.BaseName ## for SMM module in SMRAM, the SMRAM will be allocated from base to top. if not ModeIsSmm: BaseAddress = BaseAddress - ModuleInfo.Image.Size # # Update Image to new BaseAddress by GenFw tool # LaunchCommand(["GenFw", "--rebase", str(BaseAddress), "-r", ModuleInfo.Image.FileName], ModuleInfo.OutpuDir) else: # # Set new address to the section header only for SMM driver. # LaunchCommand(["GenFw", "--address", str(BaseAddress), "-r", ModuleInfo.Image.FileName], ModuleInfo.OutpuDir) # # Add general information. # if ModeIsSmm: MapBuffer.write('\n\n%s (Fix SMRAM Offset, BaseAddress=0x%010X, EntryPoint=0x%010X)\n' % (ModuleName, BaseAddress, BaseAddress + ModuleInfo.Image.EntryPoint)) elif AddrIsOffset: MapBuffer.write('\n\n%s (Fix Memory Offset, BaseAddress=-0x%010X, EntryPoint=-0x%010X)\n' % (ModuleName, 0 - BaseAddress, 0 - (BaseAddress + ModuleInfo.Image.EntryPoint))) else: MapBuffer.write('\n\n%s (Fix Memory Address, BaseAddress=0x%010X, EntryPoint=0x%010X)\n' % (ModuleName, BaseAddress, BaseAddress + ModuleInfo.Image.EntryPoint)) # # Add guid and general seciton section. # TextSectionAddress = 0 DataSectionAddress = 0 for SectionHeader in ModuleInfo.Image.SectionHeaderList: if SectionHeader[0] == '.text': TextSectionAddress = SectionHeader[1] elif SectionHeader[1] == '.data': DataSectionAddress = SectionHeader[1] if AddrIsOffset: MapBuffer.write('(GUID=%s, .textbaseaddress=-0x%010X, .databaseaddress=-0x%010X)\n\n' % (ModuleInfo.Guid, 0 - (BaseAddress + TextSectionAddress), 0 - (BaseAddress + DataSectionAddress))) else: MapBuffer.write('(GUID=%s, .textbaseaddress=0x%010X, .databaseaddress=0x%010X)\n\n' % (ModuleInfo.Guid, BaseAddress + TextSectionAddress, BaseAddress + DataSectionAddress)) # # Add funtion address # ImageMapTable = ModuleInfo.Image.FileName.replace('.efi', '.map') if not os.path.exists(ImageMapTable): continue ImageMap = open (ImageMapTable, 'r') for LinStr in ImageMap: if len (LinStr.strip()) == 0: continue StrList = LinStr.split() if len (StrList) > 4: if StrList[3] == 'f' or StrList[3] =='F': if AddrIsOffset: MapBuffer.write(' -0x%010X %s\n' % (0 - (BaseAddress + int (StrList[2], 16)), StrList[1])) else: MapBuffer.write(' 0x%010X %s\n' % (BaseAddress + int (StrList[2], 16), StrList[1])) ImageMap.close() | ef3747968bba5f59e31e3a867cfc32eb8a676f78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/914/ef3747968bba5f59e31e3a867cfc32eb8a676f78/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
426,
1969,
3120,
261,
2890,
16,
1635,
1892,
16,
3360,
1887,
16,
5924,
682,
16,
10216,
2520,
2335,
273,
1053,
16,
8126,
2520,
55,
7020,
273,
1083,
4672,
309,
8126,
2520,
55,
7020,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
426,
1969,
3120,
261,
2890,
16,
1635,
1892,
16,
3360,
1887,
16,
5924,
682,
16,
10216,
2520,
2335,
273,
1053,
16,
8126,
2520,
55,
7020,
273,
1083,
4672,
309,
8126,
2520,
55,
7020,
... |
return http.Response(stream = template('source_code.html', src_filename=self.path, src=src, username=self.username)) | return HTMLResponse(stream = template('source_code.html', src_filename=self.path, src=src, username=self.username)) | def render(self, ctx): filename = self.path if os.path.isfile(filename): if not os.path.exists(filename): src = "No such file '%s'"%filename else: src = open(filename).read() src = escape(src) return http.Response(stream = template('source_code.html', src_filename=self.path, src=src, username=self.username)) else: return static.File(filename) | 2c1a5997a8830efcfb475993e5f1efb45ed121ea /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/2c1a5997a8830efcfb475993e5f1efb45ed121ea/twist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
1544,
273,
365,
18,
803,
309,
1140,
18,
803,
18,
291,
768,
12,
3459,
4672,
309,
486,
1140,
18,
803,
18,
1808,
12,
3459,
4672,
1705,
273,
315,
2279,
41... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
1544,
273,
365,
18,
803,
309,
1140,
18,
803,
18,
291,
768,
12,
3459,
4672,
309,
486,
1140,
18,
803,
18,
1808,
12,
3459,
4672,
1705,
273,
315,
2279,
41... |
def __repr__(self): return self.message | except FeedError, e: print e sys.exit(1) | def __repr__(self): return self.message | 2bc56260e439cbf4ac58fccaf7d6d4f92d32f2b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2318/2bc56260e439cbf4ac58fccaf7d6d4f92d32f2b3/YahooFinance.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
327,
365,
18,
2150,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
327,
365,
18,
2150,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
valid_versions = ['1.1.0', '2.2.0', '1.1', '2.2'] deprecated_versions = ['1.1.0', '2.2.0'] | valid_versions = ['1.1.0', '2.2.0'] deprecated_versions = ['1.1', '2.2'] | def test_srm(self): valid_versions = ['1.1.0', '2.2.0', '1.1', '2.2'] deprecated_versions = ['1.1.0', '2.2.0'] fk_re = re.compile("GlueSiteUniqueID=(.*)") | b3cf62b0329de27fb86ea33f242129a5fa675df7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12088/b3cf62b0329de27fb86ea33f242129a5fa675df7/gip_validate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
87,
8864,
12,
2890,
4672,
923,
67,
10169,
273,
10228,
21,
18,
21,
18,
20,
2187,
296,
22,
18,
22,
18,
20,
3546,
6849,
67,
10169,
273,
10228,
21,
18,
21,
2187,
296,
22,
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,
1842,
67,
87,
8864,
12,
2890,
4672,
923,
67,
10169,
273,
10228,
21,
18,
21,
18,
20,
2187,
296,
22,
18,
22,
18,
20,
3546,
6849,
67,
10169,
273,
10228,
21,
18,
21,
2187,
296,
22,
18,... |
G = DirichletGroup(self.level(), K) | G = DirichletGroup(self.level(), L) | def q_eigenform_character(self, names=None): """ Return the Dirichlet character associated to the specific choice of `q`-eigenform attached to this simple cuspidal modular symbols space. | 480e0b141de99b0c47a69c8b56ce436c1b9a8b5a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/480e0b141de99b0c47a69c8b56ce436c1b9a8b5a/space.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1043,
67,
22663,
275,
687,
67,
11560,
12,
2890,
16,
1257,
33,
7036,
4672,
3536,
2000,
326,
8446,
1354,
1810,
3351,
3627,
358,
326,
2923,
6023,
434,
1375,
85,
68,
17,
22663,
275,
687,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1043,
67,
22663,
275,
687,
67,
11560,
12,
2890,
16,
1257,
33,
7036,
4672,
3536,
2000,
326,
8446,
1354,
1810,
3351,
3627,
358,
326,
2923,
6023,
434,
1375,
85,
68,
17,
22663,
275,
687,
7... |
self._stop = False | self._stop_server = False | def __init__(self, request_handler): threading.Thread.__init__(self) self._stop = False self.ready = threading.Event() request_handler.protocol_version = "HTTP/1.0" self.httpd = LoopbackHttpServer(('127.0.0.1', 0), request_handler) #print "Serving HTTP on %s port %s" % (self.httpd.server_name, # self.httpd.server_port) self.port = self.httpd.server_port | 3ae4973f855c970550f7038b67c8692b8b84b64e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/3ae4973f855c970550f7038b67c8692b8b84b64e/test_urllib2_localnet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
590,
67,
4176,
4672,
17254,
18,
3830,
16186,
2738,
972,
12,
2890,
13,
365,
6315,
5681,
67,
3567,
273,
1083,
365,
18,
1672,
273,
17254,
18,
1133,
1435,
59... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
590,
67,
4176,
4672,
17254,
18,
3830,
16186,
2738,
972,
12,
2890,
13,
365,
6315,
5681,
67,
3567,
273,
1083,
365,
18,
1672,
273,
17254,
18,
1133,
1435,
59... |
class ActiveTaskTreeView(TaskTreeView): """TreeView for display of a list of task. Handles DnD primitives too.""" DND_TARGETS = [ ('gtg/task-iter-str', gtk.TARGET_SAME_WIDGET, 0) ] def __init__(self, requester): TaskTreeView.__init__(self, requester) self._init_tree_view() self.get_selection().set_mode(gtk.SELECTION_MULTIPLE) self.enable_model_drag_source(\ gtk.gdk.BUTTON1_MASK, self.DND_TARGETS, gtk.gdk.ACTION_DEFAULT | gtk.gdk.ACTION_MOVE) self.enable_model_drag_dest(\ self.DND_TARGETS, gtk.gdk.ACTION_DEFAULT) self.drag_source_set(\ gtk.gdk.BUTTON1_MASK, self.DND_TARGETS, gtk.gdk.ACTION_DEFAULT | gtk.gdk.ACTION_MOVE) self.drag_dest_set(\ gtk.DEST_DEFAULT_ALL, self.DND_TARGETS, gtk.gdk.ACTION_DEFAULT | gtk.gdk.ACTION_MOVE) self.connect('drag_drop', self.on_drag_drop) self.connect('drag_data_get', self.on_drag_data_get) self.connect('drag_data_received', self.on_drag_data_received) self.connect('button_press_event', self.on_button_press) self.connect('button_release_event', self.on_button_release) self.defer_select = False def display_start_column(self,is_displayed=True): col = self.get_column(COL_SDATE) col.set_visible(is_displayed) def _init_tree_view(self): tag_col = gtk.TreeViewColumn() render_tags = CellRendererTags() tag_col.pack_start(render_tags, expand=False) tag_col.add_attribute(render_tags, "tag_list", COL_TAGS) render_tags.set_property('xalign', 0.0) tag_col.set_resizable(False) tag_col.set_cell_data_func(render_tags, self._celldatafunction) self.append_column(tag_col) self.set_column(COL_TAGS, tag_col) title_col = gtk.TreeViewColumn() render_text = gtk.CellRendererText() render_text.set_property("ellipsize", pango.ELLIPSIZE_END) title_col.set_title(_("Title")) title_col.pack_start(render_text, expand=True) title_col.add_attribute(render_text, "markup", COL_LABEL) title_col.set_resizable(True) title_col.set_expand(True) title_col.set_sort_column_id(COL_TITLE) title_col.set_cell_data_func(render_text, self._celldatafunction) self.append_column(title_col) self.set_column(COL_TITLE, title_col) self.set_search_column(COL_TITLE) sdate_col = gtk.TreeViewColumn() render_text = gtk.CellRendererText() sdate_col.set_title(_("Start date")) sdate_col.pack_start(render_text, expand=False) sdate_col.add_attribute(render_text, "markup", COL_SDATE) sdate_col.set_resizable(False) sdate_col.set_sort_column_id(COL_SDATE) sdate_col.set_cell_data_func(render_text, self._celldatafunction) self.append_column(sdate_col) self.set_column(COL_SDATE, sdate_col) ddate_col = gtk.TreeViewColumn() render_text = gtk.CellRendererText() ddate_col.set_title(_("Due")) ddate_col.pack_start(render_text, expand=False) ddate_col.add_attribute(render_text, "markup", COL_DUE) ddate_col.set_resizable(False) ddate_col.set_sort_column_id(COL_DDATE) ddate_col.set_cell_data_func(render_text, self._celldatafunction) self.append_column(ddate_col) self.set_column(COL_DUE, ddate_col) self.set_property("expander-column", title_col) self.set_property("enable-tree-lines", False) self.set_rules_hint(False) | def set_column(self,index,col): self.__columns[index] = col | 190b5cdad6885bc75049916e830fb903e3aa81c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8234/190b5cdad6885bc75049916e830fb903e3aa81c1/tasktree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2827,
12,
2890,
16,
1615,
16,
1293,
4672,
365,
16186,
5112,
63,
1615,
65,
273,
645,
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... | [
1,
1,
1,
1,
1,
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,
444,
67,
2827,
12,
2890,
16,
1615,
16,
1293,
4672,
365,
16186,
5112,
63,
1615,
65,
273,
645,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
self.currentToken = CommentToken("".charStack[:-1]) | self.currentToken = CommentToken("".join(charStack[:-1])) | def bogusCommentState(self): assert self.contentModelFlag == contentModelFlags["PCDATA"] | 7a76d9e2103866ed8f7fa14ed7d47696b3dfc04b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9368/7a76d9e2103866ed8f7fa14ed7d47696b3dfc04b/tokenizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
28774,
4469,
1119,
12,
2890,
4672,
1815,
365,
18,
1745,
1488,
4678,
422,
913,
1488,
5094,
9614,
3513,
4883,
11929,
2,
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,
324,
28774,
4469,
1119,
12,
2890,
4672,
1815,
365,
18,
1745,
1488,
4678,
422,
913,
1488,
5094,
9614,
3513,
4883,
11929,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
'price':i_line.product_id.product_tmpl_id.standard_price * i_line.quantity, | 'price':get_price(cr, uid, inv, company_currency, i_line), | def move_line_get(self, cr, uid, invoice_id, context=None): res = super(account_invoice_line,self).move_line_get(cr, uid, invoice_id, context=context) inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id, context=context) if inv.type in ('out_invoice','out_refund'): for i_line in inv.invoice_line: if i_line.product_id: if inv.type == 'out_invoice': # debit account dacc will be the output account # first check the product, if empty check the category dacc = i_line.product_id.product_tmpl_id.property_stock_account_output and i_line.product_id.product_tmpl_id.property_stock_account_output.id if not dacc: dacc = i_line.product_id.categ_id.property_stock_account_output_categ and i_line.product_id.categ_id.property_stock_account_output_categ.id else: # = out_refund # debit account dacc will be the input account # first check the product, if empty check the category dacc = i_line.product_id.product_tmpl_id.property_stock_account_input and i_line.product_id.product_tmpl_id.property_stock_account_input.id if not dacc: dacc = i_line.product_id.categ_id.property_stock_account_input_categ and i_line.product_id.categ_id.property_stock_account_input_categ.id # in both cases the credit account cacc will be the expense account # first check the product, if empty check the category cacc = i_line.product_id.product_tmpl_id.property_account_expense and i_line.product_id.product_tmpl_id.property_account_expense.id if not cacc: cacc = i_line.product_id.categ_id.property_account_expense_categ and i_line.product_id.categ_id.property_account_expense_categ.id if dacc and cacc: res.append({ 'type':'src', 'name': i_line.name[:64], 'price_unit':i_line.product_id.product_tmpl_id.standard_price, 'quantity':i_line.quantity, 'price':i_line.product_id.product_tmpl_id.standard_price * i_line.quantity, 'account_id':dacc, 'product_id':i_line.product_id.id, 'uos_id':i_line.uos_id.id, 'account_analytic_id':i_line.account_analytic_id.id, 'taxes':i_line.invoice_line_tax_id, }) res.append({ 'type':'src', 'name': i_line.name[:64], 'price_unit':i_line.product_id.product_tmpl_id.standard_price, 'quantity':i_line.quantity, 'price': -1 * i_line.product_id.product_tmpl_id.standard_price * i_line.quantity, 'account_id':cacc, 'product_id':i_line.product_id.id, 'uos_id':i_line.uos_id.id, 'account_analytic_id':i_line.account_analytic_id.id, 'taxes':i_line.invoice_line_tax_id, }) elif inv.type in ('in_invoice','in_refund'): for i_line in inv.invoice_line: if i_line.product_id: if i_line.product_id.product_tmpl_id.type != 'service': # get the price difference account at the product acc = i_line.product_id.product_tmpl_id.property_account_creditor_price_difference and i_line.product_id.product_tmpl_id.property_account_creditor_price_difference.id if not acc: # if not found on the product get the price difference account at the category acc = i_line.product_id.categ_id.property_account_creditor_price_difference_categ and i_line.product_id.categ_id.property_account_creditor_price_difference_categ.id a = None if inv.type == 'in_invoice': # oa will be the stock input account # first check the product, if empty check the category oa = i_line.product_id.product_tmpl_id.property_stock_account_input and i_line.product_id.product_tmpl_id.property_stock_account_input.id if not oa: oa = i_line.product_id.categ_id.property_stock_account_input_categ and i_line.product_id.categ_id.property_stock_account_input_categ.id else: # = in_refund # oa will be the stock output account # first check the product, if empty check the category oa = i_line.product_id.product_tmpl_id.property_stock_account_output and i_line.product_id.product_tmpl_id.property_stock_account_output.id if not oa: oa = i_line.product_id.categ_id.property_stock_account_output_categ and i_line.product_id.categ_id.property_stock_account_output_categ.id if oa: # get the fiscal position fpos = i_line.invoice_id.fiscal_position or False a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa) diff_res = [] # calculate and write down the possible price difference between invoice price and product price for line in res: if a == line['account_id'] and i_line.product_id.id == line['product_id']: uom = i_line.product_id.uos_id or i_line.product_id.uom_id standard_price = self.pool.get('product.uom')._compute_price(cr, uid, uom.id, i_line.product_id.product_tmpl_id.standard_price, i_line.uos_id.id) if standard_price != i_line.price_unit and line['price_unit'] == i_line.price_unit and acc: price_diff = i_line.price_unit - standard_price line.update({'price':standard_price * line['quantity']}) diff_res.append({ 'type':'src', 'name': i_line.name[:64], 'price_unit':price_diff, 'quantity':line['quantity'], 'price': price_diff * line['quantity'], 'account_id':acc, 'product_id':line['product_id'], 'uos_id':line['uos_id'], 'account_analytic_id':line['account_analytic_id'], 'taxes':line.get('taxes',[]), }) res += diff_res return res | 01152d412373ef527cbc9fdfa88601c98d6c6e0f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/01152d412373ef527cbc9fdfa88601c98d6c6e0f/invoice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
67,
1369,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
9179,
67,
350,
16,
819,
33,
7036,
4672,
400,
273,
2240,
12,
4631,
67,
16119,
67,
1369,
16,
2890,
2934,
8501,
67,
1369,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
67,
1369,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
9179,
67,
350,
16,
819,
33,
7036,
4672,
400,
273,
2240,
12,
4631,
67,
16119,
67,
1369,
16,
2890,
2934,
8501,
67,
1369,
67,
... |
shutil.copyfile(source, dest) | shutil.copyfile(source, dest) | def export_files(self, dirname, nodeid): ''' Export the "content" property as a file, not csv column ''' source = self.db.filename(self.classname, nodeid) | 9dab55a26b9a94cee652e7d264926fc1aeb57dfc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/9dab55a26b9a94cee652e7d264926fc1aeb57dfc/hyperdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
2354,
12,
2890,
16,
4283,
16,
756,
350,
4672,
9163,
11054,
326,
315,
1745,
6,
1272,
487,
279,
585,
16,
486,
6101,
1057,
9163,
1084,
273,
365,
18,
1966,
18,
3459,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
2354,
12,
2890,
16,
4283,
16,
756,
350,
4672,
9163,
11054,
326,
315,
1745,
6,
1272,
487,
279,
585,
16,
486,
6101,
1057,
9163,
1084,
273,
365,
18,
1966,
18,
3459,
12,
2890,
... |
if selected: self.set_selected(selected, jump=True) else: self.set_selected(None, jump=True) | self.set_selected(selected, jump=True) | def fill(self, songs): restore = self.__restore_values selected = (restore and restore.pop(0)) or self.get_selected() model = self.get_model() if len(model) == len(selected): selected = None self.inhibit() model.clear() self._add(songs) self.uninhibit() if selected: self.set_selected(selected, jump=True) else: self.set_selected(None, jump=True) | 65c353a2f58dd189cd3918d5836dbf8ca05e5f5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4764/65c353a2f58dd189cd3918d5836dbf8ca05e5f5f/paned.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
12,
2890,
16,
272,
7260,
4672,
5217,
273,
365,
16186,
13991,
67,
2372,
3170,
273,
261,
13991,
471,
5217,
18,
5120,
12,
20,
3719,
578,
365,
18,
588,
67,
8109,
1435,
938,
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,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
12,
2890,
16,
272,
7260,
4672,
5217,
273,
365,
16186,
13991,
67,
2372,
3170,
273,
261,
13991,
471,
5217,
18,
5120,
12,
20,
3719,
578,
365,
18,
588,
67,
8109,
1435,
938,
273,
365,... |
self.compiler = new_compiler (plat=os.environ.get ('PLAT'), verbose=self.verbose, | self.compiler = new_compiler (verbose=self.verbose, | def run (self): | 4620f306a4d46ca6e455247cfa5c900765d4b9d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4620f306a4d46ca6e455247cfa5c900765d4b9d1/build_ext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
size = book_metadata_field("size", formatter=int) | size = book_metadata_field("size", formatter=lambda x : int(float(x))) | def __set__(self, obj, val): """ Set the attribute """ val = self.setter(val) if self.setter else val if not isinstance(val, unicode): val = unicode(val, 'utf8', 'replace') obj.elem.setAttribute(self.attr, val) | 4dfb9a0d3f80d5230a5be646d8d152f1fcae009c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/4dfb9a0d3f80d5230a5be646d8d152f1fcae009c/books.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
972,
12,
2890,
16,
1081,
16,
1244,
4672,
3536,
1000,
326,
1566,
3536,
1244,
273,
365,
18,
18062,
12,
1125,
13,
309,
365,
18,
18062,
469,
1244,
309,
486,
1549,
12,
1125,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
972,
12,
2890,
16,
1081,
16,
1244,
4672,
3536,
1000,
326,
1566,
3536,
1244,
273,
365,
18,
18062,
12,
1125,
13,
309,
365,
18,
18062,
469,
1244,
309,
486,
1549,
12,
1125,
16,
... |
this = apply(_quickfix.new_TradSesStatus, args) | this = _quickfix.new_TradSesStatus(*args) | def __init__(self, *args): this = apply(_quickfix.new_TradSesStatus, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
1609,
72,
55,
281,
1482,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
133... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
1609,
72,
55,
281,
1482,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
133... |
return lib_dir, inc_dir, bin_dir | return home_dir, lib_dir, inc_dir, bin_dir | def path_locations(home_dir): """Return the path locations for the environment (where libraries are, where scripts go, etc)""" # XXX: We'd use distutils.sysconfig.get_python_inc/lib but its # prefix arg is broken: http://bugs.python.org/issue3386 if sys.platform == 'win32': lib_dir = join(home_dir, 'Lib') inc_dir = join(home_dir, 'Include') bin_dir = join(home_dir, 'Scripts') elif is_jython: lib_dir = join(home_dir, 'Lib') inc_dir = join(home_dir, 'Include') bin_dir = join(home_dir, 'bin') else: lib_dir = join(home_dir, 'lib', py_version) inc_dir = join(home_dir, 'include', py_version) bin_dir = join(home_dir, 'bin') return lib_dir, inc_dir, bin_dir | dc6dda8f6c595f40e2cfb5c2db467fabc291d631 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12981/dc6dda8f6c595f40e2cfb5c2db467fabc291d631/virtualenv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
589,
67,
12352,
12,
8712,
67,
1214,
4672,
3536,
990,
326,
589,
7838,
364,
326,
3330,
261,
6051,
14732,
854,
16,
1625,
8873,
1960,
16,
5527,
15574,
468,
11329,
30,
1660,
14271,
999,
2411,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
589,
67,
12352,
12,
8712,
67,
1214,
4672,
3536,
990,
326,
589,
7838,
364,
326,
3330,
261,
6051,
14732,
854,
16,
1625,
8873,
1960,
16,
5527,
15574,
468,
11329,
30,
1660,
14271,
999,
2411,... |
uids = [ m.group('uid') for m in UID_PATTERN.finditer(page) ] | uids = [ m.group('uid') for m in UID_PATTERN.finditer(value) ] | def set(self, instance, value, **kwargs): """ Assign input value to object. If mimetype is not specified, pass to processing method without one and add mimetype returned to kwargs. Assign kwargs to instance. """ if value is None: # nothing to do return | b62c785256593ff3545850cd0f68eab4947ce3a4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10193/b62c785256593ff3545850cd0f68eab4947ce3a4/ReftextField.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
791,
16,
460,
16,
2826,
4333,
4672,
3536,
12093,
810,
460,
358,
733,
18,
971,
12595,
353,
486,
1269,
16,
1342,
358,
4929,
707,
2887,
1245,
471,
527,
12595,
2106,
358... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
791,
16,
460,
16,
2826,
4333,
4672,
3536,
12093,
810,
460,
358,
733,
18,
971,
12595,
353,
486,
1269,
16,
1342,
358,
4929,
707,
2887,
1245,
471,
527,
12595,
2106,
358... |
keep_elem_refs(p1, title, stitle) | keep_elem_refs(pPopup, title, stitle) | def fl_popup_set_title(pPopup, title): """ fl_popup_set_title(pPopup, title) -> popup """ _fl_popup_set_title = cfuncproto( load_so_libforms(), "fl_popup_set_title", cty.POINTER(FL_POPUP), [cty.POINTER(FL_POPUP), STRING], """FL_POPUP * fl_popup_set_title(FL_POPUP * p1, const char * p2) """) stitle = convert_to_string(title) keep_elem_refs(p1, title, stitle) retval = _fl_popup_set_title(pPopup, stitle) return retval | db6a08ef941394cf8c4ed51185c751970c67b215 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/db6a08ef941394cf8c4ed51185c751970c67b215/library.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
16086,
67,
542,
67,
2649,
12,
84,
13770,
16,
2077,
4672,
3536,
1183,
67,
16086,
67,
542,
67,
2649,
12,
84,
13770,
16,
2077,
13,
317,
10431,
3536,
225,
389,
2242,
67,
16086,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16086,
67,
542,
67,
2649,
12,
84,
13770,
16,
2077,
4672,
3536,
1183,
67,
16086,
67,
542,
67,
2649,
12,
84,
13770,
16,
2077,
13,
317,
10431,
3536,
225,
389,
2242,
67,
16086,
... |
if key == 'font' and self.use_system_font: | if key == 'font' and self['use_system_font']: | def __getitem__ (self, key = ""): if self.cache.has_key (key): dbg (" VSGConf: returning cached value: %s"%self.cache[key]) return (self.cache[key]) | 4622b29aca4b5143667a6178ef7df3a8f6f4557a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6502/4622b29aca4b5143667a6178ef7df3a8f6f4557a/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
261,
2890,
16,
498,
273,
1408,
4672,
309,
365,
18,
2493,
18,
5332,
67,
856,
261,
856,
4672,
28966,
7566,
776,
30820,
3976,
30,
5785,
3472,
460,
30,
738,
87,
28385,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
261,
2890,
16,
498,
273,
1408,
4672,
309,
365,
18,
2493,
18,
5332,
67,
856,
261,
856,
4672,
28966,
7566,
776,
30820,
3976,
30,
5785,
3472,
460,
30,
738,
87,
28385,
28... |
else: t=url | else: t=cgi.escape(url) | def create_net_menu(self): mm = gtk.Menu() links=self.__m.get_current().get('links',u'').split(u'\n') for l in links: ll=l.split(u'\t',1) url=cgi.escape(ll[0]) if len(ll)>1: t=cgi.escape(ll[1]) else: t=url i= gtk.MenuItem(t) i.connect("activate", self.net_menu_cb,url) i.show() mm.add(i) self.net_menu.set_submenu(mm) | be1ce6d3401df60adefdf8ade0ad2a5da413a2e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9462/be1ce6d3401df60adefdf8ade0ad2a5da413a2e8/MonajatScreenlet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2758,
67,
5414,
12,
2890,
4672,
9740,
273,
22718,
18,
4599,
1435,
4716,
33,
2890,
16186,
81,
18,
588,
67,
2972,
7675,
588,
2668,
7135,
2187,
89,
6309,
2934,
4939,
12,
89,
8314... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2758,
67,
5414,
12,
2890,
4672,
9740,
273,
22718,
18,
4599,
1435,
4716,
33,
2890,
16186,
81,
18,
588,
67,
2972,
7675,
588,
2668,
7135,
2187,
89,
6309,
2934,
4939,
12,
89,
8314... |
testMethod = getattr(self, self.__testMethodName) | testMethod = getattr(self, self._testMethodName) | def run(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except KeyboardInterrupt: raise except: result.addError(self, self.__exc_info()) return | dcb7d97fc6f9b6b40c3037899d0a94b46e4e2b77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/dcb7d97fc6f9b6b40c3037899d0a94b46e4e2b77/unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
563,
33,
7036,
4672,
309,
563,
353,
599,
30,
563,
273,
365,
18,
1886,
4709,
1253,
1435,
563,
18,
1937,
4709,
12,
2890,
13,
1842,
1305,
273,
3869,
12,
2890,
16,
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,
1086,
12,
2890,
16,
563,
33,
7036,
4672,
309,
563,
353,
599,
30,
563,
273,
365,
18,
1886,
4709,
1253,
1435,
563,
18,
1937,
4709,
12,
2890,
13,
1842,
1305,
273,
3869,
12,
2890,
16,
36... |
_impl_qi = re.compile(r'NS_IMPL_(?P<threadsafe>THREADSAFE_)?(?P<type>QUERY_INTERFACE|ISUPPORTS)(?:\d+)\((?P<bases>.*)\)\s*$') | _impl_qi = re.compile(r'NS_IMPL_(?P<threadsafe>THREADSAFE_)?(?P<type>QUERY_INTERFACE|ISUPPORTS)(?P<inherited>_INHERITED)?(?:\d+)\((?P<bases>.*)\)\s*$') | def build_map(f, cname, iids): """Parse the body of an NS_INTERFACE_MAP and return (members, unfound)""" unfound = None members = [] for line in f: if line == 'NS_INTERFACE_MAP_END': return (members, unfound) if line == 'NS_INTERFACE_MAP_UNFOUND': unfound = '' for line in f: if line == 'END': break unfound += line continue if line.find(')') == -1: for line2 in f: line += line2 if line.find(')') != -1: break m = _map_entry.match(line) if m is None: raise Exception("%s: Unparseable interface map entry" % f.loc()) items = _split_commas.split(m.group('list')) action = m.group('action') if action == 'NS_INTERFACE_MAP_ENTRY': iname, = items members.append(OffsetThisQIResponse(iids[iname])) elif action == 'NS_FUTURE_INTERFACE_MAP_ENTRY': iname, = items members.append(OffsetFutureThisQIResponse(iids[iname])) elif action == 'NS_INTERFACE_MAP_ENTRY_AMBIGUOUS': iname, intermediate = items members.append(OffsetThisQIResponseAmbiguous(iids[iname], iids[intermediate])) elif action == 'NS_INTERFACE_MAP_ENTRY_TEAROFF': iname, allocator = items members.append(TearoffResponse(iids[iname], allocator)) elif action == 'NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO': domciname, = items members.append(DOMCIResult(domciname)) elif action == 'NS_INTERFACE_MAP_ENTRY_LITERAL': code = '' for line in f: if line == 'END': break code += line a = LiteralAction(items[0], code) for iname in items: iface = iids[iname] members.append(LiteralResponse(a, iface)) else: raise Exception("%s: Unexpected interface map entry" % f.loc()) raise Exception("%s: Unexpected EOF" % f.loc()) | b27c6528ebaf2229b80b9856a60cc082ead28538 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13067/b27c6528ebaf2229b80b9856a60cc082ead28538/gqi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
1458,
12,
74,
16,
18290,
16,
277,
2232,
4672,
3536,
3201,
326,
1417,
434,
392,
11472,
67,
18865,
67,
8352,
471,
327,
261,
7640,
16,
640,
7015,
15574,
640,
7015,
273,
599,
483... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
1458,
12,
74,
16,
18290,
16,
277,
2232,
4672,
3536,
3201,
326,
1417,
434,
392,
11472,
67,
18865,
67,
8352,
471,
327,
261,
7640,
16,
640,
7015,
15574,
640,
7015,
273,
599,
483... |
this = apply(_quickfix.new_Adjustment, args) | this = _quickfix.new_Adjustment(*args) | def __init__(self, *args): this = apply(_quickfix.new_Adjustment, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
19985,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
365,
18,
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,
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,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
19985,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
365,
18,
22... |
print_test("miscellaneous", 3) for i in range(-10, 11): for j in range(0, 6): for k in range(-7, 11): if (j>=0 and k!=0): o=pow(i,j) % k n=pow(i,j,k) assert o == n, 'Integer mismatch: %d, %d, %d' % (i,j,k) if (j>=0 and k<>0): o=pow(long(i),j) % k n=pow(long(i),j,k) assert o == n, 'Long mismatch: %s, %s, %s' % (i,j,k) if (i>=0 and k<>0): o=pow(float(i),j) % k n=pow(float(i),j,k) assert o == n, 'Float mismatch: %g, %g, %g' % (i,j,k) | if sys.platform.startswith('java1.1'): print_test("miscellaneous... skipping due to JVM bugs", 3) else: print_test("miscellaneous", 3) for i in range(-10, 11): for j in range(0, 6): for k in range(-7, 11): if (j>=0 and k!=0): o=pow(i,j) % k n=pow(i,j,k) assert o == n, 'Integer mismatch: %d, %d, %d' % (i,j,k) if (j>=0 and k<>0): o=pow(long(i),j) % k n=pow(long(i),j,k) assert o == n, 'Long mismatch: %s, %s, %s' % (i,j,k) if (i>=0 and k<>0): o=pow(float(i),j) % k n=pow(float(i),j,k) assert o == n, 'Float mismatch: %g, %g, %g' % (i,j,k) | def powtest(type): if (type!=float): print_test("simple identities", 4) for i in range(-1000, 1000): assert type(i)**0 == 1 assert type(i)**1 == type(i) if i > 0: assert type(0)**i == type(0) assert type(1)**i == type(1) print_test("cubes") for i in range(-100, 100): assert type(i)**3 == i*i*i print_test("powers of two") pow2=1 for i in range(0,31): assert 2**i == pow2 if i!=30: pow2=pow2*2 print_test("modpow", 4) il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): assert compare(pow(type(i),j,k), type(i)**j % type(k)) == 0, '%s, %s, %s' % (i,j,k) | dc372332781219a259de010ee8e8a0b445788b0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6753/dc372332781219a259de010ee8e8a0b445788b0a/test_pow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7602,
3813,
12,
723,
4672,
309,
261,
723,
5,
33,
5659,
4672,
1172,
67,
3813,
2932,
9647,
17230,
3113,
1059,
13,
364,
277,
316,
1048,
19236,
18088,
16,
4336,
4672,
1815,
618,
12,
77,
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,
7602,
3813,
12,
723,
4672,
309,
261,
723,
5,
33,
5659,
4672,
1172,
67,
3813,
2932,
9647,
17230,
3113,
1059,
13,
364,
277,
316,
1048,
19236,
18088,
16,
4336,
4672,
1815,
618,
12,
77,
13... |
elif node.parent.type in ("try", "catch", "finally"): print("Omit unwrapping of block (try/catch/finally) at | def optimize(node, level=0): # Process from inside to outside for child in node: optimize(child, level+1) # Unwrap blocks if node.type == "block": if len(node) == 0: print("Replace empty block #%s" % level) node.parent.replace(node, Node(node.tokenizer, "semicolon")) elif len(node) == 1: if node.parent.type == "if" and containsIf(node): print("Omit unwrapping of block (cascaded if blocks) at #%s" % level) elif node.parent.type in ("try", "catch", "finally"): print("Omit unwrapping of block (try/catch/finally) at #%s" % level) else: print("Unwrap block at #%s" % level) node.parent.replace(node, node[0]) # Process all if-statements if node.type == "if": print("IF at #%s" % level) thenPart = getattr(node, "thenPart", None) elsePart = getattr(node, "elsePart", None) # Optimize using "AND" or "OR" operators # Combine multiple semicolon statements into one semicolon statement using an "comma" expression thenPart = combineToCommaExpression(thenPart) elsePart = combineToCommaExpression(elsePart) # Optimize using hook operator if thenPart and elsePart: if thenPart.type == "return" and elsePart.type == "return": # Combine return statement replacement = createReturn(createHook(node.condition, thenPart.value, elsePart.value)) node.parent.replace(node, replacement) elif thenPart.type == "semicolon" and elsePart.type == "semicolon": # Combine two assignments or expressions thenExpression = getattr(thenPart, "expression", None) elseExpression = getattr(elsePart, "expression", None) if thenExpression and elseExpression: replacement = combineAssignments(node.condition, thenExpression, elseExpression) or combineExpressions(node.condition, thenExpression, elseExpression) if replacement: node.parent.replace(node, replacement) | f6f95836985c8a03e0192b554d8d97b02dd96874 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/f6f95836985c8a03e0192b554d8d97b02dd96874/BlockReducer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10979,
12,
2159,
16,
1801,
33,
20,
4672,
468,
4389,
628,
4832,
358,
8220,
364,
1151,
316,
756,
30,
10979,
12,
3624,
16,
1801,
15,
21,
13,
225,
468,
1351,
4113,
4398,
309,
756,
18,
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,
10979,
12,
2159,
16,
1801,
33,
20,
4672,
468,
4389,
628,
4832,
358,
8220,
364,
1151,
316,
756,
30,
10979,
12,
3624,
16,
1801,
15,
21,
13,
225,
468,
1351,
4113,
4398,
309,
756,
18,
72... | |
targetCommand.trove.troveFailed('Stop requested') | if targetCommand.trove: targetCommand.trove.troveFailed('Stop requested') elif targetCommand.job: targetCommand.job.jobFailed('Stop requested') else: self.warning('Command %s has no job or trove assigned -- ' 'cannot fail job.', targetCommandId) | def killFn(pid): self._killPid(pid, killGroup=True, hook=self._serveLoopHook) | 4d71ebc3a84f73752de77b9f1f66785c9f389eda /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8749/4d71ebc3a84f73752de77b9f1f66785c9f389eda/worker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
5372,
12,
6610,
4672,
365,
6315,
16418,
12478,
12,
6610,
16,
8673,
1114,
33,
5510,
16,
3953,
33,
2890,
6315,
30104,
6452,
5394,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
5372,
12,
6610,
4672,
365,
6315,
16418,
12478,
12,
6610,
16,
8673,
1114,
33,
5510,
16,
3953,
33,
2890,
6315,
30104,
6452,
5394,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.doReloadConfig () def doReloadConfig (self, reallyReload="dunno"): if reallyReload == "No": return | def reloadConfig (self, widget): self.doReloadConfig () | 44ba4a387d4167dedba8d083a763a0b3d1a1236b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4580/44ba4a387d4167dedba8d083a763a0b3d1a1236b/driconf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7749,
809,
261,
2890,
16,
3604,
4672,
365,
18,
2896,
13013,
809,
1832,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7749,
809,
261,
2890,
16,
3604,
4672,
365,
18,
2896,
13013,
809,
1832,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
self.folders = {} | self.folders = [] | def addfolders(self, remotefolders, autorefreshes, quick): self.folderlock.acquire() try: self.folders = {} self.quick = quick self.autorefreshes = autorefreshes for folder in remotefolders: # new folders are queued self.folders[folder] = True finally: self.folderlock.release() | 7bdd4a69fa5621c2fcf3213b32d2c21f1ba2b741 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5335/7bdd4a69fa5621c2fcf3213b32d2c21f1ba2b741/accounts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
16064,
12,
2890,
16,
2632,
16064,
16,
2059,
479,
74,
1955,
281,
16,
9549,
4672,
365,
18,
5609,
739,
18,
1077,
1039,
1435,
775,
30,
365,
18,
16064,
273,
5378,
365,
18,
19525,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
16064,
12,
2890,
16,
2632,
16064,
16,
2059,
479,
74,
1955,
281,
16,
9549,
4672,
365,
18,
5609,
739,
18,
1077,
1039,
1435,
775,
30,
365,
18,
16064,
273,
5378,
365,
18,
19525,
273,
... |
self.source = getXMLNode(xmlPayload, "code").getAttribute("source") | self.source = str(getXMLNode(xmlPayload, "code").getAttribute("source")) | def __init__(self, xmlPayload, config, ParentName): self.initLog(config) self.name = xmlPayload.getAttribute("name") self.doBase64 = (xmlPayload.getAttribute("dobase64") == "1") self.inshell = (xmlPayload.getAttribute("inshell") == "1") self.inputlist = getXMLNodes(xmlPayload, "input") self.source = getXMLNode(xmlPayload, "code").getAttribute("source") self.ParentName = ParentName self._log("fimap PayloadObject loaded: %s" %(self.name), self.LOG_DEVEL) | 556c405d104ec59d630e80568df5daf91ab1bf9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4412/556c405d104ec59d630e80568df5daf91ab1bf9d/language.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2025,
6110,
16,
642,
16,
9520,
461,
4672,
365,
18,
2738,
1343,
12,
1425,
13,
365,
18,
529,
273,
2025,
6110,
18,
588,
1499,
2932,
529,
7923,
365,
18,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2025,
6110,
16,
642,
16,
9520,
461,
4672,
365,
18,
2738,
1343,
12,
1425,
13,
365,
18,
529,
273,
2025,
6110,
18,
588,
1499,
2932,
529,
7923,
365,
18,
28... |
"""Takes a series name as the parameter. A valid .git/patches/name directory should exist | """Takes a series name as the parameter. | def __init__(self, name = None): """Takes a series name as the parameter. A valid .git/patches/name directory should exist """ if name: self.__name = name else: self.__name = git.get_head_file() | 40e65b928d0429090a39843c1a81dec31f4d38e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12366/40e65b928d0429090a39843c1a81dec31f4d38e2/stack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
273,
599,
4672,
3536,
11524,
279,
4166,
508,
487,
326,
1569,
18,
3536,
309,
508,
30,
365,
16186,
529,
273,
508,
469,
30,
365,
16186,
529,
273,
5071,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
273,
599,
4672,
3536,
11524,
279,
4166,
508,
487,
326,
1569,
18,
3536,
309,
508,
30,
365,
16186,
529,
273,
508,
469,
30,
365,
16186,
529,
273,
5071,... |
others_urls[url] = descr else: filename = url.split('/')[-1] name = file_strip_ext(filename) format = filename[len(name):] if format and format[0] == '.': format = format[1:] | others_urls[url] = descr else: | def format(bfo, style, separator='; '): """ This is the default format for formatting full-text reference. @param separator the separator between urls. @param style CSS class of the link """ urls = bfo.fields("8564_") ret = "" #ret += "%s<br />" % urls bibarchive = BibRecDocs(bfo.recID) old_version_there = False main_urls = {} others_urls = {} cern_urls = {} additionals = False for complete_url in urls: if complete_url.has_key('u'): url = complete_url['u'] descr = '' #ret += "1 descr=%s<br />" % descr if complete_url.has_key('z'): #ret += "2 descr=%s<br />" % descr descr = complete_url['z'] #ret += "3 descr=%s<br />" % descr elif complete_url.has_key('y'): #ret += "2 descr=%s<br />" % descr descr = complete_url['y'] #ret += "3 descr=%s<br />" % descr #ret += "4 descr=%s<br />" % descr if not url.startswith(weburl): #ret += "%s doesn't start with %s<br />" % (url, weburl) #ret += "5 descr=%s<br />" % descr if not descr: if '/setlink?' in url: descr = "Fulltext" else: #ret += "6 descr=%s<br />" % descr descr = url.split('/')[-1] #ret += "7 descr=%s<br />" % descr #ret += "8 descr=%s<br />" % descr if 'cern.ch' in url: cern_urls[url] = descr else: others_urls[url] = descr else: #ret += "%s starts with %s!!!<br />" % (url, weburl) filename = url.split('/')[-1] name = file_strip_ext(filename) format = filename[len(name):] if format and format[0] == '.': format = format[1:] #ret += "%s -> (%s, %s, %s)<br />" % (url, filename, name, format) assigned = False for doc in bibarchive.listBibDocs(): if int(doc.getLatestVersion()) > 1: old_version_there = True #ret += "Sto operando sul file %s" % doc #ret += "%s<br />" % [f.fullname for f in doc.listAllFiles()] if filename in [f.fullname for f in doc.listAllFiles()]: assigned = True #ret += " --> ok!!!<br />" if not doc.type == 'Main': additionals = True #ret += "Additionals?!<br />" else: #ret += "Main!!!<br />" #ret += "9 descr=%s<br />" % descr if not descr: #ret += "10 descr=%s<br />" % descr descr = 'Main file(s)' #ret += "11 descr=%s<br />" % descr #ret += "12 descr=%s<br />" % descr if not main_urls.has_key(descr): main_urls[descr] = [] #ret += "Appendo a %s (%s, %s)<br />" % (descr, url, format) main_urls[descr].append((url, name, format)) if not assigned: if not descr: descr = url.split('/')[-1] others_urls[url] = descr if style != "": style = 'class="'+style+'"' # Build urls list. # Escape special chars for <a> tag value. additional_str = '' if additionals: additional_str = ' <small>(<a '+style+' href="'+weburl+'/record/'+str(bfo.recID)+'/files/">additional files</a>)</small>' versions_str = '' if old_version_there: versions_str = ' <small>(<a '+style+' href="'+weburl+'/record/'+str(bfo.recID)+'/files/">older versions</a>)</small>' if main_urls: last_name = "" for descr, urls in main_urls.items(): ret += "<strong>"+descr+":</strong> " url_list = [] urls.sort(lambda (url1, name1, format1), (url2, name2, format2): url1 < url2 and -1 or url1 > url2 and 1 or 0) for url, name, format in urls: if not name == last_name and len(urls) > 1: print_name = "<em>%s</em> - " % name else: print_name = "" last_name = name url_list.append(print_name + '<a '+style+' href="'+escape(url)+'">'+format.upper()+'</a>') ret += separator.join(url_list) + additional_str + versions_str + '<br />' if cern_urls: ret += '<strong>CERN links</strong>: ' url_list = [] for url,descr in cern_urls.items(): url_list.append('<a '+style+' href="'+escape(url)+'">'+escape(str(descr))+'</a>') ret += separator.join(url_list) + '<br />' if others_urls: ret += '<strong>External links</strong>: ' url_list = [] for url,descr in others_urls.items(): url_list.append('<a '+style+' href="'+escape(url)+'">'+escape(str(descr))+'</a>') ret += separator.join(url_list) + '<br />' if ret.endswith('<br />'): ret = ret[:-len('<br />')] return ret | 35c8319cf9220490b56806cac2ae7cbda82fd471 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/35c8319cf9220490b56806cac2ae7cbda82fd471/bfe_fulltext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
70,
617,
16,
2154,
16,
4182,
2218,
31,
296,
4672,
3536,
1220,
353,
326,
805,
740,
364,
10407,
1983,
17,
955,
2114,
18,
632,
891,
4182,
326,
4182,
3086,
6903,
18,
632,
891,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
70,
617,
16,
2154,
16,
4182,
2218,
31,
296,
4672,
3536,
1220,
353,
326,
805,
740,
364,
10407,
1983,
17,
955,
2114,
18,
632,
891,
4182,
326,
4182,
3086,
6903,
18,
632,
891,
2... |
Return the $q$-expansion of the weight $k$ Eisenstein series to precision prec in the field $K$. | Return the $q$-expansion of the normalized weight $k$ Eisenstein series to precision prec in the ring $K$. (The normalization chosen here is the one that forces the coefficient of $q$ to be 1.) | def eisenstein_series_qexp(k, prec=10, K=QQ): r""" Return the $q$-expansion of the weight $k$ Eisenstein series to precision prec in the field $K$. Here's a rough description of how the algorithm works: we know $E_k = const + \sum_n sigma(n,k-1) q^n$. Now, we basically just compute all the $\sigma(n,k-1)$ simultaneously, as $\sigma$ is multiplicative. INPUT: k -- even positive integer prec -- nonnegative integer K -- a ring in which -(2*k)/B_k is invertible EXAMPLES: sage: eisenstein_series_qexp(2,5) -1/24 + q + 3*q^2 + 4*q^3 + 7*q^4 + O(q^5) sage: eisenstein_series_qexp(2,0) O(q^0) sage: eisenstein_series_qexp(2,5,GF(7)) 2 + q + 3*q^2 + 4*q^3 + O(q^5) AUTHORS: -- William Stein: original implementation -- Craig Citro (2007-06-01): rewrote for massive speedup """ k = Integer(k) if k%2 or k < 2: raise ValueError, "k (=%s) must be an even positive integer"%k prec = int(prec) if prec < 0: raise ValueError, "prec (=%s) must be an even nonnegative integer"%prec if (prec == 0): R = QQ[['q']] return R(0).add_bigoh(0) one = Integer(1) val = [one] * prec expt = k - one try: a0inv = - (2*k) / bernoulli(k) a0 = K(1/a0inv) except ZeroDivisionError: raise ValueError, "-(2*k)/B_k (=%s) must be invertible in the ring K"%a0inv for p in prime_range(1,prec): int_p = int(p) ppow = int_p mult = p**expt term = mult*mult last = mult while (ppow < prec): ind = ppow while (ind < prec): val[ind] = (val[ind]*(term-one)).divide_knowing_divisible_by(last - one) ind += ppow ppow *= int_p last = term term *= mult val[0] = a0 R = K[['q']] return R(val, prec=prec, check=False) | 655338a7efdf01ea27d9ca425adea6343a86f01d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/655338a7efdf01ea27d9ca425adea6343a86f01d/eis_series.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
425,
291,
275,
334,
13685,
67,
10222,
67,
85,
2749,
12,
79,
16,
13382,
33,
2163,
16,
1475,
33,
53,
53,
4672,
436,
8395,
2000,
326,
271,
85,
8,
17,
2749,
12162,
434,
326,
5640,
3119,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
425,
291,
275,
334,
13685,
67,
10222,
67,
85,
2749,
12,
79,
16,
13382,
33,
2163,
16,
1475,
33,
53,
53,
4672,
436,
8395,
2000,
326,
271,
85,
8,
17,
2749,
12162,
434,
326,
5640,
3119,
... |
hm = mcpu.HooksMaster(self._call_nodes_false, cfg, sstore, lu) | hm = mcpu.HooksMaster(self._call_nodes_false, lu) | def testIndividualFalse(self): """Test individual rpc failure""" cfg = FakeConfig() sstore = FakeSStore() op = opcodes.OpCode() lu = FakeLU(None, op, cfg, sstore) hm = mcpu.HooksMaster(self._call_nodes_false, cfg, sstore, lu) self.failUnlessRaises(errors.HooksFailure, hm.RunPhase, constants.HOOKS_PHASE_PRE) hm.RunPhase(constants.HOOKS_PHASE_POST) | fafa59906e4dd01c54d1011014c5ff5556fadfc9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7542/fafa59906e4dd01c54d1011014c5ff5556fadfc9/ganeti.hooks_unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
29834,
8381,
12,
2890,
4672,
3536,
4709,
7327,
6724,
5166,
8395,
2776,
273,
11551,
809,
1435,
272,
2233,
273,
11551,
55,
2257,
1435,
1061,
273,
1061,
7000,
18,
3817,
1085,
1435,
2007... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
29834,
8381,
12,
2890,
4672,
3536,
4709,
7327,
6724,
5166,
8395,
2776,
273,
11551,
809,
1435,
272,
2233,
273,
11551,
55,
2257,
1435,
1061,
273,
1061,
7000,
18,
3817,
1085,
1435,
2007... |
req = name + ": " + str(record[0][0]) | req = name + ": " + self.str(record[0][0]) | def handler(self, **args): import database from irclib import Event, nm_to_n # Set the target as either the person or the channel target = self.return_to_sender(args) orig_msg = args["text"] # Strip bot name orig_msg = orig_msg.split()[1:] # Now determine if we need to list karma or increment/decrement it, # which we check by seeing if the first word is "karma" msg = "" if orig_msg[0] == "karma": # If they just say "karma", print the top 3, the bottom 3, and # the requester's karma if len(orig_msg) == 1: top = "Top 3 Karma -" # Top 3 query = "select counter, nick from stats where type='karma'" \ + " order by counter desc limit 3" record = database.doSQL(query) for i in range(len(record)): # i goes from 0 to 2 (hopefully) top += " " + str(i+1) + ") " + record[i][1] + ": " \ + str(record[i][0]) + ";" top += "\n" # Bottom 3 bot = "Bottom 3 Karma -" query = "select counter, nick from stats where type='karma'" \ + " order by counter asc limit 3" record = database.doSQL(query) for i in range(len(record)): bot += " " + str(i+1) + ") " + record[i][1] + ": " \ + str(record[i][0]) + ";" bot += "\n" # Requesters import irclib name = irclib.nm_to_n(args["source"]) print name query = "select counter from stats where nick='" + name + "' and type='karma'" record = database.doSQL(query) if len(record) != 0: req = name + ": " + str(record[0][0]) else: req = "" | 0d0f57b5157c5f2aa1e6d686476fd6fff274efa7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10749/0d0f57b5157c5f2aa1e6d686476fd6fff274efa7/karma.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1838,
12,
2890,
16,
2826,
1968,
4672,
1930,
2063,
628,
9482,
830,
495,
1930,
2587,
16,
8442,
67,
869,
67,
82,
225,
468,
1000,
326,
1018,
487,
3344,
326,
6175,
578,
326,
1904,
1018,
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,
1838,
12,
2890,
16,
2826,
1968,
4672,
1930,
2063,
628,
9482,
830,
495,
1930,
2587,
16,
8442,
67,
869,
67,
82,
225,
468,
1000,
326,
1018,
487,
3344,
326,
6175,
578,
326,
1904,
1018,
273... |
pass | pass | def local_mul_switch_sink(node): """ This optimization makes the folowing changes in the graph: T.mul(A,T.switch(cond,0,iff),B) --> T.switch(cond,0,T.mul(A,B,iff)) T.mul(A,T.switch(cond,ift,0),B) --> T.switch(cond,T.mul(A,B,ift),0) A and B being several (or none) symbolic variables. This is useful because A and B may not be numerically stable and give NaN or inf values for cases where the switch returns 0. With this optimization T.grad(T.switch(...)) has the right behavior. Exemple: x -> f(x) x -> g(x) y = T.switch(cond,f(x),g(x)) **without the optimization T.grad(y,x) -> grad(f(x),x) * grad(y,f(x)) + grad(g(x),x) * grad(y,g(x)) **with the optimization T.grad(y,x) -> switch(cond,grad(f(x),x), 0) + switch(cond,0,grad(g(x),x)) This will be particularly usefull for the lazyif because we skip an entire part of the graph. """ if node.op!=T.mul: return False for idx , i in enumerate(node.inputs): if i.owner and i.owner.op == T.switch: switch = i.owner try: if get_constant_value(switch.inputs[1]) == 0.: listmul = node.inputs[:idx] + node.inputs[idx+1:] fct = [T.switch(switch.inputs[0],0,T.mul(*(listmul + [switch.inputs[2]])))] fct[0].values_eq_approx = fct[0].type.values_eq_approx_remove_nan return fct except TypeError: pass try: if get_constant_value(switch.inputs[2]) == 0.: listmul = node.inputs[:idx] + node.inputs[idx+1:] fct = [T.switch(switch.inputs[0],T.mul(*(listmul + [switch.inputs[1]])),0)] fct[0].values_eq_approx = fct[0].type.values_eq_approx_remove_nan return fct except TypeError: pass return False | 6e91c9d42ec1c846e7c295687c514e04d53f9b89 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/6e91c9d42ec1c846e7c295687c514e04d53f9b89/opt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
16411,
67,
9610,
67,
17074,
12,
2159,
4672,
3536,
1220,
14850,
7297,
326,
28420,
543,
310,
3478,
316,
326,
2667,
30,
399,
18,
16411,
12,
37,
16,
56,
18,
9610,
12,
10013,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
16411,
67,
9610,
67,
17074,
12,
2159,
4672,
3536,
1220,
14850,
7297,
326,
28420,
543,
310,
3478,
316,
326,
2667,
30,
399,
18,
16411,
12,
37,
16,
56,
18,
9610,
12,
10013,
16,
... |
key = '<tr><div class="pagebox1" align="top"><em>Key:</em><br><b>UF</b> Used For (alternative term)<br> <b>RT</b> Related Term<br><b>BT</b> Broader Term<br><b>NT</b> Narrower Term<br><b>(n*)</b> Denotes author keyword</div></tr>' | def makeTagCloud(entries, outwords): """Using the counts for each of the tags, write a simple HTML page to standard output containing a tag cloud representation. The CSS describes ten levels, each of which has differing font-size's, line-height's and font-weight's. """ max = int(entries[0][0]) print "<html>" print "<head>" print "<title>Keyword Cloud</title>" print "<style type=\"text/css\">" print "<!--" print '.pagebox {color: #000; margin-left: 1em; margin-bottom: 1em; border: 1px solid #000; padding: 1em; background-color: #f1f1f1; font-family: arial, sans-serif; max-width: 700px; margin: 10px; padding-left: 10px; float: left;}' print '.pagebox1 {color: #B5B5B5; margin-left: 1em; margin-bottom: 1em; border: 1px dotted #B5B5B5; padding: 1em; background-color: #f2f2f2; font-family: arial, sans-serif; max-width: 300px; margin: 10px; padding-left: 10px; float: left;}' print '.pagebox2 {color: #000; margin-left: 1em; margin-bottom: 1em; border: 0px solid #000; padding: 1em; fond-size: x-small, font-family: arial, sans-serif; margin: 10px; padding-left: 10px; float: left;}' for i in range(0, 10): print ".level%d" % i print "{" if i < 1: print " color:#7094FF;" elif i < 5: print " color:#3366FF;" else: print " color:#003DF5;" print " font-size:%dpx;" % fontSize[i] print " line-height:%dpx;" % (fontSize[i] + 5) if i > 5: print " font-weight:bold;" print "}" print "-->" print "</style>" print "</head>" print "<body>" print "<table>" cloud_size = 80 detail_size = outwords details = "" cloud = "" cloud_list = [] if cloud_size > len(entries): cloud_size = len(entries) if detail_size > len(entries): detail_size = len(entries) details += '<tr><div class="pagebox2" align="top"><small>' for i in range(0, detail_size): if detail_size > 0: detail_size -= 1 details += "<b>" + str(entries[i][3]) + " </b>("+ str(entries[i][0]) if int(entries[i][8])>0: details += "*" details += ")<BR>" if len(str(entries[i][4]))>1: details += " UF (" + str(entries[i][2]) + "):" + str(entries[i][4]) + "<BR>" if len(str(entries[i][5]))>1: details += " RT:" + str(entries[i][5]) + "<BR>" if len(str(entries[i][6]))>1: details += " BT:" + str(entries[i][6]) + "<BR>" if len(str(entries[i][7]))>1: details += " NT:" + str(entries[i][7]) + "<BR>" details += "<BR>" details += '</small></div></tr>' cloud += '<tr><div class="pagebox" align="top">' # Generate some ad-hoc count distribution for i in range(0, len(entries)): if cloud_size > 0: cloud_size -= 1 tag = str(entries[i][3]) count = int(entries[i][0]) color = int(entries[i][8]) if count < (max/10): cloud_list.append([tag,0,color]) elif count < (max/7.5): cloud_list.append([tag,1,color]) elif count < (max/5): cloud_list.append([tag,2,color]) elif count < (max/4): cloud_list.append([tag,3,color]) elif count < (max/3): cloud_list.append([tag,4,color]) elif count < (max/2): cloud_list.append([tag,5,color]) elif count < (max/1.7): cloud_list.append([tag,6,color]) elif count < (max/1.5): cloud_list.append([tag,7,color]) elif count < (max/1.3): cloud_list.append([tag,8,color]) else: cloud_list.append([tag,9,color]) else: continue cloud_list.sort() for i in range(0, len(cloud_list)): cloud += '<span class=\"level%s\" ' % cloud_list[i][1] if int(cloud_list[i][2]) > 0: cloud += 'style="color:red" ' cloud += '> %s </span>' % cloud_list[i][0] cloud += '</div></tr>' key = '<tr><div class="pagebox1" align="top"><em>Key:</em><br><b>UF</b> Used For (alternative term)<br> <b>RT</b> Related Term<br><b>BT</b> Broader Term<br><b>NT</b> Narrower Term<br><b>(n*)</b> Denotes author keyword</div></tr>' print cloud print key print details print "</table></body>" print "</html>" | 64a338f3e936f0b7dd77fc005559df697fcc01ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/64a338f3e936f0b7dd77fc005559df697fcc01ce/bibclassifylib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
1805,
6230,
12,
8219,
16,
596,
3753,
4672,
3536,
7736,
326,
6880,
364,
1517,
434,
326,
2342,
16,
1045,
279,
4143,
3982,
1363,
358,
4529,
876,
4191,
279,
1047,
5051,
4335,
18,
1021,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
1805,
6230,
12,
8219,
16,
596,
3753,
4672,
3536,
7736,
326,
6880,
364,
1517,
434,
326,
2342,
16,
1045,
279,
4143,
3982,
1363,
358,
4529,
876,
4191,
279,
1047,
5051,
4335,
18,
1021,... | |
user = None | u = None | def http(request): """ authenticate via http basic/digest/ntlm auth """ from MoinMoin.request import RequestTwisted user = None # check if we are running Twisted if isinstance(request, RequestTwisted): username = request.twistd.getUser() password = request.twistd.getPassword() user = User(request, auth_username=username, password=password) else: env = request.env auth_type = env.get('AUTH_TYPE','') if auth_type in ['Basic', 'Digest', 'NTLM', 'Negotiate',]: username = env.get('REMOTE_USER','') if auth_type in ('NTLM', 'Negotiate',): # converting to standard case so the user can even enter wrong case # (added since windows does not distinguish between e.g. # "Mike" and "mike") username = username.split('\\')[-1] # split off domain e.g. # from DOMAIN\user # this "normalizes" the login name from {meier, Meier, MEIER} to Meier # put a comment sign in front of next line if you don't want that: username = username.title() user = User(request, auth_username=username) # XXX create (user? maybe should not happen here, but one layer higher to be # common for all auth methods if user and user.valid: return user else: return None | d0eead74f668ffe5a3696b60c6cd3c57faff0b75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/d0eead74f668ffe5a3696b60c6cd3c57faff0b75/auth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1062,
12,
2293,
4672,
3536,
8929,
3970,
1062,
5337,
19,
10171,
19,
16681,
81,
1357,
3536,
628,
490,
885,
49,
885,
18,
2293,
1930,
1567,
23539,
25444,
582,
273,
599,
468,
866,
309,
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,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1062,
12,
2293,
4672,
3536,
8929,
3970,
1062,
5337,
19,
10171,
19,
16681,
81,
1357,
3536,
628,
490,
885,
49,
885,
18,
2293,
1930,
1567,
23539,
25444,
582,
273,
599,
468,
866,
309,
732,
... |
raise RuntimeError, 'Unable to find \'%s\' in metadata' % (paramName)) | raise RuntimeError, 'Unable to find \'%s\' in metadata' % (paramName,) | def validateMetadata(metadata, metadataPolicy): paramNames = metadataPolicy.paramNames(1) for paramName in paramNames: if not metadata.exists(paramName): raise RuntimeError, 'Unable to find \'%s\' in metadata' % (paramName)) # TBD; VALIDATE AGAINST DICTIONARY FOR TYPE ETC | 9d38d3197e3a07c641dfec55b31b49426823d164 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6553/9d38d3197e3a07c641dfec55b31b49426823d164/MetadataStages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
2277,
12,
4165,
16,
1982,
2582,
4672,
579,
1557,
273,
1982,
2582,
18,
891,
1557,
12,
21,
13,
364,
11466,
316,
579,
1557,
30,
309,
486,
1982,
18,
1808,
12,
891,
461,
4672,
1002,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
2277,
12,
4165,
16,
1982,
2582,
4672,
579,
1557,
273,
1982,
2582,
18,
891,
1557,
12,
21,
13,
364,
11466,
316,
579,
1557,
30,
309,
486,
1982,
18,
1808,
12,
891,
461,
4672,
1002,
... |
def buildAllDemos(self): | def buildAllDemos(self, selectedVariant=None): demoData = [] if self.config: if "demobrowser" in self.config: demoBrowser = True | def buildAllDemos(self): for libraryName in self.libraries: library = self.libraries[libraryName] for versionName in library.versions: version = library.versions[versionName] if version.hasDemoDir: demoVariants = version.getDemoVariants() if demoVariants: for variant in demoVariants: version.buildDemo(variant) | 3c20e1728f21800cdd9de7d2a64596f42e2a380a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/3c20e1728f21800cdd9de7d2a64596f42e2a380a/repository.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
1595,
15058,
538,
12,
2890,
16,
3170,
9356,
33,
7036,
4672,
21477,
751,
273,
5378,
309,
365,
18,
1425,
30,
309,
315,
19117,
947,
3358,
6,
316,
365,
18,
1425,
30,
21477,
9132,
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,
1361,
1595,
15058,
538,
12,
2890,
16,
3170,
9356,
33,
7036,
4672,
21477,
751,
273,
5378,
309,
365,
18,
1425,
30,
309,
315,
19117,
947,
3358,
6,
316,
365,
18,
1425,
30,
21477,
9132,
273... |
print("test", test, "crashed --", str(type) + ":", value) sys.stdout.flush() | print("test", test, "crashed --", str(type) + ":", value, file=sys.stderr) sys.stderr.flush() | def runtest_inner(test, verbose, quiet, testdir=None, huntrleaks=False, debug=False): support.unload(test) testdir = findtestdir(testdir) if verbose: capture_stdout = None else: capture_stdout = io.StringIO() test_time = 0.0 refleak = False # True if the test leaked references. try: if test.startswith('test.'): abstest = test else: # Always import it from the test package abstest = 'test.' + test with saved_test_environment(test, verbose, quiet) as environment: start_time = time.time() the_package = __import__(abstest, globals(), locals(), []) the_module = getattr(the_package, test) # Old tests run to completion simply as a side-effect of # being imported. For tests based on unittest or doctest, # explicitly invoke their test_main() function (if it exists). indirect_test = getattr(the_module, "test_main", None) if indirect_test is not None: indirect_test() if huntrleaks: refleak = dash_R(the_module, test, indirect_test, huntrleaks) test_time = time.time() - start_time except support.ResourceDenied as msg: if not quiet: print(test, "skipped --", msg) sys.stdout.flush() return RESOURCE_DENIED, test_time except unittest.SkipTest as msg: if not quiet: print(test, "skipped --", msg) sys.stdout.flush() return SKIPPED, test_time except KeyboardInterrupt: raise except support.TestFailed as msg: print("test", test, "failed --", msg) sys.stdout.flush() return FAILED, test_time except: type, value = sys.exc_info()[:2] print("test", test, "crashed --", str(type) + ":", value) sys.stdout.flush() if verbose or debug: traceback.print_exc(file=sys.stdout) sys.stdout.flush() return FAILED, test_time else: if refleak: return FAILED, test_time if environment.changed: return ENV_CHANGED, test_time return PASSED, test_time | 11cabcf73d82ca0174de85144930ce87ee538581 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/11cabcf73d82ca0174de85144930ce87ee538581/regrtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
3813,
67,
7872,
12,
3813,
16,
3988,
16,
10902,
16,
1842,
1214,
33,
7036,
16,
366,
318,
313,
298,
581,
87,
33,
8381,
16,
1198,
33,
8381,
4672,
2865,
18,
318,
945,
12,
3813,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
3813,
67,
7872,
12,
3813,
16,
3988,
16,
10902,
16,
1842,
1214,
33,
7036,
16,
366,
318,
313,
298,
581,
87,
33,
8381,
16,
1198,
33,
8381,
4672,
2865,
18,
318,
945,
12,
3813,
13,
... |
return "[" + ",".join(e.id for e in self) + "]" | return "[" + ",".join(self.keys()) + "]" | def __repr__(self): return "[" + ",".join(e.id for e in self) + "]" | 3738637169745d2291f7ece7a62312aea4eee451 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11977/3738637169745d2291f7ece7a62312aea4eee451/element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
327,
13626,
397,
5753,
18,
5701,
12,
73,
18,
350,
364,
425,
316,
365,
13,
397,
9870,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
327,
13626,
397,
5753,
18,
5701,
12,
73,
18,
350,
364,
425,
316,
365,
13,
397,
9870,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
def window_configure(self, index, cnf={}, **kw): | def window_configure(self, index, cnf=None, **kw): | def window_configure(self, index, cnf={}, **kw): """Configure an embedded window at INDEX.""" if type(cnf) == StringType: x = self.tk.split(self.tk.call( self._w, 'window', 'configure', index, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call( (self._w, 'window', 'configure', index) + self._options(cnf, kw)) | de0de912af2cf06056f14da80b65af88192c45a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/de0de912af2cf06056f14da80b65af88192c45a8/Tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2742,
67,
14895,
12,
2890,
16,
770,
16,
23118,
33,
7036,
16,
2826,
9987,
4672,
3536,
11207,
392,
7488,
2742,
622,
12425,
12123,
309,
618,
12,
10305,
74,
13,
422,
31570,
30,
619,
273,
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,
2742,
67,
14895,
12,
2890,
16,
770,
16,
23118,
33,
7036,
16,
2826,
9987,
4672,
3536,
11207,
392,
7488,
2742,
622,
12425,
12123,
309,
618,
12,
10305,
74,
13,
422,
31570,
30,
619,
273,
3... |
return None | return None | def getInitiativesProjects(self, folder=None): """returns a list with projects related with a folder inside the Initiatives folder""" try: search_keywords = u' or '.join((folder.getLocalProperty('keywords', 'en')+' '+folder.getLocalProperty('title', 'en')).split()) expr = 'self.getCatalogedObjects(meta_type=\'%s\', approved=1, objectkeywords_%s=search_keywords)' % (METATYPE_NYSEMPROJECT, 'en') return eval(expr) except: return None | 9bafd90013beef4170a14ef742a93e7bdabaa85c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3287/9bafd90013beef4170a14ef742a93e7bdabaa85c/SEMIDESite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26458,
77,
8785,
15298,
12,
2890,
16,
3009,
33,
7036,
4672,
3536,
6154,
279,
666,
598,
10137,
3746,
598,
279,
3009,
4832,
326,
4378,
77,
8785,
3009,
8395,
775,
30,
1623,
67,
11771,
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,
26458,
77,
8785,
15298,
12,
2890,
16,
3009,
33,
7036,
4672,
3536,
6154,
279,
666,
598,
10137,
3746,
598,
279,
3009,
4832,
326,
4378,
77,
8785,
3009,
8395,
775,
30,
1623,
67,
11771,
273,
... |
Increase the maximum number of assignments, or extend the expiration date, of an existing HIT. NOTE: If a HIT has a status of Reviewable and the HIT is extended to make it Available, the HIT will not be returned by GetReviewableHITs, and its submitted assignments will not be returned by GetAssignmentsForHIT, until the HIT is Reviewable again. Assignment auto-approval will still happen on its original schedule, even if the HIT has been extended. Be sure to retrieve and approve (or reject) submitted assignments before extending the HIT, if so desired. | Increase the maximum number of assignments, or extend the expiration date, of an existing HIT. NOTE: If a HIT has a status of Reviewable and the HIT is extended to make it Available, the HIT will not be returned by GetReviewableHITs, and its submitted assignments will not be returned by GetAssignmentsForHIT, until the HIT is Reviewable again. Assignment auto-approval will still happen on its original schedule, even if the HIT has been extended. Be sure to retrieve and approve (or reject) submitted assignments before extending the HIT, if so desired. | def extend_hit(self, hit_id, assignments_increment=None, expiration_increment=None): """ Increase the maximum number of assignments, or extend the expiration date, of an existing HIT. NOTE: If a HIT has a status of Reviewable and the HIT is extended to make it Available, the HIT will not be returned by GetReviewableHITs, and its submitted assignments will not be returned by GetAssignmentsForHIT, until the HIT is Reviewable again. Assignment auto-approval will still happen on its original schedule, even if the HIT has been extended. Be sure to retrieve and approve (or reject) submitted assignments before extending the HIT, if so desired. """ # must provide assignment *or* expiration increment if (assignments_increment is None and expiration_increment is None) or \ (assignments_increment is not None and expiration_increment is not None): raise ValueError("Must specify either assignments_increment or expiration_increment, but not both") | ccfdc9ec5c0cd1044df8085ab2d2c98d4f4618d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1098/ccfdc9ec5c0cd1044df8085ab2d2c98d4f4618d0/connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2133,
67,
15989,
12,
2890,
16,
6800,
67,
350,
16,
13610,
67,
15016,
33,
7036,
16,
7686,
67,
15016,
33,
7036,
4672,
3536,
657,
11908,
326,
4207,
1300,
434,
13610,
16,
578,
2133,
326,
76... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2133,
67,
15989,
12,
2890,
16,
6800,
67,
350,
16,
13610,
67,
15016,
33,
7036,
16,
7686,
67,
15016,
33,
7036,
4672,
3536,
657,
11908,
326,
4207,
1300,
434,
13610,
16,
578,
2133,
326,
76... |
print "Cancel" | utils.debug("Cancel") | def ShowDialogCloseProject(self): print "ShowDialogCloseProject" session = ses.Session() st = session.project_status print "* st", st if st == const.PROJ_CLOSE: return -1 filename = session.project_path[1] if (st == const.PROJ_NEW) or (st == const.PROJ_CHANGE): answer = dialog.SaveChangesDialog(filename) if not answer: print "Close without changes" self.CloseProject() ps.Publisher().sendMessage("Enable state project", False) ps.Publisher().sendMessage('Set project name') elif answer == 1: self.ShowDialogSaveProject() print "Save changes and close" self.CloseProject() ps.Publisher().sendMessage("Enable state project", False) ps.Publisher().sendMessage('Set project name') elif answer == -1: print "Cancel" else: self.CloseProject() ps.Publisher().sendMessage("Enable state project", False) ps.Publisher().sendMessage('Set project name') | effbb9a2aa1544431774c17b256fffff9cfdd9f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10228/effbb9a2aa1544431774c17b256fffff9cfdd9f2/control.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9674,
6353,
4605,
4109,
12,
2890,
4672,
1172,
315,
5706,
6353,
4605,
4109,
6,
1339,
273,
24138,
18,
2157,
1435,
384,
273,
1339,
18,
4406,
67,
2327,
1172,
15902,
384,
3113,
384,
309,
384,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9674,
6353,
4605,
4109,
12,
2890,
4672,
1172,
315,
5706,
6353,
4605,
4109,
6,
1339,
273,
24138,
18,
2157,
1435,
384,
273,
1339,
18,
4406,
67,
2327,
1172,
15902,
384,
3113,
384,
309,
384,... |
ok_sys_names = ('ps1', 'ps2', 'copyright', 'version', | ok_sys_names = ('ps1', 'ps2', 'copyright', 'version', 'hexversion', | def default_path(self): return self.rexec.modules['sys'].path | 69dc0c5bf5aff342afb4fa35c44dc726e2cd772f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/69dc0c5bf5aff342afb4fa35c44dc726e2cd772f/rexec.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
803,
12,
2890,
4672,
327,
365,
18,
266,
92,
557,
18,
6400,
3292,
9499,
29489,
803,
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,
805,
67,
803,
12,
2890,
4672,
327,
365,
18,
266,
92,
557,
18,
6400,
3292,
9499,
29489,
803,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'Requirements':None | 'Test_method':getattr(self,"group_processor") | def __init__(self): self.attr = { | 08e4c95267b2490d8ad400cc6c685442327a1a9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/08e4c95267b2490d8ad400cc6c685442327a1a9a/LSCfileAdd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
1747,
273,
288,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
1747,
273,
288,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
parser = OptionParser(option_list=parser_opts + [_DRY_RUN_OPT], | parser = OptionParser(option_list=parser_opts + [_DRY_RUN_OPT, DEBUG_OPT], | def _ParseArgs(argv, commands, aliases): """Parser for the command line arguments. This function parses the arguments and returns the function which must be executed together with its (modified) arguments. @param argv: the command line @param commands: dictionary with special contents, see the design doc for cmdline handling @param aliases: dictionary with command aliases {'alias': 'target, ...} """ if len(argv) == 0: binary = "<command>" else: binary = argv[0].split("/")[-1] if len(argv) > 1 and argv[1] == "--version": ToStdout("%s (ganeti) %s", binary, constants.RELEASE_VERSION) # Quit right away. That way we don't have to care about this special # argument. optparse.py does it the same. sys.exit(0) if len(argv) < 2 or not (argv[1] in commands or argv[1] in aliases): # let's do a nice thing sortedcmds = commands.keys() sortedcmds.sort() ToStdout("Usage: %s {command} [options...] [argument...]", binary) ToStdout("%s <command> --help to see details, or man %s", binary, binary) ToStdout("") # compute the max line length for cmd + usage mlen = max([len(" %s" % cmd) for cmd in commands]) mlen = min(60, mlen) # should not get here... # and format a nice command list ToStdout("Commands:") for cmd in sortedcmds: cmdstr = " %s" % (cmd,) help_text = commands[cmd][4] help_lines = textwrap.wrap(help_text, 79 - 3 - mlen) ToStdout("%-*s - %s", mlen, cmdstr, help_lines.pop(0)) for line in help_lines: ToStdout("%-*s %s", mlen, "", line) ToStdout("") return None, None, None # get command, unalias it, and look it up in commands cmd = argv.pop(1) if cmd in aliases: if cmd in commands: raise errors.ProgrammerError("Alias '%s' overrides an existing" " command" % cmd) if aliases[cmd] not in commands: raise errors.ProgrammerError("Alias '%s' maps to non-existing" " command '%s'" % (cmd, aliases[cmd])) cmd = aliases[cmd] func, args_def, parser_opts, usage, description = commands[cmd] parser = OptionParser(option_list=parser_opts + [_DRY_RUN_OPT], description=description, formatter=TitledHelpFormatter(), usage="%%prog %s %s" % (cmd, usage)) parser.disable_interspersed_args() options, args = parser.parse_args() if not _CheckArguments(cmd, args_def, args): return None, None, None return func, options, args | 064c21f8d579ac364e62272ab5c3253263d06c45 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/064c21f8d579ac364e62272ab5c3253263d06c45/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3201,
2615,
12,
19485,
16,
4364,
16,
6900,
4672,
3536,
2678,
364,
326,
1296,
980,
1775,
18,
225,
1220,
445,
8940,
326,
1775,
471,
1135,
326,
445,
1492,
1297,
506,
7120,
9475,
598,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3201,
2615,
12,
19485,
16,
4364,
16,
6900,
4672,
3536,
2678,
364,
326,
1296,
980,
1775,
18,
225,
1220,
445,
8940,
326,
1775,
471,
1135,
326,
445,
1492,
1297,
506,
7120,
9475,
598,
... |
t = tree.asETE(CONS) | t = asETE(CONS) | def test_ape(self): try: import rpy2.robjects as robjects except ImportError: print "\nNo rpy2 support. Skipping.\n" return # R | 5fd54c08987f135c3a21b4c88a2466e1779681d7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14016/5fd54c08987f135c3a21b4c88a2466e1779681d7/test_all.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1273,
12,
2890,
4672,
775,
30,
1930,
436,
2074,
22,
18,
303,
489,
87,
487,
721,
489,
87,
1335,
11308,
30,
1172,
1548,
82,
2279,
436,
2074,
22,
2865,
18,
27455,
8403,
82,
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,
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,
1273,
12,
2890,
4672,
775,
30,
1930,
436,
2074,
22,
18,
303,
489,
87,
487,
721,
489,
87,
1335,
11308,
30,
1172,
1548,
82,
2279,
436,
2074,
22,
2865,
18,
27455,
8403,
82,
6,... |
"""Connect to a new server, possible disconnecting from the current. | """Connect to a new server, possibly disconnecting from the current. | def jump_server(self): """Connect to a new server, possible disconnecting from the current. | ecabcc7a91f3433432b3ed60060b28aaae37518b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/426/ecabcc7a91f3433432b3ed60060b28aaae37518b/ircbot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11833,
67,
3567,
12,
2890,
4672,
3536,
5215,
358,
279,
394,
1438,
16,
3323,
9479,
310,
628,
326,
783,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11833,
67,
3567,
12,
2890,
4672,
3536,
5215,
358,
279,
394,
1438,
16,
3323,
9479,
310,
628,
326,
783,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
content = cat(object_provides=IDynamicType.__identifier__) | query = {'object_provides': IDynamicType.__identifier__} if HAS_LINGUAPLONE: query['Language'] = 'all' content = cat(query) | def register_all_content_for_intids(portal): """Registers all existing content with the intid utility. This will not be fast.""" cat = getToolByName(portal, 'portal_catalog', None) intids = getUtility(IIntIds) register = intids.register # Take advantage of paths stored in keyreferences in five.intid to optimize # registration registered_paths = dict((ref.path,None) for ref in intids.ids if hasattr(ref, 'path')) # Count how many objects we register registered = 0 existing = 0 if cat is not None: content = cat(object_provides=IDynamicType.__identifier__) for brain in content: if brain.getPath() in registered_paths: existing += 1 continue try: obj = brain.getObject() register(obj) registered += 1 except (AttributeError, KeyError): pass return registered, existing | 4a1e7cc58363fa2738cd0cb308fe1284899208f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12255/4a1e7cc58363fa2738cd0cb308fe1284899208f3/setuphandlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1744,
67,
454,
67,
1745,
67,
1884,
67,
474,
2232,
12,
24386,
4672,
3536,
10277,
777,
2062,
913,
598,
326,
509,
350,
12788,
18,
225,
1220,
903,
486,
506,
4797,
12123,
6573,
273,
336,
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,
1744,
67,
454,
67,
1745,
67,
1884,
67,
474,
2232,
12,
24386,
4672,
3536,
10277,
777,
2062,
913,
598,
326,
509,
350,
12788,
18,
225,
1220,
903,
486,
506,
4797,
12123,
6573,
273,
336,
63... |
DeleteOldDocs(MakePath(docs_outpath)) BuildJavaScriptForDocsFromIDLs(idl_files, docs_js_outpath) BuildO3DDocsFromJavaScript([o3d_extra_externs_path] + docs_js_files, o3d_docs_ezt_outpath, o3d_docs_html_outpath) BuildO3DClassHierarchy(o3d_docs_html_outpath) BuildJavaScriptForExternsFromIDLs(idl_files, externs_js_outpath) BuildO3DExternsFile(externs_js_outpath, o3d_extra_externs_path, o3d_externs_path) BuildO3DJSDocs(o3djs_files + [o3d_externs_path], o3djs_docs_ezt_outpath, o3djs_docs_html_outpath, o3djs_exports_path) CopyStaticFiles(o3d_docs_ezt_outpath, o3d_docs_html_outpath) BuildCompiledO3DJS(o3djs_files + [o3djs_exports_path], externs_path, o3d_externs_path, compiled_o3djs_outpath) | try: DeleteOldDocs(MakePath(docs_outpath)) BuildJavaScriptForDocsFromIDLs(idl_files, docs_js_outpath) BuildO3DDocsFromJavaScript([o3d_extra_externs_path] + docs_js_files, o3d_docs_ezt_outpath, o3d_docs_html_outpath) BuildO3DClassHierarchy(o3d_docs_html_outpath) BuildJavaScriptForExternsFromIDLs(idl_files, externs_js_outpath) BuildO3DExternsFile(externs_js_outpath, o3d_extra_externs_path, o3d_externs_path) BuildO3DJSDocs(o3djs_files + [o3d_externs_path], o3djs_docs_ezt_outpath, o3djs_docs_html_outpath, o3djs_exports_path) CopyStaticFiles(o3d_docs_ezt_outpath, o3d_docs_html_outpath) BuildCompiledO3DJS(o3djs_files + [o3djs_exports_path], externs_path, o3d_externs_path, compiled_o3djs_outpath) except Exception: if os.path.exists(compiled_o3djs_outpath): os.unlink(compiled_o3djs_outpath) raise | def main(argv): """Builds the O3D API docs and externs and the o3djs docs.""" global _java_exe _java_exe = argv[0] global _third_party_dir _third_party_dir = argv[1] global _o3d_third_party_dir _o3d_third_party_dir = os.path.normpath( os.path.join(os.path.dirname(__file__), '..', 'third_party')) # Fix up the python path of subprocesses by setting PYTHONPATH. pythonpath = os.pathsep.join([MakePath(_o3d_third_party_dir, 'gflags', 'python'), MakePath(_o3d_third_party_dir, 'ply')]) orig_pythonpath = os.environ.get('PYTHONPATH') if orig_pythonpath: pythonpath = os.pathsep.join([pythonpath, orig_pythonpath]) os.environ['PYTHONPATH'] = pythonpath js_list_filename = MakePath('..', 'samples', 'o3djs', 'js_list.manifest') idl_list_filename = MakePath('..', 'plugin', 'idl_list.manifest') js_list_basepath = os.path.dirname(js_list_filename) idl_list_basepath = os.path.dirname(idl_list_filename) global _output_dir _output_dir = argv[2] docs_outpath = os.path.join(_output_dir, 'documentation') docs_js_outpath = MakePath(docs_outpath, 'apijs') externs_js_outpath = MakePath(_output_dir, 'externs') o3d_docs_ezt_outpath = MakePath(docs_outpath, 'reference') o3d_docs_html_outpath = MakePath(docs_outpath, 'local_html') o3djs_docs_ezt_outpath = MakePath(docs_outpath, 'reference', 'jsdocs') o3djs_docs_html_outpath = MakePath(docs_outpath, 'local_html', 'jsdocs') o3d_externs_path = MakePath(_output_dir, 'o3d-externs.js') o3djs_exports_path = MakePath(_output_dir, 'o3d-exports.js') compiled_o3djs_outpath = MakePath(docs_outpath, 'base.js') externs_path = MakePath('externs', 'externs.js') o3d_extra_externs_path = MakePath('externs', 'o3d-extra-externs.js') js_list = eval(open(js_list_filename, "r").read()) idl_list = eval(open(idl_list_filename, "r").read()) idl_files = AppendBasePath(idl_list_basepath, idl_list) o3djs_files = AppendBasePath(js_list_basepath, js_list) # we need to put base.js first? o3djs_files = ( filter(lambda x: x.endswith('base.js'), o3djs_files) + filter(lambda x: not x.endswith('base.js'), o3djs_files)) docs_js_files = [os.path.join( docs_js_outpath, os.path.splitext(os.path.basename(f))[0] + '.js') for f in idl_list] DeleteOldDocs(MakePath(docs_outpath)) BuildJavaScriptForDocsFromIDLs(idl_files, docs_js_outpath) BuildO3DDocsFromJavaScript([o3d_extra_externs_path] + docs_js_files, o3d_docs_ezt_outpath, o3d_docs_html_outpath) BuildO3DClassHierarchy(o3d_docs_html_outpath) BuildJavaScriptForExternsFromIDLs(idl_files, externs_js_outpath) BuildO3DExternsFile(externs_js_outpath, o3d_extra_externs_path, o3d_externs_path) BuildO3DJSDocs(o3djs_files + [o3d_externs_path], o3djs_docs_ezt_outpath, o3djs_docs_html_outpath, o3djs_exports_path) CopyStaticFiles(o3d_docs_ezt_outpath, o3d_docs_html_outpath) BuildCompiledO3DJS(o3djs_files + [o3djs_exports_path], externs_path, o3d_externs_path, compiled_o3djs_outpath) | 3e7824dcdcd1f84a553395630bbbe72a27612930 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/3e7824dcdcd1f84a553395630bbbe72a27612930/build_docs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
3536,
7746,
326,
531,
23,
40,
1491,
3270,
471,
18885,
87,
471,
326,
320,
23,
72,
2924,
3270,
12123,
2552,
389,
6290,
67,
14880,
389,
6290,
67,
14880,
273,
5261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
3536,
7746,
326,
531,
23,
40,
1491,
3270,
471,
18885,
87,
471,
326,
320,
23,
72,
2924,
3270,
12123,
2552,
389,
6290,
67,
14880,
389,
6290,
67,
14880,
273,
5261,
... |
[(-0.0588115223184494, 1)] | [(-0.058811522318449..., 1)] | def roots(self, x=None, explicit_solutions=True, multiplicities=True, ring=None): r""" Returns roots of \code{self} that can be found exactly, possibly with multiplicities. Not all roots are guaranteed to be found. | dfa036ef92143c44c03d532e743b903d0084e324 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/dfa036ef92143c44c03d532e743b903d0084e324/calculus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12876,
12,
2890,
16,
619,
33,
7036,
16,
5515,
67,
18281,
6170,
33,
5510,
16,
3309,
1780,
1961,
33,
5510,
16,
9221,
33,
7036,
4672,
436,
8395,
2860,
12876,
434,
521,
710,
95,
2890,
97,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12876,
12,
2890,
16,
619,
33,
7036,
16,
5515,
67,
18281,
6170,
33,
5510,
16,
3309,
1780,
1961,
33,
5510,
16,
9221,
33,
7036,
4672,
436,
8395,
2860,
12876,
434,
521,
710,
95,
2890,
97,
... |
'''The bundler creates dependent clauses based on the bundle/translation scheme from bcfg1''' | def BuildBundle(self, metadata, system): bundlename = self.name.split('/')[-1] b = Element('Bundle', name=bundlename) for entry in self.all + self.systems.get(system, []): b.append(deepcopy(entry)) for attribute in metadata.attributes: for entry in self.attributes.get(attribute, []): b.append(deepcopy(entry)) return b | a88287c17ca88c3972086dd50d769903f139f9f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/a88287c17ca88c3972086dd50d769903f139f9f9/Bundler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3998,
3405,
12,
2890,
16,
1982,
16,
2619,
4672,
324,
1074,
14724,
273,
365,
18,
529,
18,
4939,
2668,
2473,
13,
18919,
21,
65,
324,
273,
3010,
2668,
3405,
2187,
508,
33,
70,
1074,
14724... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3998,
3405,
12,
2890,
16,
1982,
16,
2619,
4672,
324,
1074,
14724,
273,
365,
18,
529,
18,
4939,
2668,
2473,
13,
18919,
21,
65,
324,
273,
3010,
2668,
3405,
2187,
508,
33,
70,
1074,
14724... | |
print "Adding str" | def addOptions(self, plugin, options = {}): for i in self.tw: self.tw[i].destroy() self.options = options self.plugin = plugin self.PluginLabel.set_markup("<b>%s</b>" % plugin) c = 0 for name, data in options.items(): if plugin not in self.settings.frame.np.config.sections["plugins"] or name not in self.settings.frame.np.config.sections["plugins"][plugin]: if plugin not in self.settings.frame.np.config.sections["plugins"]: print "No1 " + plugin + ", " + repr(self.settings.frame.np.config.sections["plugins"].keys()) elif name not in self.settings.frame.np.config.sections["plugins"][plugin]: print "No2 " + name + ", " + repr(self.settings.frame.np.config.sections["plugins"][plugin].keys()) continue """ We currently support SpinButtons, TreeView (one per plugin), and Checkboxes, but there's no reason more widgets cannot be added, and we can use self.settings.SetWidget and self.settings.GetWidgetData to set and get values | 6441737c16ed337f841f0e8ce45a891315fdaa6e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8738/6441737c16ed337f841f0e8ce45a891315fdaa6e/settingswindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
1320,
12,
2890,
16,
1909,
16,
702,
273,
2618,
4672,
364,
277,
316,
365,
18,
11246,
30,
365,
18,
11246,
63,
77,
8009,
11662,
1435,
365,
18,
2116,
273,
702,
365,
18,
4094,
273,
19... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
1320,
12,
2890,
16,
1909,
16,
702,
273,
2618,
4672,
364,
277,
316,
365,
18,
11246,
30,
365,
18,
11246,
63,
77,
8009,
11662,
1435,
365,
18,
2116,
273,
702,
365,
18,
4094,
273,
19... | |
the p-adic precision of the base ring. | the `p`-adic precision of the base ring. | def prec(self): r""" Return the series precision of self. Note that this is different from the p-adic precision of the base ring. EXAMPLE:: sage: OverconvergentModularForms(3, 0, 1/2).prec() 20 sage: OverconvergentModularForms(3, 0, 1/2,prec=40).prec() 40 """ return self._prec | 51aabb4f4c1d25de708da4cd9e8295aeb8a186e7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/51aabb4f4c1d25de708da4cd9e8295aeb8a186e7/genus0.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13382,
12,
2890,
4672,
436,
8395,
2000,
326,
4166,
6039,
434,
365,
18,
3609,
716,
333,
353,
3775,
628,
326,
1375,
84,
68,
17,
20333,
6039,
434,
326,
1026,
9221,
18,
225,
5675,
21373,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13382,
12,
2890,
4672,
436,
8395,
2000,
326,
4166,
6039,
434,
365,
18,
3609,
716,
333,
353,
3775,
628,
326,
1375,
84,
68,
17,
20333,
6039,
434,
326,
1026,
9221,
18,
225,
5675,
21373,
2... |
msg = "WARNING: header file %s is CVS, but not in your directory"%(dir+"/"+x) print msg WARNINGS.append(msg) copied = [] for filename in files: srcfile = dir + "/" + filename dstfile = PREFIX + "/include/" + filename if (older(dstfile,srcfile)): copied.append(filename) WriteFile(dstfile,ReadFile(srcfile)) if (len(copied)>0): print "\nCompiling in directory: %s\n\nCopied headers: %s"%(dir,copied) | if ((skip=="ALL") or (skip.count(x)==0)): msg = "WARNING: header file %s is CVS, but not in your directory"%(dir+"/"+x) print msg WARNINGS.append(msg) | def CopyAllHeaders(dir): # get a list of headers dirlist = os.listdir(dir) dirlist.sort() files = fnmatch.filter(dirlist,"*.h")+fnmatch.filter(dirlist,"*.I")+fnmatch.filter(dirlist,"*.T") # sanity check - do headers in directory match headers in CVS? cvsentries = ReadCvsEntries(dir) if (cvsentries != 0): cvsheaders = fnmatch.filter(cvsentries,"*.h")+fnmatch.filter(cvsentries,"*.I")+fnmatch.filter(cvsentries,"*.T") for x in SetDifference(files, cvsheaders): msg = "WARNING: header file %s is in your directory, but not in CVS"%(dir+"/"+x) print msg WARNINGS.append(msg) for x in SetDifference(cvsheaders, files): msg = "WARNING: header file %s is CVS, but not in your directory"%(dir+"/"+x) print msg WARNINGS.append(msg) # actually copy the headers. copied = [] for filename in files: srcfile = dir + "/" + filename dstfile = PREFIX + "/include/" + filename if (older(dstfile,srcfile)): copied.append(filename) WriteFile(dstfile,ReadFile(srcfile)) if (len(copied)>0): print "\nCompiling in directory: %s\n\nCopied headers: %s"%(dir,copied) | a1a1bf8826ca0f4d0f41e04b2c8b5a6421d40ac7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/a1a1bf8826ca0f4d0f41e04b2c8b5a6421d40ac7/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5631,
1595,
3121,
12,
1214,
4672,
468,
336,
279,
666,
434,
1607,
1577,
1098,
273,
1140,
18,
1098,
1214,
12,
1214,
13,
1577,
1098,
18,
3804,
1435,
1390,
273,
18764,
18,
2188,
12,
1214,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5631,
1595,
3121,
12,
1214,
4672,
468,
336,
279,
666,
434,
1607,
1577,
1098,
273,
1140,
18,
1098,
1214,
12,
1214,
13,
1577,
1098,
18,
3804,
1435,
1390,
273,
18764,
18,
2188,
12,
1214,
... |
l_content = l_content.replace('@@ERRORVALUE@@', p_error_value) | l_content = l_content.replace('@@ERRORVALUE@@', str(p_error_value)) | def notifyOnErrorsEmail(self, p_to, p_from, p_error_url, p_error_ip, p_error_type, p_error_value, p_error_user, p_error_time): #notify on errors email email_template = self.getEmailTool()._getOb('email_notifyonerrors') l_subject = email_template.title l_content = email_template.body l_content = l_content.replace('@@URL@@', p_error_url) l_content = l_content.replace('@@ERRORTYPE@@', p_error_type) l_content = l_content.replace('@@ERRORVALUE@@', p_error_value) l_content = l_content.replace('@@IPADDRESS@@', p_error_ip) l_content = l_content.replace('@@USER@@', p_error_user) l_content = l_content.replace('@@TIMEOFREQUEST@@', str(p_error_time)) self.getEmailTool().sendEmail(l_content, p_to, p_from, l_subject) | 250f9aa8f4cffaaf8f5c9b760a328268274d0558 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3287/250f9aa8f4cffaaf8f5c9b760a328268274d0558/NySite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
1398,
4229,
4134,
12,
2890,
16,
293,
67,
869,
16,
293,
67,
2080,
16,
293,
67,
1636,
67,
718,
16,
293,
67,
1636,
67,
625,
16,
293,
67,
1636,
67,
723,
16,
293,
67,
1636,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5066,
1398,
4229,
4134,
12,
2890,
16,
293,
67,
869,
16,
293,
67,
2080,
16,
293,
67,
1636,
67,
718,
16,
293,
67,
1636,
67,
625,
16,
293,
67,
1636,
67,
723,
16,
293,
67,
1636,
67,
... |
client_version = tuple([ int(n) for n in _mysql.get_client_info().split('.')[:2] ]) | client_version = tuple([ numeric_part(n) for n in _mysql.get_client_info().split('.')[:2] ]) | def __init__(self, *args, **kwargs): """ | 1697ff85f1619949bf534946c59713963603b9ae /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10477/1697ff85f1619949bf534946c59713963603b9ae/connections.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
text('"' + gnode.uriref('foo@@:') + " -> " + o.uriref('foo@@:') + '"') | text('"' + gnode.uriref() + " -> " + o.uriref() + '"') | def eachNode(text, store, gnode, props): text('"' + gnode.uriref('foo@@:') + '" [') for p in props: for o in store.each(subj = gnode, pred = p): text(p.fragid) text('="') text(str(o)) # @@ quoting text('",\n') text("];\n") for p in store.each(pred=RDF.type, obj=GV.EdgeProperty): for o in store.each(subj=gnode, pred = p): text('"' + gnode.uriref('foo@@:') + " -> " + o.uriref('foo@@:') + '"') print "@@edge attributes..." | d8b4a86925ef10a931df6ecb86efc3a0fa6df7ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/d8b4a86925ef10a931df6ecb86efc3a0fa6df7ac/rdf2dot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1517,
907,
12,
955,
16,
1707,
16,
314,
2159,
16,
3458,
4672,
977,
2668,
5187,
397,
314,
2159,
18,
295,
577,
74,
2668,
11351,
30989,
2497,
13,
397,
2119,
306,
6134,
225,
364,
293,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1517,
907,
12,
955,
16,
1707,
16,
314,
2159,
16,
3458,
4672,
977,
2668,
5187,
397,
314,
2159,
18,
295,
577,
74,
2668,
11351,
30989,
2497,
13,
397,
2119,
306,
6134,
225,
364,
293,
316,
... |
yield Link('http://tracos.org/pida/report/', 'bugs') | yield Link('https://launchpad.net/products/pida/+bugs', 'bugs') | def _load_items(self): for module in CONF.get('modules', 'dirs').split(','): yield Directory(self, module, self) yield Link('http://tracos.org/pida/report/', 'bugs') | 73ccc9487603fc8a559d9b602fafc6e192cf66dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/73ccc9487603fc8a559d9b602fafc6e192cf66dc/www.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
945,
67,
3319,
12,
2890,
4672,
364,
1605,
316,
18733,
18,
588,
2668,
6400,
2187,
296,
8291,
16063,
4939,
12,
17023,
4672,
2824,
8930,
12,
2890,
16,
1605,
16,
365,
13,
2824,
4048,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
945,
67,
3319,
12,
2890,
4672,
364,
1605,
316,
18733,
18,
588,
2668,
6400,
2187,
296,
8291,
16063,
4939,
12,
17023,
4672,
2824,
8930,
12,
2890,
16,
1605,
16,
365,
13,
2824,
4048,
... |
elif (startswithany(publicId, ("-//w3c//dtd xhtml 1.0 frameset//", "-//w3c//dtd xhtml 1.0 transitional//")) or startswithany(publicId, ("-//w3c//dtd html 4.01 frameset//", "-//w3c//dtd html 4.01 transitional//")) and systemId != None): self.parser.compatMode = "limited quirks" self.parser.phase = self.parser.phases["beforeHtml"] def anythingElse(self): self.parser.compatMode = "quirks" self.parser.phase = self.parser.phases["beforeHtml"] def processCharacters(self, token): self.parser.parseError("expected-doctype-but-got-chars") self.anythingElse() self.parser.phase.processCharacters(token) def processStartTag(self, token): self.parser.parseError("expected-doctype-but-got-start-tag", {"name": token["name"]}) self.anythingElse() self.parser.phase.processStartTag(token) def processEndTag(self, token): self.parser.parseError("expected-doctype-but-got-end-tag", {"name": token["name"]}) self.anythingElse() self.parser.phase.processEndTag(token) def processEOF(self): self.parser.parseError("expected-doctype-but-got-eof") self.anythingElse() self.parser.phase.processEOF() class BeforeHtmlPhase(Phase): def insertHtmlElement(self): self.tree.insertRoot(impliedTagToken("html", "StartTag")) self.parser.phase = self.parser.phases["beforeHead"] def processEOF(self): self.insertHtmlElement() self.parser.phase.processEOF() def processComment(self, token): self.tree.insertComment(token, self.tree.document) def processSpaceCharacters(self, token): pass def processCharacters(self, token): self.insertHtmlElement() self.parser.phase.processCharacters(token) def processStartTag(self, token): if token["name"] == "html": self.parser.firstStartTag = True self.insertHtmlElement() self.parser.phase.processStartTag(token) def processEndTag(self, token): if token["name"] not in ("head", "body", "html", "br"): self.parser.parseError("unexpected-end-tag-before-html", | self.parser.phase = self.parser.phases["beforeHtml"] def processCharacters(self, token): self.parser.parseError("expected-doctype-but-got-chars") self.anythingElse() self.parser.phase.processCharacters(token) def processStartTag(self, token): self.parser.parseError("expected-doctype-but-got-start-tag", | def processDoctype(self, token): name = token["name"] publicId = token["publicId"] systemId = token["systemId"] correct = token["correct"] | 5cc56a5db432ce478d90ee0dd744811935854947 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10463/5cc56a5db432ce478d90ee0dd744811935854947/html5parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
3244,
12387,
12,
2890,
16,
1147,
4672,
508,
273,
1147,
9614,
529,
11929,
1071,
548,
273,
1147,
9614,
482,
548,
11929,
30083,
273,
1147,
9614,
4299,
548,
11929,
3434,
273,
1147,
9614,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
3244,
12387,
12,
2890,
16,
1147,
4672,
508,
273,
1147,
9614,
529,
11929,
1071,
548,
273,
1147,
9614,
482,
548,
11929,
30083,
273,
1147,
9614,
4299,
548,
11929,
3434,
273,
1147,
9614,... |
def history(self, oid, version, length=1): pass | def _loada(self, oid, _index, file): "Read any version and return the version" pos=_index[oid] file.seek(pos) read=file.read h=read(42) doid,serial,prev,tloc,vlen,plen = unpack(">8s8s8s8sH8s", h) if vlen: file.seek(16,1) version=read(vlen) else: version='' if plen != z64: return read(u64(plen)), version return _loadBack(file, oid, read(8))[0], version def _load(self, oid, version, _index, file): pos=_index[oid] file.seek(pos) read=file.read h=read(42) doid,serial,prev,tloc,vlen,plen = unpack(">8s8s8s8sH8s", h) if doid != oid: raise CorruptedDataError, h if vlen: pnv=read(8) if (not version or len(version) != vlen or (read(8) and version != read(vlen)) ): return _loadBack(file, oid, pnv) if plen != z64: return read(u64(plen)), serial pnv=read(8) return _loadBack(file, oid, pnv)[0], serial | def getSize(self): return self._pos | c717e4737d70d5e206ed68763b0a0252266215ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/c717e4737d70d5e206ed68763b0a0252266215ca/FileStorage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9950,
12,
2890,
4672,
327,
365,
6315,
917,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9950,
12,
2890,
4672,
327,
365,
6315,
917,
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,... |
if self.series_end() == len(self.series): | start = self.series_end() if start == len(self.series): | def push(self, repo, patch=None, force=False, list=False, mergeq=None): wlock = repo.wlock() if repo.dirstate.parents()[0] != repo.changelog.tip(): self.ui.status(_("(working directory not at tip)\n")) | 843bddc481c0f2c8dfe1b3e8d27af1f7e32b0b05 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/843bddc481c0f2c8dfe1b3e8d27af1f7e32b0b05/mq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1817,
12,
2890,
16,
3538,
16,
4729,
33,
7036,
16,
2944,
33,
8381,
16,
666,
33,
8381,
16,
2691,
85,
33,
7036,
4672,
341,
739,
273,
3538,
18,
91,
739,
1435,
309,
3538,
18,
72,
920,
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,
1817,
12,
2890,
16,
3538,
16,
4729,
33,
7036,
16,
2944,
33,
8381,
16,
666,
33,
8381,
16,
2691,
85,
33,
7036,
4672,
341,
739,
273,
3538,
18,
91,
739,
1435,
309,
3538,
18,
72,
920,
3... |
linenum = object.co_firstlineno - 1 if linenum >= len(lines): return (filename, linenum) pat = re.compile(r'^\s*def\s') while linenum > 0: if pat.match(lines[linenum]): break linenum = linenum - 1 | linenum = object.co_firstlineno | def _find_docstring(uid): """ @return: The file name and line number of the docstring for the given object; or C{None} if the docstring cannot be found. Line numbers are indexed from zero (i.e., the first line's line number is 0). @rtype: C{(string, int)} or C{(None, None)} """ # This function is based on inspect.findsource; but I don't want # to use that function directly, because it's not as smart about # finding modules for objects (esp. functions). # Get the filename of the source file. object = uid.value() try: if uid.is_module(): muid = uid else: muid = uid.module() filename = muid.value().__file__ except: return (None, None) if filename[-4:-1].lower() == '.py': filename = filename[:-1] # Read the source file's contents. try: lines = open(filename).readlines() except: return (None, None) # Figure out the starting line number of the object linenum = 0 if inspect.isclass(object): pat = re.compile(r'^\s*class\s*%s\b' % object.__name__) for linenum in range(len(lines)): if pat.match(lines[linenum]): break else: return (None, None) if inspect.ismethod(object): object = object.im_func if inspect.isfunction(object): object = object.func_code if inspect.istraceback(object): object = object.tb_frame if inspect.isframe(object): object = object.f_code if inspect.iscode(object): if not hasattr(object, 'co_firstlineno'): return (None, None) linenum = object.co_firstlineno - 1 if linenum >= len(lines): return (filename, linenum) pat = re.compile(r'^\s*def\s') while linenum > 0: if pat.match(lines[linenum]): break linenum = linenum - 1 # Find the line number of the docstring. for linenum in range(linenum, len(lines)): line = lines[linenum].split('#', 1)[0] pat = re.compile(r'(^|.*[^\\"\'])["\']') if pat.match(line): break else: return (None, None) return (filename, linenum) | f74adf05c6cddc04d78e5dc951a8c8150ca6fbd4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/f74adf05c6cddc04d78e5dc951a8c8150ca6fbd4/objdoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
24675,
12,
1911,
4672,
3536,
632,
2463,
30,
1021,
585,
508,
471,
980,
1300,
434,
326,
14525,
364,
326,
864,
733,
31,
578,
385,
95,
7036,
97,
309,
326,
14525,
2780,
506,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
24675,
12,
1911,
4672,
3536,
632,
2463,
30,
1021,
585,
508,
471,
980,
1300,
434,
326,
14525,
364,
326,
864,
733,
31,
578,
385,
95,
7036,
97,
309,
326,
14525,
2780,
506,
... |
args = [ action, str(url) ] | args = [ action, str(url)[7:] ] | def linkClicked(self, url): print 'clicked on link', url url = url.toString() | 3cf68df8003a6d476f728a844231cdf7f4caebf8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11141/3cf68df8003a6d476f728a844231cdf7f4caebf8/querywidget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1692,
27633,
12,
2890,
16,
225,
880,
4672,
1172,
296,
7475,
329,
603,
1692,
2187,
225,
880,
880,
273,
880,
18,
10492,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1692,
27633,
12,
2890,
16,
225,
880,
4672,
1172,
296,
7475,
329,
603,
1692,
2187,
225,
880,
880,
273,
880,
18,
10492,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
def _get_op(self, cr, uid, ids, field_names, arg, context): | def _get_op(self, cr, uid, ids, field_names, arg, context=None): | def _get_op(self, cr, uid, ids, field_names, arg, context): # op = OrderPoint res = {} for val in self.browse(cr, uid, ids, context=context): res[val.id]={} cr.execute("SELECT product_min_qty, product_max_qty, product_uom \ FROM stock_warehouse_orderpoint \ WHERE warehouse_id = %s AND product_id = %s AND active = 'TRUE'", (val.warehouse_id.id, val.product_id.id)) ret = cr.fetchone() or [0.0,0.0,False] coef = 1 round_value = 1 if ret[2]: coef = self._to_default_uom_factor(cr, uid, val, ret[2], context) res_coef, round_value = self._from_default_uom_factor(cr, uid, val, val.product_uom.id, context=context) coef = coef * res_coef res[val.id]['minimum_op'] = rounding(ret[0]*coef, round_value) res[val.id]['maximum_op'] = ret[1]*coef return res | 6a21b5d661b74602c870fac41f3c8c42e8bc6c33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6a21b5d661b74602c870fac41f3c8c42e8bc6c33/stock_planning.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
556,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
1973,
16,
1501,
16,
819,
33,
7036,
4672,
225,
468,
1061,
273,
4347,
2148,
400,
273,
2618,
364,
1244,
316,
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,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
556,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
1973,
16,
1501,
16,
819,
33,
7036,
4672,
225,
468,
1061,
273,
4347,
2148,
400,
273,
2618,
364,
1244,
316,
365,... |
month_name = _localized_name('%B') month_abbr = _localized_name('%b') | month_name = _localized_name('%B', 12) month_abbr = _localized_name('%b', 12) | def __getitem__(self, item): return strftime(self.format, (item,)*9).capitalize() | 4c8349592d508df26b9a8023f7a78d6874eedb08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4c8349592d508df26b9a8023f7a78d6874eedb08/calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
761,
4672,
327,
10405,
12,
2890,
18,
2139,
16,
261,
1726,
16,
17653,
29,
2934,
5909,
7053,
554,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
761,
4672,
327,
10405,
12,
2890,
18,
2139,
16,
261,
1726,
16,
17653,
29,
2934,
5909,
7053,
554,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"Parsing no/only (%d dicts in current" | "Parsing no/only (%d dicts in current " | def parse(self, file, list, restricted=False, prev_indent=-1): """ Read and parse lines from file until a line with an indent level lower than or equal to prev_indent is encountered. | 72823018182d7eebf6280a09d1f0e5d30df23356 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10349/72823018182d7eebf6280a09d1f0e5d30df23356/kvm_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
585,
16,
666,
16,
15693,
33,
8381,
16,
2807,
67,
9355,
29711,
21,
4672,
3536,
2720,
471,
1109,
2362,
628,
585,
3180,
279,
980,
598,
392,
3504,
1801,
2612,
2353,
578... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
585,
16,
666,
16,
15693,
33,
8381,
16,
2807,
67,
9355,
29711,
21,
4672,
3536,
2720,
471,
1109,
2362,
628,
585,
3180,
279,
980,
598,
392,
3504,
1801,
2612,
2353,
578... |
docs_token = self.doclist.GetClientLoginToken() self.doclist.SetClientLoginToken(self.spreadsheets.GetClientLoginToken()) | docs_token = self.client.GetClientLoginToken() self.client.SetClientLoginToken(self.spreadsheets.GetClientLoginToken()) | def testExportSpreadsheet(self): query = ('http://docs.google.com/feeds/documents/private/full' '/-/spreadsheet?max-results=1') feed = self.doclist.QueryDocumentListFeed(query) file_paths = ['./downloadedTest.xls', './downloadedTest.csv', './downloadedTest.pdf', './downloadedTest.ods', './downloadedTest.tsv', './downloadedTest.html'] docs_token = self.doclist.GetClientLoginToken() self.doclist.SetClientLoginToken(self.spreadsheets.GetClientLoginToken()) for path in file_paths: self.doclist.DownloadSpreadsheet(feed.entry[0], path) self.assert_(os.path.exists(path)) self.assert_(os.path.getsize(path)) os.remove(path) self.doclist.SetClientLoginToken(docs_token) | 6a1d41e0ebd05471e1aa915fdf0a98f4af4bce69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5609/6a1d41e0ebd05471e1aa915fdf0a98f4af4bce69/service_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
6144,
28719,
8118,
12,
2890,
4672,
843,
273,
7707,
2505,
2207,
8532,
18,
9536,
18,
832,
19,
7848,
87,
19,
24795,
19,
1152,
19,
2854,
11,
1173,
17,
19,
26007,
8118,
35,
1896,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
6144,
28719,
8118,
12,
2890,
4672,
843,
273,
7707,
2505,
2207,
8532,
18,
9536,
18,
832,
19,
7848,
87,
19,
24795,
19,
1152,
19,
2854,
11,
1173,
17,
19,
26007,
8118,
35,
1896,
17,
... |
minima=localMinmax(bi.gm,True,False,False) for y in range(minima.height()): for x in range(minima.width()): if minima[x,y]<0: minimaMap.insert(Vector2(x,y), Vector2(x,y)) for edge in map.edgeIter(): mindist = 1e8 | for min in minima: minimaMap.insert(min, min) for edge in map.edgeIter(): mindist2 = 1e16 | def __init__(self, map, bi): DynamicEdgeStatistics.__init__(self, map) self.attrName = _makeAttrName("minDist_"+bi.name) minimaMap = PositionedMap() minima=localMinmax(bi.gm,True,False,False) for y in range(minima.height()): for x in range(minima.width()): if minima[x,y]<0: minimaMap.insert(Vector2(x,y), Vector2(x,y)) for edge in map.edgeIter(): mindist = 1e8 for p in edge: d = (minimaMap(p)-p).magnitude() if (d < mindist): mindist = d setattr(edge, self.attrName, mindist) | 8925518c2ae9f74de3b734317beccbc4670dbd43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10394/8925518c2ae9f74de3b734317beccbc4670dbd43/statistics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
852,
16,
10054,
4672,
12208,
6098,
8569,
16186,
2738,
972,
12,
2890,
16,
852,
13,
365,
18,
1747,
461,
273,
389,
6540,
28973,
2932,
1154,
5133,
9548,
15,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
852,
16,
10054,
4672,
12208,
6098,
8569,
16186,
2738,
972,
12,
2890,
16,
852,
13,
365,
18,
1747,
461,
273,
389,
6540,
28973,
2932,
1154,
5133,
9548,
15,
... |
'There are no distros vailable that meet %s. Using our best.', req) | 'There are no distros available that meet %s. Using our best.', req) | def _satisfied(req, env, dest, executable, index, links): dists = [dist for dist in env[req.project_name] if dist in req] if not dists: logger.debug('We have no distributions for %s', req.project_name) return None # Note that dists are sorted from best to worst, as promised by # env.__getitem__ for dist in dists: if (dist.precedence == pkg_resources.DEVELOP_DIST): logger.debug('We have a develop egg for %s', req) return dist # Find an upprt limit in the specs, if there is one: specs = [(pkg_resources.parse_version(v), op) for (op, v) in req.specs] specs.sort() maxv = None greater = False lastv = None for v, op in specs: if op == '==' and not greater: maxv = v elif op in ('>', '>=', '!='): maxv = None greater == True elif op == '<': maxv = None greater == False elif op == '<=': maxv = v greater == False if v == lastv: # Repeated versions values are undefined, so # all bets are off maxv = None greater = True else: lastv = v best_we_have = dists[0] # Because dists are sorted from best to worst # Check if we have the upper limit if maxv is not None and best_we_have.version == maxv: logger.debug('We have the best distributon that satisfies\n%s', req) return best_we_have # We have some installed distros. There might, theoretically, be # newer ones. Let's find out which ones are available and see if # any are newer. We only do this if we're willing to install # something, which is only true if dest is not None: if dest is not None: best_available = _get_index(executable, index, links).obtain(req) else: best_available = None if best_available is None: # That's a bit odd. There aren't any distros available. # We should use the best one we have that meets the requirement. logger.debug( 'There are no distros vailable that meet %s. Using our best.', req) return best_we_have else: # Let's find out if we already have the best available: if best_we_have.parsed_version >= best_available.parsed_version: # Yup. Use it. logger.debug('We have the best distributon that satisfies\n%s', req) return best_we_have return None | 331de9a4f535f3e29496e8103427ec218eb814eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11359/331de9a4f535f3e29496e8103427ec218eb814eb/easy_install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12973,
21501,
12,
3658,
16,
1550,
16,
1570,
16,
9070,
16,
770,
16,
4716,
4672,
16871,
273,
306,
4413,
364,
2411,
316,
1550,
63,
3658,
18,
4406,
67,
529,
65,
309,
2411,
316,
1111,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12973,
21501,
12,
3658,
16,
1550,
16,
1570,
16,
9070,
16,
770,
16,
4716,
4672,
16871,
273,
306,
4413,
364,
2411,
316,
1550,
63,
3658,
18,
4406,
67,
529,
65,
309,
2411,
316,
1111,
... |
self.primaryTroveSet = primaryTroveSet self._inputSets = [ self.primaryTroveSet ] self._inputSets += [ x for x in args if isinstance(x, TroveTupleSet) ] def _applyFilters(self, l, graph = None): | inputSets = [ primaryTroveSet ] inputSets += [ x for x in args if isinstance(x, TroveTupleSet) ] self._inputSets = self._applyFilters(inputSets) self.primaryTroveSet = self._inputSets[0] def _applyFilters(self, l): if not self.prefilter: return l | def __init__(self, primaryTroveSet, *args): self.primaryTroveSet = primaryTroveSet self._inputSets = [ self.primaryTroveSet ] self._inputSets += [ x for x in args if isinstance(x, TroveTupleSet) ] | 547feb455a1a091526437036973b3dc1560449d6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8747/547feb455a1a091526437036973b3dc1560449d6/troveset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3354,
56,
303,
537,
694,
16,
380,
1968,
4672,
365,
18,
8258,
56,
303,
537,
694,
273,
3354,
56,
303,
537,
694,
365,
6315,
2630,
2785,
273,
306,
365,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3354,
56,
303,
537,
694,
16,
380,
1968,
4672,
365,
18,
8258,
56,
303,
537,
694,
273,
3354,
56,
303,
537,
694,
365,
6315,
2630,
2785,
273,
306,
365,
18,... |
gLogger.info("SEvsLFCAgent.execute: Attempting to execute %s sub-request." % operation) | gLogger.info( "SEvsLFCAgent.execute: Attempting to execute %s sub-request." % operation ) | def execute(self): | 00d8a55a0d409a04efa1a3f677ff9c2bc47dd619 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/00d8a55a0d409a04efa1a3f677ff9c2bc47dd619/SEvsLFCAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
cxx.ExprVar(md._cxx.method.name), | cxx.ExprVar(md._cxx.alloc), | block.addstmt(cxx.CppDirective('endif', '// ifdef DEBUG')) | 53837e42f63c8b55de89d5dc2a96ceb7a76ec3ea /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/53837e42f63c8b55de89d5dc2a96ceb7a76ec3ea/lower.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1203,
18,
1289,
10589,
12,
71,
5279,
18,
39,
11858,
13307,
2668,
409,
430,
2187,
12084,
309,
536,
6369,
26112,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1203,
18,
1289,
10589,
12,
71,
5279,
18,
39,
11858,
13307,
2668,
409,
430,
2187,
12084,
309,
536,
6369,
26112,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print (garbage, path) | def retrieve(self, url, filename=None): url = unwrap(url) if self.tempcache and self.tempcache.has_key(url): return self.tempcache[url] type, url1 = splittype(url) if not filename and (not type or type == 'file'): try: fp = self.open_local_file(url1) hdrs = fp.info() del fp return url2pathname(splithost(url1)[1]), hdrs except IOError, msg: pass fp = self.open(url) headers = fp.info() if not filename: import tempfile garbage, path = splittype(url) print (garbage, path) garbage, path = splithost(path or "") print (garbage, path) path, garbage = splitquery(path or "") print (path, garbage) path, garbage = splitattr(path or "") print (path, garbage) suffix = os.path.splitext(path)[1] filename = tempfile.mktemp(suffix) self.__tempfiles.append(filename) result = filename, headers if self.tempcache is not None: self.tempcache[url] = result tfp = open(filename, 'wb') bs = 1024*8 block = fp.read(bs) while block: tfp.write(block) block = fp.read(bs) fp.close() tfp.close() del fp del tfp return result | c74521acc4d3d08fe557a8ac835c1f827d107e7c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c74521acc4d3d08fe557a8ac835c1f827d107e7c/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4614,
12,
2890,
16,
880,
16,
1544,
33,
7036,
4672,
880,
273,
11014,
12,
718,
13,
309,
365,
18,
874,
2436,
807,
471,
365,
18,
874,
2436,
807,
18,
5332,
67,
856,
12,
718,
4672,
327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4614,
12,
2890,
16,
880,
16,
1544,
33,
7036,
4672,
880,
273,
11014,
12,
718,
13,
309,
365,
18,
874,
2436,
807,
471,
365,
18,
874,
2436,
807,
18,
5332,
67,
856,
12,
718,
4672,
327,
... | |
self.taskdone_ts.set_sort_column_id(self.CTASKS_MODEL_DDATE, gtk.SORT_DESCENDING) | self.taskdone_ts.set_sort_column_id( self.CTASKS_MODEL_DDATE, gtk.SORT_DESCENDING) | def refresh_closed(self): #We build the closed tasks pane dselect = self.taskdone_tview.get_selection() d_path = None if dselect: d_model, d_path = dselect.get_selected_rows() #pylint: disable-msg=W0612 #We empty the pane self.taskdone_ts.clear() #We rebuild it tag_list, notag_only = self.get_selected_tags() closed_tasks = self.req.get_closed_tasks_list(tags=tag_list,\ notag_only=notag_only) for tid in closed_tasks: t = self.req.get_task(tid) title_str = saxutils.escape(t.get_title()) closeddate = t.get_closed_date() closeddate_str = closeddate tags = t.get_tags() if self.priv["bg_color_enable"] and t.has_tags(): my_color = colors.background_color(t.get_tags()) else: my_color = None if t.get_status() == "Dismiss": title_str = "<span color=\"#AAAAAA\">%s</span>" % title_str closeddate_str = "<span color=\"#AAAAAA\">%s</span>" % closeddate self.taskdone_ts.append(None, [tid, t.get_color(), title_str, closeddate, closeddate_str, my_color, tags]) closed_selection = self.taskdone_tview.get_selection() if d_path: for i in d_path: closed_selection.select_path(i) self.taskdone_ts.set_sort_column_id(self.CTASKS_MODEL_DDATE, gtk.SORT_DESCENDING) | 451ea29e3924785bc6c6b8648aa6459b292a0db4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/451ea29e3924785bc6c6b8648aa6459b292a0db4/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
67,
12204,
12,
2890,
4672,
468,
3218,
1361,
326,
4375,
4592,
13618,
302,
4025,
273,
365,
18,
4146,
8734,
67,
88,
1945,
18,
588,
67,
10705,
1435,
302,
67,
803,
273,
599,
309,
302,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
67,
12204,
12,
2890,
4672,
468,
3218,
1361,
326,
4375,
4592,
13618,
302,
4025,
273,
365,
18,
4146,
8734,
67,
88,
1945,
18,
588,
67,
10705,
1435,
302,
67,
803,
273,
599,
309,
302,... |
"""Determine whether a line is a legal end of RFC-822 headers. You may override this method if your application wants to bend the rules, e.g. to strip trailing whitespace, or to recognize MH template separators ('--------'). For convenience (e.g. for code reading from sockets) a line consisting of \r\n also matches. | """Determine whether a line is a legal end of RFC 2822 headers. You may override this method if your application wants to bend the rules, e.g. to strip trailing whitespace, or to recognize MH template separators ('--------'). For convenience (e.g. for code reading from sockets) a line consisting of \r\n also matches. | def islast(self, line): """Determine whether a line is a legal end of RFC-822 headers. | 8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8ede07cdfca2de9fd7d4ed84bc2b545f5d60f4da/rfc822.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
2722,
12,
2890,
16,
980,
4672,
3536,
8519,
2856,
279,
980,
353,
279,
19286,
679,
434,
8372,
17,
24532,
1607,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
2722,
12,
2890,
16,
980,
4672,
3536,
8519,
2856,
279,
980,
353,
279,
19286,
679,
434,
8372,
17,
24532,
1607,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
f2 = self.tar.extractfile("S-SPARSE-WITH-NULLS") | f2 = self.tar.extractfile("/S-SPARSE-WITH-NULLS") | def test_sparse(self): """Test sparse member extraction. """ if self.sep != "|": f1 = self.tar.extractfile("S-SPARSE") f2 = self.tar.extractfile("S-SPARSE-WITH-NULLS") self.assert_(f1.read() == f2.read(), "_FileObject failed on sparse file member") | ff5c8b677975dc32839a3be17f3592a656c949b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff5c8b677975dc32839a3be17f3592a656c949b3/test_tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
17472,
12,
2890,
4672,
3536,
4709,
9387,
3140,
18752,
18,
3536,
309,
365,
18,
10814,
480,
11747,
6877,
284,
21,
273,
365,
18,
11718,
18,
8004,
768,
2932,
55,
17,
55,
21045,
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,
1842,
67,
17472,
12,
2890,
4672,
3536,
4709,
9387,
3140,
18752,
18,
3536,
309,
365,
18,
10814,
480,
11747,
6877,
284,
21,
273,
365,
18,
11718,
18,
8004,
768,
2932,
55,
17,
55,
21045,
7... |
"the Undo command. <b>Currently not implemented</b>."\ | "the Undo command."\ | def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "fileopen", self.fileOpenAction.iconSet().pixmap() ) self.fileOpenAction.setWhatsThis( fileOpenText ) #### Save File #### fileSaveText = "<u><b>Save File</b></u> (Ctrl + S)</b></p><br> "\ "<p><img source=\"filesave\"><br> "\ "Saves the current file."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "filesave", self.fileSaveAction.iconSet().pixmap() ) self.fileSaveAction.setWhatsThis( fileSaveText ) ############################################## # Edit Toolbar ############################################## #### Undo #### editUndoText = "<u><b>Undo</b></u> (Ctrl + Z)</b></p><br> "\ "<p><img source=\"editUndo\"><br> "\ "Reverses the last edit or command to the active part. "\ "<b>Currently not implemented</b>."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editUndo", self.editUndoAction.iconSet().pixmap() ) self.editUndoAction.setWhatsThis( editUndoText ) #### Redo #### editRedoText = "<u><b>Redo</b></u> (Ctrl + Y)</b></p><br> "\ "<p><img source=\"editRedo\"> <br>"\ "Re-applies the actions or commands on which you have used "\ "the Undo command. <b>Currently not implemented</b>."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editRedo", self.editRedoAction.iconSet().pixmap() ) self.editRedoAction.setWhatsThis( editRedoText ) #### Cut #### editCutText = "<u><b>Cut</b></u> (Ctrl + X)</b></p><br> "\ "<p><img source=\"editCut\"><br> "\ "Removes the selected object(s) and stores the cut data on the"\ "clipboard."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editCut", self.editCutAction.iconSet().pixmap() ) self.editCutAction.setWhatsThis( editCutText ) #### Copy #### editCopyText = "<u><b>Copy</b></u> (Ctrl + C)</b></p><br> "\ "<p><img source=\"editCopy\"><br> "\ "Places a copy of the selected chunk(s) on the clipboard "\ "while leaving the original chunk(s) unaffected."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editCopy", self.editCopyAction.iconSet().pixmap() ) self.editCopyAction.setWhatsThis( editCopyText ) #### Paste #### editPasteText = "<u><b>Paste</b></u> (Ctrl + V)</b></p><br> "\ "<p><img source=\"editPaste\"><br> "\ "<b>Paste</b> places the user in <b>Build</b> mode where copied chunks on "\ "the clipboard can be pasted into the model by double clicking in empty space. "\ "If the current clipboard chunk has a <b><i>hotspot</i></b>, it can be bonded to "\ "another chunk by single clicking on one of the chunk's bondpoints."\ "</p>"\ "<p>A <b><i>Hotspot</i></b> is a green bondpoint on a clipboard chunk indicating "\ "it will be the active bondpoint which will connect to another chunk's bondpoint. "\ "To specify a hotspot on the clipboard chunk, click on one of its bondpoints in the "\ "<b><i>MMKit's Thumbview</i></b>."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editPaste", self.editPasteAction.iconSet().pixmap() ) self.editPasteAction.setWhatsThis( editPasteText ) #### Delete #### editDeleteText = "<u><b>Delete</b></u> (DEL)</b></p><br> "\ "<p><img source=\"editDelete\"><br> "\ "Deletes the selected object(s). "\ "For this Alpha release, deleted objects may be permanently lost, or they might be recoverable using Undo.</p>" #bruce 060212 revised above text (and fixed spelling error); should be revised again before A7 release QMimeSourceFactory.defaultFactory().setPixmap( "editDelete", self.editDeleteAction.iconSet().pixmap() ) self.editDeleteAction.setWhatsThis( editDeleteText ) ############################################## # View Toolbar ############################################## #### Home View #### setViewHomeActionText = "<u><b>Home</b></u> (Home)<br>"\ "<p><img source=\"setViewHome\"><br> "\ "When you create a new model, it appears in a default view orientation (FRONT view). When you open an existing model, it appears in the orientation it was last saved. You can change the default orientation by selecting <b>Set Home View to Current View</b> from the <b>View</b> menu.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewHome", self.setViewHomeAction.iconSet().pixmap() ) self.setViewHomeAction.setWhatsThis( setViewHomeActionText ) #### Fit to Window #### setViewFitToWindowActionText = "<u><b>Fit To Window</b></u><br>"\ "<p><img source=\"setViewFitToWindow\"><br> "\ "Refits the model to the screen so you can view the entire model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewFitToWindow", self.setViewFitToWindowAction.iconSet().pixmap() ) self.setViewFitToWindowAction.setWhatsThis( setViewFitToWindowActionText ) #### Recenter #### setViewRecenterActionText = "<u><b>Recenter</b></u><br>"\ "<p><img source=\"setViewRecenter\"><br> "\ "Changes the view center and zoom factor so that the origin is in the "\ "center of the view and you can view the entire model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewRecenter", self.setViewRecenterAction.iconSet().pixmap() ) self.setViewRecenterAction.setWhatsThis( setViewRecenterActionText ) #### Zoom Tool #### setzoomToolActionText = "<u><b>Zoom Tool</b></u><br>"\ "<p><img source=\"setzoomTool\"><br> "\ "Allows the user to zoom into a specific area of the model by specifying a rectangular area. "\ "This is done by holding down the left button and dragging the mouse.</p>"\ "<p>A mouse with a mouse wheel can also be used to zoom in and out "\ "at any time, without using the Zoom Tool.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setzoomTool", self.zoomToolAction.iconSet().pixmap() ) self.zoomToolAction.setWhatsThis( setzoomToolActionText ) #### Pan Tool #### setpanToolActionText = "<u><b>Pan Tool</b></u><br>"\ "<p><img source=\"setpanTool\"><br> "\ "Allows X-Y panning using the left mouse button.</p>"\ "<p>Users with a 3-button mouse can pan the model at any time by pressing "\ "the middle mouse button while holding down the Shift key.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setpanTool", self.panToolAction.iconSet().pixmap() ) self.panToolAction.setWhatsThis( setpanToolActionText ) #### Rotate Tool #### setrotateToolActionText = "<u><b>Rotate Tool</b></u><br>"\ "<p><img source=\"setrotateTool\"><br> "\ "Allows free rotation using the left mouse button.</p>"\ "<p>Users with a 3-button mouse can rotate the model at any time by pressing "\ "the middle mouse button and dragging the mouse.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setrotateTool", self.rotateToolAction.iconSet().pixmap() ) self.rotateToolAction.setWhatsThis( setrotateToolActionText ) #### Orthographic Projection #### setViewOrthoActionText = "<u><b>Orthographic Projection</b></u><br>"\ "<p>Sets nonperspective (or parallel) projection, with no foreshortening."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewOrtho", self.setViewOrthoAction.iconSet().pixmap() ) self.setViewOrthoAction.setWhatsThis( setViewOrthoActionText ) #### Perspective Projection #### setViewPerspecActionText = "<u><b>Perspective Projection</b></u><br>"\ "<p>Set perspective projection, drawing objects slightly larger "\ "that are closer to the viewer."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewPerspec", self.setViewPerspecAction.iconSet().pixmap() ) self.setViewPerspecAction.setWhatsThis( setViewPerspecActionText ) #### Normal To #### setViewNormalToActionText = "<u><b>Set View Normal To</b></u><br>"\ "<p><img source=\"setViewNormalTo\"><br> "\ "Orients view to the normal vector of the plane defined by "\ "3 or more selected atoms, or a jig's axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewNormalTo", self.setViewNormalToAction.iconSet().pixmap() ) self.setViewNormalToAction.setWhatsThis( setViewNormalToActionText ) #### Parallel To #### setViewParallelToActionText = "<u><b>Set View Parallel To</b></u><br>"\ "<p><img source=\"setViewParallelTo\"><br> "\ "Orients view parallel to the vector defined by 2 selected atoms."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewParallelTo", self.setViewParallelToAction.iconSet().pixmap() ) self.setViewParallelToAction.setWhatsThis( setViewParallelToActionText ) #### Save Named View #### saveNamedViewActionText = "<u><b>Save Named View</b></u><br>"\ "<p><img source=\"saveNamedView\"><br> "\ "Saves the current view as a custom <b>named view</b> and places it in the Model Tree.</p>" \ "<p>The view can be restored by selecting <b>Change View</b> from its context menu in the Model Tree."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "saveNamedView", self.saveNamedViewAction.iconSet().pixmap() ) self.saveNamedViewAction.setWhatsThis( saveNamedViewActionText ) #### Front View #### setViewFrontActionText = "<u><b>Front View</b></u><br>"\ "<p><img source=\"setViewFront\"><br> "\ "Orients the view to the Front View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewFront", self.setViewFrontAction.iconSet().pixmap() ) self.setViewFrontAction.setWhatsThis( setViewFrontActionText ) #### Back View #### setViewBackActionText = "<u><b>Back View</b></u><br>"\ "<p><img source=\"setViewBack\"><br> "\ "Orients the view to the Back View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewBack", self.setViewBackAction.iconSet().pixmap() ) self.setViewBackAction.setWhatsThis( setViewBackActionText ) #### Top View #### setViewTopActionText = "<u><b>Top View</b></u><br>"\ "<p><img source=\"setViewTop\"><br> "\ "Orients the view to the Top View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewTop", self.setViewTopAction.iconSet().pixmap() ) self.setViewTopAction.setWhatsThis( setViewTopActionText ) #### Bottom View #### setViewBottomActionText = "<u><b>Bottom View</b></u><br>"\ "<p><img source=\"setViewBottom\"><br> "\ "Orients the view to the Bottom View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewBottom", self.setViewBottomAction.iconSet().pixmap() ) self.setViewBottomAction.setWhatsThis( setViewBottomActionText ) #### Left View #### setViewLeftActionText = "<u><b>Left View</b></u><br>"\ "<p><img source=\"setViewLeft\"><br> "\ "Orients the view to the Left View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewLeft", self.setViewLeftAction.iconSet().pixmap() ) self.setViewLeftAction.setWhatsThis( setViewLeftActionText ) #### Right View #### setViewRightActionText = "<u><b>Right View</b></u><br>"\ "<p><img source=\"setViewRight\"><br> "\ "Orients the view to the Right View."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewRight", self.setViewRightAction.iconSet().pixmap() ) self.setViewRightAction.setWhatsThis( setViewRightActionText ) #### Rotate View 180 #### setViewOppositeActionText = "<u><b>Rotate View 180</b></u><br>"\ "<p><img source=\"setViewOpposite\"><br> "\ "Rotates the view 180 degrees."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewOpposite", self.setViewOppositeAction.iconSet().pixmap() ) self.setViewOppositeAction.setWhatsThis( setViewOppositeActionText ) #### Rotate View +90 #### setViewPlus90ActionText = "<u><b>Rotate View +90</b></u><br>"\ "<p><img source=\"setViewPlus90\"><br> "\ "Increment the current view by 90 degrees around the vertical axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewPlus90", self.setViewPlus90Action.iconSet().pixmap() ) self.setViewPlus90Action.setWhatsThis( setViewPlus90ActionText ) #### Rotate View -90 #### setViewMinus90ActionText = "<u><b>Rotate View -90</b></u><br>"\ "<p><img source=\"setViewMinus90\"><br> "\ "Decrement the current view by 90 degrees around the vertical axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewMinus90", self.setViewMinus90Action.iconSet().pixmap() ) self.setViewMinus90Action.setWhatsThis( setViewMinus90ActionText ) ############################################## # Grids Toolbar ############################################## #### Surface 100 #### orient100ActionText = "<u><b>Surface 100</b></u><br>"\ "<p><img source=\"orient100Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,0,0) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient100Action", self.orient100Action.iconSet().pixmap() ) self.orient100Action.setWhatsThis(orient100ActionText ) #### Surface 110 #### orient110ActionText = "<u><b>Surface 110</b></u><br>"\ "<p><img source=\"orient110Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,1,0) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient110Action", self.orient110Action.iconSet().pixmap() ) self.orient110Action.setWhatsThis(orient110ActionText ) #### Surface 111 #### orient111ActionText = "<u><b>Surface 111</b></u><br>"\ "<p><img source=\"orient111Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,1,1) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient111Action", self.orient111Action.iconSet().pixmap() ) self.orient111Action.setWhatsThis(orient111ActionText ) ############################################## # Molecular Display toolbar ############################################## #### Display Default #### dispDefaultActionText = "<u><b>Display Default</b></u><br>"\ "<p><img source=\"dispDefaultAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Default</b> , rendering them in the <b>Current Display Mode</b>."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to the <b>Default Display Mode</b>. " \ "All chunks with their display setting set to <b>Default</b> will be rendered in the "\ "<b>Default Display Mode</b>."\ "</p>"\ "<p>The <b>Default Display Mode</b> can be changed via the "\ "<b>Edit > Preferences</b> menu and selecting the <b>General</b> tab."\ "</p>"\ "<p>The <b>Current or Default Display Mode</b> is displayed in the status bar in the "\ "lower right corner of the main window."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDefaultAction", self.dispDefaultAction.iconSet().pixmap() ) self.dispDefaultAction.setWhatsThis(dispDefaultActionText ) #### Display Invisible #### dispInvisActionText = "<u><b>Display Invisible</b></u><br>"\ "<p><img source=\"dispInvisAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Invisible</b>, making them invisible."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Invisible</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispInvisAction", self.dispInvisAction.iconSet().pixmap() ) self.dispInvisAction.setWhatsThis(dispInvisActionText ) #### Display Lines #### dispLinesActionText = "<u><b>Display Lines</b></u><br>"\ "<p><img source=\"dispLinesAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ " <b>Lines</b>. Only bonds are rendered as colored lines."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Lines</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispLinesAction", self.dispLinesAction.iconSet().pixmap() ) self.dispLinesAction.setWhatsThis(dispLinesActionText ) #### Display Tubes #### dispTubesActionText = "<u><b>Display Tubes</b></u><br>"\ "<p><img source=\"dispTubesAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Tubes</b>. Atoms and bonds are rendered as colored tubes."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Tubes</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispTubesAction", self.dispTubesAction.iconSet().pixmap() ) self.dispTubesAction.setWhatsThis(dispTubesActionText ) #### Display Ball and Stick (was CPK) #### dispCPKActionText = "<u><b>Display Ball and Stick</b></u><br>"\ "<p><img source=\"dispCPKAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Ball and Stick</b> mode. Atoms are rendered "\ "as spheres and bonds are rendered as narrow cylinders."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Ball and Stick</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>"\ "<p>The scale of the spheres and cylinders can be changed from the "\ "<b>Atoms</b> and <b>Bonds</b> pages of the <b>Preferences</b> dialog."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispCPKAction", self.dispCPKAction.iconSet().pixmap() ) self.dispCPKAction.setWhatsThis(dispCPKActionText ) #### Display CPK (was VdW) #### [bruce extended and slightly corrected text, 060307] dispVdWActionText = "<u><b>Display CPK</b></u><br>"\ "<p><img source=\"dispVdWAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>CPK</b> mode. Atoms are rendered as spheres with "\ "a size equal to 0.78 of their VdW radius, corresponding "\ "to a contact force of approximately 0.1 nN with neighboring "\ "nonbonded atoms. Bonds are not rendered."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>CPK</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>"\ "<p>The scale of the spheres can be changed from the "\ "<b>Atoms</b> and <b>Bonds</b> pages of the <b>Preferences</b> dialog."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispVdWAction", self.dispVdWAction.iconSet().pixmap() ) self.dispVdWAction.setWhatsThis(dispVdWActionText ) ############################################## # Select toolbar ############################################## #### Select All #### selectAllActionText = "<u><b>Select All</b></u> (Ctrl + A)</b></p><br>"\ "<p><img source=\"selectAllAction\"><br> "\ "During <b>Select Atoms</b> mode, this will select all the atoms in "\ "the model. Otherwise, this will select all the chunks in the model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectAllAction", self.selectAllAction.iconSet().pixmap() ) self.selectAllAction.setWhatsThis(selectAllActionText ) #### Select None #### selectNoneActionText = "<u><b>Select None</b></u></p><br>"\ "<p><img source=\"selectNoneAction\"><br> "\ "Unselects everything currently selected.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectNoneAction", self.selectNoneAction.iconSet().pixmap() ) self.selectNoneAction.setWhatsThis(selectNoneActionText ) #### Invert Selection #### selectInvertActionText = "<u><b>Invert Selection</b></u> <br> (Ctrl + Shift + I)</b></p><br>"\ "<p><img source=\"selectInvertAction\"><br> "\ "Inverts the current selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectInvertAction", self.selectInvertAction.iconSet().pixmap() ) self.selectInvertAction.setWhatsThis(selectInvertActionText ) #### Select Connected #### selectConnectedActionText = "<u><b>Select Connected</b></u> (Ctrl + Shift + C)</b></p><br>"\ "<p><img source=\"selectConnectedAction\"><br> "\ "Selects all the atoms that can be reached by the currently selected atom "\ "via an unbroken chain of bonds. </p>"\ "<p>To use this feature, you must first be in "\ "<b>Select Atoms</b> mode and select at least one atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectConnectedAction", self.selectConnectedAction.iconSet().pixmap() ) self.selectConnectedAction.setWhatsThis(selectConnectedActionText ) #### Select Doubly #### selectDoublyActionText = "<u><b>Select Doubly</b></u></b></p><br>"\ "<p><img source=\"selectDoublyAction\"><br> "\ "Selects all the atoms that can be reached from a currently selected "\ "atom through two disjoint unbroken chains of bonds. Atoms singly "\ "connected to this group and unconnected to anything else are also "\ "included in the selection.</p>"\ "<p>To use this feature, you must first be in "\ "<b>Select Atoms</b> mode and select at least one atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectDoublyAction", self.selectDoublyAction.iconSet().pixmap() ) self.selectDoublyAction.setWhatsThis(selectDoublyActionText ) #### Expand Selection #### selectExpandActionText = "<u><b>Expand Selection</b></u> (Ctrl + D)</b></p><br>"\ "<p><img source=\"selectExpandAction\"><br> "\ "Selects any atom that is a neighbor of a currently selected atom."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectExpandAction", self.selectExpandAction.iconSet().pixmap() ) self.selectExpandAction.setWhatsThis(selectExpandActionText ) #### Contract Selection #### selectContractActionText = "<u><b>Contract Selection</b></u> (Ctrl + Shift + D)</b></p><br>"\ "<p><img source=\"selectContractAction\"><br> "\ "Deselects any atom that is a neighbor of a non-picked atom or has a bondpoint."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectContractAction", self.selectContractAction.iconSet().pixmap() ) self.selectContractAction.setWhatsThis(selectContractActionText ) ############################################## # Modify Toolbar ############################################## #### Minimize Selection #### modifyMinimizeSelActionText = "<u><b>Minimize Selection</b></u> (Ctrl + M)</b></p><br>"\ "<p><img source=\"modifyMinimizeSelAction\"><br> "\ "Arranges the atoms (<i>of the current selection</i>) to their chemically stable point of "\ "equilibrium in reference to the other atoms in the structure."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMinimizeSelAction", self.modifyMinimizeSelAction.iconSet().pixmap() ) self.modifyMinimizeSelAction.setWhatsThis(modifyMinimizeSelActionText ) #### Minimize All #### modifyMinimizeAllActionText = "<u><b>Minimize All</b></u></p><br>"\ "<p><img source=\"modifyMinimizeAllAction\"><br> "\ "Arranges the atoms (<i>of the entire part</i>) to their chemically stable point of "\ "equilibrium in reference to the other atoms in the structure."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMinimizeAllAction", self.modifyMinimizeAllAction.iconSet().pixmap() ) self.modifyMinimizeAllAction.setWhatsThis(modifyMinimizeAllActionText ) #### Hydrogenate #### modifyHydrogenateActionText = "<u><b>Hydrogenate</b></u> </b></p><br>"\ "<p><img source=\"modifyHydrogenateAction\"><br> "\ "Adds hydrogen atoms to all the bondpoints in the selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyHydrogenateAction", self.modifyHydrogenateAction.iconSet().pixmap() ) self.modifyHydrogenateAction.setWhatsThis(modifyHydrogenateActionText ) #### Dehydrogenate #### modifyDehydrogenateActionText = "<u><b>Dehydrogenate</b></u><br>"\ "<p><img source=\"modifyDehydrogenateAction\"><br> "\ "Removes all hydrogen atoms from the selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyDehydrogenateAction", self.modifyDehydrogenateAction.iconSet().pixmap() ) self.modifyDehydrogenateAction.setWhatsThis(modifyDehydrogenateActionText ) #### Passivate #### modifyPassivateActionText = "<u><b>Passivate</b></u> (Ctrl + P)</b></p><br>"\ "<p><img source=\"modifyPassivateAction\"><br> "\ "Changes the types of incompletely bonded atoms to atoms with the "\ "right number of bonds, using atoms with the best atomic radius."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyPassivateAction", self.modifyPassivateAction.iconSet().pixmap() ) self.modifyPassivateAction.setWhatsThis(modifyPassivateActionText ) #### Stretch #### modifyStretchActionText = "<u><b>Stretch</b></u><br>"\ "<p><img source=\"modifyStretchAction\"><br> "\ "Stretches the bonds of the selected chunk(s).</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyStretchAction", self.modifyStretchAction.iconSet().pixmap() ) self.modifyStretchAction.setWhatsThis(modifyStretchActionText ) #### Delete Bonds #### modifyDeleteBondsActionText = "<u><b>Delete Bonds</b></u><br>"\ "<p><img source=\"modifyDeleteBondsAction\"><br> "\ "Delete all bonds between selected and unselected atoms or chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyDeleteBondsAction", self.modifyDeleteBondsAction.iconSet().pixmap() ) self.modifyDeleteBondsAction.setWhatsThis(modifyDeleteBondsActionText ) #### Separate #### modifySeparateActionText = "<u><b>Separate</b></u><br>"\ "<p><img source=\"modifySeparateAction\"><br> "\ "Creates a new chunk from the currently selected atoms.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifySeparateAction", self.modifySeparateAction.iconSet().pixmap() ) self.modifySeparateAction.setWhatsThis(modifySeparateActionText ) #### Merge Chunks #### modifyMergeActionText = "<u><b>Merge Chunks</b></u><br>"\ "<p><img source=\"modifyMergeAction\"><br> "\ "Merges two or more chunks into a single chunk.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMergeAction", self.modifyMergeAction.iconSet().pixmap() ) self.modifyMergeAction.setWhatsThis(modifyMergeActionText ) #### Invert Chunks #### modifyInvertActionText = "<u><b>Invert</b></u><br>"\ "<p><img source=\"modifyInvertAction\"><br> "\ "Inverts the atoms of the selected chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyInvertAction", self.modifyInvertAction.iconSet().pixmap() ) self.modifyInvertAction.setWhatsThis(modifyInvertActionText ) #### Align to Common Axis #### modifyAlignCommonAxisActionText = "<u><b>Align To Common Axis</b></u><br>"\ "<p><img source=\"modifyAlignCommonAxis\"><br> "\ "Aligns one or more chunks to the axis of the first selected chunk."\ "You must select two or more chunks before using this feature."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyAlignCommonAxis", self. modifyAlignCommonAxisAction.iconSet().pixmap() ) self. modifyAlignCommonAxisAction.setWhatsThis( modifyAlignCommonAxisActionText ) ############################################## # Tools Toolbar ############################################## #### Select Chunks #### toolsSelectMoleculesActionText = "<u><b>Select Chunks</b></u><!-- [[Feature:Select Chunks Mode]] --><br>"\ "<p><img source=\" toolsSelectMoleculesAction\"><br> "\ "<b>Select Chunks</b> allows you to select/unselect chunks with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Click/Drag</b> - selects a chunk(s).</p>"\ "<p><b>Ctrl+Left Click/Drag</b> - removes chunk(s) from selection.</p>"\ "<p><b>Shift+Left Click/Drag</b> - adds chunk(s) to selection."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsSelectMoleculesAction", self. toolsSelectMoleculesAction.iconSet().pixmap() ) self. toolsSelectMoleculesAction.setWhatsThis( toolsSelectMoleculesActionText ) #### Select Atoms #### toolsSelectAtomsActionText = "<u><b>Select Atoms</b></u><!-- [[Feature:Select Atoms Mode]] --><br>"\ "<p><img source=\" toolsSelectAtomsAction\"><br> "\ "<b>Select Atoms</b> allows you to select/unselect atoms with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Click/Drag</b> - selects an atom(s).</p>"\ "<p><b>Ctrl+Left Click/Drag</b> - removes atom(s) from selection.</p>"\ "<p><b>Shift+Left Click/Drag</b> - adds atom(s) to selection."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsSelectAtomsAction", self. toolsSelectAtomsAction.iconSet().pixmap() ) self. toolsSelectAtomsAction.setWhatsThis( toolsSelectAtomsActionText ) #### Move Chunks #### toolsMoveMoleculeActionText = "<u><b>Move Chunks</b></u><!-- [[Feature:Move Chunks Mode]] --><br>"\ "<p><img source=\" toolsMoveMoleculeAction\"><br> "\ "Activates <b>Move Chunks</b> mode, allowing you to select, "\ "move and rotate one of more chunks with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Drag</b> - moves the selected chunk(s).</p>"\ "<p><b>Ctrl+Left Drag</b> - freely rotates selected chunk(s).</p>"\ "<p><b>Shift+Left Drag</b> - constrained movement and rotation of a chunk about its own axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsMoveMoleculeAction", self. toolsMoveMoleculeAction.iconSet().pixmap() ) self. toolsMoveMoleculeAction.setWhatsThis( toolsMoveMoleculeActionText ) #### Build Atoms Tool #### toolsDepositAtomActionText = "<u><b>Build Tool</b></u><!-- [[Feature:Build Mode]] --><br>"\ "<p><img source=\" toolsDepositAtomAction\"><br> "\ "<b>Build Mode</b> allows you to build structures by depositing objects "\ "from the Molecular Modeling Kit, including atoms, clipboard objects and parts "\ "from the nanoENGINEER-1 Library.</p>"\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsDepositAtomAction", self. toolsDepositAtomAction.iconSet().pixmap() ) self. toolsDepositAtomAction.setWhatsThis( toolsDepositAtomActionText ) #### Cookie Cutter #### toolsCookieCutActionText = "<u><b>Cookie Cutter Tool</b></u><!-- [[Feature:Cookie Cutter Mode]] --><br>"\ "<p><><img source=\" toolsCookieCutAction\"><br> "\ "Activates <b>Cookie Cutter</b> mode, allowing you to cut out 3-D shapes from a "\ "slab of diamond or lonsdaleite lattice.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsCookieCutAction", self. toolsCookieCutAction.iconSet().pixmap() ) self. toolsCookieCutAction.setWhatsThis( toolsCookieCutActionText ) #### Extrude Tool #### toolsExtrudeActionText = "<u><b>Extrude Tool</b></u><!-- [[Feature:Extrude Mode]] --><br>"\ "<p><img source=\" toolsExtrudeAction\"><br> "\ "Activates <b>Extrude</b> mode, allowing you to create a rod or ring using a chunk as "\ "a repeating unit.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsExtrudeAction", self. toolsExtrudeAction.iconSet().pixmap() ) self. toolsExtrudeAction.setWhatsThis( toolsExtrudeActionText ) #### Fuse Chunks Tool #### toolsFuseChunksActionText = "<u><b>Fuse Chunks Tool</b></u><!-- [[Feature:Fuse Chunks Mode]] --><br>"\ "<p><img source=\" toolsFuseChunksAction\"><br> "\ "<b>Fuse Chunks</b> can be used to interactively join two or more "\ "chunks by dragging chunks around and fusing them together. "\ "Two types of fusing are supported:<br><br>"\ "<b>Make Bonds</b> creates bonds between the existing bondpoints) "\ "of two or more chunks. Bonds are drawn (and undrawn) as chunks "\ "are moved together (and apart).<br><br>"\ "<b>Fuse Atoms</b> fuses overlapping atoms between chunks. Overlapping "\ "pairs of atoms are highlighted in green and blue to indicate which atoms "\ "will be fused.<br>"\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsFuseChunksAction", self. toolsFuseChunksAction.iconSet().pixmap() ) self.toolsFuseChunksAction.setWhatsThis( toolsFuseChunksActionText ) #### Fuse Atoms Tool #### toolsFuseAtomsActionText = "<u><b>Fuse Atoms Tool</b></u><!-- [[Feature:Fuse Atoms Mode]] (nim?) --><br>"\ "<p><img source=\" toolsFuseAtomsAction\"><br> "\ "<b>Fuse Atoms</b> fuses the overlapping atoms between two or more chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsFuseAtomsAction", self. toolsFuseAtomsAction.iconSet().pixmap() ) self.toolsFuseAtomsAction.setWhatsThis( toolsFuseAtomsActionText ) #### Movie Player #### simMoviePlayerActionText = "<u><b>Movie Player</b></u><br>"\ "<p><img source=\" simMoviePlayerAction\"><br> "\ "Plays the most recent trajectory (movie) file created by the <b>Simulator</b>.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simMoviePlayerAction", self. simMoviePlayerAction.iconSet().pixmap() ) self. simMoviePlayerAction.setWhatsThis( simMoviePlayerActionText ) #### Simulator #### simSetupActionText = "<u><b>Simulator</b></u><br>"\ "<p><img source=\" simSetupAction\"><br> "\ "Creates a trajectory (movie) file by calculating the inter-atomic potentials and bonding "\ "of the entire model. The user determines the number of frames in the movie, the time step, "\ "and the temperature for the simulation.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simSetupAction", self. simSetupAction.iconSet().pixmap() ) self. simSetupAction.setWhatsThis( simSetupActionText ) #### Plot Tool #### simPlotToolActionText = "<u><b>Plot Tool</b></u><br>"\ "<p><img source=\" simPlotToolAction\"><br> "\ "Plots a simulator trace file using GNUplot. A simulation must be run to create "\ "the trace file, and the part must have a jig that writes output to the trace file. <br><br>"\ "The following list of jigs write data to the trace file:<br>"\ "<b>Rotary Motors:</b> speed (GHz) and torque (nn-nm)<br>"\ "<b>Linear Motors:</b> displacement (pm)<br>"\ "<b>Anchors:</b> torque (nn-nm)<br>"\ "<b>Thermostats:</b> energy added (zJ)<br>"\ "<b>Thermometer:</b> temperature (K)<br>"\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simPlotToolAction", self. simPlotToolAction.iconSet().pixmap() ) self. simPlotToolAction.setWhatsThis( simPlotToolActionText ) ############################################## # Dashboard Buttons ############################################## #### Done #### toolsDoneActionText = "<u><b>Done</b></u><br>"\ "<p><img source=\" toolsDoneAction\"><br> "\ "Completes the current operation and enters Select Chunks mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsDoneAction", self. toolsDoneAction.iconSet().pixmap() ) self. toolsDoneAction.setWhatsThis( toolsDoneActionText ) #### Cancel #### toolsCancelActionText = "<u><b>Cancel</b></u><br>"\ "<p><img source=\" toolsCancelAction\"><br> "\ "Cancels the current operation and enters Select Chunks mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsCancelAction", self.toolsCancelAction.iconSet().pixmap() ) self. toolsCancelAction.setWhatsThis( toolsCancelActionText ) #### Back up #### toolsBackUpActionText = "<u><b>Back Up</b></u><br>"\ "<p><img source=\" toolsBackUpAction\"><br> "\ "Undoes the previous operation."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsBackUpAction", self.toolsBackUpAction.iconSet().pixmap() ) self. toolsBackUpAction.setWhatsThis( toolsBackUpActionText ) #### Start Over #### toolsStartOverActionText = "<u><b>Start Over</b></u><br>"\ "<p><img source=\"toolsStartOverAction\"><br> "\ "Cancels the current operation, leaving the user in the current mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "toolsStartOverAction", self.toolsStartOverAction.iconSet().pixmap() ) self.toolsStartOverAction.setWhatsThis(toolsStartOverActionText ) #### Add Layers #### ccAddLayerActionText = "<u><b>Add Layer</b></u><br>"\ "<p><img source=\"ccAddLayerAction\"><br> "\ "Adds a new layer of diamond lattice to the existing layer."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "ccAddLayerAction", self.ccAddLayerAction.iconSet().pixmap() ) self.ccAddLayerAction.setWhatsThis(ccAddLayerActionText ) ############################################## # Jigs ############################################## #### Anchor #### jigsAnchorActionText = "<u><b>Anchor</b></u><br>"\ "<p><img source=\"jigsAnchorAction\"><br> "\ "Attaches a <b>Anchor</b> to the selected atom(s), which "\ "constrains its motion during a minimization or simulation."\ "</p>"\ "<p>To create an Anchor, enter <b>Select Atoms</b> mode, "\ "select the atom(s) you want to anchor and then select this action. "\ "Anchors are drawn as a black wireframe box around each selected atom."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsAnchorAction", self.jigsAnchorAction.iconSet().pixmap() ) self.jigsAnchorAction.setWhatsThis(jigsAnchorActionText ) #### Rotary Motor #### jigsMotorActionText = "<u><b>Rotary Motor</b></u><br>"\ "<p><img source=\"jigsMotorAction\"><br> "\ "Attaches a <b>Rotary Motor</b> to the selected atoms. The Rotary Motor is used by "\ "the simulator to apply rotary motion to a set of atoms during a simulation run. You may "\ "specify the <b>torque (in nN*nm)</b> and <b>speed (in Ghz)</b> of the motor."\ "</p>"\ "<p>To create a Rotary Motor, enter <b>Select Atoms</b> mode, "\ "select the atoms you want to attach the motor to and then select this action."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsMotorAction", self.jigsMotorAction.iconSet().pixmap() ) self.jigsMotorAction.setWhatsThis(jigsMotorActionText ) #### Linear Motor #### jigsLinearMotorActionText = "<u><b>Linear Motor</b></u><br>"\ "<p><img source=\"jigsLinearMotorAction\"><br> "\ "Attaches a <b>Linear Motor</b> to the selected atoms. The Linear Motor is used by "\ "the simulator to apply linear motion to a set of atoms during a simulation run. You may "\ "specify the <b>force (in nN*nm)</b> and <b>stiffness (in N/m)</b> of the motor."\ "</p>"\ "<p>To create a Linear Motor, enter <b>Select Atoms</b> mode, "\ "select the atoms you want to attach the motor to and then select this action."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsLinearMotorAction", self.jigsLinearMotorAction.iconSet().pixmap() ) self.jigsLinearMotorAction.setWhatsThis(jigsLinearMotorActionText ) #### Thermostat #### jigsStatActionText = "<u><b>Thermostat</b></u><br>"\ "<p><img source=\"jigsStatAction\"><br> "\ "Attaches a <b>Langevin Thermostat</b> to a single selected atom, thereby associating "\ "the themostat to the entire molecule of which the selected atom is a member. The user "\ "specifies the temperature (in Kelvin)."\ "</p>"\ "<p>The Langevin Thermostat is used to set and hold the temperature "\ "of a molecule during a simulation run."\ "</p>"\ "<p>To create a Langevin Thermostat, enter <b>Select Atoms</b> mode, "\ "select a single atom and then select this action. The thermostat is drawn as a "\ "blue wireframe box around the selected atom."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsStatAction", self.jigsStatAction.iconSet().pixmap() ) self.jigsStatAction.setWhatsThis(jigsStatActionText ) #### Thermometer #### jigsThermoActionText = "<u><b>Thermometer</b></u><br>"\ "<p><img source=\"jigsThermoAction\"><br> "\ "Attaches a <b>Thermometer</b> to a single selected atom, thereby associating "\ "the themometer to the entire molecule of which the selected atom is a member. "\ "<p>The temperature of the molecule will be recorded and written to a trace file "\ "during a simulation run."\ "</p>"\ "<p>To create a Thermometer, enter <b>Select Atoms</b> mode, "\ "select a single atom and then select this action. The thermometer is drawn as a "\ "dark red wireframe box around the selected atom."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsThermoAction", self.jigsThermoAction.iconSet().pixmap() ) self.jigsThermoAction.setWhatsThis(jigsThermoActionText ) #### ESP Image #### jigsESPImageActionText = "<u><b>ESP Image</b></u></b></p><br>"\ "<p><img source=\"jigsESPImageAction\"><br> "\ "An <b>ESP Image</b> allows the user to visualize the electrostatic potential "\ "of points on the face of a square 2D surface. Nano-Hive's MPQC ESP Plane plug-in "\ "is used to calculate the electrostatic potential."\ "</p>"\ "<p>To create an ESP Image, enter <b>Select Atoms</b> mode, "\ "select three or more atoms and then select this jig. The ESP Image is drawn as a "\ "plane with a bounding volume."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsESPImageAction", self.jigsESPImageAction.iconSet().pixmap() ) self.jigsESPImageAction.setWhatsThis(jigsESPImageActionText ) #### Atom Set #### jigsAtomSetActionText = "<u><b>Atom Set</b></u></b></p><br>"\ "<p><img source=\"jigsAtomSetAction\"><br> "\ "An <b>Atom Set</b> jig provides a convienient way to save an atom "\ "selection which can be reselected later."\ "</p>"\ "<p>To create an Atom Set, enter <b>Select Atoms</b> mode, "\ "select any number of atoms and then select this jig. The Atom Set is "\ "drawn as a set of wireframe boxes around each atom in the selection."\ "</p>"\ "<p>To reselect the atoms in an Atom Set, select it's context "\ "menu in the Model Tree and click the menu item that states "\ "<b>Select this jig's atoms</b>."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsAtomSetAction", self.jigsAtomSetAction.iconSet().pixmap() ) self.jigsAtomSetAction.setWhatsThis(jigsAtomSetActionText ) #### Measure Distance #### jigsDistanceActionText = "<u><b>Measure Distance Jig</b></u></b></p><br>"\ "<p><img source=\"jigsDistanceAction\"><br> "\ "A <b>Measure Distance Jig</b> functions as a dimension to display the "\ "distance between two atoms."\ "</p>"\ "<p>To create the Measure Distance Jig, enter <b>Select Atoms</b> mode, "\ "select two atoms and then select this jig. The Measure Distance Jig is "\ "drawn as a pair of wireframe boxes around each atom connected by "\ "a line and a pair of numbers. The first number is the distance between the "\ "VdW radii (this can be a negative number for atoms that are close together). "\ "The second number is the distance between the nuclei."\ "</p>"\ "<p>The Measure Distance Jig will write the two distance values to the trace file "\ "for each frame of a simulation run and can be plotted using the Plot Tool."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsDistanceAction", self.jigsDistanceAction.iconSet().pixmap() ) self.jigsDistanceAction.setWhatsThis(jigsDistanceActionText ) #### Measure Angle #### jigsAngleActionText = "<u><b>Measure Angle Jig</b></u></b></p><br>"\ "<p><img source=\"jigsAngleAction\"><br> "\ "A <b>Measure Angle Jig</b> functions as a dimension to display the "\ "angle between three atoms.</p>"\ "<p>To create the Measure Angle Jig, enter <b>Select Atoms</b> mode, "\ "select three atoms and then select this jig. The Measure Angle Jig is "\ "drawn as a set of wireframe boxes around each atom and a number "\ "which is the angle between the three atoms."\ "</p>"\ "<p>The Measure Angle Jig will write the angle value to the trace file "\ "for each frame of a simulation run and can be plotted using the Plot Tool."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsAngleAction", self.jigsAngleAction.iconSet().pixmap() ) self.jigsAngleAction.setWhatsThis(jigsAngleActionText ) #### Measure Dihedral #### jigsDihedralActionText = "<u><b>Measure Dihedral Jig</b></u></b></p><br>"\ "<p><img source=\"jigsDihedralAction\"><br> "\ "A <b>Measure Dihedral Jig</b> functions as a dimension to display the "\ "dihedral angle of a four atom sequence.</p>"\ "<p>To create the Measure Dihedral Jig, enter <b>Select Atoms</b> mode, "\ "select four atoms and then select this jig. The Measure Dihedral Jig is "\ "drawn as a set of wireframe boxes around each atom and a number "\ "which is the dihedral angle value."\ "</p>"\ "<p>The Measure Dihedral Jig will write the dihedral angle value to the trace file "\ "for each frame of a simulation run and can be plotted using the Plot Tool."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsDihedralAction", self.jigsDihedralAction.iconSet().pixmap() ) self.jigsDihedralAction.setWhatsThis(jigsDihedralActionText ) #### GAMESS Jig #### jigsGamessActionText = "<u><b>GAMESS Jig</b></u></b></p><br>"\ "<p><img source=\"jigsGamessAction\"><br> "\ "A <b>GAMESS Jig</b> is used to tag a set of atoms for running a GAMESS "\ "calculation. <b>Energy</b> and <b>Geometry Optimization</b> calculations are supported."\ "</p>"\ "<p>To create the GAMESS Jig, enter <b>Select Atoms</b> mode, "\ "select the atoms to tag and then select this jig. The GAMESS Jig is drawn as a "\ "set of magenta wireframe boxes around each atom."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsGamessAction", self.jigsGamessAction.iconSet().pixmap() ) self.jigsGamessAction.setWhatsThis(jigsGamessActionText ) #### Grid Plane Jig #### jigsGridPlaneActionText = "<u><b>Grid Plane</b></u></b></p><br>"\ "<p><img source=\"jigsGridPlaneAction\"><br> "\ "A <b>Grid Plane</b> jig is a rectanglar plane that can display a square or SiC grid "\ "within its boundary. It is often used as an aid in constructing large lattice "\ "structures made of silicon carbide (SiC). It is also used as a visual aid in estimating "\ "distances between atoms and/or other structures."\ "</p>"\ "<p>To create the Grid Plane jig, enter <b>Select Atoms</b> mode, "\ "select three or more atoms and then select this jig. "\ "</p>"\ "<p>The Grid Plane jig is drawn as a rectanglar plane with a grid."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsGridPlaneAction", self.jigsGridPlaneAction.iconSet().pixmap() ) self.jigsGridPlaneAction.setWhatsThis(jigsGridPlaneActionText ) ############################################## # Display ############################################## #### Display Object Color #### dispObjectColorActionText = "<u><b>Object Color</b></u><br>"\ "<p><img source=\"dispObjectColorAction\"><br> "\ "Allows you to change the color of the selected object(s).</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispObjectColorAction", self.dispObjectColorAction.iconSet().pixmap() ) self.dispObjectColorAction.setWhatsThis(dispObjectColorActionText ) #### Display Background Color #### dispBGColorActionText = "<u><b>Background Color</b></u><br>"\ "<p><img source=\"dispBGColorAction\"><br> "\ "Allows you to change the background color of the main window.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispBGColorAction", self.dispBGColorAction.iconSet().pixmap() ) self.dispBGColorAction.setWhatsThis(dispBGColorActionText ) ############################################## # Help Toolbar ############################################## #### What's This #### helpWhatsThisText = "<u><b>What's This</b></u><br>"\ "<p><img source=\"helpWhatsThis\"><br> "\ "Click this option to invoke a small question mark that is attached to the mouse pointer. "\ "Click on a feature which you would like more information about. "\ "A popup box appears with information about the feature.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "helpWhatsThis", self.helpWhatsThisAction.iconSet().pixmap() ) self.helpWhatsThisAction.setWhatsThis( helpWhatsThisText ) ############################################## # Datum Display Toolbar ############################################## #### Display Trihedron #### dispTrihedronText = "<u><b>Display Trihedron</b></u><br>"\ "<p><img source=\"dispTrihedron\"><br> "\ "Toggles the trihedron on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispTrihedron", self.dispTrihedronAction.iconSet().pixmap() ) self.dispTrihedronAction.setWhatsThis(dispTrihedronText ) #### Display Csys #### dispCsysText = "<u><b>Display Csys Axis</b></u><br>"\ "<p><img source=\"dispCsys\"><br> "\ "Toggles the coordinate system axis on and off."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispCsys", self.dispCsysAction.iconSet().pixmap() ) self.dispCsysAction.setWhatsThis(dispCsysText ) #### Display Datum Lines #### dispDatumLinesText = "<u><b>Display Datum Lines</b></u><br>"\ "<p><img source=\"dispDatumLines\"><br> "\ "Toggles Datum Lines on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDatumLines", self.dispDatumLinesAction.iconSet().pixmap() ) self.dispDatumLinesAction.setWhatsThis(dispDatumLinesText ) #### Display Datum Planes #### dispDatumPlanesText = "<u><b>Display Datum Planes</b></u><br>"\ "<p><img source=\"dispDatumPlanes\"><br> "\ "Toggles Datum Planes on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDatumPlanes", self.dispDatumPlanesAction.iconSet().pixmap() ) self.dispDatumPlanesAction.setWhatsThis(dispDatumPlanesText ) #### Display Grid #### dispGridText = "<u><b>Display 3-D Grid</b></u><br>"\ "<p><img source=\"dispGrid\"><br> "\ "Toggles the 3-D grid on and off."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispGrid", self.dispGridAction.iconSet().pixmap() ) self.dispGridAction.setWhatsThis(dispGridText ) | 4a7238f3af684f1b0e4239ba03daeb96cefa3ccb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/4a7238f3af684f1b0e4239ba03daeb96cefa3ccb/whatsthis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
2888,
2323,
2503,
12,
2890,
4672,
225,
19709,
26487,
7,
468,
1387,
13288,
3215,
19709,
26487,
7,
225,
11849,
7,
3502,
1387,
11849,
7,
225,
585,
3678,
1528,
273,
3532,
89,
4438,
70,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
2888,
2323,
2503,
12,
2890,
4672,
225,
19709,
26487,
7,
468,
1387,
13288,
3215,
19709,
26487,
7,
225,
11849,
7,
3502,
1387,
11849,
7,
225,
585,
3678,
1528,
273,
3532,
89,
4438,
70,
... |
gPanel.AddGrowableCol(1) | lyricsCow.AddComponent(gPanel) lyricsCow.Pack() | def Body(self): # Main Panel mainPanel = VerticalPanel(self) # Options gPanel = FlexGridPanel(mainPanel, rows=3, cols=3, hgap=5, vgap=5) self.baseDir = TextBox(gPanel, Value=os.path.expanduser(config.get('Output', 'BaseDir'))) self.fileModel = TextBox(gPanel, Value=config.get('Output', 'Model')) self.fileModel.OnChar = self._RegenerateExample self.fileExample = Label(gPanel, GenerateFilename(artist='Simple Plan', song='Thank You', album='Still Not Getting Any')) gPanel.AddComponent(0, 0, Label(gPanel, _("Output directory"), align='right'), border=5) gPanel.AddComponent(0, 1, Label(gPanel, _("File model"), align='right'), border=5) gPanel.AddComponent(0, 2, Label(gPanel, _("Example"), align='right'), border=5) gPanel.AddComponent(1, 0, self.baseDir) gPanel.AddComponent(1, 1, self.fileModel) gPanel.AddComponent(1, 2, self.fileExample, border=6) gPanel.AddComponent(2, 0, Button(gPanel, _("Browse"), self.OnBrowse)) gPanel.Pack() gPanel.AddGrowableCol(1) # Buttons butPnl = HorizontalPanel(mainPanel) butPnl.AddComponent(Button(butPnl, _("Ok"), event=self.OnOk), border=3, align='center') butPnl.AddComponent(Button(butPnl, _("Abort"), event=self.OnQuit), border=3, align='center') butPnl.Pack() mainPanel.AddComponent(Label(mainPanel, _("Global preferences")), border=8, align='center') mainPanel.AddComponent(gPanel, border=10) mainPanel.AddComponent(butPnl, border=10, align='center') mainPanel.Pack() self.AddComponent(mainPanel, expand = 'both', border=10) self.Pack() | 13d1aeb4164d2f674b86384e4591391209dab7b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2441/13d1aeb4164d2f674b86384e4591391209dab7b5/cowpreferences.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5652,
12,
2890,
4672,
468,
12740,
23641,
2774,
5537,
273,
27394,
5537,
12,
2890,
13,
225,
468,
5087,
314,
5537,
273,
25361,
6313,
5537,
12,
5254,
5537,
16,
2595,
33,
23,
16,
5347,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5652,
12,
2890,
4672,
468,
12740,
23641,
2774,
5537,
273,
27394,
5537,
12,
2890,
13,
225,
468,
5087,
314,
5537,
273,
25361,
6313,
5537,
12,
5254,
5537,
16,
2595,
33,
23,
16,
5347,
33,
... |
def isOK(self): | def isOK( self ): | def isOK(self): return self.valid | 6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
3141,
12,
365,
262,
30,
327,
365,
18,
877,
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,
353,
3141,
12,
365,
262,
30,
327,
365,
18,
877,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
'update-motd'] | 'update-motd', 'linux-ec2'] | def apply_ec2_settings(self): self.vm.addpkg += ['ec2-init', 'openssh-server', 'standard^', 'ec2-ami-tools', 'update-motd'] if self.vm.arch == 'i386': self.vm.addpkg += ['libc6-xen'] | 8dcfa935247c859f08c34a9f1d9b1f3aaa004f42 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1496/8dcfa935247c859f08c34a9f1d9b1f3aaa004f42/karmic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
67,
557,
22,
67,
4272,
12,
2890,
4672,
365,
18,
3489,
18,
1289,
10657,
1011,
10228,
557,
22,
17,
2738,
2187,
296,
20346,
674,
17,
3567,
2187,
296,
10005,
66,
2187,
296,
557,
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,
2230,
67,
557,
22,
67,
4272,
12,
2890,
4672,
365,
18,
3489,
18,
1289,
10657,
1011,
10228,
557,
22,
17,
2738,
2187,
296,
20346,
674,
17,
3567,
2187,
296,
10005,
66,
2187,
296,
557,
22,
... |
return len(axis) | return len(self.axis) | def dim(self): return len(axis) | 632d8f587ab74c3ebcac4ce3c273c9fe2f501d84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/762/632d8f587ab74c3ebcac4ce3c273c9fe2f501d84/so.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2464,
12,
2890,
4672,
327,
562,
12,
4890,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2464,
12,
2890,
4672,
327,
562,
12,
4890,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
@paginate('tasks',default_order='-id', limit=30) | @paginate('tasks',default_order='-id', limit=30, allow_limit_override=True) | def executed(self, hidden={}, **kw): tmp = self._do_search(hidden, **kw) tmp['form'] = self.task_form tmp['action'] = './do_search' tmp['value'] = None tmp['options'] = dict() return tmp | 78d6aa9fe1f4c381e2dfd234dfd8813dc62bd488 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14755/78d6aa9fe1f4c381e2dfd234dfd8813dc62bd488/tasks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7120,
12,
2890,
16,
5949,
28793,
2826,
9987,
4672,
1853,
273,
365,
6315,
2896,
67,
3072,
12,
6345,
16,
2826,
9987,
13,
1853,
3292,
687,
3546,
273,
365,
18,
4146,
67,
687,
1853,
3292,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7120,
12,
2890,
16,
5949,
28793,
2826,
9987,
4672,
1853,
273,
365,
6315,
2896,
67,
3072,
12,
6345,
16,
2826,
9987,
13,
1853,
3292,
687,
3546,
273,
365,
18,
4146,
67,
687,
1853,
3292,
1... |
def processComment(self, data): self.parser.document.appendChild(CommentNode(data)) | def processComment(self, data): self.parser.document.appendChild(CommentNode(data)) | 63b257c91a1a03874ee2932271f4c904c94d49df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9368/63b257c91a1a03874ee2932271f4c904c94d49df/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
4469,
12,
2890,
16,
501,
4672,
365,
18,
4288,
18,
5457,
18,
6923,
1763,
12,
4469,
907,
12,
892,
3719,
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,
1207,
4469,
12,
2890,
16,
501,
4672,
365,
18,
4288,
18,
5457,
18,
6923,
1763,
12,
4469,
907,
12,
892,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
def execute(sql,params=None) : | def execute(self, sql, params=None) : | def execute(sql,params=None) : if config.log_sql : log(3, sql+' '+str(params)) cursor = self.connection.cursor() cursor.execute(sql,params) return cursor | 93a897dfc11dc8c11dd93323bf2cdbfb5bdc5eb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1319/93a897dfc11dc8c11dd93323bf2cdbfb5bdc5eb3/Database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
1847,
16,
859,
33,
7036,
13,
294,
309,
642,
18,
1330,
67,
4669,
294,
613,
12,
23,
16,
1847,
6797,
15126,
701,
12,
2010,
3719,
3347,
273,
365,
18,
4071,
18,
9216,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1836,
12,
2890,
16,
1847,
16,
859,
33,
7036,
13,
294,
309,
642,
18,
1330,
67,
4669,
294,
613,
12,
23,
16,
1847,
6797,
15126,
701,
12,
2010,
3719,
3347,
273,
365,
18,
4071,
18,
9216,
... |
if record['dirname'][-1:] == u'/': storagegroups[storagegroupnames[record['groupname']]] = record['dirname'] | if dirname[-1:] == u'/': storagegroups[storagegroupnames[record['groupname']]] = dirname | def getStorageGroups(): '''Populate the storage group dictionary with the host's storage groups. return False if there is an error ''' # Get storagegroup table field names: table_names = mythvideo.getTableFieldNames(u'storagegroup') # Get Recorded videos recordedprogram / airdate cur = mythdb.cursor() try: cur.execute(u'select * from storagegroup') except MySQLdb.Error, e: logger.error(u"Reading storage group MythTV table: %d: %s" % (e.args[0], e.args[1])) return False while True: data_id = cur.fetchone() if not data_id: break record = {} i = 0 for elem in data_id: if table_names[i] == 'groupname' or table_names[i] == 'hostname' or table_names[i] == 'dirname': record[table_names[i]] = elem i+=1 if record['hostname'].lower() == localhostname.lower() and record['groupname'] in storagegroupnames.keys(): # Add a slash if missing to any storage group dirname if record['dirname'][-1:] == u'/': storagegroups[storagegroupnames[record['groupname']]] = record['dirname'] else: storagegroups[storagegroupnames[record['groupname']]] = record['dirname']+u'/' continue cur.close() if len(storagegroups): # Verify that each storage group is an existing local directory storagegroup_ok = True for key in storagegroups.keys(): if not os.path.isdir(storagegroups[key]): logger.critical(u"The Storage group (%s) directory (%s) does not exist" % (key, storagegroups[key])) storagegroup_ok = False if not storagegroup_ok: sys.exit(False) | cefa7947527c8e9e2184befa6fb1cdca04096461 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/cefa7947527c8e9e2184befa6fb1cdca04096461/mirobridge.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13840,
3621,
13332,
9163,
19097,
326,
2502,
1041,
3880,
598,
326,
1479,
1807,
2502,
3252,
18,
327,
1083,
309,
1915,
353,
392,
555,
9163,
468,
968,
2502,
1655,
1014,
652,
1257,
30,
1014,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13840,
3621,
13332,
9163,
19097,
326,
2502,
1041,
3880,
598,
326,
1479,
1807,
2502,
3252,
18,
327,
1083,
309,
1915,
353,
392,
555,
9163,
468,
968,
2502,
1655,
1014,
652,
1257,
30,
1014,
... |
rssurl = websearch_templates.build_rss_url(cgi.parse_qs(req.args)) | argd = {} if req.args: argd = cgi.parse_qs(req.args) rssurl = websearch_templates.build_rss_url(argd) | def page_start(req, of, cc, as, ln, uid, title_message=None, description='', keywords='', recID=-1, tab=''): "Start page according to given output format." _ = gettext_set_language(ln) if not title_message: title_message = _("Search Results") if not req: return # we were called from CLI content_type = get_output_format_content_type(of) if of.startswith('x'): if of == 'xr': # we are doing RSS output req.content_type = "application/rss+xml" req.send_http_header() req.write("""<?xml version="1.0" encoding="UTF-8"?>\n""") else: # we are doing XML output: req.content_type = "text/xml" req.send_http_header() req.write("""<?xml version="1.0" encoding="UTF-8"?>\n""") elif of.startswith('t') or str(of[0:3]).isdigit(): # we are doing plain text output: req.content_type = "text/plain" req.send_http_header() elif of == "id": pass # nothing to do, we shall only return list of recIDs elif content_type == 'text/html': # we are doing HTML output: req.content_type = "text/html" req.send_http_header() if not description: description = "%s %s." % (cc, _("Search Results")) if not keywords: keywords = "%s, WebSearch, %s" % (get_coll_i18nname(cdsname, ln), get_coll_i18nname(cc, ln)) rssurl = websearch_templates.build_rss_url(cgi.parse_qs(req.args)) navtrail = create_navtrail_links(cc, as, ln) navtrail_append_title_p = 1 # FIXME: Find a good point to put this code. # This is a nice hack to trigger jsMath only when displaying single # records. if of.lower() in CFG_WEBSEARCH_USE_JSMATH_FOR_FORMATS: metaheaderadd = """ <script> jsMath = {styles: {'#jsMath_button': 'display: none'}}; </script> <script src='/jsMath/easy/invenio-jsmath.js'></script> | 534bf897c99b7ad1b543c6fdc9ea7b87394ca9d3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/534bf897c99b7ad1b543c6fdc9ea7b87394ca9d3/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1363,
67,
1937,
12,
3658,
16,
434,
16,
4946,
16,
487,
16,
7211,
16,
4555,
16,
2077,
67,
2150,
33,
7036,
16,
2477,
2218,
2187,
7093,
2218,
2187,
1950,
734,
29711,
21,
16,
3246,
2218,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1363,
67,
1937,
12,
3658,
16,
434,
16,
4946,
16,
487,
16,
7211,
16,
4555,
16,
2077,
67,
2150,
33,
7036,
16,
2477,
2218,
2187,
7093,
2218,
2187,
1950,
734,
29711,
21,
16,
3246,
2218,
... |
cflags += " -arch ppc -arch i386" | cflags += " -arch i386 -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk" | def configure_pjsip(self): log.info("Configuring PJSIP") cflags = "-O3 -fPIC" if sys.platform == "darwin": if platform.mac_ver()[0].startswith('10.6'): cflags += " -arch i386 -arch x86_64" else: cflags += " -arch ppc -arch i386" if self.pjsip_disable_assertions: cflags += " -DNDEBUG" env = os.environ.copy() env['CFLAGS'] = ' '.join(x for x in (cflags, env.get('CFLAGS', None)) if x) distutils_exec_process(["./configure"], True, cwd=self.svn_dir, env=env) if "#define PJSIP_HAS_TLS_TRANSPORT 1\n" not in open(os.path.join(self.svn_dir, "pjsip", "include", "pjsip", "sip_autoconf.h")).readlines(): os.remove(os.path.join(self.svn_dir, "build.mak")) raise DistutilsError("PJSIP TLS support was disabled, OpenSSL development files probably not present on this system") | 26f51417bfb2077be621872ce150dd3bcdc0e820 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3449/26f51417bfb2077be621872ce150dd3bcdc0e820/setup_pjsip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
67,
84,
2924,
625,
12,
2890,
4672,
613,
18,
1376,
2932,
809,
4017,
453,
46,
17739,
7923,
276,
7133,
273,
3701,
51,
23,
300,
74,
20385,
6,
309,
2589,
18,
9898,
422,
315,
28076,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
67,
84,
2924,
625,
12,
2890,
4672,
613,
18,
1376,
2932,
809,
4017,
453,
46,
17739,
7923,
276,
7133,
273,
3701,
51,
23,
300,
74,
20385,
6,
309,
2589,
18,
9898,
422,
315,
28076,
... |
""" <directives namespace="http://namespaces.zope.org/zope"> <directive name="permission" attributes="id title description" handler=" zope.app.security.metaconfigure.definePermission" /> </directives> | ''' <include package="zope.app.security" file="meta.zcml" /> | def testProtectedtemplate(self): | 1cfc7ddd1cac0110cca3e909215477e1c59bbca3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9523/1cfc7ddd1cac0110cca3e909215477e1c59bbca3/test_directives.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
15933,
3202,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
1842,
15933,
3202,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
debug(ALWAYS, "Proxy:", `self.request`) | debug(BRING_IT_ON, "Proxy:", `self.request`) | def __init__ (self, client, request, headers, content, nofilter,compress): self.client = client self.request = request self.headers = headers self.compress = compress self.content = content self.nofilter = nofilter debug(ALWAYS, "Proxy:", `self.request`) self.method, self.url, protocol = self.request.split() scheme, hostname, port, document = spliturl(self.url) # fix missing trailing / if not document: document = '/' # fix missing host headers for HTTP/1.1 if protocol=='HTTP/1.1' and not self.headers.has_key('host'): self.headers['Host'] = hostname if port!=80: self.headers['Host'] += ":%d"%port debug(HURT_ME_PLENTY, "Proxy: splitted url", scheme, hostname, port, document) if scheme=='file': # a blocked url is a local file:// link # this means we should _not_ use this proxy for local # file links :) mtype = mimetypes.guess_type(self.url)[0] config['requests']['valid'] += 1 config['requests']['blocked'] += 1 ServerHandleDirectly(self.client, 'HTTP/1.0 200 OK\r\n', 'Content-Type: %s\r\n\r\n'%(mtype or 'application/octet-stream'), open(document, 'rb').read()) return | 66661dc35f0c97769c0e026c2d852cc6c2c46bb9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/66661dc35f0c97769c0e026c2d852cc6c2c46bb9/ClientServerMatchmaker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
1004,
16,
590,
16,
1607,
16,
913,
16,
290,
792,
1088,
16,
14706,
4672,
365,
18,
2625,
273,
1004,
365,
18,
2293,
273,
590,
365,
18,
2485,
273,
1607,
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,
1001,
2738,
972,
261,
2890,
16,
1004,
16,
590,
16,
1607,
16,
913,
16,
290,
792,
1088,
16,
14706,
4672,
365,
18,
2625,
273,
1004,
365,
18,
2293,
273,
590,
365,
18,
2485,
273,
1607,
36... |
__modulePrefix = None | __modulePrefixElts = None | def namespace (self): return self.__namespace | 5eacb77c8998fd31b68477e0ec37388e9983b97b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7171/5eacb77c8998fd31b68477e0ec37388e9983b97b/generate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1981,
261,
2890,
4672,
327,
365,
16186,
4937,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1981,
261,
2890,
4672,
327,
365,
16186,
4937,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.