rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
return _prelude.idmef_data_get_data(data) | return (lambda d: None, _prelude.idmef_data_get_char, _prelude.idmef_data_get_byte, _prelude.idmef_data_get_uint32, _prelude.idmef_data_get_uint64, _prelude.idmef_data_get_float, _prelude.idmef_data_get_char_string, _prelude.idmef_data_get_byte_string)[_prelude.idmef_data_get_type(data)](data) | def idmef_value_c_to_python(value): func_type_table = { _prelude.IDMEF_VALUE_TYPE_INT8: _prelude.idmef_value_get_int8, _prelude.IDMEF_VALUE_TYPE_UINT8: _prelude.idmef_value_get_uint8, _prelude.IDMEF_VALUE_TYPE_INT16: _prelude.idmef_value_get_int16, _prelude.IDMEF_VALUE_TYPE_UINT16: _prelude.idmef_value_get_uint16, _prelude.IDMEF_VALUE_TYPE_INT32: _prelude.idmef_value_get_int32, _prelude.IDMEF_VALUE_TYPE_UINT32: _prelude.idmef_value_get_uint32, _prelude.IDMEF_VALUE_TYPE_INT64: _prelude.idmef_value_get_int64, _prelude.IDMEF_VALUE_TYPE_UINT64: _prelude.idmef_value_get_uint64, _prelude.IDMEF_VALUE_TYPE_FLOAT: _prelude.idmef_value_get_float, _prelude.IDMEF_VALUE_TYPE_DOUBLE: _prelude.idmef_value_get_double, } type = _prelude.idmef_value_get_type(value) if type == _prelude.IDMEF_VALUE_TYPE_TIME: time = _prelude.idmef_value_get_time(value) if not time: return None py_time = IDMEFTime() py_time.res = _prelude.idmef_time_clone(time) return py_time if type == _prelude.IDMEF_VALUE_TYPE_STRING: string = _prelude.idmef_value_get_string(value) if not string: return None return _prelude.prelude_string_get_string(string) if type == _prelude.IDMEF_VALUE_TYPE_DATA: data = _prelude.idmef_value_get_data(value) if not data: return None return _prelude.idmef_data_get_data(data) if type == _prelude.IDMEF_VALUE_TYPE_ENUM: return _prelude.idmef_type_enum_to_string(_prelude.idmef_value_get_object_type(value), _prelude.idmef_value_get_enum(value)) try: func = func_type_table[type] except KeyError: raise Error() return func(value) | 70503a61b09c81c138dcbfff4fd6a60a97ea41c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11628/70503a61b09c81c138dcbfff4fd6a60a97ea41c3/prelude.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
612,
3501,
74,
67,
1132,
67,
71,
67,
869,
67,
8103,
12,
1132,
4672,
225,
1326,
67,
723,
67,
2121,
273,
288,
389,
1484,
80,
1317,
18,
734,
958,
42,
67,
4051,
67,
2399,
67,
3217,
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,
612,
3501,
74,
67,
1132,
67,
71,
67,
869,
67,
8103,
12,
1132,
4672,
225,
1326,
67,
723,
67,
2121,
273,
288,
389,
1484,
80,
1317,
18,
734,
958,
42,
67,
4051,
67,
2399,
67,
3217,
28,... |
self.msgObjs = [FakeyMessage({'from': 'user@domain', 'to': 'resu@domain', 'date': 'thursday', 'subject': 'it is a message', 'message-id': 'id-id-id-yayaya'}, (), '', '', 65656, None)] self.expected = {0: {'ENVELOPE': [ 'thursday', 'it is a message', [[None, None, 'user', 'domain']], [[None, None, 'user', 'domain']], [[None, None, 'user', 'domain']], [[None, None, 'resu', 'domain']], None, None, None, 'id-id-id-yayaya']}} self._fetchWork(fetch, uid) | self.msgObjs = [ FakeyMessage({ 'from': 'user@domain', 'to': 'resu@domain', 'date': 'thursday', 'subject': 'it is a message', 'message-id': 'id-id-id-yayaya'}, (), '', '', 65656, None), ] self.expected = { 0: {'ENVELOPE': ['thursday', 'it is a message', [[None, None, 'user', 'domain']], [[None, None, 'user', 'domain']], [[None, None, 'user', 'domain']], [[None, None, 'resu', 'domain']], None, None, None, 'id-id-id-yayaya'] } } self._fetchWork(uid) | def fetch(): return self.client.fetchEnvelope(self.messages, uid=uid) | fd0ab51569d572065ee4a73067158b7e009de90d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0ab51569d572065ee4a73067158b7e009de90d/test_imap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
13332,
327,
365,
18,
2625,
18,
5754,
10862,
12,
2890,
18,
6833,
16,
4555,
33,
1911,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
13332,
327,
365,
18,
2625,
18,
5754,
10862,
12,
2890,
18,
6833,
16,
4555,
33,
1911,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if (space_group_info is None): | if (space_group_info is not None): self.space_group_info = space_group_info else: | def __call__(self, option, opt, value, parser): if (opt == "--unit_cell"): unit_cell = None try: unit_cell = uctbx.unit_cell(value) except: pass if (unit_cell is None): crystal_symmetry = crystal_symmetry_from_any.extract_from(value) if ( crystal_symmetry is None or crystal_symmetry.unit_cell() is None): raise OptionError("cannot read parameters: " + value, opt) self.unit_cell = unit_cell elif (opt == "--space_group"): space_group_info = None space_group_info = sgtbx.space_group_info(symbol=value) try: space_group_info = sgtbx.space_group_info(symbol=value) except: pass if (space_group_info is None): crystal_symmetry = crystal_symmetry_from_any.extract_from(value) if ( crystal_symmetry is None or crystal_symmetry.space_group_info() is None): raise OptionError("unknown space group: " + value, opt) self.space_group_info = space_group_info elif (opt == "--symmetry"): crystal_symmetry = crystal_symmetry_from_any.extract_from(value) if ( crystal_symmetry is None or crystal_symmetry.space_group_info() is None): raise OptionError("cannot read symmetry: " + value, opt) if (crystal_symmetry.unit_cell() is not None): self.unit_cell = crystal_symmetry.unit_cell() if (crystal_symmetry.space_group_info() is not None): self.space_group_info = crystal_symmetry.space_group_info() else: raise RuntimeError, "Programming error." | 0699076e2a272a9ff18073de02f0fb2181f091b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/0699076e2a272a9ff18073de02f0fb2181f091b1/option_parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1456,
16,
2153,
16,
460,
16,
2082,
4672,
309,
261,
3838,
422,
5238,
4873,
67,
3855,
6,
4672,
2836,
67,
3855,
273,
599,
775,
30,
2836,
67,
3855,
273,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1456,
16,
2153,
16,
460,
16,
2082,
4672,
309,
261,
3838,
422,
5238,
4873,
67,
3855,
6,
4672,
2836,
67,
3855,
273,
599,
775,
30,
2836,
67,
3855,
273,
58... |
if 'selection' in fields[field]: trans = lambda x: translate(cr, res_name, 'selection', lang, x) or x for idx, (key, val) in enumerate(fields[field]['selection']): fields[field]['selection'][idx] = (key, trans(val)) | result_def = state_def.get('result', {}) | a014326410b0e9bc596723893389ec1029ec9f80 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/a014326410b0e9bc596723893389ec1029ec9f80/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
563,
67,
536,
273,
919,
67,
536,
18,
588,
2668,
2088,
2187,
2618,
13,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
563,
67,
536,
273,
919,
67,
536,
18,
588,
2668,
2088,
2187,
2618,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
print 'smart sort', self._objectlist, attribute, order | def _on_configuration_changed(self, *k): order_descending = self._order_button.get_active() if order_descending: order = gtk.SORT_DESCENDING else: order = gtk.SORT_ASCENDING attribute = self._proxy.read() | b9c466169462bb506f4ba12050d3993b30b3ff15 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11322/b9c466169462bb506f4ba12050d3993b30b3ff15/widgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
265,
67,
7025,
67,
6703,
12,
2890,
16,
380,
79,
4672,
1353,
67,
5569,
2846,
273,
365,
6315,
1019,
67,
5391,
18,
588,
67,
3535,
1435,
309,
1353,
67,
5569,
2846,
30,
1353,
273,
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,
389,
265,
67,
7025,
67,
6703,
12,
2890,
16,
380,
79,
4672,
1353,
67,
5569,
2846,
273,
365,
6315,
1019,
67,
5391,
18,
588,
67,
3535,
1435,
309,
1353,
67,
5569,
2846,
30,
1353,
273,
22... | |
if not line: self.cmd_missing_arg() return | def ftp_STOR(self, line, rwa='w', mode='b'): if not line: self.cmd_missing_arg() return # A resume could occur in case of APPE or REST commands. # In that case we have to open file object in different ways: # STOR: rwa = 'w' # APPE: rwa = 'a' # REST: rwa = 'r+' (to permit seeking on file object) file = self.fs.translate(line) | 42cfb92815cfe91b8e9573da1b07cf8dce19a9ff /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7236/42cfb92815cfe91b8e9573da1b07cf8dce19a9ff/FTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13487,
67,
882,
916,
12,
2890,
16,
980,
16,
7985,
69,
2218,
91,
2187,
1965,
2218,
70,
11,
4672,
225,
468,
432,
10774,
3377,
3334,
316,
648,
434,
14410,
1423,
578,
8392,
4364,
18,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13487,
67,
882,
916,
12,
2890,
16,
980,
16,
7985,
69,
2218,
91,
2187,
1965,
2218,
70,
11,
4672,
225,
468,
432,
10774,
3377,
3334,
316,
648,
434,
14410,
1423,
578,
8392,
4364,
18,
468,
... | |
jobIDString = ','.join([str(j) for j in jobIDList]) | jobIDString = ','.join( [str( j ) for j in jobIDList] ) | def removeJobFromDB(self, jobIDs): """Remove job from DB | 99c1bc850ba087890925b3180df206f65bb1d4b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/99c1bc850ba087890925b3180df206f65bb1d4b3/JobDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
2278,
1265,
2290,
12,
2890,
16,
1719,
5103,
4672,
3536,
3288,
1719,
628,
2383,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1206,
2278,
1265,
2290,
12,
2890,
16,
1719,
5103,
4672,
3536,
3288,
1719,
628,
2383,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
class Spin_crystal_type_B(Crystal): | class Spin_crystal_type_B(ClassicalCrystal): | def CrystalOfSpins(type): r""" Return the spin crystal of the given type INPUT: T -- A CartanType (either B or D) Kashiwara and Nakashima represent the elements by sequences of signs +/-. In this implementation, the elements are represented by positive integers, but their notation can be recovered using signature() EXAMPLES: sage: C = CrystalOfSpins(['B',3]) sage: C.list() [1, 2, 3, 4, 5, 6, 7, 8] sage: [x.signature() for x in C] ['+++', '++-', '+-+', '+--', '-++', '-+-', '--+', '---'] """ type = CartanType(type) if type[0] == 'B': return Spin_crystal_type_B(type) else: raise NotImplementedError | 159c30089bab1b13af9e1095b1ee2b33969b7e53 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/159c30089bab1b13af9e1095b1ee2b33969b7e53/spins.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14998,
31365,
951,
3389,
2679,
12,
723,
4672,
436,
8395,
2000,
326,
12490,
4422,
31365,
434,
326,
864,
618,
225,
12943,
30,
399,
1493,
432,
17695,
304,
559,
261,
73,
2927,
605,
578,
463,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14998,
31365,
951,
3389,
2679,
12,
723,
4672,
436,
8395,
2000,
326,
12490,
4422,
31365,
434,
326,
864,
618,
225,
12943,
30,
399,
1493,
432,
17695,
304,
559,
261,
73,
2927,
605,
578,
463,... |
if entryFactory: self.entryFactory = entryFactory | if 'entryFactory' in options: self.entryFactory = options['entryFactory'] | def __init__(self, entryFactory=None, columnFormatStrategies=None, readingSearchStrategy=None, translationSearchStrategy=None, databaseUrl=None, dbConnectInst=None): """ Initialises the BaseDictionary instance. | 7768f0434aecc2e353c85a4406b0b7da401f6ea2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11128/7768f0434aecc2e353c85a4406b0b7da401f6ea2/dictionary.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1241,
1733,
33,
7036,
16,
1057,
1630,
1585,
15127,
33,
7036,
16,
6453,
2979,
4525,
33,
7036,
16,
4794,
2979,
4525,
33,
7036,
16,
2063,
1489,
33,
7036,
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,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1241,
1733,
33,
7036,
16,
1057,
1630,
1585,
15127,
33,
7036,
16,
6453,
2979,
4525,
33,
7036,
16,
4794,
2979,
4525,
33,
7036,
16,
2063,
1489,
33,
7036,
16... |
introFree, selFreeIntensity, initSize, endingSize, growthModel, | initSize, endingSize, growthModel, | def simuComplexDisease(numChrom, numLoci, markerType, DSLafter, DSLdistTmp, introFree, selFreeIntensity, initSize, endingSize, growthModel, burninGen, splitGen, mixingGen, endingGen, numSubPop, migrModel, migrRate, alleleDistInSubPop, curAlleleFreqTmp, minMutAge, maxMutAge, fitnessTmp, mlSelModelTmp, mutaRate, recRate, savedGen, numOffspring, numOffMode, simuAge, dryrun, savePop, filename, format): ''' run a simulation of complex disease with given parameters. ''' ### ### CHECK PARAMETERS ### if initSize < len(DSLafter): raise exceptions.ValueError("Initial population size is too small. (Less than number of DSL)") # expand .5 -> [0.5, 0.5...] if len(DSLdistTmp) == 1: DSLdist = DSLdistTmp * len(DSLafter) else: DSLdist = DSLdistTmp if len( DSLafter ) != len(DSLdist): raise exceptions.ValueError("Please specify DSL distance for each DSL.") numDSL = len(DSLafter) if burninGen > splitGen or splitGen > mixingGen or splitGen > endingGen: raise exceptions.ValueError("Generations should in the order of burnin, split, mixing and ending") # curAlleleFreq expand 0.5 -> [0.5,0.5,...] if len(curAlleleFreqTmp) == 1: curAlleleFreq = curAlleleFreqTmp * len(DSLafter) elif len(curAlleleFreqTmp) == len(DSLafter): curAlleleFreq = curAlleleFreqTmp else: raise exceptions.ValueError("min allele frequency should be either a number or a list\n" + " of the same length as DSLafter") # fitness if mlSelModelTmp == 'none': fitness = [] elif mlSelModelTmp == 'interaction': if numDSL == 1: raise exceptions.ValueError("Interaction model can only be used with more than one DSL"); if len(fitnessTmp) != 3**numDSL: raise exceptions.ValueError("Please specify 3^n fitness values for n DSL"); fitness = fitnessTmp else: if fitnessTmp == []: # neutral process fitness = [1,1,1]*numDSL else: # for a single DSL if len(fitnessTmp) == 3: fitness = fitnessTmp*numDSL elif len(fitnessTmp) != numDSL*3: raise exceptions.ValueError("Please specify fitness for each DSL") else: fitness = fitnessTmp # number of offspring if numOffMode == 'geometric' and numOffspring > 1: raise exceptions.ValueError("numOffspring is p for a geometric distribution when numOffMode='geometric'. It should be elss than 1.") ### ### simulating population frequency ### print '\n\nSimulating trajectory of allele frequencies' # 1. define population size function def popSizeFunc(gen, curSize=[]): if gen < burninGen: return [initSize] if growthModel == 'linear': inc = (endingSize-initSize)/float(endingGen-burninGen) if gen < splitGen: return [int(initSize+inc*(gen-burninGen))] else: return [int(initSize+inc*(gen-burninGen))/numSubPop]*numSubPop else: # exponential rate = (math.log(endingSize)-math.log(initSize))/(endingGen-burninGen) if gen < splitGen: return [int(initSize*math.exp((gen-burninGen)*rate))] else: return [int(initSize*math.exp((gen-burninGen)*rate)/numSubPop)]*numSubPop # 2. simulating allele frequency trajectory if maxMutAge == 0: maxMutAge = endingGen elif maxMutAge < minMutAge: raise exceptions.ValueError('maxMutAge needs to be greater than minMutAge.') elif maxMutAge > endingGen: print 'maxMutAge should be smaller than endingGen, set it to endingGen.' maxMutAge = endingGen # this is defined in simuUtil, a wrapper for # FreqTrajectoryMultiStoch if simuAge > 0: mutantAges = [] for i in range(simuAge): (traj, introGens, trajFunc) = FreqTrajectoryMultiStochWithSubPop( curGen=endingGen, numLoci=len(DSLafter), freq=curAlleleFreq, NtFunc=popSizeFunc, fitness=fitness, minMutAge=minMutAge, maxMutAge=maxMutAge, mode=alleleDistInSubPop, restartIfFail=True) mutantAges.append([len(x) for x in traj]) print "Simulated trajectory length:" for i,age in enumerate(mutantAges): print 'simu %3d:' % i, ', '.join(['%6d' % x for x in age]) mean = [sum([x[col] for x in mutantAges])*1./simuAge for col in range(len(DSLafter))] print "Mean: ", ', '.join(['%6.1f' % x for x in mean]) sys.exit(0) (traj, introGens, trajFunc) = FreqTrajectoryMultiStochWithSubPop( curGen=endingGen, numLoci=len(DSLafter), freq=curAlleleFreq, NtFunc=popSizeFunc, fitness=fitness, minMutAge=minMutAge, maxMutAge=maxMutAge, mode=alleleDistInSubPop, restartIfFail=True) # # 3. save and plot the simulation scenario tfile = open(filename+'.traj', 'w') tfile.write('Simulated trajectories:\n') for t in traj: tfile.write(', '.join([str(x) for x in t ]) + '\n') tfile.write('Observed allele frequency (generation, population size, allele frequencies)\n') tfile.close() print '\n\nTrajectories simulated successfully. Their lengths are %s.\n Check %s.eps for details. \n\n' \ % ( ', '.join([ str(len(x)) for x in traj]), filename) ### ### translate numChrom, numLoci, DSLafterLoci to ### loci, lociPos, DSL, nonDSL in the usual index ### (count DSL along with markers) ### if markerType == 'microsatellite': maxAle = 99 # max allele else: maxAle = 1 # SNP (0 and 1) numDSL = len(DSLafter) if len(DSLdist) != numDSL: raise exceptions.ValueError("--DSL and --DSLloc has different length.") # real indices of DSL DSL = list(DSLafter) for i in range(0,numDSL): DSL[i] += i+1 # adjust loci and lociPos loci = [0]*numChrom lociPos = [] i = 0 # current absolute locus j = 0 # current DSL for ch in range(0, numChrom): lociPos.append([]) for loc in range(0,numLoci): # DSL after original loci indices if j < numDSL and i == DSLafter[j]: loci[ch] += 2 lociPos[ch].append(loc+1) lociPos[ch].append(loc+1 + DSLdist[j]) j += 1 else: loci[ch] += 1 lociPos[ch].append(loc+1) i += 1 # non-DSL loci, for convenience nonDSL = range(0, reduce(operator.add, loci)) for loc in DSL: nonDSL.remove(loc) ### ### initialization ### if maxAle > 1: # Not SNP preOperators = [ # initialize all loci with 5 haplotypes initByValue(value=[[x]*sum(loci) for x in range(48, 53)], proportions=[.2]*5), # and then init DSL with all wild type alleles initByValue([0]*len(DSL), atLoci=DSL) ] else: # SNP preOperators = [ # initialize all loci with two haplotypes (0001,111) initByValue(value=[[x]*sum(loci) for x in [0,1] ], proportions=[.5]*2), # and then init DSL with all wild type alleles initByValue([0]*len(DSL), atLoci=DSL) ] ### ### mutation, start from gen 0, ### if maxAle > 1: # Not SNP # symmetric mutation model for microsatellite mutator = smmMutator(rate=mutaRate, maxAllele=maxAle, atLoci=nonDSL) else: # k-allele model for mutation of SNP mutator = kamMutator(rate=mutaRate, maxAllele=1, atLoci=nonDSL) ### ### Recombination ### if len(recRate) == 1: rec = recombinator(intensity=recRate[0]) else: # rec after ... if len(recRate) != sum(loci) - numChrom: raise exceptions.ValueError("Recombination rate specification is wrong. Please see help file") al = [] start = 0 for ch in range(numChrom): al.extend( [x+start for x in range(loci(ch) )] ) start += loci[ch] rec = recombinator(rate=recRate, afterLoci=al) ### ### output progress ### operators = [ mutator, rec, stat(alleleFreq=DSL, popSize=True, LD=[DSL[0], DSL[0]+1], step=1), # output to screen pyEval( expr=r'"%d(%d): "%(gen, popSize) + " ".join(["%.5f"%(1-alleleFreq[x][0]) for x in DSL])+" %f\n"%LD_prime[DSL[0]][DSL[0]+1]', step=100), # output to file (append) pyEval( expr=r'"%d %d " %(gen, popSize) + " ".join(["%.5f"%(1-alleleFreq[x][0]) for x in DSL])+"\n"', output='>>>'+filename+'.traj') ] ### ### introduction of disease mutants ### ### endingGen ### 0 1 ...... i_T for i in range(numDSL): operators.append( pointMutator(atLoci=[DSL[i]], toAllele=1, inds=[i], at = [introGens[i]], stage=PreMating ) ) ### ### split to subpopulations ### if numSubPop > 1: operators.append( splitSubPop(0, proportions=[1./numSubPop]*numSubPop, at=[splitGen]), ) ### ### selection ### if mlSelModelTmp in ['additive', 'multiplicative']: mlSelModel = {'additive':SEL_Additive, 'multiplicative':SEL_Multiplicative}[mlSelModelTmp] operators.append( mlSelector( # with five multiple-allele selector as parameter [ maSelector(locus=DSL[x], wildtype=[0], fitness=[fitness[3*x],fitness[3*x+1],fitness[3*x+2]]) for x in range(len(DSL)) ], mode=mlSelModel, begin=splitGen), ) elif mlSelModelTmp == 'interaction': # multi-allele selector can handle multiple DSL case operators.append( maSelector(loci=DSL, fitness=fitness, wildtype=[0]) ) ### ### migration ### if numSubPop > 1 and migrModel == 'island' and migrRate > 0: operators.append( migrator(migrIslandRates(migrRate, numSubPop), mode=MigrByProbability, begin=mixingGen) ) elif numSubPop > 1 and migrModel == 'stepping stone' and migrRate > 0: operators.append( migrator(migrSteppingStoneRates(migrRate, numSubPop, circular=True), mode=MigrByProbability, begin=mixingGen) ) ### ### output statistics, track performance ### operators.extend([ pyOperator(func=outputStatistics, param = (burninGen, splitGen, mixingGen, endingGen, filename+'.log'), at = [burninGen, splitGen, mixingGen, endingGen ] ), # show elapsed time ticToc(at=[burninGen, splitGen, mixingGen, endingGen]), ] ) if len(savePop) > 0: # save population at given generations operators.append(savePopulation(outputExpr='os.path.join(simuName, "%s_%d.%s" % (simuName, gen, format))', at=savePop)) ### ### prepare mating scheme ### ### use ancestralDepth, def saveAncestors(gen): if gen >= endingGen - savedGen: return savedGen else: return 1 # create a population, note that I add needed information # fields father_idx, mother_idx later on, with the hope # that simulation can run a bit faster without them. pop = population(subPop=popSizeFunc(0), ploidy=2, loci = loci, maxAllele = maxAle, lociPos = lociPos, infoFields = ['fitness']) # save DSL info, some operators will use it. pop.dvars().DSL = DSL pop.dvars().numLoci = numLoci pop.dvars().curAlleleFreq = curAlleleFreq # clear log file if it exists try: os.remove(filename+'.log') except: pass # # start simulation. simu = simulator( pop, controlledRandomMating( newSubPopSizeFunc=popSizeFunc, # demographic model loci=DSL, # which loci to control alleles=[1]*numDSL, # which allele to control freqFunc=trajFunc # frequency control function ), rep=1) # evolve! If --dryrun is set, only show info simu.evolve( preOps = preOperators, ops = operators, end=endingGen-savedGen, dryrun=dryrun ) if dryrun: raise exceptions.SystemError("Stop since in dryrun mode.") # prepare for the last several generations # change mating scheme to random mating. # # save saveGen-1 ancestral generations simu.population(0).setAncestralDepth(savedGen-1) simu.population(0).addInfoFields(['father_idx', 'mother_idx']) operators.append(parentsTagger()) simu.setMatingScheme( randomMating( newSubPopSizeFunc=popSizeFunc, # demographic model numOffspring = numOffspring, mode = {'constant': MATE_NumOffspring, 'geometric': MATE_GeometricDistribution }[numOffMode] ) ) # different evolution method for the last few generations simu.evolve(ops=operators, end=endingGen) # succeed save information pop = simu.population(0) # we want to save info on how this population is generated. # This is not required but is a good practise pop.dvars().DSLafter = DSLafter pop.dvars().DSLdist = DSLdist pop.dvars().initSize = initSize pop.dvars().endingSize = endingSize pop.dvars().burninGen = burninGen pop.dvars().splitGen = splitGen pop.dvars().mixingGen = mixingGen pop.dvars().endingGen = endingGen pop.dvars().numSubPop = numSubPop pop.dvars().mutaRate = mutaRate pop.dvars().mutaModel = "symmetric stepwise" pop.dvars().migrRate = migrRate pop.dvars().alleleDistInSubPop = alleleDistInSubPop pop.dvars().migrModel = "circular stepping stone" pop.dvars().recRate = recRate pop.dvars().numOffspring = numOffspring pop.dvars().numOffMode = numOffMode print "Saving population to " + filename + '.' + format + '\n' #TurnOnDebug(DBG_UTILITY) simu.population(0).savePopulation(filename+'.'+format) return True | 6192e8ac3832ae52136a6066f5b44a030344c709 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/6192e8ac3832ae52136a6066f5b44a030344c709/simuComplexDisease.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3142,
89,
12795,
40,
26816,
12,
2107,
30761,
16,
818,
1333,
77,
16,
5373,
559,
16,
28053,
5205,
16,
28053,
4413,
9161,
16,
1208,
1225,
16,
11463,
1225,
16,
13334,
451,
1488,
16,
18305,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3142,
89,
12795,
40,
26816,
12,
2107,
30761,
16,
818,
1333,
77,
16,
5373,
559,
16,
28053,
5205,
16,
28053,
4413,
9161,
16,
1208,
1225,
16,
11463,
1225,
16,
13334,
451,
1488,
16,
18305,
... |
v.stmt_id as stmt_id, case sum(v.version_id) when %d then "A" when %d then "B" when %d then "AB" end as context | v.stmt_id AS stmt_id, CASE sum(IF(v.version_id = %d, 1, 0) + IF(v.version_id = %d, 2, 0)) WHEN 1 THEN "A" WHEN 2 THEN "B" WHEN 3 THEN "AB" END AS context | def prepareConnection(self, connection): cursor = connection.cursor() | 37ad7ef1cbf77fb013759adb3ee095d4767870e5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5223/37ad7ef1cbf77fb013759adb3ee095d4767870e5/basicquery.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1952,
12,
2890,
16,
1459,
4672,
3347,
273,
1459,
18,
9216,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
2911,
1952,
12,
2890,
16,
1459,
4672,
3347,
273,
1459,
18,
9216,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
wikipedia.output(u'\n\n>>>> Description on \03{lightpurple}%s\03{default} <<<<\n' % page.title()) wikipedia.output(localImagePage.get()) wikipedia.output(u'\n\n>>>> Description on \03{lightpurple}%s\03{default} <<<<\n' % commonsImagePage.title()) wikipedia.output(commonsText) choice = wikipedia.inputChoice(u'Does the description on Commons contain all required source and license information?', ['yes', 'no'], ['y', 'N'], 'N') | pywikibot.output( u'\n\n>>>> Description on \03{lightpurple}%s\03{default} <<<<\n' % page.title()) pywikibot.output(localImagePage.get()) pywikibot.output( u'\n\n>>>> Description on \03{lightpurple}%s\03{default} <<<<\n' % commonsImagePage.title()) pywikibot.output(commonsText) choice = pywikibot.inputChoice( u'Does the description on Commons contain all required source and license information?', ['yes', 'no'], ['y', 'N'], 'N') | def run(self): commons = wikipedia.getSite('commons', 'commons') comment = wikipedia.translate(self.site, nowCommonsMessage) | 3e7506930193ed64965aabc3e2d1d58bf15e5c6b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/3e7506930193ed64965aabc3e2d1d58bf15e5c6b/nowcommons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
24021,
273,
21137,
18,
588,
4956,
2668,
6054,
87,
2187,
296,
6054,
87,
6134,
2879,
273,
21137,
18,
13929,
12,
2890,
18,
4256,
16,
2037,
6517,
87,
1079,
13,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
24021,
273,
21137,
18,
588,
4956,
2668,
6054,
87,
2187,
296,
6054,
87,
6134,
2879,
273,
21137,
18,
13929,
12,
2890,
18,
4256,
16,
2037,
6517,
87,
1079,
13,
2,
-10... |
self.output = "audioconvert ! vorbisenc ! oggmux ! filesink location=" + file | self.output = "audioconvert ! vorbisenc ! oggmux ! filesink location=%s" % file.replace(" ", "\ ") | def record(self): '''Record to this instrument's temporary file.''' | d2854a3005e8ed974492b8e6c3675ad74c72e737 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10033/d2854a3005e8ed974492b8e6c3675ad74c72e737/Instrument.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1409,
12,
2890,
4672,
9163,
2115,
358,
333,
10353,
1807,
6269,
585,
1093,
6309,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1409,
12,
2890,
4672,
9163,
2115,
358,
333,
10353,
1807,
6269,
585,
1093,
6309,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
ds = gdaltest.tiff_drv.Create( 'tmp/test_6.tif', 200, 200, 1, | ds = gdaltest.tiff_drv.Create( 'tmp/test_8.tif', 200, 200, 1, | def tiff_write_8(): options= [ 'TILED=YES', 'BLOCKSIZE=32', 'COMPRESS=PACKBITS' ] ds = gdaltest.tiff_drv.Create( 'tmp/test_6.tif', 200, 200, 1, gdal.GDT_Byte, options ) # make a 32x32 byte buffer buf = array.array('B',range(32)).tostring() for i in range(5): buf = buf + buf ds.WriteRaster( 0, 0, 32, 32, buf, buf_type = gdal.GDT_Byte ) ds.FlushCache() ds.WriteRaster( 32, 0, 32, 32, buf, buf_type = gdal.GDT_Byte ) ds.FlushCache() buf_read = ds.ReadRaster( 0, 0, 32, 32, buf_type = gdal.GDT_Byte ) if buf_read != buf: gdaltest.post_reason( 'did not get back expected data.' ) return 'fail' ds = None gdaltest.tiff_drv.Delete( 'tmp/test_6.tif' ) return 'success' | 777d5aad0cbc14d0eb98f470cd8022c9b6d43be0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10289/777d5aad0cbc14d0eb98f470cd8022c9b6d43be0/tiff_write.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
3048,
67,
2626,
67,
28,
13332,
225,
702,
33,
306,
296,
56,
9504,
33,
29081,
2187,
296,
11403,
4574,
33,
1578,
2187,
296,
4208,
22526,
33,
12231,
25171,
11,
308,
3780,
273,
15551,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
3048,
67,
2626,
67,
28,
13332,
225,
702,
33,
306,
296,
56,
9504,
33,
29081,
2187,
296,
11403,
4574,
33,
1578,
2187,
296,
4208,
22526,
33,
12231,
25171,
11,
308,
3780,
273,
15551,
... |
def testKukitCutObject(self): | def testKssCutObject(self): | def testKukitCutObject(self): req = self.portal.REQUEST view = content_replacer.ContentMenuView(self.fpage, req) result = view.cutObject() | c01f348b980345a36cd65be7267e7e1998a9d174 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12181/c01f348b980345a36cd65be7267e7e1998a9d174/test_menus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
47,
1049,
15812,
921,
12,
2890,
4672,
1111,
273,
365,
18,
24386,
18,
5519,
1476,
273,
913,
67,
26745,
10598,
18,
1350,
4599,
1767,
12,
2890,
18,
74,
2433,
16,
1111,
13,
563,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
47,
1049,
15812,
921,
12,
2890,
4672,
1111,
273,
365,
18,
24386,
18,
5519,
1476,
273,
913,
67,
26745,
10598,
18,
1350,
4599,
1767,
12,
2890,
18,
74,
2433,
16,
1111,
13,
563,
273,... |
self.beginInsertRows(QModelIndex(), 0, len(items)-1) | self.beginResetModel() | def load(self): try: try: file = open(ApplicationData.get('contacts')) items = pickle.load(file) except (IOError, OSError): file = open(ApplicationData.get('contacts.bak')) items = pickle.load(file) except (IOError, OSError): file = None group = ContactGroup('Test') contacts = [Contact(group, 'Call Test', '3333@sip2sip.info', 'icons/3333@sip2sip.info.png'), Contact(group, 'Echo Test', '4444@sip2sip.info', 'icons/4444@sip2sip.info.png'), Contact(group, 'Multi-Party Chat', '123@chatserver.ag-projects.com'), Contact(group, 'VUC Conference', '200901@login.zipdx.com', 'icons/200901@login.zipdx.com.png')] contacts.sort(key=attrgetter('name')) items = [group] + contacts self.beginInsertRows(QModelIndex(), 0, len(items)-1) self.items = items self.endInsertRows() for position, item in enumerate(self.items): if type(item) is ContactGroup: self.contact_list.openPersistentEditor(self.index(position)) else: self.contact_list.setRowHidden(position, item.group.collapsed) if file is None: self.save() | 0f2ef3558a357dfc3f0f2122fc1186bc6e7e698b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3447/0f2ef3558a357dfc3f0f2122fc1186bc6e7e698b/contacts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
12,
2890,
4672,
775,
30,
775,
30,
585,
273,
1696,
12,
3208,
751,
18,
588,
2668,
20777,
26112,
1516,
273,
13379,
18,
945,
12,
768,
13,
1335,
261,
4294,
668,
16,
10002,
4672,
585,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
12,
2890,
4672,
775,
30,
775,
30,
585,
273,
1696,
12,
3208,
751,
18,
588,
2668,
20777,
26112,
1516,
273,
13379,
18,
945,
12,
768,
13,
1335,
261,
4294,
668,
16,
10002,
4672,
585,
... |
operator a string which will be output as the infix operator between | :param operator: a string which will be output as the infix operator between | def op(self, operator): """produce a generic operator function. | 6bc016a76205aefad3ba6f21a89053a318eeb88e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1074/6bc016a76205aefad3ba6f21a89053a318eeb88e/expression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1061,
12,
2890,
16,
3726,
4672,
3536,
11776,
311,
279,
5210,
3726,
445,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1061,
12,
2890,
16,
3726,
4672,
3536,
11776,
311,
279,
5210,
3726,
445,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
Returns the degree centrality (fraction of nodes connected to) as a dictionary of values keyed by node. The degree centrality is | Returns the degree centrality (fraction of vertices connected to) as a dictionary of values keyed by vertex. The degree centrality is | def centrality_degree(self, v=False): r""" Returns the degree centrality (fraction of nodes connected to) as a dictionary of values keyed by node. The degree centrality is normalized to be in range (0,1). Measures of the centrality of a vertex within a graph determine the relative importance of that node to its graph. Degree centrality measures the number of links incident upon a node. INPUT: v -- a vertex label (to find degree centrality of only one node) EXAMPLES: sage: (graphs.ChvatalGraph()).centrality_degree() {0: 0.36363636363636365, 1: 0.36363636363636365, 2: 0.36363636363636365, 3: 0.36363636363636365, 4: 0.36363636363636365, 5: 0.36363636363636365, 6: 0.36363636363636365, 7: 0.36363636363636365, 8: 0.36363636363636365, 9: 0.36363636363636365, 10: 0.36363636363636365, 11: 0.36363636363636365} sage: D = DiGraph({0:[1,2,3], 1:[2], 3:[0,1]}) sage.: D.show(figsize=[2,2]) sage: D = D.to_undirected() sage.: D.show(figsize=[2,2]) sage: D.centrality_degree() {0: 1.0, 1: 1.0, 2: 0.66666666666666663, 3: 0.66666666666666663} sage: D.centrality_degree(v=1) 1.0 """ import networkx return networkx.degree_centrality(self._nxg, v) | 7d819cbf1df622e9f76b4801233dbb334f44d362 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/7d819cbf1df622e9f76b4801233dbb334f44d362/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
8230,
7919,
67,
21361,
12,
2890,
16,
331,
33,
8381,
4672,
436,
8395,
2860,
326,
10782,
276,
8230,
7919,
261,
16744,
434,
6928,
5840,
358,
13,
487,
279,
3880,
434,
924,
17408,
635,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
8230,
7919,
67,
21361,
12,
2890,
16,
331,
33,
8381,
4672,
436,
8395,
2860,
326,
10782,
276,
8230,
7919,
261,
16744,
434,
6928,
5840,
358,
13,
487,
279,
3880,
434,
924,
17408,
635,
... |
if type is not None: value = type.decode(value) return value | if value is None: return type.default return type.decode(value) | def get_cookie(self, name, type=None): request, response = self.request, self.response # Get the value cookie = response.get_cookie(name) if cookie is None: value = request.get_cookie(name) else: # Check expiration time expires = cookie.expires if expires is not None: expires = expires[5:-4] expires = strptime(expires, '%d-%b-%y %H:%M:%S') year, month, day, hour, min, sec, kk, kk, kk = expires expires = datetime.datetime(year, month, day, hour, min, sec) | 52a1b59f947418d1aa25ed45e8d3f3a214552685 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/52a1b59f947418d1aa25ed45e8d3f3a214552685/context.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
8417,
12,
2890,
16,
508,
16,
618,
33,
7036,
4672,
590,
16,
766,
273,
365,
18,
2293,
16,
365,
18,
2740,
468,
968,
326,
460,
3878,
273,
766,
18,
588,
67,
8417,
12,
529,
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,
336,
67,
8417,
12,
2890,
16,
508,
16,
618,
33,
7036,
4672,
590,
16,
766,
273,
365,
18,
2293,
16,
365,
18,
2740,
468,
968,
326,
460,
3878,
273,
766,
18,
588,
67,
8417,
12,
529,
13,
... |
INPUT: an integer OUTPUT: a list of four numbers whose squares sum to n EXAMPLES:: | INPUT: - ``n`` - an integer OUTPUT: - a list of four numbers whose squares sum to n EXAMPLES:: | def four_squares(n): """ Computes the decomposition into the sum of four squares, using an algorithm described by Peter Schorn at: http://www.schorn.ch/howto.html. INPUT: an integer OUTPUT: a list of four numbers whose squares sum to n EXAMPLES:: sage: four_squares(3) [0, 1, 1, 1] sage: four_squares(130) [0, 0, 3, 11] sage: four_squares(1101011011004) [2, 1049178, 2370, 15196] sage: sum([i-sum([q^2 for q in four_squares(i)]) for i in range(2,10000)]) # long time 0 """ from sage.rings.integer_mod import mod from math import sqrt from sage.rings.arith import _brute_force_four_squares try: ts = two_squares(n) return [0,0,ts[0],ts[1]] except ValueError: pass m = n v = 0 while mod(m,4)==0: v = v +1 m = m/4 if mod(m,8) == 7: d = 1 m = m - 1 else: d = 0 if mod(m,8)==3: x = int(sqrt(m)) if mod(x,2) == 0: x = x - 1 p = (m-x**2)/2 while not is_prime(p): x = x - 2 p = (m-x**2)/2 if x < 0: # fall back to brute force m = m + d return [2**v*q for q in _brute_force_four_squares(m)] y,z = two_squares(p) return [2**v*q for q in [d,x,y+z,abs(y-z)]] x = int(sqrt(m)) p = m - x**2 if p == 1: return[2**v*q for q in [d,0,x,1]] while not is_prime(p): x = x - 1 p = m - x**2 if x < 0: # fall back to brute force m = m + d return [2**v*q for q in _brute_force_four_squares(m)] y,z = two_squares(p) return [2**v*q for q in [d,x,y,z]] | 08206c95546f1db2a947692b19f3ca4ec939d5d9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/08206c95546f1db2a947692b19f3ca4ec939d5d9/arith.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12792,
67,
87,
29405,
12,
82,
4672,
3536,
14169,
281,
326,
26288,
1368,
326,
2142,
434,
12792,
31206,
16,
1450,
392,
4886,
11893,
635,
453,
847,
348,
4964,
82,
622,
30,
1062,
2207,
5591,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12792,
67,
87,
29405,
12,
82,
4672,
3536,
14169,
281,
326,
26288,
1368,
326,
2142,
434,
12792,
31206,
16,
1450,
392,
4886,
11893,
635,
453,
847,
348,
4964,
82,
622,
30,
1062,
2207,
5591,... |
self.statuslist.append(( _("Package list update"), '', _("Trying to download a new packetlist. Please wait..." ),'', '', statuspng, divpng, None, '' )) | self.statuslist.append(( _("Updating software catalog"), '', _("Searching for available updates. Please wait..." ),'', '', statuspng, divpng, None, '' )) | def setState(self,status = None): if status: self.currList = "status" self.statuslist = [] self["key_green"].setText("") self["key_blue"].setText("") self["key_yellow"].setText("") divpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/div-h.png")) if status == 'update': statuspng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/upgrade.png")) self.statuslist.append(( _("Package list update"), '', _("Trying to download a new packetlist. Please wait..." ),'', '', statuspng, divpng, None, '' )) self["list"].style = "default" self['list'].setList(self.statuslist) elif status == 'sync': statuspng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/upgrade.png")) self.statuslist.append(( _("Package list update"), '', _("Searching for new installed or removed packages. Please wait..." ),'', '', statuspng, divpng, None, '' )) self["list"].style = "default" self['list'].setList(self.statuslist) elif status == 'error': statuspng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/remove.png")) self.statuslist.append(( _("Error"), '', _("There was an error downloading the packetlist. Please try again." ),'', '', statuspng, divpng, None, '' )) self["list"].style = "default" self['list'].setList(self.statuslist) | 018534fa7bf9be0885b2ffc753d8d6fc5b56143c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/018534fa7bf9be0885b2ffc753d8d6fc5b56143c/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12947,
12,
2890,
16,
2327,
273,
599,
4672,
309,
1267,
30,
365,
18,
17016,
682,
273,
315,
2327,
6,
365,
18,
2327,
1098,
273,
5378,
365,
9614,
856,
67,
11571,
6,
8009,
542,
1528,
2932,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12947,
12,
2890,
16,
2327,
273,
599,
4672,
309,
1267,
30,
365,
18,
17016,
682,
273,
315,
2327,
6,
365,
18,
2327,
1098,
273,
5378,
365,
9614,
856,
67,
11571,
6,
8009,
542,
1528,
2932,
... |
issue = self.get_handler(issue_name) | issue = self.get_object(issue_name) | def go_to_issue(self, context): issue_name = context.get_form_value('issue_name') if not issue_name in self.get_handler_names(): return context.come_back(u'Issue not found.') issue = self.get_handler(issue_name) if not isinstance(issue, Issue): return context.come_back(u'Issue not found.') return context.uri.resolve2('../%s/;edit_form' % issue_name) | 1fa77be5b783398ca5fc70ac4c6bcf0d082732e2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/1fa77be5b783398ca5fc70ac4c6bcf0d082732e2/tracker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1960,
67,
869,
67,
13882,
12,
2890,
16,
819,
4672,
5672,
67,
529,
273,
819,
18,
588,
67,
687,
67,
1132,
2668,
13882,
67,
529,
6134,
309,
486,
5672,
67,
529,
316,
365,
18,
588,
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,
1960,
67,
869,
67,
13882,
12,
2890,
16,
819,
4672,
5672,
67,
529,
273,
819,
18,
588,
67,
687,
67,
1132,
2668,
13882,
67,
529,
6134,
309,
486,
5672,
67,
529,
316,
365,
18,
588,
67,
... |
'style:position="center" ' | 'style:position="top left" ' | def test_image_full(self): style = self.style.clone() style.set_background(uri='Pictures/toto', position='top left', repeat='no-repeat', opacity=50, filter='myfilter') expected = ('<style:style style:family="paragraph">' '<style:paragraph-properties>' '<style:background-image ' 'xlink:href="Pictures/toto" ' 'style:position="center" ' 'style:repeat="no-repeat" ' 'draw:opacity="50" ' 'style:filter-name="myfilter"/>' '</style:paragraph-properties>' '</style:style>') self.assertEqual(style.serialize(), expected) | 6fd6709ea9c81d28c1f17f6ceca4ccec71572ab7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10612/6fd6709ea9c81d28c1f17f6ceca4ccec71572ab7/test_style.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2730,
67,
2854,
12,
2890,
4672,
2154,
273,
365,
18,
4060,
18,
14056,
1435,
2154,
18,
542,
67,
9342,
12,
1650,
2218,
52,
28636,
19,
3307,
83,
2187,
1754,
2218,
3669,
2002,
218... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2730,
67,
2854,
12,
2890,
4672,
2154,
273,
365,
18,
4060,
18,
14056,
1435,
2154,
18,
542,
67,
9342,
12,
1650,
2218,
52,
28636,
19,
3307,
83,
2187,
1754,
2218,
3669,
2002,
218... |
model.postProcessParents() | def process(klass, contentHandler): """ Main process entry point. All instantiations of this class should be made through this class method unless you really know what you are doing. """ elements = contentHandler.getRoot().getChildren() model = klass() model.topLevelSimpleTypes = contentHandler.topLevelSimpleTypes model.processTree(elements) model.postProcessReferences() model.postProcessParents() return model | b8edc8e06c23123f9d79f992de7ab12a338c9b98 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1844/b8edc8e06c23123f9d79f992de7ab12a338c9b98/fu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
22626,
16,
913,
1503,
4672,
3536,
12740,
1207,
1241,
1634,
18,
4826,
5934,
77,
1012,
434,
333,
667,
1410,
506,
7165,
3059,
333,
667,
707,
3308,
1846,
8654,
5055,
4121,
1846,
85... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
22626,
16,
913,
1503,
4672,
3536,
12740,
1207,
1241,
1634,
18,
4826,
5934,
77,
1012,
434,
333,
667,
1410,
506,
7165,
3059,
333,
667,
707,
3308,
1846,
8654,
5055,
4121,
1846,
85... | |
self._closer.makefile_close() | def close(self): if self.closed: return self._closer.makefile_close() io.RawIOBase.close(self) | 5632861bff7fa6411b4628799710688d14756ec1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/5632861bff7fa6411b4628799710688d14756ec1/socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
309,
365,
18,
12204,
30,
327,
2527,
18,
4809,
4294,
2171,
18,
4412,
12,
2890,
13,
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,
1746,
12,
2890,
4672,
309,
365,
18,
12204,
30,
327,
2527,
18,
4809,
4294,
2171,
18,
4412,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
def processEOF(self, data): | def processEOF(self): | def processEOF(self, data): self.createHTMLNode() self.parser.phase.processEOF() | 8ef6b38c10a7b3aa507d2e8ae3e7fe155e46b6ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4487/8ef6b38c10a7b3aa507d2e8ae3e7fe155e46b6ae/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12706,
12,
2890,
4672,
365,
18,
2640,
4870,
907,
1435,
365,
18,
4288,
18,
13961,
18,
2567,
12706,
1435,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
12706,
12,
2890,
4672,
365,
18,
2640,
4870,
907,
1435,
365,
18,
4288,
18,
13961,
18,
2567,
12706,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
return curses.tparm(curses.tigetstr("setf"), 6) | return curses.tparm(SETF, 6) | def GetColor(color = None): if not HAVE_COLORS: return "" if color != None: color = color.lower() if (color == "blue"): return curses.tparm(curses.tigetstr("setf"), 1) elif (color == "green"): return curses.tparm(curses.tigetstr("setf"), 2) elif (color == "cyan"): return curses.tparm(curses.tigetstr("setf"), 3) elif (color == "red"): return curses.tparm(curses.tigetstr("setf"), 4) elif (color == "magenta"): return curses.tparm(curses.tigetstr("setf"), 5) elif (color == "yellow"): return curses.tparm(curses.tigetstr("setf"), 6) else: return curses.tparm(curses.tigetstr("sgr0")) | c0695c34a90684ebb8c382fa9ff9081ded7d9802 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8543/c0695c34a90684ebb8c382fa9ff9081ded7d9802/makepandacore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2957,
12,
3266,
273,
599,
4672,
309,
486,
21926,
3412,
67,
10989,
55,
30,
327,
1408,
309,
2036,
480,
599,
30,
2036,
273,
2036,
18,
8167,
1435,
309,
261,
3266,
422,
315,
14081,
6,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2957,
12,
3266,
273,
599,
4672,
309,
486,
21926,
3412,
67,
10989,
55,
30,
327,
1408,
309,
2036,
480,
599,
30,
2036,
273,
2036,
18,
8167,
1435,
309,
261,
3266,
422,
315,
14081,
6,
... |
dlg.Destroy() | def onRunScript(self, event_): dlg = wx.FileDialog(None, 'Choose a script to run', './Scripts', '', '*.py', wx.OPEN) if dlg.ShowModal() == wx.ID_OK: try: self.runScript(dlg.GetPath()) except: (exceptionType, exceptionValue, exceptionTraceback) = sys.exc_info() frames = traceback.extract_tb(exceptionTraceback)[2:] dialog = wx.MessageDialog(self, str(exceptionValue) + ' (' + exceptionType.__name__ + ')' + '\n\nTraceback:\n' + ''.join(traceback.format_list(frames)), gettext('An error occurred while running the script:'), style = wx.ICON_ERROR | wx.OK) dialog.ShowModal() dlg.Destroy() self.Show(True) # Turn off bulk loading in case the script forgot to. self.display.network.setBulkLoading(False) | 7ac073cc28d9d5d60c4a9274d6bf4f34416a6173 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6368/7ac073cc28d9d5d60c4a9274d6bf4f34416a6173/neuroptikon_frame.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
1997,
3651,
12,
2890,
16,
871,
67,
4672,
25840,
273,
7075,
18,
812,
6353,
12,
7036,
16,
296,
24529,
279,
2728,
358,
1086,
2187,
12871,
15041,
2187,
10226,
19962,
2074,
2187,
7075,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
1997,
3651,
12,
2890,
16,
871,
67,
4672,
25840,
273,
7075,
18,
812,
6353,
12,
7036,
16,
296,
24529,
279,
2728,
358,
1086,
2187,
12871,
15041,
2187,
10226,
19962,
2074,
2187,
7075,
1... | |
MarkerInterface,\ | def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) | 85e69b65134313ec3f3db57e106088fcd5133b18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/85e69b65134313ec3f3db57e106088fcd5133b18/XMLSchema.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
8832,
12,
2890,
16,
756,
4672,
365,
18,
542,
2498,
12,
2159,
13,
2939,
273,
365,
18,
588,
6323,
12,
2159,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
8832,
12,
2890,
16,
756,
4672,
365,
18,
542,
2498,
12,
2159,
13,
2939,
273,
365,
18,
588,
6323,
12,
2159,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
def history(self, direction='descending'): | def history(self, direction='descending', dre=re.compile('\d+')): | def history(self, direction='descending'): l = ['<table class="history">' '<tr><th colspan="4" class="header">', _('History'), '</th></tr><tr>', _('<th>Date</th>'), _('<th>User</th>'), _('<th>Action</th>'), _('<th>Args</th>'), '</tr>'] comments = {} history = self._klass.history(self._nodeid) history.sort() if direction == 'descending': history.reverse() for id, evt_date, user, action, args in history: date_s = str(evt_date).replace("."," ") arg_s = '' if action == 'link' and type(args) == type(()): if len(args) == 3: linkcl, linkid, key = args arg_s += '<a href="%s%s">%s%s %s</a>'%(linkcl, linkid, linkcl, linkid, key) else: arg_s = str(args) | 237ba6557a200663ce36484188c896ac285de68d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/237ba6557a200663ce36484188c896ac285de68d/templating.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4927,
12,
2890,
16,
4068,
2218,
5569,
2846,
2187,
302,
266,
33,
266,
18,
11100,
2668,
64,
72,
6797,
3719,
30,
328,
273,
10228,
32,
2121,
667,
1546,
8189,
7918,
2368,
313,
4438,
451,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4927,
12,
2890,
16,
4068,
2218,
5569,
2846,
2187,
302,
266,
33,
266,
18,
11100,
2668,
64,
72,
6797,
3719,
30,
328,
273,
10228,
32,
2121,
667,
1546,
8189,
7918,
2368,
313,
4438,
451,
20... |
'_topdir ' + os.getcwd() + '/build/rpm',]) | '_topdir %s/%s' % (os.getcwd(), rpm_base),]) | def run (self): | 0e661804b50eec51ca89be25e62a5acc391083e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/0e661804b50eec51ca89be25e62a5acc391083e9/bdist_rpm.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,
... |
self._points = self._embed(read_palp_matrix( self.poly_x("p", reduce_dimension=True))) self._points.set_immutable() | if self.dim() == 0: self._points = self._vertices else: self._points = self._embed(read_palp_matrix( self.poly_x("p", reduce_dimension=True))) self._points.set_immutable() | def points(self): r""" Return all lattice points of this polytope as columns of a matrix. EXAMPLES: The lattice points of the 3-dimensional octahedron and its polar cube:: sage: o = lattice_polytope.octahedron(3) sage: o.points() [ 1 0 0 -1 0 0 0] [ 0 1 0 0 -1 0 0] [ 0 0 1 0 0 -1 0] sage: cube = o.polar() sage: cube.points() [-1 1 -1 1 -1 1 -1 1 -1 -1 -1 -1 -1 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 1 -1 -1 -1 0 0 0 1 1 1 -1 0 0 0 1] [ 1 1 1 1 -1 -1 -1 -1 0 -1 0 1 0 -1 0 1 -1 0 1 -1 0 1 0 -1 0 1 0] Lattice points of a 2-dimensional diamond in a 3-dimensional space:: sage: m = matrix(ZZ, [[1, 0, -1, 0], ... [0, 1, 0, -1], ... [0, 0, 0, 0]]) ... sage: p = LatticePolytope(m) sage: p.points() [ 1 0 -1 0 0] [ 0 1 0 -1 0] [ 0 0 0 0 0] """ if not hasattr(self, "_points"): self._points = self._embed(read_palp_matrix( self.poly_x("p", reduce_dimension=True))) self._points.set_immutable() return self._points | 10caea0912f38e43cabd86a75aa2a5a6640cd135 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/10caea0912f38e43cabd86a75aa2a5a6640cd135/lattice_polytope.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3143,
12,
2890,
4672,
436,
8395,
2000,
777,
16690,
3143,
434,
333,
7573,
869,
347,
487,
2168,
434,
279,
3148,
18,
225,
5675,
8900,
11386,
30,
1021,
16690,
3143,
434,
326,
890,
17,
31236,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3143,
12,
2890,
4672,
436,
8395,
2000,
777,
16690,
3143,
434,
333,
7573,
869,
347,
487,
2168,
434,
279,
3148,
18,
225,
5675,
8900,
11386,
30,
1021,
16690,
3143,
434,
326,
890,
17,
31236,... |
if Q >= args[Q_pos][j] and Q < args[Q_pos][j+1]: | if Q[0] >= args[Q_pos][j] and Q[0] < args[Q_pos][j + 1]: | def create_2D_dist(som,*args,**kwargs): """ This function takes a SOM of single spectrum with energy transfer axes and rebins those axes to a given axis and converts the spectra into a single I(Q,E) spectrum. Parameters: ---------- -> som is the input SOM with energy transfer axis SOs -> *args is a mandatory list of axes for rebinning. There is a particular order to them. They should be present in the following order: Without errors 1. Energy transfer 2. Momentum transfer With errors 1. Energy transfer 2. Energy transfer error^2 3. Momentum transfer 4. Momentum transfer error ^2 -> **kwargs is a dictionary of optional keywords that pass information to the function. Here are the currently accepted keywords: - withXVar=<string>. The string will either be True or False. If the keyword is not present, the default value will be False - data_type=<string> The string can be either histogram, density or coordinate. If the keyword is not present, the default value will be histogram - so_id=<identifier> The identifier represents a number, string, tuple or other object that describes the resulting SO - y_label=<string> This is a string that sets the y axis label - y_units=<string> This is a string that sets the y axis units - x_labels=<list of strings> This is a list of strings that sets the individual x axes labels - x_units=<list of string> This is a list of strings that sets the individual x axes units Returns: ------- <- A SOM with a single 2D SO with E and Q axes Exceptions: ---------- <- RuntimeError is raised if the parameter given to the keyword argument withXVar is not True or False <- RuntimeError is raised if the parameter given to the keyword argument data_type is not histogram or density or coordinate <- RuntimeError is raised is the number of given arguments (x-axes) is not either 2 (no errors) or 4 (with errors) """ import common_lib import hlr_utils import nessi_list import SOM # Setup some variables dim = 2 N_y = [] N_tot = 1 N_args = len(args) # Check withXVar keyword argument and also check number of given args. # Set xvar and Q_pos (position of the momentum transfer axis in the args # list) to the appropriate values try: value = kwargs["withXVar"] if value.lower() == "true": if N_args != 4: raise RuntimeError, "Since you have requested x errors, 4 x "\ +"axes must be provided." else: xvar = True Q_pos = 2 elif value.lower() == "false": if N_args != 2: raise RuntimeError, "Since you did not requested x errors, 2 "\ +"x axes must be provided." else: xvar = False Q_pos = 1 else: raise RuntimeError, "Do not understand given parameter %s" % \ value except KeyError: if N_args != 2: raise RuntimeError, "Since you did not requested x errors, 2 "\ +"x axes must be provided." else: xvar = False Q_pos = 1 # Check dataType keyword argument. An offset will be set to 1 for the # histogram type and 0 for either density or coordinate try: type = kwargs["data_type"] if type.lower() == "histogram": offset = 1 elif type.lower() == "density" or type.lower() == "coordinate": offset = 0 else: raise RuntimeError, "Do not understand data type given: %s" % \ type # Default is offset for histogram except KeyError: offset = 1 so_dim = SOM.SO(dim) for i in range(dim): # Set the x-axis arguments from the *args list into the new SO if not xvar: # Axis positions are 1 (Q) and 0 (E) position = dim-i-1 so_dim.axis[i].val = args[position] else: # Axis positions are 2 (Q), 3 (eQ), 0 (E), 1 (eE) position = dim-2*i so_dim.axis[i].val = args[position] so_dim.axis[i].var = args[position+1] # Set individual value axis sizes (not x-axis size) N_y.append(len(args[position]) - offset) # Calculate total 2D array size N_tot = N_tot * N_y[-1] # Create y and var_y lists from total 2D size so_dim.y = nessi_list.NessiList(N_tot) so_dim.var_y = nessi_list.NessiList(N_tot) # Rebin data to E axis som1 = common_lib.rebin_axis_1D(som, args[0]) som = None del som inst = som1.attr_list.instrument lambda_final = som1.attr_list["Wavelength_final"] import array_manip import axis_manip for i in range(hlr_utils.get_length(som1)): # Find Q for pixel so = hlr_utils.get_value(som1,i,"SOM","all") (angle,angle_err2) = hlr_utils.get_parameter("polar",so,inst) l_f = hlr_utils.get_special(lambda_final, so) (Q,Q_err2) = axis_manip.wavelength_to_scalar_Q(l_f[0], l_f[1], angle/2.0, angle_err2/2.0) # Find Q value in given momentum transfer axis index = -1 for j in range(N_y[0]): if Q >= args[Q_pos][j] and Q < args[Q_pos][j+1]: index = j break if index != -1: start = index * N_y[1] finish = (index + 1) * N_y[1] length = finish - start + 1 val = hlr_utils.get_value(som1, i, "SOM") err2 = hlr_utils.get_err2(som1, i, "SOM") (so_dim.y, so_dim.var_y) = array_manip.add_ncerr(so_dim.y, so_dim.var_y, val, err2, a_start=start, b_size=length) # If the Q value is not found in the given axis, do nothing and # continue else: pass # Check for so_id keyword argument if kwargs.has_key("so_id"): so_dim.id = kwargs["so_id"] else: so_dim.id = 0 comb_som = SOM.SOM() comb_som.copyAttributes(som1) # Check for y_label keyword argument if kwargs.has_key("y_label"): comb_som.setYLabel(kwargs["y_label"]) else: comb_som.setYLabel("Counts") # Check for y_units keyword argument if kwargs.has_key("y_units"): comb_som.setYUnits(kwargs["y_units"]) else: comb_som.setYUnits("Counts / THz A^-1") # Check for x_labels keyword argument if kwargs.has_key("x_labels"): comb_som.setAllAxisLabels(kwargs["x_labels"]) else: comb_som.setAllAxisLabels(["Momentum transfer","Energy transfer"]) # Check for x_units keyword argument if kwargs.has_key("x_units"): comb_som.setAllAxisUnits(kwargs["x_units"]) else: comb_som.setAllAxisUnits(["A^-1","THz"]) comb_som.append(so_dim) return comb_som | 8c0e478ff0fa2abc2e5d85a427bbaf1028f81580 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/8c0e478ff0fa2abc2e5d85a427bbaf1028f81580/hlr_create_2D_dist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
22,
40,
67,
4413,
12,
87,
362,
16,
14,
1968,
16,
636,
4333,
4672,
3536,
1220,
445,
5530,
279,
348,
1872,
434,
2202,
17970,
598,
12929,
7412,
6515,
471,
283,
11862,
5348,
6515,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
22,
40,
67,
4413,
12,
87,
362,
16,
14,
1968,
16,
636,
4333,
4672,
3536,
1220,
445,
5530,
279,
348,
1872,
434,
2202,
17970,
598,
12929,
7412,
6515,
471,
283,
11862,
5348,
6515,... |
if not self.flag and collide.dist(self.pos, self.team.base.center) < self.team.base.radius: self.pos[0] += 1 | basedist = collide.dist(self.pos, self.team.base.center) if basedist < self.team.base.radius: angle = math.atan2(self.team.base.center[1]-self.pos[1], self.team.base.center[0]-self.pos[0]) + math.pi self.pos = [math.cos(angle) * self.team.base.radius + self.team.base.pos[0], math.sin(angle) * self.team.base.radius + self.team.base.pos[1]] if self.flag and self.team.map.closest_base(self.pos) == self.team.base: self.team.map.scoreFlag(self.flag) | def update_goals(self, dt): '''update the velocities to match the goals''' if not self.flag and collide.dist(self.pos, self.team.base.center) < self.team.base.radius: self.pos[0] += 1 self.hspeed += self.accelx self.vspeed += self.accely max = 30 if collide.dist((0,0),(self.hspeed, self.vspeed)) > max: dr = math.atan2(self.vspeed, self.hspeed) self.hspeed = math.cos(dr) * max self.vspeed = math.sin(dr) * max | a88763d0651e3694631bd311df26113d428bb8b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9601/a88763d0651e3694631bd311df26113d428bb8b7/game.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
3240,
1031,
12,
2890,
16,
3681,
4672,
9163,
2725,
326,
331,
9640,
1961,
358,
845,
326,
1960,
1031,
26418,
2511,
376,
273,
645,
8130,
18,
4413,
12,
2890,
18,
917,
16,
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,
1089,
67,
3240,
1031,
12,
2890,
16,
3681,
4672,
9163,
2725,
326,
331,
9640,
1961,
358,
845,
326,
1960,
1031,
26418,
2511,
376,
273,
645,
8130,
18,
4413,
12,
2890,
18,
917,
16,
365,
18,... |
if len(args["namespace"] == 1): | if len(args["namespace"]) == 1: | def do_GET(self): if self.path.startswith("/?"): args = cgi.parse_qs( self.path[2:] ) else: args = {} | e38f93105bdff22c75ec2b89c6d2a477842bdb88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2338/e38f93105bdff22c75ec2b89c6d2a477842bdb88/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
3264,
12,
2890,
4672,
309,
365,
18,
803,
18,
17514,
1918,
2932,
19,
7225,
4672,
833,
273,
276,
10052,
18,
2670,
67,
12926,
12,
365,
18,
803,
63,
22,
26894,
262,
469,
30,
833... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
741,
67,
3264,
12,
2890,
4672,
309,
365,
18,
803,
18,
17514,
1918,
2932,
19,
7225,
4672,
833,
273,
276,
10052,
18,
2670,
67,
12926,
12,
365,
18,
803,
63,
22,
26894,
262,
469,
30,
833... |
Instance attributes defined in this class, initialized when channel is opened: | Class attributes: | def appendleft(self, obj): list.insert(self, 0, obj) | da26c0220f6be8e564309ee809d0345ad26f45a4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3782/da26c0220f6be8e564309ee809d0345ad26f45a4/ftpserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
4482,
12,
2890,
16,
1081,
4672,
666,
18,
6387,
12,
2890,
16,
374,
16,
1081,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
4482,
12,
2890,
16,
1081,
4672,
666,
18,
6387,
12,
2890,
16,
374,
16,
1081,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if s3_filename.startswith('s3:'): | if s3_file.startswith('s3:'): | def fetch_s3_file(s3_file): try: if s3_filename.startswith('s3:'): bucket_name, key_name = s3_file[len('s3:'):].split('/') c = boto.connect_s3() bucket = c.get_bucket(bucket_name) key = bucket.get_key(key_name) print 'Fetching %s.%s' % (bucket.name, key.name) path = os.path.join(config.get_value('General', 'working_dir'), key.name) key.get_contents_to_filename(script_path) except: path = None print 'Problem Retrieving file: %s' % s3_file return path | bdbe45423437bd1a6ef47e57dae4ece0231283e6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1098/bdbe45423437bd1a6ef47e57dae4ece0231283e6/startup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
67,
87,
23,
67,
768,
12,
87,
23,
67,
768,
4672,
775,
30,
309,
272,
23,
67,
768,
18,
17514,
1918,
2668,
87,
23,
2497,
4672,
2783,
67,
529,
16,
498,
67,
529,
273,
272,
23,
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,
2158,
67,
87,
23,
67,
768,
12,
87,
23,
67,
768,
4672,
775,
30,
309,
272,
23,
67,
768,
18,
17514,
1918,
2668,
87,
23,
2497,
4672,
2783,
67,
529,
16,
498,
67,
529,
273,
272,
23,
67... |
return self.getconf('remoteuser') | user = None localeval = self.localeval if self.config.has_option(self.getsection(), 'remoteusereval'): user = self.getconf('remoteusereval') if user != None: return localeval.eval(user) user = self.getconf('remoteuser') if user != None: return user | def getuser(self): return self.getconf('remoteuser') | a6db99a21ee5e9452ed47fb4d1c6237b239eef6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5335/a6db99a21ee5e9452ed47fb4d1c6237b239eef6e/IMAP.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
1355,
12,
2890,
4672,
327,
365,
18,
588,
3923,
2668,
7222,
1355,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
1355,
12,
2890,
4672,
327,
365,
18,
588,
3923,
2668,
7222,
1355,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.pool.get('ir.model.data').ir_set(self.cr, self.uid, 'action', keyword, \ | self.pool.get('ir.model.data').ir_set(self.cr, 1, 'action', keyword, \ | def process_act_window(self, node): assert getattr(node, 'id'), "Attribute %s of act_window is empty !" % ('id',) assert getattr(node, 'name'), "Attribute %s of act_window is empty !" % ('name',) assert getattr(node, 'res_model'), "Attribute %s of act_window is empty !" % ('res_model',) self.validate_xml_id(node.id) view_id = False if node.view: view_id = self.get_id(node.view) if not node.context: node.context={} context = eval(str(node.context), self.eval_context) values = { 'name': node.name, 'type': node.type or 'ir.actions.act_window', 'view_id': view_id, 'domain': node.domain, 'context': context, 'res_model': node.res_model, 'src_model': node.src_model, 'view_type': node.view_type or 'form', 'view_mode': node.view_mode or 'tree,form', 'usage': node.usage, 'limit': node.limit, 'auto_refresh': node.auto_refresh, 'multi': getattr(node, 'multi', False), } | 9ec0865f7c8ce62032212bcee73dc1b1f39c2b04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9ec0865f7c8ce62032212bcee73dc1b1f39c2b04/yaml_import.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
621,
67,
5668,
12,
2890,
16,
756,
4672,
1815,
3869,
12,
2159,
16,
296,
350,
19899,
315,
1499,
738,
87,
434,
1328,
67,
5668,
353,
1008,
29054,
738,
7707,
350,
2187,
13,
1815,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
621,
67,
5668,
12,
2890,
16,
756,
4672,
1815,
3869,
12,
2159,
16,
296,
350,
19899,
315,
1499,
738,
87,
434,
1328,
67,
5668,
353,
1008,
29054,
738,
7707,
350,
2187,
13,
1815,
... |
@classmethod def getTable(cls): | @staticmethod def _create_field(*args, **kwargs): """ controls how fields are created when declared in the field list with a simple string, list, tuple, or dictionary rather than a field instance. By default, passes field declaration to the Field constructor. """ return Field(*args, **kwargs) @classmethod def getTable(cls, withSchema=True): | def __init__(cls, cl_name, bases, namespace): | 921743729a711ba51ff496b908e5a8ccd1ab477a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2304/921743729a711ba51ff496b908e5a8ccd1ab477a/base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
6429,
16,
927,
67,
529,
16,
8337,
16,
1981,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
6429,
16,
927,
67,
529,
16,
8337,
16,
1981,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
message = _(u'msg_update_entries', default=u'Entries updated') | message = _(u'msg_update_entry', default=u'Entry updated') | def edit_entries(self, **kwargs): """ In this call we handle a form which contains a list of entries. Each entry has a text and time field which we expect to change. """ tracker = get_tracker(self.context) textkeys = [k for k in self.request.keys() if k.startswith('text-')] timekeys = [k for k in self.request.keys() if k.startswith('time-')] | 964eb18633f02a68ce23066a2f76abe46bdb8672 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10445/964eb18633f02a68ce23066a2f76abe46bdb8672/entry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
67,
8219,
12,
2890,
16,
2826,
4333,
4672,
3536,
657,
333,
745,
732,
1640,
279,
646,
1492,
1914,
279,
666,
434,
3222,
18,
8315,
1241,
711,
279,
977,
471,
813,
652,
1492,
732,
4489... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
67,
8219,
12,
2890,
16,
2826,
4333,
4672,
3536,
657,
333,
745,
732,
1640,
279,
646,
1492,
1914,
279,
666,
434,
3222,
18,
8315,
1241,
711,
279,
977,
471,
813,
652,
1492,
732,
4489... |
@intFields(writeperm = None, capped = None, admin = None) | @intFields(writeperm = None, capped = None, admin = None, remove = None) | def addPermForm(self, auth, userGroupName): groups = self.repServer.auth.getGroupList() labels = self.repServer.auth.getLabelList() troves = self.repServer.auth.getItemList() | 4b66daa2d8f05d6498c511bfb2e56a732b82976d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/4b66daa2d8f05d6498c511bfb2e56a732b82976d/http.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
9123,
1204,
12,
2890,
16,
1357,
16,
729,
3943,
4672,
3252,
273,
365,
18,
14462,
2081,
18,
1944,
18,
588,
1114,
682,
1435,
3249,
273,
365,
18,
14462,
2081,
18,
1944,
18,
588,
2224,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
9123,
1204,
12,
2890,
16,
1357,
16,
729,
3943,
4672,
3252,
273,
365,
18,
14462,
2081,
18,
1944,
18,
588,
1114,
682,
1435,
3249,
273,
365,
18,
14462,
2081,
18,
1944,
18,
588,
2224,... |
function. Right now it's pretty crude.""" | function. Right now it's pretty crude.""" | def toString(self): """Utility method for converting a Field to a string for the purpose of comparing fields. This comparison is used for determining whether a schema has changed in the auto update function. Right now it's pretty crude.""" # TODO fixme s = '%s(%s): {' % ( self.__class__.__name__, self.__name__ ) sorted_keys = self._properties.keys() sorted_keys.sort() for k in sorted_keys: value = getattr( self, k, self._properties[k] ) if k == 'widget': value = value.__class__.__name__ s = s + '%s:%s,' % (k, value ) s = s + '}' return s | 7ceff8c470eae33b4a063061230f3f8948cfaf8b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12165/7ceff8c470eae33b4a063061230f3f8948cfaf8b/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1762,
12,
2890,
4672,
3536,
6497,
707,
364,
14540,
279,
2286,
358,
279,
533,
364,
326,
13115,
434,
17553,
1466,
18,
225,
1220,
5826,
353,
1399,
364,
23789,
2856,
279,
1963,
711,
3550,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1762,
12,
2890,
4672,
3536,
6497,
707,
364,
14540,
279,
2286,
358,
279,
533,
364,
326,
13115,
434,
17553,
1466,
18,
225,
1220,
5826,
353,
1399,
364,
23789,
2856,
279,
1963,
711,
3550,
31... |
if self.mode >= 0: self.chmod(macros['destdir'], thisdest[destlen:]) def __init__(self, fromFiles, toFile, mode, use, component): | self.chmod(macros['destdir'], thisdest[destlen:]) def __init__(self, fromFiles, toFile, **keywords): _FileAction.__init__(self, **keywords) | def do(self, macros): | fe27d4ad6ae0ded6abdad24608dcfc91c29d3e4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/fe27d4ad6ae0ded6abdad24608dcfc91c29d3e4d/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
12,
2890,
16,
24302,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
12,
2890,
16,
24302,
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,
-10... |
max_snp_mismatch_rate, max_snp_NA_rate, npute_window_size, self.output_fname) | max_snp_mismatch_rate, max_snp_NA_rate, npute_window_size, self.output_dir) | def run(self): """ 2008-05-09 """ self.parameter_names = ['max_call_mismatch_rate_ls', 'max_call_NA_rate_ls', \ 'max_snp_mismatch_rate_ls', 'max_snp_NA_rate_ls', 'npute_window_size_ls'] if self.debug: #serial debug import pdb pdb.set_trace() init_data = self.create_init_data() min_call_probability, max_call_mismatch_rate, max_call_NA_rate, max_snp_mismatch_rate, max_snp_NA_rate, npute_window_size = init_data.param_d.parameters[0][:6] result = self.doFilter(init_data.snpData_250k, init_data.snpData_2010_149_384, init_data.snpData_perlegen, \ min_call_probability, max_call_mismatch_rate, max_call_NA_rate,\ max_snp_mismatch_rate, max_snp_NA_rate, npute_window_size, self.output_fname) sys.exit(2) self.communicator = MPI.world.duplicate() node_rank = self.communicator.rank free_computing_nodes = range(1, self.communicator.size-1) #exclude the 1st and last node data_to_pickle_name_ls = ['snpData_2010_149_384', 'snpData_perlegen', 'param_d'] assembleSignal = 'assemble' if node_rank == 0: init_data = self.create_init_data() param_d = init_data.param_d self.divideAndSendSNPData(init_data.snpData_250k, free_computing_nodes, assembleSignal=assembleSignal, block_size=400) for data_to_pickle_name in data_to_pickle_name_ls: sys.stderr.write("passing %s ... \n"%(data_to_pickle_name)) for node in free_computing_nodes: #send it to the computing_node sys.stderr.write("passing initial data to nodes from %s to %s ..."%(node_rank, node)) data_pickle = cPickle.dumps(getattr(init_data, data_to_pickle_name), -1) self.communicator.send(data_pickle, node, 0) del data_pickle sys.stderr.write(" Done.\n") sys.stderr.write("Done.\n") del init_data elif node_rank in free_computing_nodes: init_data = PassingData() init_data.snpData_250k = self.receiveAndAssembleSNPData(assembleSignal=assembleSignal) for data_to_pickle_name in data_to_pickle_name_ls: data, source, tag = self.communicator.receiveString(0, 0) setattr(init_data, data_to_pickle_name, cPickle.loads(data)) del data else: pass self.synchronize() if node_rank == 0: param_d.index = 0 parameter_list = [param_d] self.input_node(parameter_list, free_computing_nodes, input_handler=self.input_handler) elif node_rank in free_computing_nodes: computing_parameter_obj = PassingData(init_data=init_data, output_dir=self.output_dir) self.computing_node(computing_parameter_obj, self.computing_node_handler) else: outf = open('%s.csv'%self.output_fname, 'w') writer = csv.writer(outf) outf_avg = open('%s.avg.csv'%self.output_fname, 'w') writer_avg = csv.writer(outf_avg) common_var_name_ls = self.common_var_name_ls header = ['strain or snp', 'id', 'after_imputation'] + common_var_name_ls + \ ['NA_rate', 'mismatch_rate', 'no_of_NAs', 'no_of_totals', 'no_of_mismatches', 'no_of_non_NA_pairs', 'relative_NA_rate', 'relative_no_of_NAs', 'relative_no_of_totals'] writer.writerow(header) avg_var_name_ls = self.avg_var_name_ls avg_var_name_pair_ls, partial_header_avg = self.generate_avg_variable_names(avg_var_name_ls) header_avg = ['strain or snp', 'after_imputation'] + common_var_name_ls + partial_header_avg writer_avg.writerow(header_avg) parameter_list = [writer, writer_avg, common_var_name_ls, avg_var_name_pair_ls, partial_header_avg, outf, outf_avg] self.output_node(free_computing_nodes, parameter_list, self.output_node_handler) del writer, writer_avg outf.close() outf_avg.close() self.synchronize() #to avoid some node early exits | f63587f08905f60d56304e528550eaba6f93898b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9645/f63587f08905f60d56304e528550eaba6f93898b/MpiQCCall.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
3536,
4044,
28,
17,
6260,
17,
5908,
3536,
365,
18,
6775,
67,
1973,
273,
10228,
1896,
67,
1991,
67,
11173,
1916,
67,
5141,
67,
3251,
2187,
296,
1896,
67,
1991,
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,
1086,
12,
2890,
4672,
3536,
4044,
28,
17,
6260,
17,
5908,
3536,
365,
18,
6775,
67,
1973,
273,
10228,
1896,
67,
1991,
67,
11173,
1916,
67,
5141,
67,
3251,
2187,
296,
1896,
67,
1991,
67,... |
ret = [] for tag, line in get_all_tag_lines(data): cur = '<large>%s</large>' % tag if tag.startswith('00'): cur += '<code>%s</code>\n' % esc(line[:-1]) else: cur += '<code>' + esc_sp(line[0:2]) + ''.join("<b>$%s</b>%s" % (esc_sp(k), esc(v)) for k, v in get_all_subfields(line)) + '</code>' ret.append(cur) return '<br>\n'.join(ret) | return '<br>\n'.join(html_line(t, l) for t, l in get_all_tag_lines(data)) | def as_html(data): ret = [] for tag, line in get_all_tag_lines(data): cur = '<large>%s</large>' % tag if tag.startswith('00'): # control field: cur += '<code>%s</code>\n' % esc(line[:-1]) else: cur += '<code>' + esc_sp(line[0:2]) + ''.join("<b>$%s</b>%s" % (esc_sp(k), esc(v)) for k, v in get_all_subfields(line)) + '</code>' ret.append(cur) return '<br>\n'.join(ret) | 724a0bd2f48077c45389f1c4f1045877bf29ac00 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3913/724a0bd2f48077c45389f1c4f1045877bf29ac00/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
487,
67,
2620,
12,
892,
4672,
325,
273,
5378,
364,
1047,
16,
980,
316,
336,
67,
454,
67,
2692,
67,
3548,
12,
892,
4672,
662,
273,
2368,
14095,
9822,
87,
1757,
14095,
1870,
738,
1047,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
487,
67,
2620,
12,
892,
4672,
325,
273,
5378,
364,
1047,
16,
980,
316,
336,
67,
454,
67,
2692,
67,
3548,
12,
892,
4672,
662,
273,
2368,
14095,
9822,
87,
1757,
14095,
1870,
738,
1047,
... |
viewRightActionText = "<u><b>Right View</b></u><br>"\ "<p><img source=\"ui/actions/View/Right.png\"><br> "\ | viewRightActionText =\ "<u><b>Right View</b></u><br>"\ "<p>"\ "<img source=\"ui/actions/View/Right.png\"><br> "\ | def createWhatsThisTextForMainWindowWidgets(win): """ Adds the "What's This" help text to items found in the NE1 mainwindow toolbars and menus . @param win: NE1's mainwindow object. @type win: U{B{QMainWindow}<http://doc.trolltech.com/4/qmainwindow.html>} @note: Property Managers specify "What's This" text for their own widgets, usually in a method called add_whats_this_text(), not in this file. """ # # File Toolbar # # Open File fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)<br> "\ "<p><img source=\"ui/actions/File/Open.png\"><br> "\ "Opens a new file."\ "</p>" win.fileOpenAction.setWhatsThis( fileOpenText ) # Import File fileImportText = "<u><b>Import File</b></u><br>"\ "Inserts a file of any chemical file format supported by "\ "<b>Openbabel</b> into the current Part" win.fileImportAction.setWhatsThis(fileImportText) #Export File fileExportText = "<u><b>Export File</b></u><br>"\ "Save the current Part in any chemical file format supported by "\ "<b>Openbabel</b>. Note that exclusive features of NanoEngineer-1 "\ "are not saved to the exported file" win.fileExportAction.setWhatsThis(fileExportText) # Save File fileSaveText = "<u><b>Save File</b></u> (Ctrl + S)<br> "\ "<p><img source=\"ui/actions//Save.png\"><br> "\ "Saves the current file."\ "</p>" win.fileSaveAction.setWhatsThis( fileSaveText ) # # Edit Toolbar # # Make Checkpoint ### editMakeCheckpointText = \ "<u><b>Make Checkpoint</b></u>"\ "<p>"\ "<img source=\"ui/actions/Edit/Make_CheckPoint.png\"><br> "\ "Make Undo checkpoint."\ "</p>" win.editMakeCheckpointAction.setWhatsThis( editMakeCheckpointText ) # Automatic Checkpointing ### [minor changes, bruce 060319] editAutoCheckpointingText = \ "<u><b>Automatic Checkpointing</b></u>"\ "<p>"\ "Enables/Disables <b>Automatic Checkpointing</b>. When enabled, "\ "the program maintains the Undo stack automatically. When disabled, "\ "the user is required to manually create Undo checkpoints using the "\ "<b>Make Checkpoint</b> button: "\ "</p>"\ "<p><img source=\"ui/actions/Edit/Make_CheckPoint.png\">"\ "</p>"\ "<p><b>Automatic Checkpointing</b> can impact program performance. "\ "By disabling Automatic Checkpointing, the program will run faster. "\ "</p>"\ "<p><b><i>Remember that you must make your own Undo checkpoints "\ "manually when Automatic Checkpointing is disabled.</i></b>"\ "</p>" win.editAutoCheckpointingAction.setWhatsThis( editAutoCheckpointingText ) # Clear Undo Stack ### [minor changes, bruce 060319] editClearUndoStackText = "<u><b>Clear Undo Stack</b></u>"\ "<p>Clears all checkpoints on the Undo and Redo stacks, freeing up memory."\ "</p>" win.editClearUndoStackAction.setWhatsThis( editClearUndoStackText ) # Undo editUndoText = "<u><b>Undo</b></u> (Ctrl + Z)<br> "\ "<p><img source=\"ui/actions/Undo.png\"><br> "\ "Reverses the last edit or command which changed structure or selection. "\ "<br><font color=\"#808080\">"\ "Known bug: the link to wiki help for Undo "\ "only works if you got this popup from the Edit menu item for Undo, "\ "not from the Undo toolbutton."\ "</font>"\ "</p>" #bruce 060317 revised this text to reflect what it does in A7; 060320 added 1421-not-fixed warning win.editUndoAction.setWhatsThis( editUndoText ) win.editUndoText = editUndoText #bruce 060317 to help fix bug 1421 in Undo whatsthis wiki help link # Redo from PlatformDependent import is_macintosh if is_macintosh(): redo_accel = "(Ctrl + Shift + Z)" # note: this is further modified (Ctrl -> Cmd) by other code # changing this is partly redundant with code in undo*.py, but as of 060317 it's desirable in editRedoText too else: redo_accel = "(Ctrl + Y)" editRedoText = "<u><b>Redo</b></u> %s<br> "\ "<p><img source=\"ui/actions/Edit/Redo.png\"> <br>"\ "Restores a change which was undone using the Undo command."\ "<br><font color=\"#808080\">"\ "Known bug: the link to wiki help for Redo "\ "only works if you got this popup from the Edit menu item for Redo, "\ "not from the Redo toolbutton."\ "</font>"\ "</p>" % redo_accel #bruce 060317 revised this text to be more accurate, and split out redo_accel; 060320 added 1421-not-fixed warning win.editRedoAction.setWhatsThis( editRedoText ) win.editRedoText = editRedoText #bruce 060317 to help fix bug 1421 in Redo whatsthis wiki help link # Cut editCutText = "<u><b>Cut</b></u> (Ctrl + X)<br> "\ "<p><img source=\"ui/actions/Edit/Cut.png\"><br> "\ "Removes the selected object(s) and stores the cut data on the"\ "clipboard."\ "</p>" win.editCutAction.setWhatsThis( editCutText ) # Copy editCopyText = "<u><b>Copy</b></u> (Ctrl + C)<br> "\ "<p><img source=\"ui/actions/Edit/Copy.png\"><br> "\ "Places a copy of the selected chunk(s) on the clipboard "\ "while leaving the original chunk(s) unaffected."\ "</p>" win.editCopyAction.setWhatsThis( editCopyText ) # Paste editPasteText = "<u><b>Paste</b></u> (Ctrl + V)<br> "\ "<p><img source=\"ui/actions/Edit/Paste_On.png\"><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>" win.editPasteAction.setWhatsThis( editPasteText ) # Delete editDeleteText = "<u><b>Delete</b></u> (DEL)<br> "\ "<p><img source=\"ui/actions/Delete.png\"><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 win.editDeleteAction.setWhatsThis( editDeleteText ) #Preferences Dialog editPrefsText = "<u><b>Preferences Dialog</b></u>"\ "<p>Allows you to edit various user preferences "\ "such as changing atom, bond display properties,"\ "lighting, background color, window position and"\ "size, plugins etc. </p>" win.editPrefsAction.setWhatsThis( editPrefsText ) # # View Toolbar # # Home View setViewHomeActionText = \ "<u><b>Home</b></u> (Home)<br>"\ "<p>"\ "<img source=\"ui/actions/View/Modify/Home.png\"><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>" win.setViewHomeAction.setWhatsThis( setViewHomeActionText ) # Fit to Window setViewFitToWindowActionText = "<u><b>Fit To Window</b></u><br>"\ "<p><img source=\"ui/actions/View/Modify/Zoom_To_Fit.png\"><br> "\ "Refits the model to the screen so you can view the entire model."\ "</p>" win.setViewFitToWindowAction.setWhatsThis( setViewFitToWindowActionText ) # Recenter setViewRecenterActionText = "<u><b>Recenter</b></u><br>"\ "<p><img source=\"ui/actions/View/Modify/Recenter.png\"><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>" win.setViewRecenterAction.setWhatsThis( setViewRecenterActionText ) # Zoom Tool setzoomToolActionText = "<u><b>Zoom Tool</b></u><br>"\ "<p><img source=\"ui/actions/View/Modify/Zoom.png\"><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>" win.zoomToolAction.setWhatsThis( setzoomToolActionText ) # Pan Tool setpanToolActionText = "<u><b>Pan Tool</b></u><br>"\ "<p><img source=\"ui/actions/View/Modify/Pan.png\"><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>" win.panToolAction.setWhatsThis( setpanToolActionText ) # Rotate Tool setrotateToolActionText = "<u><b>Rotate Tool</b></u><br>"\ "<p><img source=\"ui/actions/View/Modify/Rotate.png\"><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>" win.rotateToolAction.setWhatsThis( setrotateToolActionText ) # Orthographic Projection setViewOrthoActionText = "<u><b>Orthographic Projection</b></u><br>"\ "<p>Sets nonperspective (or parallel) projection, with no foreshortening."\ "</p>" win.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>" win.setViewPerspecAction.setWhatsThis( setViewPerspecActionText ) # Normal To viewNormalToActionText = "<u><b>Set View Normal To</b></u><br>"\ "<p><img source=\"ui/actions/View/Set_View_Normal_To.png/\"><br> "\ "Orients view to the normal vector of the plane defined by "\ "3 or more selected atoms, or a jig's axis."\ "</p>" win.viewNormalToAction.setWhatsThis( viewNormalToActionText ) # Parallel To viewParallelToActionText = "<u><b>Set View Parallel To</b></u><br>"\ "<p><img source=\"ui/actions/View/Set_View_Parallel_To.png\"><br> "\ "Orients view parallel to the vector defined by 2 selected atoms."\ "</p>" win.viewParallelToAction.setWhatsThis( viewParallelToActionText ) # Save Named View saveNamedViewActionText = "<u><b>Save Named View</b></u><br>"\ "<p><img source=\"ui/actions/View/Modify/Save_Named_View.png\"><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>" win.saveNamedViewAction.setWhatsThis( saveNamedViewActionText ) # Front View viewFrontActionText = "<u><b>Front View</b></u><br>"\ "<p><img source=\"ui/actions/View/Front.png\"><br> "\ "Orients the view to the Front View."\ "</p>" win.viewFrontAction.setWhatsThis( viewFrontActionText ) # Back View viewBackActionText = "<u><b>Back View</b></u><br>"\ "<p><img source=\"ui/actions/View/Back.png\"><br> "\ "Orients the view to the Back View."\ "</p>" win.viewBackAction.setWhatsThis( viewBackActionText ) # Top View viewTopActionText = "<u><b>Top View</b></u><br>"\ "<p><img source=\"ui/actions/View/Top.png\"><br> "\ "Orients the view to the Top View."\ "</p>" win.viewTopAction.setWhatsThis( viewTopActionText ) # Bottom View viewBottomActionText = "<u><b>Bottom View</b></u><br>"\ "<p><img source=\"ui/actions/View/Bottom.png\"><br> "\ "Orients the view to the Bottom View."\ "</p>" win.viewBottomAction.setWhatsThis( viewBottomActionText ) # Left View viewLeftActionText = "<u><b>Left View</b></u><br>"\ "<p><img source=\"ui/actions/View/Left.png\"><br> "\ "Orients the view to the Left View."\ "</p>" win.viewLeftAction.setWhatsThis( viewLeftActionText ) # Right View viewRightActionText = "<u><b>Right View</b></u><br>"\ "<p><img source=\"ui/actions/View/Right.png\"><br> "\ "Orients the view to the Right View."\ "</p>" win.viewRightAction.setWhatsThis( viewRightActionText ) #Isometric View viewIsometricActionText = "<u><b>IsometricView</b></u><br>"\ "<p><img source=\"ui/actions/View/Isometric.png\"><br> "\ "Orients the view to the Isometric View."\ "</p>" win.viewIsometricAction.setWhatsThis( viewIsometricActionText ) # Rotate View 180 viewRotate180ActionText = "<u><b>Rotate View 180</b></u><br>"\ "<p><img source=\"ui/actions/View/Rotate_View_180.png.png\"><br> "\ "Rotates the view 180 degrees."\ "</p>" win.viewRotate180Action.setWhatsThis( viewRotate180ActionText ) # Rotate View +90 viewRotatePlus90ActionText = "<u><b>Rotate View +90</b></u><br>"\ "<p><img source=\"ui/actions/View/Rotate_View_+90.png\"><br> "\ "Increment the current view by 90 degrees around the vertical axis."\ "</p>" win.viewRotatePlus90Action.setWhatsThis( viewRotatePlus90ActionText ) # Rotate View -90 viewRotateMinus90ActionText = "<u><b>Rotate View -90</b></u><br>"\ "<p><img source=\"ui/actions/View/Rotate_View_-90.png\"><br> "\ "Decrement the current view by 90 degrees around the vertical axis."\ "</p>" win.viewRotateMinus90Action.setWhatsThis( viewRotateMinus90ActionText ) # QuteMol viewQuteMolActionText = \ "<u><b>QuteMol</b></u><br>"\ "<p><img source=\"ui/actions/View/Display/QuteMol.png\"><br> "\ "Starts QuteMol and loads a PDB file of the current model."\ "</p>" \ "QuteMol must be installed and enabled as a plug-in from "\ "<b>Preferences > Plug-ins</b> for this feature to work." \ "</p>" win.viewQuteMolAction.setWhatsThis( viewQuteMolActionText ) # POV-Ray (was Raytrace Scene) viewRaytraceSceneActionText = "<u><b>POV-Ray</b></u><br>"\ "<p><img source=\"ui/actions/View/Display/Raytrace_Scene.png\"><br> "\ "Raytrace the current scene using POV-Ray. "\ "</p>" \ "POV-Ray must be installed and enabled as a plug-in from "\ "<b>Preferences > Plug-ins</b> for this feature to work." \ "</p>" win.viewRaytraceSceneAction.setWhatsThis( viewRaytraceSceneActionText ) # # Grids Toolbar # # Surface 100 orient100ActionText = "<u><b>Surface 100</b></u><br>"\ "<p><img source=\"ui\actions\Properties Manager/Surface100.png\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,0,0) surface of a diamond lattice."\ "</p>" win.orient100Action.setWhatsThis(orient100ActionText ) # Surface 110 orient110ActionText = "<u><b>Surface 110</b></u><br>"\ "<p><img source=\"ui\actions\Properties Manager/Surface110.png\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,1,0) surface of a diamond lattice."\ "</p>" win.orient110Action.setWhatsThis(orient110ActionText ) # Surface 111 orient111ActionText = "<u><b>Surface 111</b></u><br>"\ "<p><img source=\"ui\actions\Properties Manager/Surface111.png\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,1,1) surface of a diamond lattice."\ "</p>" win.orient111Action.setWhatsThis(orient111ActionText ) # # Insert toolbar # # Graphene insertGrapheneActionText = \ "<u><b>Build Graphene</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Build Structures/Graphene.png\"><br> "\ "Inserts a 2D sheet of graphene in the model "\ "based on the current parameters in the Property Manager. "\ "To preview the structure based on the current parameters, "\ "click the Preview button located at the top of the "\ "Property Manager :<br> "\ "<img source=\"ui/actions/Properties Manager/Preview.png\"> "\ "</p>" win.insertGrapheneAction.setWhatsThis(insertGrapheneActionText ) # Build Nanotube insertNanotubeActionText = \ "<u><b>Build Nanotube</b></u>"\ "<p><img source=\"ui/actions/Tools/Build Structures/Nanotube.png\"> <br>"\ "Inserts a carbon or boron nitride nanotube in the model "\ "based on the current parameters in the Property Manager. "\ "To preview the structure based on the current parameters, "\ "click the Preview button located at the top of the "\ "Property Manager :<br> "\ "<img source=\"ui/actions/Properties Manager/Preview.png\"> "\ "</p>" win.insertNanotubeAction.setWhatsThis(insertNanotubeActionText ) # Build DNA buildDnaActionText = \ "<u><b>Build DNA</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Build Structures/DNA.png\"><br> "\ "Inserts DNA in the model "\ "based on the current parameters in the Property Manager. "\ "To preview the structure based on the current parameters, "\ "click the Preview button located at the top of the "\ "Property Manager :<br> "\ "<img source=\"ui/actions/Properties Manager/Preview.png\"> "\ "</p>" win.buildDnaAction.setWhatsThis(buildDnaActionText ) # POV-Ray Scene insertPovraySceneActionText = "<u><b>Insert POV-Ray Scene</b></u><br>"\ "<p><img source=\"ui/actions/POV-Ray_Scene.png\"><br> "\ "Inserts a POV-Ray Scene file based on the current model and viewpoint. "\ "</p>" win.insertPovraySceneAction.setWhatsThis(insertPovraySceneActionText ) # Comment insertCommentActionText = "<u><b>Insert Comment</b></u><br>"\ "<p><img source=\"ui/actions/Insert/Comment.png\"><br> "\ "Inserts a comment in the current part. "\ "</p>" win.insertCommentAction.setWhatsThis(insertCommentActionText ) # # Display toolbar # # Display Default dispDefaultActionText = "<u><b>Display Default</b></u><br>"\ "<p><img source=\"ui/actions/View/Display/Default.png\"><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>Modes</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>" win.dispDefaultAction.setWhatsThis(dispDefaultActionText ) # Display Invisible dispInvisActionText = "<u><b>Display Invisible</b></u><br>"\ "<p><img source=\"ui/actions/View/Display/Invisible.png\"><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>" win.dispInvisAction.setWhatsThis(dispInvisActionText ) # Display Lines dispLinesActionText = "<u><b>Display Lines</b></u><br>"\ "<p><img source=\"ui/actions/View/Display/Lines.png\"><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>" win.dispLinesAction.setWhatsThis(dispLinesActionText ) # Display Tubes dispTubesActionText = "<u><b>Display Tubes</b></u><br>"\ "<p><img source=\"ui/actions/View/Display/Tubes.png\"><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>" win.dispTubesAction.setWhatsThis(dispTubesActionText ) # Display Ball and Stick dispBallActionText = "<u><b>Display Ball and Stick</b></u><br>"\ "<p><img source=\"ui/actions/View/Display/Ball_and_Stick.png\"><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>" win.dispBallAction.setWhatsThis(dispBallActionText ) # Display CPK # [bruce extended and slightly corrected text, 060307] dispCPKActionText = "<u><b>Display CPK</b></u><br>"\ "<p><img source=\"ui/actions/View/Display/CPK.png\"><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>" win.dispCPKAction.setWhatsThis(dispCPKActionText ) # Display Cylinder dispCylinderActionText = "<u><b>Display Cylinder</b></u><br>"\ "<p><img source=\"ui/actions/View/Display/Cylinder.png\"><br> "\ "Changes the <i>display setting</i> of selected chunks to "\ "<b>Cylinder</b> mode. Chunks are rendered as cylinders."\ "</p>"\ "<p>If no chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Cylinder</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" win.dispCylinderAction.setWhatsThis(dispCylinderActionText ) # Display Surface dispSurfaceActionText = "<u><b>Display Surface</b></u><br>"\ "<p><img source=\"ui/actions/View/Display/Surface.png\"><br> "\ "Changes the <i>display setting</i> of selected chunks to "\ "<b>Surface</b> mode. Chunks are rendered as a smooth surface."\ "</p>"\ "<p>If no chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Surface</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" win.dispSurfaceAction.setWhatsThis(dispSurfaceActionText ) #Reset Chunk Color dispResetChunkColorText = "<u><b>Reset Chunk Color</b></u><br>"\ "Resets the user defined chunk color and renders the atoms " \ "(in the chunk) with their own element colors" win.dispResetChunkColorAction.setWhatsThis(dispResetChunkColorText ) #Reset Atoms Display dispResetAtomsDisplayText = "<u><b>Reset Atoms Display</b></u><br>"\ "Renders the selected atoms (or the atoms in the"\ "selected chunks) with the same display style as "\ "that of their parent chunk" win.dispResetAtomsDisplayAction.setWhatsThis(dispResetAtomsDisplayText) #Show Invisible Atoms dispShowInvisAtomsText = "<u><b>Show Invisible Atoms</b></u><br>"\ "Renders the selected atoms (or the atoms in the selected "\ "chunks) with the same display style as their parent chunk. "\ "However, if the parent chunk is set as invisible, this feature " \ "will not work. " win.dispShowInvisAtomsAction.setWhatsThis(dispShowInvisAtomsText) #Element Color Settings Dialog dispElementColorSettingsText = "<u><b>Element Color Settings Dialog</b></u><br>"\ "Element colors can be manually changed " \ "using this dialog. Also, the user can load"\ "or save the element colors" win.dispElementColorSettingsAction.setWhatsThis(dispElementColorSettingsText) # # Select toolbar # # Select All selectAllActionText = "<u><b>Select All</b></u> (Ctrl + A)<br>"\ "<p><img source=\"ui/actions/Tools/Select/Select_All.png\"><br> "\ "When in <b>Build</b> mode, this will select all the atoms in "\ "the model. Otherwise, this will select all the chunks in the model."\ "</p>" win.selectAllAction.setWhatsThis(selectAllActionText ) # Select None selectNoneActionText = "<u><b>Select None</b></u></p><br>"\ "<p><img source=\"ui/actions/Tools/Select/Select_None.png\"><br> "\ "Unselects everything currently selected.</p>" win.selectNoneAction.setWhatsThis(selectNoneActionText ) # InvertSelection selectInvertActionText = "<u><b>Invert Selection</b></u> (Ctrl + Shift + I)<br>"\ "<p><img source=\"ui/actions/Tools/Select/Select_Invert.png\"><br> "\ "Inverts the current selection.</p>" win.selectInvertAction.setWhatsThis(selectInvertActionText ) # Select Connected selectConnectedActionText = "<u><b>Select Connected</b></u> (Ctrl + Shift + C)<br>"\ "<p><img source=\"ui/actions/Tools/Select/Select_Connected.png\"><br> "\ "Selects all the atoms that can be reached by the currently selected atom "\ "via an unbroken chain of bonds. </p>"\ "<p>You can also select all connected atoms by double clicking on an atom or bond "\ "while in <b>Build</b> mode.</p>" win.selectConnectedAction.setWhatsThis(selectConnectedActionText ) # Select Doubly selectDoublyActionText = "<u><b>Select Doubly</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Select/Select_Doubly.png\"><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>" win.selectDoublyAction.setWhatsThis(selectDoublyActionText ) # Expand Selection selectExpandActionText = "<u><b>Expand Selection</b></u> (Ctrl + D)<br>"\ "<p><img source=\"ui/actions/Tools/Select/Expand.png\"><br> "\ "Selects any atom that is a neighbor of a currently selected atom."\ "</p>" win.selectExpandAction.setWhatsThis(selectExpandActionText ) # Contract Selection selectContractActionText = "<u><b>Contract Selection</b></u> (Ctrl + Shift + D)<br>"\ "<p><img source=\"ui/actions/Tools/Select/Contract.png\"><br> "\ "Deselects any atom that is a neighbor of a non-picked atom or has a bondpoint."\ "</p>" win.selectContractAction.setWhatsThis(selectContractActionText ) # # Modify Toolbar # # Adjust Selection modifyAdjustSelActionText = "<u><b>Adjust Selection</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Adjust_Selection.png\"><br> "\ "Adjusts the atom and bond positions (<i>of the selection</i>) to make the geometry more realistic. "\ "The operations used to move the atoms and bonds approximate molecular mechanics methods."\ "</p>" win.modifyAdjustSelAction.setWhatsThis(modifyAdjustSelActionText ) # Adjust All modifyAdjustAllActionText = "<u><b>Adjust All</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Adjust_All.png\"><br> "\ "Adjusts the atom and bond positions (<i>of the entire part</i>) to make the geometry of the part more realistic. "\ "The operations used to move the atoms and bonds approximate molecular mechanics methods."\ "</p>" win.modifyAdjustAllAction.setWhatsThis(modifyAdjustAllActionText ) # Hydrogenate modifyHydrogenateActionText = "<u><b>Hydrogenate</b></u> <br>"\ "<p><img source=\"ui/actions/Tools/Build Tools/Hydrogenate.png\"><br> "\ "Adds hydrogen atoms to all the bondpoints in the selection.</p>" win.modifyHydrogenateAction.setWhatsThis(modifyHydrogenateActionText ) # Dehydrogenate modifyDehydrogenateActionText = "<u><b>Dehydrogenate</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Build Tools/Dehydrogenate.png\"><br> "\ "Removes all hydrogen atoms from the selection.</p>" win.modifyDehydrogenateAction.setWhatsThis(modifyDehydrogenateActionText ) # Passivate modifyPassivateActionText = "<u><b>Passivate</b></u> (Ctrl + P)<br>"\ "<p><img source=\"ui/actions/Tools/Build Tools/Passivate.png\"><br> "\ "Changes the types of incompletely bonded atoms to atoms with the "\ "right number of bonds, using atoms with the best atomic radius."\ "</p>" win.modifyPassivateAction.setWhatsThis(modifyPassivateActionText ) # Stretch modifyStretchActionText = "<u><b>Stretch</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Build Tools/Stretch.png\"><br> "\ "Stretches the bonds of the selected chunk(s).</p>" win.modifyStretchAction.setWhatsThis(modifyStretchActionText ) # Delete Bonds modifyDeleteBondsActionText = "<u><b>Cut Bonds</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Build Tools/Delete_Bonds.png\"><br> "\ "Delete all bonds between selected and unselected atoms or chunks.</p>" win.modifyDeleteBondsAction.setWhatsThis(modifyDeleteBondsActionText ) # Separate/New Chunk modifySeparateActionText = "<u><b>Separate</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Build Tools/Separate.png\"><br> "\ "Creates a new chunk(s) from the currently selected atoms. "\ "If the selected atoms belong to different chunks, multiple new "\ "chunks are created.</p>" win.modifySeparateAction.setWhatsThis(modifySeparateActionText ) # New Chunk makeChunkFromSelectedAtomsActionText = "<u><b>New Chunk</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Build Tools/New_Chunk.png\"><br> "\ "Creates a new chunk from the currently selected atoms. "\ "All atoms end up in a single chunk.</p>" win.makeChunkFromSelectedAtomsAction.setWhatsThis(makeChunkFromSelectedAtomsActionText ) # Merge Chunks modifyMergeActionText = "<u><b>Merge Chunks</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Build Tools/Merge.png\"><br> "\ "Merges two or more chunks into a single chunk.</p>" win.modifyMergeAction.setWhatsThis(modifyMergeActionText ) # Invert Chunks modifyInvertActionText = "<u><b>Invert</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Build Tools/Invert.png\"><br> "\ "Inverts the atoms of the selected chunks.</p>" win.modifyInvertAction.setWhatsThis(modifyInvertActionText ) # Mirror Selected Chunks #Note that the the feature name is intentionally kept "Mirror" instead of "Mirror Chunks" because # in future we will support mirrroing atoms as well. -- ninad060814 modifyMirrorActionText = "<u><b>Mirror</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Build Tools/Mirror.png\"><br> "\ "Mirrors the selected <b> chunks </b> about a reference Grid Plane.<br>"\ "<font color=\"#808080\">Note: In this version, it doesn't mirror jigs or individual atoms.</font> </p>" win.modifyMirrorAction.setWhatsThis(modifyMirrorActionText ) # Align to Common Axis modifyAlignCommonAxisActionText = "<u><b>Align To Common Axis</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Build Tools/AlignToCommonAxis.png\"><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>" win. modifyAlignCommonAxisAction.setWhatsThis( modifyAlignCommonAxisActionText ) #Center on Common Axis modifyCenterCommonAxisActionText= "<u><b>Center On Common Axis</b></u><br>"\ "<p><b> Moves</b> all selected chunks to the center of the <b> first </b> selected chunk "\ "and also <b>aligns</b> them to the axis of the first one ."\ "You must select two or more chunks before using this feature. </p>" win.modifyCenterCommonAxisAction.setWhatsThis(modifyCenterCommonAxisActionText) # # Tools Toolbar # # Select Chunks toolsSelectMoleculesActionText = "<u><b>Select Chunks</b></u><!-- [[Feature:Select Chunks Mode]] --><br>"\ "<p><img source=\"ui/actions/Toolbars/Standard/63.png\"><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>" win. toolsSelectMoleculesAction.setWhatsThis( toolsSelectMoleculesActionText ) # Move Chunks toolsMoveMoleculeActionText = "<u><b>Move Chunks</b></u><!-- [[Feature:Move Chunks Mode]] --><br>"\ "<p><img source=\"ui/actions/Toolbars/Standard/64.png\"><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>" win. toolsMoveMoleculeAction.setWhatsThis( toolsMoveMoleculeActionText ) # Build Atoms toolsDepositAtomActionText = \ "<u><b>Build Atoms</b></u><!-- [[Feature:Build Atoms]] --><br>"\ "<p><img source=\"ui/actions/Tools/Build Structures/Atoms.png\"><br> "\ "<b>Build Atoms</b> allows you to build structures one atom at a time or by depositing objects "\ "that are on the paste clipboard. You can also insert structures from the "\ "NanoEngineer-1 Parts Library.</p>"\ "<p>It is also possible to change bond types between atoms using the <b>Bond Tool</b> or by "\ "simply dragging and dropping one bondpoint onto another."\ "</p>" win. toolsDepositAtomAction.setWhatsThis( toolsDepositAtomActionText ) # Build Crystal (was Cookie Cutter Mode) toolsCookieCutActionText = "<u><b>Build Crystal</b></u><!-- [[Feature:Build Crystal]] --><br>"\ "<p><><img source=\"ui/actions/Tools/Build Structures/Cookie_Cutter.png\"><br> "\ "<b>Build Crystal</b> provides tools for cutting out multi-layered shapes from "\ "slabs of diamond or lonsdaleite lattice.</p>" win. toolsCookieCutAction.setWhatsThis( toolsCookieCutActionText ) # Tools > Extrude toolsExtrudeActionText = "<u><b>Extrude</b></u><!-- [[Feature:Extrude Mode]] --><br>"\ "<p><img source=\"ui/actions/Insert/Features/Extrude.png\"><br> "\ "Activates <b>Extrude</b> mode, allowing you to create a rod or ring using a chunk as "\ "a repeating unit.</p>" win. toolsExtrudeAction.setWhatsThis( toolsExtrudeActionText ) # Fuse Chunks Mode toolsFuseChunksActionText = "<u><b>Fuse Chunks Mode</b></u><!-- [[Feature:Fuse Chunks Mode]] --><br>"\ "<p><img source=\"ui/actions/Tools/Build Tools/Fuse.png\"><br> "\ "<b>Fuse Chunks</b> can be used to interactively join two or more "\ "chunks by dragging chunks around and fusing them together. "\ "Two fusing options are supported:<br><br>"\ "<b>Make Bonds</b> creates bonds between the existing bondpoints "\ "of two or more chunks. Bondpoints are highlighted and lines are drawn (and undrawn) as chunks "\ "are dragged to indicate bonding relationships between bondpoints. Bondpoints with "\ "multiple bonding relationships are highlighted in magenta to indicate that they cannot "\ "make bonds.<br><br>"\ "<b>Fuse Atoms</b> fuses pairs of overlapping atoms between chunks. The set of overlapping "\ "atoms in the selected chunk(s) are highlighted in green while the set of atoms that will be deleted "\ "in non-selected chunks are highlighted in dark red. It is possible that deleted atoms will not fuse "\ "properly, leaving bondpoints on the selected chunk(s) atoms. This is a bug. To help "\ "minimize this problem, try to get the bonds of overlapping atoms oriented similarly.<br>"\ "</p>" win.toolsFuseChunksAction.setWhatsThis( toolsFuseChunksActionText ) # # Simulator Toolbar # # Minimize Energy simMinimizeEnergyActionText = "<u><b>Minimize Energy</b></u><br>"\ "<p><img source=\"ui/actions/Simulation/Minimize_Energy.png\"><br> "\ "The potential energy of a chemical structure is a function of the relative positions of its atoms. " \ "To obtain this energy with complete accuracy involves a lot of computer time spent on quantum " \ "mechanical calculations, which cannot be practically done on a desktop computer. "\ "To get an approximate potential energy without all that, we represent the energy as a series of " \ "terms involving geometric properties of the structure: lengths of chemical bonds, angles between " \ "pairs and triples of chemical bonds, etc. </p>" \ "<p>" \ "As is generally the case with physical systems, the gradient of the potential energy represents " \ "the forces acting on various particles. The atoms want to move in the direction that most reduces " \ "the potential energy. Energy minimization is a process of adjusting the atom positions to try to find " \ "a global minimum of the potential energy. Each atom contributes three variables (its x, y, and z " \ "coordinates) so the search space is multi-dimensional. The global minimum is the configuration " \ "that the atoms will settle into if lowered to zero Kelvin. </p>" win. simMinimizeEnergyAction.setWhatsThis( simMinimizeEnergyActionText ) # Run Dynamics (was NanoDynamics-1). Mark 060807. simSetupActionText = "<u><b>Run Dynamics</b></u><br>"\ "<p><img source=\"ui/actions/Simulation/Run_Dynamics.png\"><br> "\ "This is the interface to the NanoEngineer-1 molecular dynamics simulator. "\ "Enter the parameters of the simulation and click <b>Run Simulation</b>."\ "The simulator creates a trajectory (movie) file by calculating the inter-atomic potentials and bonding "\ "of the entire model.</p>" win. simSetupAction.setWhatsThis( simSetupActionText ) # Play Movie (was Movie Player) Mark 060807. simMoviePlayerActionText = "<u><b>Play Movie</b></u><br>"\ "<p><img source=\"ui/actions/Simulation/Play_Movie.png\"><br> "\ "Plays the most recent trajectory (movie) file created by the NanoEngineer-1 molecular dynamics simulator."\ "To create a movie file, select <b>Run Dynamics</b>.</p>" win. simMoviePlayerAction.setWhatsThis( simMoviePlayerActionText ) # Make Graphs (was Plot Tool) Mark 060807. simPlotToolActionText = "<u><b>Make Graphs</b></u><br>"\ "<p><img source=\"ui/actions/Simulation/Make_Graphs.png\"><br> "\ "Make a graph of 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>"\ "<b>Measure Distance:</b> distance(angstroms)<br>"\ "<b>Measure Angle:</b> angle (degrees)<br>"\ "<b>Measure Dihedral:</b> dihedral(degrees)<br>"\ "</p>" win. simPlotToolAction.setWhatsThis( simPlotToolActionText ) # # Dashboard Buttons # # Done toolsDoneActionText = "<u><b>Done</b></u><br>"\ "<p><img source=\"ui/actions/Properties Manager/Done.png\"><br> "\ "Completes the current operation and enters the default mode."\ "</p>" win. toolsDoneAction.setWhatsThis( toolsDoneActionText ) # Cancel toolsCancelActionText = "<u><b>Cancel</b></u><br>"\ "<p><img source=\"ui/actions/Properties Manager/Cancel.png\"><br> "\ "Cancels the current operation and enters the default mode."\ "</p>" win. toolsCancelAction.setWhatsThis( toolsCancelActionText ) # Back up toolsBackUpActionText = "<u><b>Back Up</b></u><br>"\ "Undoes the previous operation."\ "</p>" win. toolsBackUpAction.setWhatsThis( toolsBackUpActionText ) # Start Over toolsStartOverActionText = "<u><b>Start Over</b></u><br>"\ "Cancels the current operation, leaving the user in the current mode."\ "</p>" win.toolsStartOverAction.setWhatsThis(toolsStartOverActionText ) # Add Layers ccAddLayerActionText = "<u><b>Add Layer</b></u><br>"\ "<p><img source=\"ui/actions/Properties Manager/addlayer.png\"><br> "\ "Adds a new layer of diamond lattice to the existing layer."\ "</p>" win.ccAddLayerAction.setWhatsThis(ccAddLayerActionText ) # # Jigs # # Anchor jigsAnchorActionText = "<u><b>Anchor</b></u><br>"\ "<p><img source=\"ui/actions/Simulation/Anchor.png\"><br> "\ "Attaches an <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>Build</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>" win.jigsAnchorAction.setWhatsThis(jigsAnchorActionText ) # Rotary Motor jigsMotorActionText = "<u><b>Rotary Motor</b></u><br>"\ "<p><img source=\"ui/actions/Simulation/Rotary_Motor.png\"><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>Build</b> mode, "\ "select the atoms you want to attach the motor to and then select this action."\ "</p>" win.jigsMotorAction.setWhatsThis(jigsMotorActionText ) # Linear Motor jigsLinearMotorActionText = "<u><b>Linear Motor</b></u><br>"\ "<p><img source=\"ui/actions/Simulation/Linear_Motor.png\"><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>Build</b> mode, "\ "select the atoms you want to attach the motor to and then select this action."\ "</p>" win.jigsLinearMotorAction.setWhatsThis(jigsLinearMotorActionText ) # Thermostat jigsStatActionText = "<u><b>Thermostat</b></u><br>"\ "<p><img source=\"ui/actions/Simulation/Thermostat.png\"><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>Build</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>" win.jigsStatAction.setWhatsThis(jigsStatActionText ) # Thermometer jigsThermoActionText = "<u><b>Thermometer</b></u><br>"\ "<p><img source=\"ui/actions/Simulation/Measurements/Thermometer.png\"><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>Build</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>" win.jigsThermoAction.setWhatsThis(jigsThermoActionText ) # ESP Image jigsESPImageActionText = "<u><b>ESP Image</b></u><br>"\ "<p><img source=\"ui/actions/Simulation/ESP_Image.png\"><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>Build</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>" win.jigsESPImageAction.setWhatsThis(jigsESPImageActionText ) # Atom Set jigsAtomSetActionText = "<u><b>Atom Set</b></u><br>"\ "<p><img source=\"ui/actions/Tools/Atom_Set.png\"><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>Build</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>" win.jigsAtomSetAction.setWhatsThis(jigsAtomSetActionText ) # Measure Distance jigsDistanceActionText = "<u><b>Measure Distance Jig</b></u><br>"\ "<p><img source=\"ui/actions/Simulation/Measurements/Measure_Distance.png\"><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>Build</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>" win.jigsDistanceAction.setWhatsThis(jigsDistanceActionText ) # Measure Angle jigsAngleActionText = "<u><b>Measure Angle Jig</b></u><br>"\ "<p><img source=\"ui/actions/Simulation/Measurements/Measure_Angle.png\"><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>Build</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>" win.jigsAngleAction.setWhatsThis(jigsAngleActionText ) # Measure Dihedral jigsDihedralActionText = "<u><b>Measure Dihedral Jig</b></u><br>"\ "<p><img source=\"ui/actions/Simulation/Measurements/Measure_Dihedral.png\"><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>Build</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>" win.jigsDihedralAction.setWhatsThis(jigsDihedralActionText ) # GAMESS Jig jigsGamessActionText = "<u><b>GAMESS Jig</b></u><br>"\ "<p><img source=\"ui/actions/Simulation/Gamess.png\"><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>Build</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>" win.jigsGamessAction.setWhatsThis(jigsGamessActionText ) # Grid Plane Jig jigsGridPlaneActionText = "<u><b>Grid Plane</b></u><br>"\ "<p><img source=\"ui/actions/Insert/Reference Geometry/Grid_Plane.png\"><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>Build</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>" win.jigsGridPlaneAction.setWhatsThis(jigsGridPlaneActionText ) # # Help Toolbar # # What's This helpWhatsThisText = "<u><b>What's This</b></u><br>"\ "<p><img source=\"ui/actions/Help/WhatsThis.png\"><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>" win.helpWhatsThisAction.setWhatsThis( helpWhatsThisText ) win.helpMouseControlsAction.setWhatsThis('Displays help for mouse controls') win.helpKeyboardShortcutsAction.setWhatsThis('Displays help for keyboard shortcuts') | 596540c24ceb3b478e904a42e26d7d5dd8809d95 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/596540c24ceb3b478e904a42e26d7d5dd8809d95/whatsthis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
2888,
2323,
2503,
1528,
1290,
6376,
3829,
16166,
12,
8082,
4672,
3536,
15605,
326,
315,
23801,
1807,
1220,
6,
2809,
977,
358,
1516,
1392,
316,
326,
12901,
21,
2774,
5668,
12748,
87,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1528,
1290,
6376,
3829,
16166,
12,
8082,
4672,
3536,
15605,
326,
315,
23801,
1807,
1220,
6,
2809,
977,
358,
1516,
1392,
316,
326,
12901,
21,
2774,
5668,
12748,
87,
... |
fp = open(pathname, "U") | if hasattr(sys.stdout, "newlines"): fp = open(pathname, "U") else: fp = open(pathname, "r") | def load_file(self, pathname): dir, name = os.path.split(pathname) name, ext = os.path.splitext(name) fp = open(pathname, "U") stuff = (ext, "r", imp.PY_SOURCE) self.load_module(name, fp, pathname, stuff) | 5dfe9be5ef61518a8b81e4c9b253068998be2078 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/5dfe9be5ef61518a8b81e4c9b253068998be2078/modulefinder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
768,
12,
2890,
16,
9806,
4672,
1577,
16,
508,
273,
1140,
18,
803,
18,
4939,
12,
28336,
13,
508,
16,
1110,
273,
1140,
18,
803,
18,
4939,
408,
12,
529,
13,
309,
3859,
12,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
768,
12,
2890,
16,
9806,
4672,
1577,
16,
508,
273,
1140,
18,
803,
18,
4939,
12,
28336,
13,
508,
16,
1110,
273,
1140,
18,
803,
18,
4939,
408,
12,
529,
13,
309,
3859,
12,
9... |
else | else: | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 310) else quickfix.StringField.__init__(self, 310, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
890,
2163,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
890,
2163,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738,... |
maximal. Note that this may not be the term which actually appears first when ``self`` is printed. If the default term ordering is not what is desired, a comparison function, cmp(x,y), can be provided. | maximal. Note that this may not be the term which actually appears first when ``self`` is printed. If the default term ordering is not what is desired, a comparison function, cmp(x,y), can be provided. | def leading_term(self, cmp=None): r""" Returns the leading term of ``self``. | af11dfe919a0b487f6e716e60a01a0379a53e463 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/af11dfe919a0b487f6e716e60a01a0379a53e463/modules_with_basis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7676,
67,
6408,
12,
2890,
16,
9411,
33,
7036,
4672,
436,
8395,
2860,
326,
7676,
2481,
434,
12176,
2890,
68,
8338,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7676,
67,
6408,
12,
2890,
16,
9411,
33,
7036,
4672,
436,
8395,
2860,
326,
7676,
2481,
434,
12176,
2890,
68,
8338,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
_('Use any branch information in patch (implied by --exact)'))] + commitopts, _('hg import [-p NUM] [-m MESSAGE] [-f] PATCH...')), | _('Use any branch information in patch (implied by --exact)'))] + commitopts + commitopts2, _('hg import [OPTION]... PATCH...')), | def version_(ui): """output version and copyright information""" ui.write(_("Mercurial Distributed SCM (version %s)\n") % version.get_version()) ui.status(_( "\nCopyright (C) 2005-2007 Matt Mackall <mpm@selenic.com> and others\n" "This is free software; see the source for copying conditions. " "There is NO\nwarranty; " "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" )) | 2fd5dbc9c1e5ff4c6e98cdc5eb3acbc3166c9737 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/2fd5dbc9c1e5ff4c6e98cdc5eb3acbc3166c9737/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1177,
67,
12,
4881,
4672,
3536,
2844,
1177,
471,
22245,
1779,
8395,
5915,
18,
2626,
24899,
2932,
8478,
1397,
649,
27877,
8795,
49,
261,
1589,
738,
87,
5153,
82,
7923,
738,
1177,
18,
588,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1177,
67,
12,
4881,
4672,
3536,
2844,
1177,
471,
22245,
1779,
8395,
5915,
18,
2626,
24899,
2932,
8478,
1397,
649,
27877,
8795,
49,
261,
1589,
738,
87,
5153,
82,
7923,
738,
1177,
18,
588,... |
return 'greatest(0,datediff(least(%s,%s,%s), greatest(%s,%s,%s)))' % (e1,e2,e3,s1,s2,s3) | return 'greatest(0,timestampdiff(second,greatest(%s,%s,%s),least(%s,%s,%s)))/86400' % (s1,s2,s3,e1,e2,e3) | def sql_overlap3(s1,e1,s2,e2,s3,e3): return 'greatest(0,datediff(least(%s,%s,%s), greatest(%s,%s,%s)))' % (e1,e2,e3,s1,s2,s3) | 08dc9f1871fb9f0748ae0c068c27568973148e48 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8604/08dc9f1871fb9f0748ae0c068c27568973148e48/db.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1847,
67,
17946,
23,
12,
87,
21,
16,
73,
21,
16,
87,
22,
16,
73,
22,
16,
87,
23,
16,
73,
23,
4672,
327,
296,
75,
6150,
395,
12,
20,
16,
12563,
3048,
12,
16446,
9275,
87,
15529,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1847,
67,
17946,
23,
12,
87,
21,
16,
73,
21,
16,
87,
22,
16,
73,
22,
16,
87,
23,
16,
73,
23,
4672,
327,
296,
75,
6150,
395,
12,
20,
16,
12563,
3048,
12,
16446,
9275,
87,
15529,
... |
x_to_p_less_one = x**(p-1) x_to_p = x_to_p_less_one * x x_to_p_cubed = x_to_p.square() * x_to_p r = (base_ring(1) / base_ring(2)) * (x_to_p_cubed + Q[1]*x_to_p + S(Q[0])) | x_to_p_less_one = x**(p-1) x_to_p = x_to_p_less_one * x x_to_p_cubed = x_to_p.square() * x_to_p r = (base_ring(1) / base_ring(2)) * (x_to_p_cubed + Q[1]*x_to_p + S(Q[0])) | def frobenius_expansion_by_newton(Q, p, M): r""" Computes the action of Frobenius on $dx/y$ and on $x dx/y$, using Newton's method (as suggested in Kedlaya's paper). (This function does *not* yet use the cohomology relations -- that happens afterwards in the "reduction" step.) More specifically, it finds $F_0$ and $F_1$ in the quotient ring $R[x, T]/(T - Q(x))$, such that $$ F( dx/y) = T^{-r} F0 dx/y, \text{ and } F(x dx/y) = T^{-r} F1 dx/y $$ where $$ r = ( (2M-3)p - 1 )/2. $$ (Here $T$ is $y^2 = z^{-2}$, and $R$ is the coefficient ring of $Q$.) $F_0$ and $F_1$ are computed in the SpecialCubicQuotientRing associated to $Q$, so all powers of $x^j$ for $j \geq 3$ are reduced to powers of $T$. INPUT: Q -- cubic polynomial of the form Q(x) = x^3 + ax + b, whose coefficient ring is a Z/(p^M)Z-algebra p -- residue characteristic of the p-adic field M -- p-adic precision of the coefficient ring (this will be used to determine the number of Newton iterations) OUTPUT: F0, F1 -- elements of SpecialCubicQuotientRing(Q), as described above r -- non-negative integer, as described above """ S = SpecialCubicQuotientRing(Q) x, _ = S.gens() # T = y^2 base_ring = S.base_ring() # When we compute Frob(1/y) we actually only need precision M-1, since # we're going to multiply by p at the end anyway. M = float(M - 1) # Kedlaya sets s = Q(x^p)/T^p = 1 + p T^{-p} E, where # E = (Q(x^p) - Q(x)^p) / p (has integral coefficients). # Then he computes s^{-1/2} in S, using Newton's method to find # successive approximations. We follow this plan, but we normalise our # approximations so that we only ever need positive powers of T. # Start by setting r = Q(x^p)/2 = 1/2 T^p s. # (The 1/2 is for convenience later on.) x_to_p_less_one = x**(p-1) x_to_p = x_to_p_less_one * x x_to_p_cubed = x_to_p.square() * x_to_p r = (base_ring(1) / base_ring(2)) * (x_to_p_cubed + Q[1]*x_to_p + S(Q[0])) # todo: this next loop would be clearer if it used the newton_method_sizes() # function # We will start with a hard-coded initial approximation, which we provide # up to precision 3. First work out what precision is best to start with. if M <= 3: initial_precision = M elif ceil(log(M/2, 2)) == ceil(log(M/3, 2)): # In this case there's no advantage to starting with precision three, # because we'll overshoot at the end. E.g. suppose the final precision # is 8. If we start with precision 2, we need two iterations to get us # to 8. If we start at precision 3, we will still need two iterations, # but we do more work along the way. So may as well start with only 2. initial_precision = 2 else: initial_precision = 3 # Now compute the first approximation. In the main loop below, X is the # normalised approximation, and k is the precision. More specifically, # X = T^{p(k-1)} x_i, where x_i is an approximation to s^{-1/2}, and the # approximation is correct mod p^k. if initial_precision == 1: k = 1 X = S(1) elif initial_precision == 2: # approximation is 3/2 - 1/2 s k = 2 X = S(base_ring(3) / base_ring(2)).shift(p) - r elif initial_precision == 3: # approximation is (15 - 10 s + 3 s^2) / 8 k = 3 X = (base_ring(1) / base_ring(8)) * ( S(15).shift(2*p) - \ (base_ring(20) * r).shift(p) + \ (base_ring(12) * r.square()) \ ) # The key to the following calculation is that the T^{-m} coefficient # of every x_i is divisible by p^(ceil(m/p)) (for m >= 0). Therefore if # we are only expecting an answer correct mod p^k, we can truncate # beyond the T^{-(k-1)p} term without any problems. # todo: what would be really nice is to be able to work in a lower # precision *coefficient ring* when we start the iteration, and move up to # higher precision rings as the iteration proceeds. This would be feasible # over Integers(p**n), but quite complicated (maybe impossible) over a more # general base ring. This might give a decent constant factor speedup; # or it might not, depending on how much the last iteration dominates the # whole runtime. My guess is that it isn't worth the effort. three_halves = base_ring(3) / base_ring(2) # Newton iteration loop while k < M: # target_k = k' = precision we want our answer to be after this iteration target_k = 2*k # This prevents us overshooting. For example if the current precision # is 3 and we want to get to 10, we're better off going up to 5 # instead of 6, because it's less work to get from 5 to 10 than it # is to get from 6 to 10. if ceil(log(M/target_k, 2)) == ceil(log(M/(target_k-1), 2)): target_k -= 1 # temp = T^{p(3k-2)} 1/2 s x_i^3 temp = X.square() * (X * r) # We know that the final result is only going to be correct mod # p^(target_k), so we might as well truncate the extraneous terms now. # temp = T^{p(k'-1)} 1/2 s x_i^3 temp = temp.shift(-p*(3*k - target_k - 1)) # X = T^{p(k'-1)} (3/2 x_i - 1/2 s x_i^3) # = T^{p(k'-1)} x_{i+1} X = (three_halves * X).shift(p*(target_k - k)) - temp k = target_k # Now k should equal M, since we're up to the correct precision assert k == M, "Oops, something went wrong in the iteration" # We should have s^{-1/2} correct to precision M. # The following line can be uncommented to verify this. # (It's a slow verification though, can double the whole computation time.) #assert (p * X.square() * r * base_ring(2)).coeffs() == \ # R(p).shift(p*(2*M - 1)).coeffs() # Finally incorporate frobenius of dx and x dx, and choose offset that # compensates for our normalisations by powers of T. F0 = base_ring(p) * x_to_p_less_one * X F1 = F0 * x_to_p offset = ((2*k-1)*p - 1)/2 return F0, F1, offset | 06ea403f27d6562f2b12bd1e2b8f27b9b674388a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/06ea403f27d6562f2b12bd1e2b8f27b9b674388a/monsky_washnitzer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
303,
19425,
8384,
67,
2749,
12162,
67,
1637,
67,
2704,
1917,
12,
53,
16,
293,
16,
490,
4672,
436,
8395,
14169,
281,
326,
1301,
434,
478,
303,
19425,
8384,
603,
271,
13437,
19,
93,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
303,
19425,
8384,
67,
2749,
12162,
67,
1637,
67,
2704,
1917,
12,
53,
16,
293,
16,
490,
4672,
436,
8395,
14169,
281,
326,
1301,
434,
478,
303,
19425,
8384,
603,
271,
13437,
19,
93,... |
for i in xrange(min(revs) + 1, len(self)): | for i in xrange(first + 1, len(self)): | def descendants(self, *revs): """Generate the descendants of 'revs' in revision order. | d4eeb7e371bcd2ef6fcbb6ae8c8e6c1f7fc5da9b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/d4eeb7e371bcd2ef6fcbb6ae8c8e6c1f7fc5da9b/revlog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18039,
12,
2890,
16,
380,
266,
6904,
4672,
3536,
4625,
326,
18039,
434,
296,
266,
6904,
11,
316,
6350,
1353,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18039,
12,
2890,
16,
380,
266,
6904,
4672,
3536,
4625,
326,
18039,
434,
296,
266,
6904,
11,
316,
6350,
1353,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.avatar = LocalAvatar.LocalAvatar(None, None, None) | self.avatar = LEAvatar(None, None, None) | def useDriveMode(self): """ Lerp down to eye level then switch to Drive mode """ # create avatar and set it's location to the camera if (self.avatar == None): #self.avatar = RobotToon.RobotToon() self.avatar = LocalAvatar.LocalAvatar(None, None, None) base.localAvatar = self.avatar self.avatar.doId = 0 self.avatar.robot = RobotToon.RobotToon() self.avatar.robot.reparentTo(self.avatar) self.avatar.setHeight(self.avatar.robot.getHeight()) self.avatar.setName("The Inspector") self.avatar.robot.loop('neutral') | 97e2d19ab961b670b3ad177dfe05a057eda260aa /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7242/97e2d19ab961b670b3ad177dfe05a057eda260aa/LevelEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
999,
24681,
2309,
12,
2890,
4672,
3536,
511,
264,
84,
2588,
358,
16098,
1801,
1508,
1620,
358,
11473,
688,
1965,
3536,
468,
752,
16910,
471,
444,
518,
1807,
2117,
358,
326,
10836,
309,
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,
999,
24681,
2309,
12,
2890,
4672,
3536,
511,
264,
84,
2588,
358,
16098,
1801,
1508,
1620,
358,
11473,
688,
1965,
3536,
468,
752,
16910,
471,
444,
518,
1807,
2117,
358,
326,
10836,
309,
2... |
if progress_callback: progress_callback('index.html') | self._files_written += 1 log.progress(self._files_written/self._num_files, 'index.html') | def write(self, directory=None, progress_callback=None): """ Write the documentation to the given directory. | fab1255010a52ee17b13b50d1696c13e716be512 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/fab1255010a52ee17b13b50d1696c13e716be512/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
1867,
33,
7036,
16,
4007,
67,
3394,
33,
7036,
4672,
3536,
2598,
326,
7323,
358,
326,
864,
1867,
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,
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,
1045,
12,
2890,
16,
1867,
33,
7036,
16,
4007,
67,
3394,
33,
7036,
4672,
3536,
2598,
326,
7323,
358,
326,
864,
1867,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
], | ] + ['build/simuPOP_%s' % x for x in MODULES], | def ModuInfo(modu, SIMUPOP_VER, SIMUPOP_REV): # boost_inc_path = boost_include_dir boost_lib_names = [] boost_lib_path = None res = {} res['src'] = ['build/simuPOP_' + modu + '_wrap.cpp'] for src in SOURCE_FILES: res['src'].append(src[:-4] + '_' + modu + '.cpp') res['src'].extend(LIB_FILES) # lib if os.name == 'nt': # Windows, build zlib from source res['libraries'] = [] else: res['libraries'] = ['stdc++', 'z'] res['libraries'].extend(boost_lib_names) res['include_dirs'] = ['.', 'gsl', boost_inc_path] res['library_dirs'] = ['build'] if os.name == 'nt': # I have a portable stdint.h for msvc, to avoid distributing # zdll1.dll, I also build zlib from source res['include_dirs'].extend(['win32', 'win32/zlib-1.2.3']) # zdll.lib is under win32 res['library_dirs'].append('win32') if os.name == 'nt': # msvc does not have O3 option, /GR is to fix a C4541 warning # /EHsc is for VC exception handling, # /wd4819 is used to disable a warning for non-unicode character in boost/uitlity/enable_if.hpp res['extra_compile_args'] = ['/O2', '/GR', '/EHsc', '/wd4819'] else: res['extra_compile_args'] = ['-O3', '-Wall'] # if Intel ICC is used, turn off remark 981 if os.getenv('CC', '').endswith('icc') or \ (get_config_var('CC') is not None and 'icc' in get_config_var('CC')): res['extra_compile_args'].append('-wd981') # define_macros (deep copy) res['define_macros'] = [x for x in MACROS[modu]] res['define_macros'].extend([('SIMUPOP_VER', SIMUPOP_VER), ('SIMUPOP_REV', SIMUPOP_REV)]) if os.name == 'nt': res['define_macros'].extend([('BOOST_ALL_NO_LIB', None), ('NO_ZLIB', 0), ('NO_BZIP' , 1), # this one disables a lot of warnings about VC Checked iterators. Might not be a good idea. ('_SCL_SECURE_NO_WARNINGS', None) ]) res['undef_macros'] = [] return res | f2e8acc368de90f765575993e5a4ecc699cc430c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/401/f2e8acc368de90f765575993e5a4ecc699cc430c/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3431,
89,
966,
12,
1711,
89,
16,
31433,
57,
30374,
67,
2204,
16,
31433,
57,
30374,
67,
862,
58,
4672,
468,
14994,
67,
9523,
67,
803,
273,
14994,
67,
6702,
67,
1214,
14994,
67,
2941,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3431,
89,
966,
12,
1711,
89,
16,
31433,
57,
30374,
67,
2204,
16,
31433,
57,
30374,
67,
862,
58,
4672,
468,
14994,
67,
9523,
67,
803,
273,
14994,
67,
6702,
67,
1214,
14994,
67,
2941,
... |
cp_cmd = "cp %s/* %s/opt/mozilla/[a-z\-\.0-9]*/defaults/preferences/" % \ | cp_cmd = "cp %s/* %s/opt/mozilla/[a-z\-\.0-9]*/defaults/pref/" % \ | def copyFiles(self): full_path = "%s/preferences" % self.full_partner_path if os.path.exists(full_path): cp_cmd = "cp %s/* %s/opt/mozilla/[a-z\-\.0-9]*/defaults/preferences/" % \ (full_path, self.tmpdir) shellCommand(cp_cmd) | 2b72b9e05797f09c24ac4299448fae53cf1c38cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10262/2b72b9e05797f09c24ac4299448fae53cf1c38cb/partner-repacks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
2697,
12,
2890,
4672,
1983,
67,
803,
273,
2213,
87,
19,
23219,
6,
738,
365,
18,
2854,
67,
31993,
67,
803,
309,
1140,
18,
803,
18,
1808,
12,
2854,
67,
803,
4672,
3283,
67,
4172,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
2697,
12,
2890,
4672,
1983,
67,
803,
273,
2213,
87,
19,
23219,
6,
738,
365,
18,
2854,
67,
31993,
67,
803,
309,
1140,
18,
803,
18,
1808,
12,
2854,
67,
803,
4672,
3283,
67,
4172,... |
gtest_filter = self._options.gtest_filter | gtest_filter = self._gtest_filter | def _ReadGtestFilterFile(self, name, cmd): '''Read a file which is a list of tests to filter out with --gtest_filter and append the command-line option to cmd. ''' filters = [] for directory in self._data_dirs: gtest_filter_files = [ os.path.join(directory, name + ".gtest.txt"), os.path.join(directory, name + ".gtest-%s.txt" % \ self._options.valgrind_tool)] for platform_suffix in common.PlatformNames(): gtest_filter_files += [ os.path.join(directory, name + ".gtest_%s.txt" % platform_suffix), os.path.join(directory, name + ".gtest-%s_%s.txt" % \ (self._options.valgrind_tool, platform_suffix))] for filename in gtest_filter_files: if os.path.exists(filename): logging.info("reading gtest filters from %s" % filename) f = open(filename, 'r') for line in f.readlines(): if line.startswith("#") or line.startswith("//") or line.isspace(): continue line = line.rstrip() filters.append(line) gtest_filter = self._options.gtest_filter if len(filters): if gtest_filter: gtest_filter += ":" if gtest_filter.find("-") < 0: gtest_filter += "-" else: gtest_filter = "-" gtest_filter += ":".join(filters) if gtest_filter: cmd.append("--gtest_filter=%s" % gtest_filter) | 3130c2db3d14804287e0c5fd99fad239f7858386 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/3130c2db3d14804287e0c5fd99fad239f7858386/chrome_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1994,
43,
3813,
1586,
812,
12,
2890,
16,
508,
16,
1797,
4672,
9163,
1994,
279,
585,
1492,
353,
279,
666,
434,
7434,
358,
1034,
596,
598,
1493,
75,
3813,
67,
2188,
471,
714,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1994,
43,
3813,
1586,
812,
12,
2890,
16,
508,
16,
1797,
4672,
9163,
1994,
279,
585,
1492,
353,
279,
666,
434,
7434,
358,
1034,
596,
598,
1493,
75,
3813,
67,
2188,
471,
714,
326,
... |
curs.execute(query, (one_day, ed)) | if host: curs.execute(query, (one_day, ed, host)) elif user: curs.execute(query, (one_day, ed, user)) else: curs.execute(query, (one_day, ed)) | def get_key_statistics(self, end_date, report_days, host=None, user=None, email=None): if email: return None | 23256af1e8e77c746a31d94ef7f2cab0675707b6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/87/23256af1e8e77c746a31d94ef7f2cab0675707b6/untangle_base_webfilter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
856,
67,
14438,
12,
2890,
16,
679,
67,
712,
16,
2605,
67,
9810,
16,
1479,
33,
7036,
16,
729,
33,
7036,
16,
2699,
33,
7036,
4672,
309,
2699,
30,
327,
599,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
856,
67,
14438,
12,
2890,
16,
679,
67,
712,
16,
2605,
67,
9810,
16,
1479,
33,
7036,
16,
729,
33,
7036,
16,
2699,
33,
7036,
4672,
309,
2699,
30,
327,
599,
2,
-100,
-100,
-1... |
where "command" is a string that can be passed to Subprocess.Popen() | where "command" is a string that can be passed to subprocess.Popen() | def ssl(self): """Return SSLObject instance used to communicate with the IMAP4 server. | 36f4214255ec8a2b5e0389a4e18cfcdec5c987ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/36f4214255ec8a2b5e0389a4e18cfcdec5c987ed/imaplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5832,
12,
2890,
4672,
3536,
990,
7419,
921,
791,
1399,
358,
15541,
598,
326,
6246,
2203,
24,
1438,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
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,
5832,
12,
2890,
4672,
3536,
990,
7419,
921,
791,
1399,
358,
15541,
598,
326,
6246,
2203,
24,
1438,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
pass | def __init__(self, uri = None): if uri is not None: self.connection = _connect(uri) def connect(self, uri): self.connection = _connect(uri) def write(self, data, statement): pass def create(self, data, tabname): pass | def data(self): self.update() if self.exampleTable: return self.exampleTable return None | 914335463cf95b57b6ce129d8bf6106fa5882b1d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/914335463cf95b57b6ce129d8bf6106fa5882b1d/orngSQL.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
12,
2890,
4672,
365,
18,
2725,
1435,
309,
365,
18,
8236,
1388,
30,
327,
365,
18,
8236,
1388,
327,
599,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
12,
2890,
4672,
365,
18,
2725,
1435,
309,
365,
18,
8236,
1388,
30,
327,
365,
18,
8236,
1388,
327,
599,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
output_phyi = "temp_f002.phy" | output_html = "temp_f002.html" | def test_with_multiple_output_formats(self): """Simple muscle call with multiple output formats""" input_file = "Fasta/f002" output_phyi = "temp_f002.phy" output_clwstrict = "temp_f002.clw" self.assert_(os.path.isfile(input_file)) records = list(SeqIO.parse(open(input_file),"fasta")) #Prepare the command... use Clustal output (with a MUSCLE header) cmdline = MuscleCommandline(muscle_exe, input=input_file, stable=True, clw = True, phyiout = output_phyi, clwstrictout = output_clwstrict) self.assertEqual(str(cmdline).rstrip(), muscle_exe + \ " -in Fasta/f002 -clw -phyiout temp_f002.phy" +\ " -clwstrictout temp_f002.clw -stable") self.assertEqual(str(eval(repr(cmdline))), str(cmdline)) child = subprocess.Popen(str(cmdline), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=(sys.platform!="win32")) return_code = child.wait() self.assertEqual(return_code, 0) #Didn't use -quiet so there should be progress reports on stderr, self.assert_(child.stderr.read().strip().startswith("MUSCLE")) #Clustalw on stdout: align = AlignIO.read(child.stdout, "clustal") self.assertEqual(len(records),len(align)) for old, new in zip(records, align): self.assertEqual(old.id, new.id) del child #Phylip interleaved: align = AlignIO.read(open(output_phyi), "phylip") self.assertEqual(len(records),len(align)) for old, new in zip(records, align): self.assertEqual(old.id[:10], new.id) #ClustalW strict: align = AlignIO.read(open(output_clwstrict), "clustal") self.assertEqual(len(records),len(align)) for old, new in zip(records, align): self.assertEqual(old.id, new.id) os.remove(output_phyi) os.remove(output_clwstrict) | 3fd73a34807fc3c7f44b6cc0c89d28fb80658d1b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7167/3fd73a34807fc3c7f44b6cc0c89d28fb80658d1b/test_Muscle_tool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1918,
67,
9622,
67,
2844,
67,
11962,
12,
2890,
4672,
3536,
5784,
312,
407,
2131,
745,
598,
3229,
876,
6449,
8395,
810,
67,
768,
273,
315,
12305,
69,
19,
74,
24908,
6,
876,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1918,
67,
9622,
67,
2844,
67,
11962,
12,
2890,
4672,
3536,
5784,
312,
407,
2131,
745,
598,
3229,
876,
6449,
8395,
810,
67,
768,
273,
315,
12305,
69,
19,
74,
24908,
6,
876,
... |
menu_item_object, menu_item_id, menu, context) | menu_item_object, menu_item_id[0], menu, context) | def _menu_for(self, cursor, user, identifier, ident_field_value, context=None): """ Returns a dictionary of menu tree | f433c2248755933f43055728de032cb05d66b56f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2593/f433c2248755933f43055728de032cb05d66b56f/cms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5414,
67,
1884,
12,
2890,
16,
3347,
16,
729,
16,
2756,
16,
3390,
67,
1518,
67,
1132,
16,
819,
33,
7036,
4672,
3536,
2860,
279,
3880,
434,
3824,
2151,
2,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5414,
67,
1884,
12,
2890,
16,
3347,
16,
729,
16,
2756,
16,
3390,
67,
1518,
67,
1132,
16,
819,
33,
7036,
4672,
3536,
2860,
279,
3880,
434,
3824,
2151,
2,
-100,
-100,
-100,
-100,
... |
def Accumulated_GC_skew(seq, window = 1000): " calculates the accumulated GC skew (G-C)/(G+C) (easier to see)" values = [] | def xGC_skew(seq, window = 1000, zoom = 100, r = 300, px = 100, py = 100): " calculates and plots normal and accumulated GC skew (GRAPHICS !!!) " from Tkinter import * from math import pi, sin, cos, log yscroll = Scrollbar(orient = VERTICAL) xscroll = Scrollbar(orient = HORIZONTAL) canvas = Canvas(yscrollcommand = yscroll.set, xscrollcommand = xscroll.set, background = 'white') win = canvas.winfo_toplevel() win.geometry('700x700') yscroll.config(command = canvas.yview) xscroll.config(command = canvas.xview) yscroll.pack(side = RIGHT, fill = Y) xscroll.pack(side = BOTTOM, fill = X) canvas.pack(fill=BOTH, side = LEFT, expand = 1) canvas.update() X0, Y0 = r + px, r + py x1, x2, y1, y2 = X0 - r, X0 + r, Y0 -r, Y0 + r ty = Y0 canvas.create_text(X0, ty, text = '%s...%s (%d nt)' % (seq[:7], seq[-7:], len(seq))) ty +=20 canvas.create_text(X0, ty, text = 'GC %3.2f%%' % (GC(seq))) ty +=20 canvas.create_text(X0, ty, text = 'GC Skew', fill = 'blue') ty +=20 canvas.create_text(X0, ty, text = 'Accumulated GC Skew', fill = 'magenta') ty +=20 canvas.create_oval(x1,y1, x2, y2) | def Accumulated_GC_skew(seq, window = 1000): " calculates the accumulated GC skew (G-C)/(G+C) (easier to see)" values = [] acc = 0 for i in range(0, len(seq), window): s = seq[i: i + window] print GC(s) acc += GC(s) values.append(acc) return values | 53822bd9bbc4f9ef4bb8423ba4ecd44a9a518636 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/53822bd9bbc4f9ef4bb8423ba4ecd44a9a518636/sequtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
15396,
67,
7771,
359,
12,
5436,
16,
2742,
273,
4336,
16,
7182,
273,
2130,
16,
436,
273,
11631,
16,
10318,
273,
2130,
16,
2395,
273,
2130,
4672,
315,
17264,
471,
17931,
2212,
471,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
15396,
67,
7771,
359,
12,
5436,
16,
2742,
273,
4336,
16,
7182,
273,
2130,
16,
436,
273,
11631,
16,
10318,
273,
2130,
16,
2395,
273,
2130,
4672,
315,
17264,
471,
17931,
2212,
471,
... |
icalendar.remove(self, 'VEVENT', uid) | def remove(self, context): uid = context.get_form_value('UID') method = context.get_form_value('method', 'monthly_view') icalendar.remove(self, 'VEVENT', uid) goto = ';%s?%s' % (method, self.get_current_date()) if method not in dir(self): goto = '../;%s?%s' % (method, self.get_current_date()) return context.come_back(u'Event definitely deleted.', goto=goto) | cdcbfc5c5dcf59ef595103ae4ba9fe6baaeec457 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/cdcbfc5c5dcf59ef595103ae4ba9fe6baaeec457/ical.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
12,
2890,
16,
819,
4672,
4555,
273,
819,
18,
588,
67,
687,
67,
1132,
2668,
3060,
6134,
707,
273,
819,
18,
588,
67,
687,
67,
1132,
2668,
2039,
2187,
296,
7496,
715,
67,
1945,
61... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
12,
2890,
16,
819,
4672,
4555,
273,
819,
18,
588,
67,
687,
67,
1132,
2668,
3060,
6134,
707,
273,
819,
18,
588,
67,
687,
67,
1132,
2668,
2039,
2187,
296,
7496,
715,
67,
1945,
61... | |
data_key_name = keyed_data['Quantity'].strip()+"~"+keyed_data['Group'].strip()+"~"+keyed_data['Dataname'].strip()+"~"+keyed_data['Exp_Col_Name'].strip() print "Key Name:", data_key_name | data_key_name = keyed_data['Quantity'].strip()+"~"+keyed_data['Group'].strip()+"~"+keyed_data['Dataname'].strip()+"~"+keyed_data['Exp_Y_Col_Name'].strip() | def extract_config_data(config_file): print "*** Extracting Configuration Data and Building Dictionaries ***" # Collect Data from Config File groups_dict = {} quantities_dict = {} data_dict = {} keyed_groups = {} keyed_quantities = {} keyed_data = {} quantity_counter = 0 data_counter = 0 group_counter = 0 skip_counter = 0 #Create File Object try: fh = file(config_file, 'U') except: print"!!! The Config File "+config_file_name+" does not exist or the path defined in the script is incorrect. !!!" exit() #Read file with csv module. data_array = csv.reader(fh) #Convert into List object config_lists = [list(sublist) for sublist in data_array] print str(len(config_lists))+" lines read in from "+config_file_name+"\n" #Build Quantity and Data Dictionaries, with values keyed by config column name. for list_item in config_lists: if list_item[0] == 'g': if group_counter < 1: group_header = list_item[2:] else: if group_counter >= 1: for x in range(len(group_header)): keyed_groups[group_header[x]] = list_item[x+2] groups_dict[int(list_item[1])] = keyed_groups keyed_groups = {} group_counter += 1 #print "This is group line #"+str(group_counter)+"." elif list_item[0] == 'q': if quantity_counter < 1: quantity_header = list_item[2:] if quantity_counter >= 1: for x in range(len(quantity_header)): keyed_quantities[quantity_header[x]] = list_item[x+2] #print "List item 1:",int(list_item[1]) quantities_dict[int(list_item[1])] = keyed_quantities keyed_quantities = {} quantity_counter += 1 elif list_item[0] == 'd': if data_counter < quantity_counter: data_counter = quantity_counter - 1 data_header = list_item[1:] if data_counter >= quantity_counter: for x in range(len(data_header)): keyed_data[data_header[x].strip()] = list_item[x+1] data_key_name = keyed_data['Quantity'].strip()+"~"+keyed_data['Group'].strip()+"~"+keyed_data['Dataname'].strip()+"~"+keyed_data['Exp_Col_Name'].strip() print "Key Name:", data_key_name data_dict[data_key_name] = keyed_data #print data_dict[data_key_name] keyed_data = {} data_counter += 1 else: skip_counter = skip_counter + 1 #print """No g, d or q, skip row.""" print "There were "+str(skip_counter)+" lines skipped, out of the "+str(len(config_lists))+" lines read in." # Return a single list object containing the dictionaries. #print groups_dict #print quantities_dict #print data_dict return [groups_dict,quantities_dict,data_dict] | c2bd4f556a2ce61eab4e48660ca05fb2aaf49751 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12/c2bd4f556a2ce61eab4e48660ca05fb2aaf49751/Validation_Data_Processor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
1425,
67,
892,
12,
1425,
67,
768,
4672,
1172,
315,
14465,
8152,
310,
4659,
1910,
471,
3998,
310,
463,
14336,
18852,
6,
225,
468,
9302,
1910,
628,
1903,
1387,
3252,
67,
1576,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
1425,
67,
892,
12,
1425,
67,
768,
4672,
1172,
315,
14465,
8152,
310,
4659,
1910,
471,
3998,
310,
463,
14336,
18852,
6,
225,
468,
9302,
1910,
628,
1903,
1387,
3252,
67,
1576,
... |
self.__param_tuple__ = (self.__query_dict__['dillhole'][2],) | self.__param_tuple__ = (self.__query_dict__['expression'][2],) | def __init__(self, database, query_dict=None): """ point out strings '"value"' """ | 85d02cb25b26fc015382d67ed0b0b5b5529e5568 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/85d02cb25b26fc015382d67ed0b0b5b5529e5568/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2063,
16,
843,
67,
1576,
33,
7036,
4672,
3536,
1634,
596,
2064,
2119,
1132,
5187,
3536,
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,
1001,
2738,
972,
12,
2890,
16,
2063,
16,
843,
67,
1576,
33,
7036,
4672,
3536,
1634,
596,
2064,
2119,
1132,
5187,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
identity.__doc__ = projection_func_identity.__doc__ | def identity(self): """ Returns the identity projection. | 84c90f627aa2eefd601a2ae3a4ad63f4e91ac1cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/84c90f627aa2eefd601a2ae3a4ad63f4e91ac1cc/polyhedra.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4215,
12,
2890,
4672,
3536,
2860,
326,
4215,
8106,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4215,
12,
2890,
4672,
3536,
2860,
326,
4215,
8106,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
if (oldValues.has_key(key)): oldValues[key][0] += njobs oldValues[key][1] += wall | if (oldValues.has_key(keys)): oldValues[keys][0] += njobs oldValues[keys][1] += wall | def GenericRange(what, range_end = datetime.date.today(), range_begin = None, output = "text"): factor = 3600 # Convert number of seconds to number of hours if (not range_begin or range_begin == None): range_begin = range_end + datetime.timedelta(days=-1) if (not range_end or range_end == None): range_end = range_begin + datetime.timedelta(days=+1) timediff = range_end - range_begin if (output != "None") : if (what.title != "") : print what.title % ( DateToString(range_begin,False), DateToString(range_end,False) ) if (what.headline != "") : print what.headline % ( DateToString(range_begin,False), DateToString(range_end,False) ) print what.lines[output] print " ", what.formats[output] % what.headers print what.lines[output] # First get the previous' range-length's information totalwall = 0 totaljobs = 0 oldValues = {} result = [] start = range_begin - timediff end = range_end - timediff lines = what.GetData(start,end) for i in range (0,len(lines)): val = lines[i].split('\t') offset = 0 site = val[0] if what.headers[0] == "VO": # "site" is really "VO": hack to harmonize Panda output if site != "unknown": site = string.lower(site) if site == "atlas": site = "usatlas" key = site vo = "" num_header = what.num_header; offset = num_header - 1; if (len(val)==4) : # Nasty hack to harmonize Panda output if what.headers[1] == "VO": if vo != "unknown": vo = string.lower(val[1]) if vo == "atlas": vo = "usatlas" else: vo = val[1] key = site + " " + vo elif (num_header == 2) : vo = val[1] key = site + " " + vo njobs= string.atoi( val[offset+1] ) wall = string.atof( val[offset+2] ) / factor totalwall = totalwall + wall totaljobs = totaljobs + njobs if (oldValues.has_key(key)): oldValues[key][0] += njobs oldValues[key][1] += wall else: oldValues[key] = [njobs,wall,site,vo] oldValues["total"] = (totaljobs, totalwall, "total","") # Then getting the current information and print it totalwall = 0 totaljobs = 0 start = range_begin end = range_end lines = what.GetData(start,end) num_header = 1; index = 0 printValues = {} for i in range (0,len(lines)): val = lines[i].split('\t') site = val[0] if what.headers[0] == "VO": # "site" is really "VO": hack to harmonize Panda output if site != "unknown": site = string.lower(site) if site == "atlas": site = "usatlas" key = site offset = 0 num_header = what.num_header; offset = num_header - 1; if (len(val)==4) : # Nasty hack to harmonize Panda output if what.headers[1] == "VO": if vo != "unknown": vo = string.lower(val[1]) if vo == "atlas": vo = "usatlas" else: vo = val[1] key = site + " " + vo elif (num_header == 2) : vo = val[1] key = site + " " + vo (oldnjobs,oldwall) = (0,0) if oldValues.has_key(key): (oldnjobs,oldwall,s,v) = oldValues[key] del oldValues[key] njobs= string.atoi( val[offset+1] ) wall = string.atof( val[offset+2] ) / factor totalwall = totalwall + wall totaljobs = totaljobs + njobs if printValues.has_key(key): printValues[key][0] += njobs printValues[key][1] += wall else: printValues[key] = [njobs,wall,oldnjobs,oldwall,site,vo] for key,(oldnjobs,oldwall,site,vo) in oldValues.iteritems(): if (key != "total") : printValues[key] = (0,0,oldnjobs,oldwall,site,vo) if (what.defaultSort): sortedValues = sortedDictValues(printValues) else: sortedValues = sortedDictValuesFunc(printValues,what.Sorting) for key,(njobs,wall,oldnjobs,oldwall,site,vo) in sortedValues: index = index + 1; if (num_header == 2) : values = (site,vo,niceNum(njobs), niceNum(wall), niceNum(njobs-oldnjobs),niceNum(wall-oldwall)) else: values = (site,niceNum(njobs), niceNum(wall), niceNum(njobs-oldnjobs),niceNum(wall-oldwall)) if (output != "None") : print "%3d " %(index), what.formats[output] % values result.append(values) (oldnjobs,oldwall,s,v) = oldValues["total"] if (output != "None") : print what.lines[output] if (num_header == 2) : print " ", what.formats[output] % \ (what.col1, what.col2, niceNum(totaljobs), niceNum(totalwall), niceNum(totaljobs-oldnjobs), niceNum(totalwall-oldwall)) else: print " ", what.formats[output] % \ (what.col1, niceNum(totaljobs), niceNum(totalwall), niceNum(totaljobs-oldnjobs), niceNum(totalwall-oldwall)) print what.lines[output] return result | 840d5408521dcd3fd349c48313ce276b0ab91bb4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/637/840d5408521dcd3fd349c48313ce276b0ab91bb4/PSACCTReport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7928,
2655,
12,
23770,
16,
1048,
67,
409,
273,
3314,
18,
712,
18,
30064,
9334,
1048,
67,
10086,
273,
599,
16,
876,
273,
315,
955,
6,
4672,
5578,
273,
12396,
225,
468,
4037,
1300,
434,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7928,
2655,
12,
23770,
16,
1048,
67,
409,
273,
3314,
18,
712,
18,
30064,
9334,
1048,
67,
10086,
273,
599,
16,
876,
273,
315,
955,
6,
4672,
5578,
273,
12396,
225,
468,
4037,
1300,
434,
... |
if op in (LITERAL, NOT_LITERAL): | if op in LITERAL_CODES: | def _compile(code, pattern, flags): # internal: compile a (sub)pattern emit = code.append for op, av in pattern: if op in (LITERAL, NOT_LITERAL): if flags & SRE_FLAG_IGNORECASE: emit(OPCODES[OP_IGNORE[op]]) emit(_sre.getlower(av, flags)) else: emit(OPCODES[op]) emit(av) elif op is IN: if flags & SRE_FLAG_IGNORECASE: emit(OPCODES[OP_IGNORE[op]]) def fixup(literal, flags=flags): return _sre.getlower(literal, flags) else: emit(OPCODES[op]) fixup = lambda x: x skip = len(code); emit(0) _compile_charset(av, flags, code, fixup) code[skip] = len(code) - skip elif op is ANY: if flags & SRE_FLAG_DOTALL: emit(OPCODES[ANY_ALL]) else: emit(OPCODES[ANY]) elif op in (REPEAT, MIN_REPEAT, MAX_REPEAT): if flags & SRE_FLAG_TEMPLATE: raise error, "internal: unsupported template operator" emit(OPCODES[REPEAT]) skip = len(code); emit(0) emit(av[0]) emit(av[1]) _compile(code, av[2], flags) emit(OPCODES[SUCCESS]) code[skip] = len(code) - skip elif _simple(av) and op != REPEAT: if op == MAX_REPEAT: emit(OPCODES[REPEAT_ONE]) else: emit(OPCODES[MIN_REPEAT_ONE]) skip = len(code); emit(0) emit(av[0]) emit(av[1]) _compile(code, av[2], flags) emit(OPCODES[SUCCESS]) code[skip] = len(code) - skip else: emit(OPCODES[REPEAT]) skip = len(code); emit(0) emit(av[0]) emit(av[1]) _compile(code, av[2], flags) code[skip] = len(code) - skip if op == MAX_REPEAT: emit(OPCODES[MAX_UNTIL]) else: emit(OPCODES[MIN_UNTIL]) elif op is SUBPATTERN: if av[0]: emit(OPCODES[MARK]) emit((av[0]-1)*2) # _compile_info(code, av[1], flags) _compile(code, av[1], flags) if av[0]: emit(OPCODES[MARK]) emit((av[0]-1)*2+1) elif op in (SUCCESS, FAILURE): emit(OPCODES[op]) elif op in (ASSERT, ASSERT_NOT): emit(OPCODES[op]) skip = len(code); emit(0) if av[0] >= 0: emit(0) # look ahead else: lo, hi = av[1].getwidth() if lo != hi: raise error, "look-behind requires fixed-width pattern" emit(lo) # look behind _compile(code, av[1], flags) emit(OPCODES[SUCCESS]) code[skip] = len(code) - skip elif op is CALL: emit(OPCODES[op]) skip = len(code); emit(0) _compile(code, av, flags) emit(OPCODES[SUCCESS]) code[skip] = len(code) - skip elif op is AT: emit(OPCODES[op]) if flags & SRE_FLAG_MULTILINE: av = AT_MULTILINE.get(av, av) if flags & SRE_FLAG_LOCALE: av = AT_LOCALE.get(av, av) elif flags & SRE_FLAG_UNICODE: av = AT_UNICODE.get(av, av) emit(ATCODES[av]) elif op is BRANCH: emit(OPCODES[op]) tail = [] for av in av[1]: skip = len(code); emit(0) # _compile_info(code, av, flags) _compile(code, av, flags) emit(OPCODES[JUMP]) tail.append(len(code)); emit(0) code[skip] = len(code) - skip emit(0) # end of branch for tail in tail: code[tail] = len(code) - tail elif op is CATEGORY: emit(OPCODES[op]) if flags & SRE_FLAG_LOCALE: av = CH_LOCALE[av] elif flags & SRE_FLAG_UNICODE: av = CH_UNICODE[av] emit(CHCODES[av]) elif op is GROUPREF: if flags & SRE_FLAG_IGNORECASE: emit(OPCODES[OP_IGNORE[op]]) else: emit(OPCODES[op]) emit(av-1) elif op is GROUPREF_EXISTS: emit(OPCODES[op]) emit((av[0]-1)*2) skipyes = len(code); emit(0) _compile(code, av[1], flags) if av[2]: emit(OPCODES[JUMP]) skipno = len(code); emit(0) code[skipyes] = len(code) - skipyes + 1 _compile(code, av[2], flags) code[skipno] = len(code) - skipno else: code[skipyes] = len(code) - skipyes + 1 else: raise ValueError, ("unsupported operand type", op) | 3f8fdffe72485d69e9e31bdeb4796c1cca750eba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/3f8fdffe72485d69e9e31bdeb4796c1cca750eba/sre_compile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11100,
12,
710,
16,
1936,
16,
2943,
4672,
468,
2713,
30,
4074,
279,
261,
1717,
13,
4951,
3626,
273,
981,
18,
6923,
364,
1061,
16,
1712,
316,
1936,
30,
309,
1061,
316,
511,
18454,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11100,
12,
710,
16,
1936,
16,
2943,
4672,
468,
2713,
30,
4074,
279,
261,
1717,
13,
4951,
3626,
273,
981,
18,
6923,
364,
1061,
16,
1712,
316,
1936,
30,
309,
1061,
316,
511,
18454,
... |
return scm_map[scm_name](url, root_dir, relpath, scm_name) | return scm_map[scm_name](orig_url, root_dir, relpath, scm_name) | def CreateSCM(url=None, root_dir=None, relpath=None, scm_name='svn'): # TODO(maruel): Deduce the SCM from the url. scm_map = { 'svn' : SVNWrapper, 'git' : GitWrapper, } if url and (url.startswith('git:') or url.startswith('ssh:') or url.endswith('.git')): scm_name = 'git' if not scm_name in scm_map: raise gclient_utils.Error('Unsupported scm %s' % scm_name) return scm_map[scm_name](url, root_dir, relpath, scm_name) | 85b8f5dba3aba4ea68291e6ad299fdf2681d8869 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6076/85b8f5dba3aba4ea68291e6ad299fdf2681d8869/gclient_scm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
2312,
49,
12,
718,
33,
7036,
16,
1365,
67,
1214,
33,
7036,
16,
14614,
33,
7036,
16,
29207,
67,
529,
2218,
31505,
11,
4672,
468,
2660,
12,
3684,
20317,
4672,
463,
329,
3965,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
2312,
49,
12,
718,
33,
7036,
16,
1365,
67,
1214,
33,
7036,
16,
14614,
33,
7036,
16,
29207,
67,
529,
2218,
31505,
11,
4672,
468,
2660,
12,
3684,
20317,
4672,
463,
329,
3965,
326,
... |
self._checkLogLevel(level) | """ Log data without and prefix. """ self._checkLogLevel(level, min=self.FATAL, max=self.DEBUG_MAX) | def log(self, level, data): self._checkLogLevel(level) self._log(level, 0, 1, "%s", data) | 3d7d63966162f8881fad278dc8cc728a7e5a1f77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/3d7d63966162f8881fad278dc8cc728a7e5a1f77/logger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
12,
2890,
16,
1801,
16,
501,
4672,
3536,
1827,
501,
2887,
471,
1633,
18,
3536,
365,
6315,
1893,
21806,
12,
2815,
16,
1131,
33,
2890,
18,
29891,
16,
943,
33,
2890,
18,
9394,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
12,
2890,
16,
1801,
16,
501,
4672,
3536,
1827,
501,
2887,
471,
1633,
18,
3536,
365,
6315,
1893,
21806,
12,
2815,
16,
1131,
33,
2890,
18,
29891,
16,
943,
33,
2890,
18,
9394,
67,
... |
win32api.Sleep(2) | win32api.Sleep(2) | def win32_launcher(commandline): startupInfo = win32process.STARTUPINFO() startupInfo.dwFlags = win32process.DETACHED_PROCESS | win32process.STARTF_USESHOWWINDOW startupInfo.wShowWindow = win32con.SW_HIDE hProcess, hThread, dwProcessId, dwThreadId = \ win32process.CreateProcess(None, commandline, None, None, 0, 0, None, None, startupInfo) while (win32process.GetExitCodeProcess(hProcess) == win32con.STILL_ACTIVE): win32api.Sleep(2) # FIXME: try to get the errcode return 0 | cb21993c059a29db03180285e4c1a09e1235d9a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2259/cb21993c059a29db03180285e4c1a09e1235d9a2/converter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5657,
1578,
67,
20738,
264,
12,
3076,
1369,
4672,
11850,
966,
273,
5657,
1578,
2567,
18,
7570,
3079,
5923,
1435,
11850,
966,
18,
22512,
5094,
273,
5657,
1578,
2567,
18,
40,
31370,
15023,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5657,
1578,
67,
20738,
264,
12,
3076,
1369,
4672,
11850,
966,
273,
5657,
1578,
2567,
18,
7570,
3079,
5923,
1435,
11850,
966,
18,
22512,
5094,
273,
5657,
1578,
2567,
18,
40,
31370,
15023,
... |
angle_samples = np.linspace(0,2*np.pi,angles) | angle_samples = np.linspace(0, 2*np.pi, angles) | def logpolar(ref_img,img_list,window_shape=None,angles=180, variance_threshold=0.75,peak_thresh=5): """Register the given images using log polar transforms. Output: ------- accepted : bool array For each of the input frames, return whether the image could be used. Hs : list of (3,3) floating point arrays For each of the input frames, the homography H that maps the frame to the reference image. """ assert ref_img.ndim == 2, "Images must be 2-dimensional arrays" for img in img_list: assert ref_img.shape == img.shape if window_shape is None: window_shape = np.array(img.shape,dtype=int)/5 + 1 window_shape[window_shape < 21] = 21 else: window_shape = np.asarray(window_shape,dtype=int) # Pre-calculate coordinates for log-polar transforms angle_samples = np.linspace(0,2*np.pi,angles) w = max(window_shape[:2]) cr, cc, angle_samples, log_base = \ sr.transform.transform._lpcoords( np.append(window_shape, 1), w, angles=angle_samples) def lpt_on_path(image,path,shape): """Calculate log polar transforms along a given path.""" path = list(path) cutouts = sr.geometry.cut.along_path(path,image,shape=shape) for pos,cut in izip(path,cutouts): lpt = sr.transform.logpolar(cut,_coords_r=cr,_coords_c=cc,mode='W') yield (pos,cut,lpt - lpt.mean()) def lpt_corr(reference_frames,frame,descr,path,window_shape,fft_shape): try: max_corr_sofar = descr['source'].info['variance'] except: max_corr_sofar = 0 corr_vals = [] for pos,cut,lpt in lpt_on_path(frame,path,window_shape): # prepare correlation FFT X = fft2(lpt,fft_shape) for rf in reference_frames: corr = abs(ifft2(X*rf['fft'])) corr /= (np.sqrt((lpt**2).sum()*(rf['lpt']**2).sum())) corr_max_arg = corr.argmax() corr_max = corr.flat[corr_max_arg] corr_vals.append(corr_max) if corr_max > max_corr_sofar: print corr_max rotation,scale = np.unravel_index(corr_max_arg,fft_shape) rotation = angle_samples[rotation] scale -= fft_shape[1]/2 max_corr_sofar = corr_max if max_corr_sofar < 0.6: quality = 'rejected' elif max_corr_sofar < 0.7: quality = 'bad' elif max_corr_sofar < 0.8: quality = 'good' elif max_corr_sofar < 0.85: quality = 'stable' else: quality = 'trusted' descr.update({'source': Image(cut, info={'variance': max_corr_sofar, 'position': pos, 'rotation': rotation, 'scale': scale, 'reference': rf, 'quality': quality}), 'lpt': lpt, 'fft': X, 'frame': frame}) return corr_vals # Divide reference frame into 4 quadrants and calculate log-polar # transforms at points of maximum variance. # High-pass filter def _prepare_varmap(ref_img): vm_filter_mask = [[0, 1, 0], [1, -2, 1], [0, 1, 0]] #vmsource = ndi.correlate(ref_img,vm_filter_mask) vmsource = ref_img - ndi.sobel(ref_img) vm = sr.ext.variance_map(vmsource,shape=window_shape/4) vm = vm/np.prod(window_shape/4) vm = _clearborder(vm,window_shape/2) return vm vm = _prepare_varmap(ref_img) import pylab as P P.subplot(121) P.imshow(ref_img,cmap=P.cm.gray) P.axis('off') P.subplot(122) P.imshow(vm) P.rcParams['figure.figsize'] = (6.67,3.335) P.axis('off') P.savefig('varmap.eps') P.show() # 'reference' stores image sequences. Each sequence contains # original slice, slice log polar transform and DFT of slice LPT reference_frames = [] ref_pos = _peaks(vm,12,peak_thresh) assert len(ref_pos) > 0, "Could not find suitable reference position." ref_var = [vm[tuple(p)] for p in ref_pos] for pos,original,lpt in lpt_on_path(ref_img,ref_pos,window_shape): reference_frames.append({'source':Image(original,info={'position':pos, 'maxcor':0}), 'lpt': lpt}) # Calculate Fourier transforms of reference log-polar transforms. fft_shape = (angles,w*2-1) for frame in reference_frames: frame['fft'] = fft2(frame['lpt'][::-1,::-1], fft_shape) best_matched_frame = [{} for i in xrange(len(img_list))] for fnum,frame in enumerate(img_list): print "Matching frame ", fnum tic = timeit.time.time() bmf = best_matched_frame[fnum] vm = _prepare_varmap(frame) print "Performing log polar transforms and correlations..." path = _peaks(vm,40,0.95*min(ref_var)) lpt_corr(reference_frames,frame,bmf,path,window_shape,fft_shape) toc = timeit.time.time() print "Peak correlation was", best_matched_frame[fnum]['source'].info['variance'] print "Registration completed in %.2f seconds.\n" % (toc-tic) def _lpt_peak(pos,frame,bmf,window_shape,fft_shape): corr = lpt_corr([bmf['source'].info['reference']],frame,bmf,[pos],window_shape,fft_shape) return corr[0] for fnum,frame in enumerate(img_list): print "Refining frame %d..." % fnum bmf = best_matched_frame[fnum] | cc3c399ed2f306cdf02d244f317c4793f63d5a0c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12843/cc3c399ed2f306cdf02d244f317c4793f63d5a0c/logpolar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
3915,
297,
12,
1734,
67,
6081,
16,
6081,
67,
1098,
16,
5668,
67,
4867,
33,
7036,
16,
12356,
33,
18278,
16,
12380,
67,
8699,
33,
20,
18,
5877,
16,
10244,
67,
19237,
33,
25,
4672,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
3915,
297,
12,
1734,
67,
6081,
16,
6081,
67,
1098,
16,
5668,
67,
4867,
33,
7036,
16,
12356,
33,
18278,
16,
12380,
67,
8699,
33,
20,
18,
5877,
16,
10244,
67,
19237,
33,
25,
4672,... |
newStore = self.store.extract('d','b','p') | newStore = self.store.extract(['d','b','p']) | def test_extract(self): '''DictStore: Test the extract function''' newStore = self.store.extract('d','b','p') #newStore.save('test_dictstore1.csv') | 45268ff49ddb4f963530947d7202a5e0642e2fda /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2720/45268ff49ddb4f963530947d7202a5e0642e2fda/storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
8004,
12,
2890,
4672,
9163,
5014,
2257,
30,
7766,
326,
2608,
445,
26418,
394,
2257,
273,
365,
18,
2233,
18,
8004,
12,
3292,
72,
17023,
70,
17023,
84,
19486,
468,
2704,
2257,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
8004,
12,
2890,
4672,
9163,
5014,
2257,
30,
7766,
326,
2608,
445,
26418,
394,
2257,
273,
365,
18,
2233,
18,
8004,
12,
3292,
72,
17023,
70,
17023,
84,
19486,
468,
2704,
2257,
... |
['verbose', 'v', 'verbose color output'], | ['verbose', 'v', 'verbose color output (default)'], | def remove(self): if self in log.theLogPublisher.observers: log.removeObserver(self) | f904174f21f710dc919e29681965ae0589740649 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f904174f21f710dc919e29681965ae0589740649/trial.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
12,
2890,
4672,
309,
365,
316,
613,
18,
5787,
1343,
15960,
18,
12199,
2496,
30,
613,
18,
4479,
11048,
12,
2890,
13,
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,
1206,
12,
2890,
4672,
309,
365,
316,
613,
18,
5787,
1343,
15960,
18,
12199,
2496,
30,
613,
18,
4479,
11048,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.histogramCheck.setChecked(False) self.histogramCheck.setDisabled(True) self.histogramLabel.setDisabled(True) | def __init__(self,parent=None, signalManager = None): OWWidget.__init__(self, parent, signalManager, "Nomogram", 1) | 73262a6b44aac8122745c128bc45bdad25f591e8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/73262a6b44aac8122745c128bc45bdad25f591e8/OWNomogram.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2938,
33,
7036,
16,
4277,
1318,
273,
599,
4672,
18233,
4609,
16186,
2738,
972,
12,
2890,
16,
982,
16,
4277,
1318,
16,
315,
26685,
5553,
3113,
404,
13,
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,
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,
2938,
33,
7036,
16,
4277,
1318,
273,
599,
4672,
18233,
4609,
16186,
2738,
972,
12,
2890,
16,
982,
16,
4277,
1318,
16,
315,
26685,
5553,
3113,
404,
13,
2,... | |
(user, subnamespace, tagname) = self.tag_path_split (tag) | (user, subnamespace, tagname) = self.tag_path_split(tag) | def create_abstract_tag (self, tag, description=None, indexed=True): """Creates an (abstract) tag with the name (full path) given. The tag is not applied to any object. If the tag's name (tag) contains slashes, namespaces are created as needed. | e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
17801,
67,
2692,
261,
2890,
16,
1047,
16,
2477,
33,
7036,
16,
8808,
33,
5510,
4672,
3536,
2729,
392,
261,
17801,
13,
1047,
598,
326,
508,
261,
2854,
589,
13,
864,
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,
752,
67,
17801,
67,
2692,
261,
2890,
16,
1047,
16,
2477,
33,
7036,
16,
8808,
33,
5510,
4672,
3536,
2729,
392,
261,
17801,
13,
1047,
598,
326,
508,
261,
2854,
589,
13,
864,
18,
1021,
... |
line = geom.readline().strip() | line = geom.next().strip() | def read_geom(): opened = False if type(geom) == type(''): geom = open(geom, 'r') opened = True lines = [] line = geom.readline().strip() # Skip header if present if line.startswith('BEGIN header'): while not line.startswith('END header'): line = geom.readline().strip() geom.readline() # skip blank line else: lines.append(line) # Read until next blank line while line != '': line = geom.readline().strip() if line != '': lines.append(line) if opened: geom.close() # Let go of the file if len(lines) <= 1: # Check for EOF raise IOError params = Dictionary() # First line is the time/step params['time'] = float(lines[0]) # Then the energy, in Hartree energy_lines = filter(lambda s: s.endswith('<-- E'), lines) if len(energy_lines) != 1: raise ValueError('Number of energy lines should be exactly one.') params['energy'], params['hamiltonian'] = \ [float(x)*HARTREE_TO_EV for x in energy_lines[0].split()[0:2]] # Lattice is next, in units of Bohr lattice_lines = filter(lambda s: s.endswith('<-- h'), lines) lattice = farray([ [float(x)* BOHR_TO_ANG for x in row[0:3]] for row in map(string.split, lattice_lines) ]) # Then optionally stress tensor (FIXME: units) stress_lines = filter(lambda s: s.endswith('<-- S'), lines) params['stress'] = farray([ [float(x) for x in row[0:3]] for row in map(string.split, stress_lines) ]) # Find positions and forces poslines = filter(lambda s: s.endswith('<-- R'), lines) forcelines = filter(lambda s: s.endswith('<-- F'), lines) if len(poslines) != len(forcelines): raise ValueError('Number of pos lines (%d) != force lines (%d)'\ % (len(poslines), len(forcelines))) result = Atoms(n=len(poslines),lattice=lattice,params=params) # Now parse the positions, converting from units of Bohr field_list = [line.split() for line in poslines] result.species[:] = farray(map(operator.itemgetter(0), field_list)) result.pos[:,:] = farray([ [float(x)* BOHR_TO_ANG for x in row] \ for row in [field[2:5] for field in field_list]]) # And finally the forces, which are in units of hartree/bohr field_list = [line.split() for line in forcelines] force = farray([ [float(x)*HARTREE_TO_EV/BOHR_TO_ANG for x in row] \ for row in [field[2:5] for field in field_list]]) result.add_property('force', force) result.force[:] = force result.add_property('norm_f',norm(force)) return result | 39dd3544f0f8fd6f2cc4ecc741e1de15fbb88db0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8914/39dd3544f0f8fd6f2cc4ecc741e1de15fbb88db0/castep.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
10049,
13332,
10191,
273,
1083,
309,
618,
12,
10049,
13,
422,
618,
2668,
11,
4672,
7364,
273,
1696,
12,
10049,
16,
296,
86,
6134,
10191,
273,
1053,
225,
2362,
273,
5378,
980,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
10049,
13332,
10191,
273,
1083,
309,
618,
12,
10049,
13,
422,
618,
2668,
11,
4672,
7364,
273,
1696,
12,
10049,
16,
296,
86,
6134,
10191,
273,
1053,
225,
2362,
273,
5378,
980,
... |
def __init__(self, offset_vector): | def __init__(self, offset_vector, time_slide_id = None): self.time_slide_id = time_slide_id | def __init__(self, offset_vector): self.offset_vector = offset_vector self.deltas = ligolw_tisi.offset_vector_to_deltas(offset_vector) self.components = set() | 602bb20f07221107abd463f1f997ff3cd558a7bd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/602bb20f07221107abd463f1f997ff3cd558a7bd/snglcoinc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1384,
67,
7737,
16,
813,
67,
26371,
67,
350,
273,
599,
4672,
365,
18,
957,
67,
26371,
67,
350,
273,
813,
67,
26371,
67,
350,
365,
18,
3348,
67,
7737,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1384,
67,
7737,
16,
813,
67,
26371,
67,
350,
273,
599,
4672,
365,
18,
957,
67,
26371,
67,
350,
273,
813,
67,
26371,
67,
350,
365,
18,
3348,
67,
7737,
... |
vob.setAttribute("file",os.path.join(getThemFile(themeName, videomode + '_' + introFile))) | vob.setAttribute("file",os.path.join(getThemeFile(themeName, videomode + '_' + introFile))) | def createDVDAuthorXMLNoMenus(screensize, numberofitems): """Creates the xml file for dvdauthor containing no menus.""" # creates a simple DVD with no menus that chains the videos one after the other # can contain an intro movie and each title can have a details page # displayed before each title write( "Creating DVD XML file for dvd author (No Menus)") dvddom = xml.dom.minidom.parseString( ''' <dvdauthor> <vmgm> </vmgm> </dvdauthor>''') dvdauthor_element = dvddom.documentElement titleset = dvddom.createElement("titleset") titles = dvddom.createElement("titles") titleset.appendChild(titles) dvdauthor_element.appendChild(titleset) dvdauthor_element.insertBefore(dvddom.createComment("dvdauthor XML file created by MythBurn script"), dvdauthor_element.firstChild ) dvdauthor_element.setAttribute("dest",os.path.join(getTempPath(),"dvd")) fileCount = 0 itemNum = 1 if wantIntro: node = themeDOM.getElementsByTagName("intro")[0] introFile = node.attributes["filename"].value titles.appendChild(dvddom.createComment("Intro movie")) pgc = dvddom.createElement("pgc") vob = dvddom.createElement("vob") vob.setAttribute("file",os.path.join(getThemFile(themeName, videomode + '_' + introFile))) pgc.appendChild(vob) titles.appendChild(pgc) post = dvddom.createElement("post") post .appendChild(dvddom.createTextNode("jump title 2 chapter 1;")) pgc.appendChild(post) titles.appendChild(pgc) fileCount +=1 del pgc del vob del post while itemNum <= numberofitems: write( "Adding item %s" % itemNum) pgc = dvddom.createElement("pgc") if wantDetailsPage: #add the detail page intro for this item vob = dvddom.createElement("vob") vob.setAttribute("file",os.path.join(getTempPath(),"details-%s.mpg" % itemNum)) pgc.appendChild(vob) fileCount +=1 del vob vob = dvddom.createElement("vob") vob.setAttribute("file", os.path.join(getItemTempPath(itemNum), "final.mpg")) vob.setAttribute("chapters", createVideoChaptersFixedLength(chapterLength, getLengthOfVideo(itemNum))) pgc.appendChild(vob) del vob post = dvddom.createElement("post") if itemNum == numberofitems: post.appendChild(dvddom.createTextNode("exit;")) else: if wantIntro: post.appendChild(dvddom.createTextNode("jump title %d chapter 1;" % (itemNum + 2))) else: post.appendChild(dvddom.createTextNode("jump title %d chapter 1;" % (itemNum + 1))) pgc.appendChild(post) fileCount +=1 titles.appendChild(pgc) del pgc itemNum +=1 #Save xml to file WriteXMLToFile (dvddom,os.path.join(getTempPath(),"dvdauthor.xml")) #Destroy the DOM and free memory dvddom.unlink() | e83e330dd6079c7513d3059744cec38da1468e13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13713/e83e330dd6079c7513d3059744cec38da1468e13/mythburn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
40,
21544,
3594,
4201,
2279,
29755,
12,
1017,
266,
773,
554,
16,
1300,
792,
3319,
4672,
3536,
2729,
326,
2025,
585,
364,
12494,
72,
4161,
4191,
1158,
21374,
12123,
225,
468,
3414,
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,
752,
40,
21544,
3594,
4201,
2279,
29755,
12,
1017,
266,
773,
554,
16,
1300,
792,
3319,
4672,
3536,
2729,
326,
2025,
585,
364,
12494,
72,
4161,
4191,
1158,
21374,
12123,
225,
468,
3414,
2... |
elif CONFIG is BuildConfig.L10N: | if CONFIG is BuildConfig.L10N: | def preprocess(src, debug=False, vals=None): """Returns the given source string, with variables substituted and testing code removed. Variables are of the following form: ${VarName} where "VarName" is the name of the variable. Testing code can be removed when debug is True. This method removes everything from any line that contains: $if{Debug} to any line that contains: $endif{} inclusive. Similarly, it removes BabelZilla-incompatible code between: $unless{BabelZilla} and: $endunless{} Because the each of these lines are removed entirely, these processing instructions can be place inside of comments, to avoid errors when the file is parsed as code. Note that general if-test support has not been implemented.""" # Remove testing code. We don't have real if-test support yet. if CONFIG in [BuildConfig.RELEASE, BuildConfig.AMO]: debug_re = re.compile(r"^[^\r\n]*\$if\{" + BuildConfig.DEBUG + r"\}.*?\$endif\{\}[^\r\n]*$", re.M | re.S) src = debug_re.sub(r"", src) elif CONFIG is BuildConfig.L10N: l10n_re = re.compile(r"^[^\r\n]*\$unless\{" + BuildConfig.L10N + r"\}.*?\$endunless\{\}[^\r\n]*$", re.M | re.S) src = l10n_re.sub(r"", src) # Substitute variables. for k, v in vals.iteritems(): src = src.replace("${%s}" % k, str(v)) return src | f7b6a6950d9ddde616f30725ff4cdbdbbb56e02f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8389/f7b6a6950d9ddde616f30725ff4cdbdbbb56e02f/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17942,
12,
4816,
16,
1198,
33,
8381,
16,
5773,
33,
7036,
4672,
3536,
1356,
326,
864,
1084,
533,
16,
598,
3152,
7461,
4817,
471,
7769,
981,
3723,
18,
225,
23536,
854,
434,
326,
3751,
64... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17942,
12,
4816,
16,
1198,
33,
8381,
16,
5773,
33,
7036,
4672,
3536,
1356,
326,
864,
1084,
533,
16,
598,
3152,
7461,
4817,
471,
7769,
981,
3723,
18,
225,
23536,
854,
434,
326,
3751,
64... |
winnerField.x = 0 | winnerField.x = 200 | def enter(self): self.timeout = g_player.setTimeout(5000, self.onTimeout) winnerField = g_player.getElementByID("winner") self.startButton = StartButton(self.onStartClick) self.exitButton = ExitButton(lambda e:self.game.leave()) anim.fadeIn(winnerField, config.STATE_FADE_TIME).start() if self.game.getWinner() == 0: winnerField.x = 0 else: winnerField.x = 880 | 6b95493bcafa100a244de77ab3fe3e8d8591faef /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7301/6b95493bcafa100a244de77ab3fe3e8d8591faef/Game.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6103,
12,
2890,
4672,
365,
18,
4538,
273,
314,
67,
14872,
18,
542,
2694,
12,
25,
3784,
16,
365,
18,
265,
2694,
13,
5657,
1224,
974,
273,
314,
67,
14872,
18,
21336,
13331,
2932,
91,
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,
6103,
12,
2890,
4672,
365,
18,
4538,
273,
314,
67,
14872,
18,
542,
2694,
12,
25,
3784,
16,
365,
18,
265,
2694,
13,
5657,
1224,
974,
273,
314,
67,
14872,
18,
21336,
13331,
2932,
91,
7... |
idlist = map(lambda i: (i.isdigit() and int(i)) or i, idlist) | idlist = map(lambda i: int(i), idlist) | def _getbugs(self,idlist): '''Return a list of dicts of full bug info for each given bug id. bug ids that couldn't be found will return None instead of a dict.''' idlist = map(lambda i: (i.isdigit() and int(i)) or i, idlist) r = self._proxy.Bug.get_bugs({'ids':idlist, 'permissive': 1}) bugdict = dict([(b['id'], b['internals']) for b in r['bugs']]) return [bugdict.get(i) for i in idlist] | 745dc3f536f3ea03a836d884b6941251d1ce08d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5050/745dc3f536f3ea03a836d884b6941251d1ce08d2/bugzilla3.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
19381,
12,
2890,
16,
350,
1098,
4672,
9163,
990,
279,
666,
434,
15838,
434,
1983,
7934,
1123,
364,
1517,
864,
7934,
612,
18,
7934,
3258,
716,
17991,
1404,
506,
1392,
903,
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,
389,
588,
19381,
12,
2890,
16,
350,
1098,
4672,
9163,
990,
279,
666,
434,
15838,
434,
1983,
7934,
1123,
364,
1517,
864,
7934,
612,
18,
7934,
3258,
716,
17991,
1404,
506,
1392,
903,
327,
... |
self.body.append('</dt>\n') self.body.append(self.starttag(node, 'dd', '')) if len(node) and isinstance(node[0], nodes.paragraph): node[0].set_class('first') | pass | def visit_definition(self, node): self.body.append('</dt>\n') self.body.append(self.starttag(node, 'dd', '')) if len(node) and isinstance(node[0], nodes.paragraph): node[0].set_class('first') | 6375238ab8247c4cfacf9efad70324a50b6c7ce8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/6375238ab8247c4cfacf9efad70324a50b6c7ce8/OOwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
6907,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
2668,
1757,
7510,
5333,
82,
6134,
365,
18,
3432,
18,
6923,
12,
2890,
18,
1937,
2692,
12,
2159,
16,
296,
449,
2187,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
6907,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
2668,
1757,
7510,
5333,
82,
6134,
365,
18,
3432,
18,
6923,
12,
2890,
18,
1937,
2692,
12,
2159,
16,
296,
449,
2187,
8... |
gLogger.error(errStr,lfn) return res if not res['Value']['Successful'].has_key(lfn): | gLogger.error( errStr, lfn ) return res if not res['Value']['Successful'].has_key( lfn ): | def putAndRegister(self,lfn,file,diracSE,guid=None,path=None,checksum=None,catalog=None): """ Put a local file to a Storage Element and register in the File Catalogues | 9fabceb719d19d46d8b75011d2932552dbe360f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9fabceb719d19d46d8b75011d2932552dbe360f9/ReplicaManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
1876,
3996,
12,
2890,
16,
80,
4293,
16,
768,
16,
3211,
8836,
1090,
16,
14066,
33,
7036,
16,
803,
33,
7036,
16,
15149,
33,
7036,
16,
7199,
33,
7036,
4672,
3536,
4399,
279,
1191,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
1876,
3996,
12,
2890,
16,
80,
4293,
16,
768,
16,
3211,
8836,
1090,
16,
14066,
33,
7036,
16,
803,
33,
7036,
16,
15149,
33,
7036,
16,
7199,
33,
7036,
4672,
3536,
4399,
279,
1191,
... |
if cnf is None and not kw: cnf = {} for x in self.tk.split( self.tk.call(self._w, 'itemconfigure', tagOrId)): cnf[x[0][1:]] = (x[0][1:],) + x[1:] return cnf if type(cnf) == StringType and not kw: x = self.tk.split(self.tk.call( self._w, 'itemconfigure', tagOrId, '-'+cnf)) return (x[0][1:],) + x[1:] self.tk.call((self._w, 'itemconfigure', tagOrId) + self._options(cnf, kw)) | return self._configure(('itemconfigure', tagOrId), cnf, kw) | def itemconfigure(self, tagOrId, cnf=None, **kw): """Configure resources of an item TAGORID. | 6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ce1315bd35b6114abf8a59d0e9b9f7dce0bcd7d/Tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
761,
14895,
12,
2890,
16,
1047,
1162,
548,
16,
23118,
33,
7036,
16,
2826,
9987,
4672,
3536,
11207,
2703,
434,
392,
761,
8358,
916,
734,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
761,
14895,
12,
2890,
16,
1047,
1162,
548,
16,
23118,
33,
7036,
16,
2826,
9987,
4672,
3536,
11207,
2703,
434,
392,
761,
8358,
916,
734,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"""Get the hostname that the user passed in to the request. | """ Get the hostname that the user passed in to the request. | def getRequestHostname(self): """Get the hostname that the user passed in to the request. | 61e18979bbf7cbc4ea2ccfcbdaa594bb49936f26 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12595/61e18979bbf7cbc4ea2ccfcbdaa594bb49936f26/http.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4328,
13769,
12,
2890,
4672,
3536,
967,
326,
5199,
716,
326,
729,
2275,
316,
358,
326,
590,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4328,
13769,
12,
2890,
4672,
3536,
967,
326,
5199,
716,
326,
729,
2275,
316,
358,
326,
590,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
if functionref != '%keepalive': codewriter.append('call void %s(%s)' % (functionref, args)) | codewriter.append('call void %s(%s)' % (functionref, args)) | def invoke(self, codewriter, targetvar, returntype, functionref, args, label, except_label): if returntype == 'void': if functionref != '%keepalive': #XXX I think keepalive should not be the last operation here! codewriter.append('call void %s(%s)' % (functionref, args)) else: codewriter.llvm('%s = call %s %s(%s)' % (targetvar, returntype, functionref, args)) tmp = '%%invoke.tmp.%d' % self.invoke_count exc = '%%invoke.exc.%d' % self.invoke_count self.invoke_count += 1 codewriter.llvm('%(tmp)s = load %%RPYTHON_EXCEPTION_VTABLE** last_exception_type' % locals()) codewriter.llvm('%(exc)s = seteq %%RPYTHON_EXCEPTION_VTABLE* %(tmp)s, null' % locals()) codewriter.llvm('br bool %(exc)s, label %%%(label)s, label %%%(except_label)s' % locals()) | 11354dcb5ef05322fcbe1201ca7cb6f7e5284502 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/11354dcb5ef05322fcbe1201ca7cb6f7e5284502/exception.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4356,
12,
2890,
16,
981,
6299,
16,
1018,
1401,
16,
327,
723,
16,
445,
1734,
16,
833,
16,
1433,
16,
1335,
67,
1925,
4672,
309,
327,
723,
422,
296,
6459,
4278,
309,
445,
1734,
480,
199... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4356,
12,
2890,
16,
981,
6299,
16,
1018,
1401,
16,
327,
723,
16,
445,
1734,
16,
833,
16,
1433,
16,
1335,
67,
1925,
4672,
309,
327,
723,
422,
296,
6459,
4278,
309,
445,
1734,
480,
199... |
app = App() | def run(): parser = optparse.OptionParser(usage = "usage: %prog [options]") parser.add_option("--version", dest="printversion", action="store_true", help="Display the version information for this program") (options, args) = parser.parse_args() if options.printversion != None: print get_version() return if not os.path.exists(CACHEDIR): os.makedirs(CACHEDIR) app = App() config = parse_config() items = config.keys() for key in items: app.add(key) app.run() | b0be527ef6a1f029d19420ceb0333083835e95bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6425/b0be527ef6a1f029d19420ceb0333083835e95bd/crawler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
13332,
2082,
273,
2153,
2670,
18,
1895,
2678,
12,
9167,
273,
315,
9167,
30,
738,
14654,
306,
2116,
4279,
13,
2082,
18,
1289,
67,
3482,
2932,
413,
1589,
3113,
1570,
1546,
1188,
1589... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13332,
2082,
273,
2153,
2670,
18,
1895,
2678,
12,
9167,
273,
315,
9167,
30,
738,
14654,
306,
2116,
4279,
13,
2082,
18,
1289,
67,
3482,
2932,
413,
1589,
3113,
1570,
1546,
1188,
1589... | |
print 'Opening ' + self.short_name + '...' | print 'Opening ' + self.channel.name + '...' | def run(self): #print "Using libshout version %s" % shout.version() | d28aa783db003af7e24c341eb71817b82e80d9c4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12047/d28aa783db003af7e24c341eb71817b82e80d9c4/d-fuzz.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
468,
1188,
315,
7736,
2561,
674,
659,
1177,
738,
87,
6,
738,
699,
659,
18,
1589,
1435,
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,
1086,
12,
2890,
4672,
468,
1188,
315,
7736,
2561,
674,
659,
1177,
738,
87,
6,
738,
699,
659,
18,
1589,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
tmp._int = (0,)+tmp._int | tmp._int = (0,) + tmp._int | def _rescale(self, exp, rounding = None, context=None, watchexp = 1): """Rescales so that the exponent is exp. | b277e15abb88b70aabae5a4859ba6920ae8be40f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/b277e15abb88b70aabae5a4859ba6920ae8be40f/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
455,
1869,
12,
2890,
16,
1329,
16,
13885,
273,
599,
16,
819,
33,
7036,
16,
4267,
2749,
273,
404,
4672,
3536,
607,
21177,
1427,
716,
326,
9100,
353,
1329,
18,
2,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
455,
1869,
12,
2890,
16,
1329,
16,
13885,
273,
599,
16,
819,
33,
7036,
16,
4267,
2749,
273,
404,
4672,
3536,
607,
21177,
1427,
716,
326,
9100,
353,
1329,
18,
2,
-100,
-100,
-100,
... |
def disk_type_get_next: | def disk_type_get_next(): | def disk_type_get_next: warnings.warn("disk_type_get_next() is deprecated and will be removed", DeprecationWarning) # XXX | 58f09f31f275f6d8c81df749d3dc7b8c9b8eb6ec /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5978/58f09f31f275f6d8c81df749d3dc7b8c9b8eb6ec/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4234,
67,
723,
67,
588,
67,
4285,
13332,
5599,
18,
8935,
2932,
10863,
67,
723,
67,
588,
67,
4285,
1435,
353,
6849,
471,
903,
506,
3723,
3113,
24041,
13,
468,
11329,
225,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4234,
67,
723,
67,
588,
67,
4285,
13332,
5599,
18,
8935,
2932,
10863,
67,
723,
67,
588,
67,
4285,
1435,
353,
6849,
471,
903,
506,
3723,
3113,
24041,
13,
468,
11329,
225,
2,
-100,
-100,... |
while len(filename) > 0 and (filename[0] == '/' or filename[0] == '\\'): | while (len(filename) > 0 and (filename[0] == '/' or filename[0] == '\\')): | def addGlob(self, wildcard): wildcard = os.path.join(self.dist_dir, wildcard) length = len(self.dist_dir) for filename in iglob(wildcard): if filename[:length] == self.dist_dir: filename = filename[length:] while len(filename) > 0 and (filename[0] == '/' or filename[0] == '\\'): filename = filename[1:] print "Compressing %s" % filename self.zipfile.write(os.path.join(self.dist_dir, filename), filename) | 16717514d85be409df247e58637855a19e0ad04f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/16717514d85be409df247e58637855a19e0ad04f/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
13499,
12,
2890,
16,
8531,
4672,
8531,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
4413,
67,
1214,
16,
8531,
13,
769,
273,
562,
12,
2890,
18,
4413,
67,
1214,
13,
364,
1544,
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,
527,
13499,
12,
2890,
16,
8531,
4672,
8531,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
4413,
67,
1214,
16,
8531,
13,
769,
273,
562,
12,
2890,
18,
4413,
67,
1214,
13,
364,
1544,
316,... |
path, object = locate(key) if object: file = open(key + '.html', 'w') file.write(html.page(object)) file.close() print 'wrote', key + '.html' | try: path, object = locate(key) except DocImportError, value: print value else: if object: page = html.page('Python: ' + describe(object), html.document(object, object.__name__)) file = open(key + '.html', 'w') file.write(page) file.close() print 'wrote', key + '.html' else: print 'no Python documentation found for %s' % repr(key) def writedocs(dir, pkgpath='', done={}): """Write out HTML documentation for all modules in a directory tree.""" for file in os.listdir(dir): path = os.path.join(dir, file) if ispackage(path): writedocs(path, pkgpath + file + '.') elif os.path.isfile(path): modname = modulename(path) if modname: modname = pkgpath + modname if not done.has_key(modname): done[modname] = 1 writedoc(modname) | def writedoc(key): """Write HTML documentation to a file in the current directory.""" path, object = locate(key) if object: file = open(key + '.html', 'w') file.write(html.page(object)) file.close() print 'wrote', key + '.html' | 37f7b38eb6247564c00c8a355ab12268e8486c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/37f7b38eb6247564c00c8a355ab12268e8486c4e/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2518,
329,
504,
12,
856,
4672,
3536,
3067,
3982,
7323,
358,
279,
585,
316,
326,
783,
1867,
12123,
775,
30,
589,
16,
733,
273,
10627,
12,
856,
13,
1335,
3521,
5010,
668,
16,
460,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2518,
329,
504,
12,
856,
4672,
3536,
3067,
3982,
7323,
358,
279,
585,
316,
326,
783,
1867,
12123,
775,
30,
589,
16,
733,
273,
10627,
12,
856,
13,
1335,
3521,
5010,
668,
16,
460,
30,
... |
video = query.get() | key_id = 0 for v in query: if v.key().id() > key_id and not v.youtube_id.endswith('_player'): video = v key_id = v.key().id() | def get(self): user = users.get_current_user() user_data = UserData.get_for_current_user() logout_url = users.create_logout_url(self.request.uri) video = None video_id = self.request.get('v') path = self.request.path readable_id = urllib.unquote(path.rpartition('/')[2]) if video_id: # Support for old links query = Video.all() query.filter('youtube_id =', video_id) video = query.get() readable_id = video.readable_id self.redirect("/video/"+urllib.quote(readable_id), True); return if readable_id: query = Video.all() query.filter('readable_id =', readable_id) video = query.get() if video is None: error_message = "No video found for ID '%s'" % readable_id logging.error(error_message) report_issue_handler = ReportIssue() report_issue_handler.initialize(self.request, self.response) report_issue_handler.write_response('Defect', {'issue_labels': 'Component-Videos,Video-%s' % readable_id, 'message': 'Error: %s' % error_message}) return | 106a04fe81f0922574c0142c1a76b6e182a06189 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12010/106a04fe81f0922574c0142c1a76b6e182a06189/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
729,
273,
3677,
18,
588,
67,
2972,
67,
1355,
1435,
729,
67,
892,
273,
31109,
18,
588,
67,
1884,
67,
2972,
67,
1355,
1435,
12735,
67,
718,
273,
3677,
18,
2640,
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,
336,
12,
2890,
4672,
729,
273,
3677,
18,
588,
67,
2972,
67,
1355,
1435,
729,
67,
892,
273,
31109,
18,
588,
67,
1884,
67,
2972,
67,
1355,
1435,
12735,
67,
718,
273,
3677,
18,
2640,
67... |
port = args[1] | port = args[1]._int() | def recurringRun(self, counter): self.test_response = self.request('PUT', self.cmp, body=self.rMikealAccount, headers=self.foxHeaders) self.checkStatus(431) #username in use auth = 'Basic %s' % base64.encodestring('%s:%s' % ("testAccount%s" % counter, "testAccount")).strip() putFoxHeaders = {'Host' : "sync.foxcloud.com", 'User-Agent': "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1 Foxmarks/0.56", 'Accept' : "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5", 'Accept-Language' : "en-us,en;q=0.5", 'Accept-Encoding' : "gzip,deflate", 'Accept-Charset' : "ISO-8859-1,utf-8;q=0.7,*;q=0.7", 'Keep-Alive' : "300", 'Connection' : "keep-alive", 'Content-Length' : "12789", 'Content-Type' : "text/xml; charset=UTF-8", 'Authorization': auth} getFoxHeaders = {'Host' : "sync.foxcloud.com", 'User-Agent': "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1 Foxmarks/0.56", 'Accept' : "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5", 'Accept-Language' : "en-us,en;q=0.5", 'Accept-Encoding' : "gzip,deflate", 'Accept-Charset' : "ISO-8859-1,utf-8;q=0.7,*;q=0.7", 'Keep-Alive' : "300", 'Connection' : "keep-alive", 'Content-Type' : "text/xml; charset=UTF-8", 'Authorization' : auth, 'If-None-Match' : "15847-1143250968808", 'Pragma' : 'no-cache', 'Cache-Control' : 'no=cache'} rCMPNewCurreEmail = '<?xml version="1.0" encoding="utf-8" ?> \ <user xmlns="http://osafoundation.org/cosmo"> \ <username>testAccount%s</username> \ <password>testAccount</password> \ <firstName>testAccount</firstName> \ <lastName>Rogers</lastName> \ <email>testAccount%s@osafoundation.org</email> \ </user>' % (counter, counter) putfox = "%s/home/testAccount%s/files/foxmarks.xml" % (self.connection["path"], counter) #print self.results[0] self.test_response = self.request('PUT', self.cmp, body=rCMPNewCurreEmail, headers=self.foxHeaders) self.checkStatus(201) print self.test_response.read() #print self.results[1] self.test_response = self.request('PUT', putfox, body=self.rPutFox, headers=putFoxHeaders) self.checkStatus(201) #print self.results[2] self.test_response = self.request('GET', putfox, body=None, headers=getFoxHeaders) self.checkStatus(200) #print self.results[3] | 2f9ccd81c5f2191a75de255ab846809d22ef4a7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9939/2f9ccd81c5f2191a75de255ab846809d22ef4a7d/client-foxcloud.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26043,
1997,
12,
2890,
16,
3895,
4672,
282,
365,
18,
3813,
67,
2740,
273,
365,
18,
2293,
2668,
4762,
2187,
365,
18,
9625,
16,
1417,
33,
2890,
18,
86,
49,
2547,
287,
3032,
16,
1607,
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,
26043,
1997,
12,
2890,
16,
3895,
4672,
282,
365,
18,
3813,
67,
2740,
273,
365,
18,
2293,
2668,
4762,
2187,
365,
18,
9625,
16,
1417,
33,
2890,
18,
86,
49,
2547,
287,
3032,
16,
1607,
3... |
attributes = jobDB.getJobAttributes(job) if not attributes['OK']: | ret = jobDB.getJobAttributes(job) if not ret['OK']: | def __getJobDict(self, job): """ Get job constant Properties and keep them local to avoid quering the DB each time """ result = jobDB.getJobJDL(job) if not result['OK']: self.log.error(result['Message']) updateJobStatus( self.log, AGENT_NAME, job, 'Failed', 'No Job JDL Available', logRecord=True) return False | 962f17a6c5fa9829e5dcf98786c112246cc74530 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/962f17a6c5fa9829e5dcf98786c112246cc74530/Director.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
2278,
5014,
12,
2890,
16,
1719,
4672,
3536,
968,
1719,
5381,
6183,
471,
3455,
2182,
1191,
358,
4543,
21287,
310,
326,
2383,
1517,
813,
3536,
563,
273,
1719,
2290,
18,
588,
227... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
588,
2278,
5014,
12,
2890,
16,
1719,
4672,
3536,
968,
1719,
5381,
6183,
471,
3455,
2182,
1191,
358,
4543,
21287,
310,
326,
2383,
1517,
813,
3536,
563,
273,
1719,
2290,
18,
588,
227... |
sim.getRNG().setSeed(12345) | sim.getRNG().set(seed=12345) | def demo(gen, pop): if gen < 2: return 1000 + 100 * gen if gen == 2: # this happens right before mating at generation 2 size = pop.popSize() pop.splitSubPop(0, [size/2, size - size/2]) # for generation two and later return [x + 50 * gen for x in pop.subPopSizes()] | 205f55f8c6cd28aed704d70838912648f07ac340 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/401/205f55f8c6cd28aed704d70838912648f07ac340/userGuide.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21477,
12,
4507,
16,
1843,
4672,
309,
3157,
411,
576,
30,
327,
4336,
397,
2130,
380,
3157,
309,
3157,
422,
576,
30,
468,
333,
10555,
2145,
1865,
312,
1776,
622,
9377,
576,
963,
273,
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,
21477,
12,
4507,
16,
1843,
4672,
309,
3157,
411,
576,
30,
327,
4336,
397,
2130,
380,
3157,
309,
3157,
422,
576,
30,
468,
333,
10555,
2145,
1865,
312,
1776,
622,
9377,
576,
963,
273,
18... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.