rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
if value is not None: | if value is not None and 'rel' not in already_processed: | def buildAttributes(self, node, attrs, already_processed): value = attrs.get('href') if value is not None: already_processed.append('href') self.href = value value = attrs.get('rel') if value is not None: already_processed.append('rel') self.rel = value super(ResourceMeta, self).buildAttributes(node, attrs, already_processed) | 10f2a4b3101435822c472af9b202a5a0bb496366 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14016/10f2a4b3101435822c472af9b202a5a0bb496366/_nexml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
2498,
12,
2890,
16,
756,
16,
3422,
16,
1818,
67,
11005,
4672,
460,
273,
3422,
18,
588,
2668,
7547,
6134,
309,
460,
353,
486,
599,
471,
296,
2878,
11,
486,
316,
1818,
67,
11005,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
2498,
12,
2890,
16,
756,
16,
3422,
16,
1818,
67,
11005,
4672,
460,
273,
3422,
18,
588,
2668,
7547,
6134,
309,
460,
353,
486,
599,
471,
296,
2878,
11,
486,
316,
1818,
67,
11005,
... |
ef = codecs.EncodedFile(f, 'utf-16', 'utf-8') | ef = codecs.EncodedFile(f, 'utf-16-le', 'utf-8') | def test_basic(self): f = StringIO.StringIO('\xed\x95\x9c\n\xea\xb8\x80') ef = codecs.EncodedFile(f, 'utf-16', 'utf-8') self.assertEquals(ef.read(), '\xff\xfe\\\xd5\n\x00\x00\xae') | e4cc181031b7a5d95083edefdaf1e64bcc4055f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e4cc181031b7a5d95083edefdaf1e64bcc4055f7/test_codecs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13240,
12,
2890,
4672,
284,
273,
15777,
18,
780,
4294,
2668,
64,
92,
329,
64,
92,
8778,
64,
92,
29,
71,
64,
82,
64,
6554,
69,
64,
6114,
28,
64,
92,
3672,
6134,
20986,
273... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13240,
12,
2890,
4672,
284,
273,
15777,
18,
780,
4294,
2668,
64,
92,
329,
64,
92,
8778,
64,
92,
29,
71,
64,
82,
64,
6554,
69,
64,
6114,
28,
64,
92,
3672,
6134,
20986,
273... |
return True | return False | def onKeyDown(self, event): global node curTime = node.getCurTime() if event.keystring == "right": node.seekToTime(curTime+10000) elif event.keystring == "left": if curTime > 10000: node.seekToTime(curTime-10000) else: node.seekToTime(0) return True | 25df09f78cbb78a18d4efce8941906a9ad2e477d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7300/25df09f78cbb78a18d4efce8941906a9ad2e477d/avg_videoplayer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
653,
4164,
12,
2890,
16,
871,
4672,
2552,
756,
662,
950,
273,
756,
18,
588,
2408,
950,
1435,
309,
871,
18,
856,
1080,
422,
315,
4083,
6877,
756,
18,
16508,
774,
950,
12,
1397,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
653,
4164,
12,
2890,
16,
871,
4672,
2552,
756,
662,
950,
273,
756,
18,
588,
2408,
950,
1435,
309,
871,
18,
856,
1080,
422,
315,
4083,
6877,
756,
18,
16508,
774,
950,
12,
1397,
9... |
["jsdouble ", "DOUBLE", "0"], | ["jsdouble ", "DOUBLE", "DOUBLE", " 0"], | f.write("#ifdef DEBUG\n") | f54640901f9704aa02f15abc4882b5cd0254cf98 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11102/f54640901f9704aa02f15abc4882b5cd0254cf98/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
284,
18,
2626,
2932,
7,
430,
536,
6369,
64,
82,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
284,
18,
2626,
2932,
7,
430,
536,
6369,
64,
82,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.areaResetComboBox = QtGui.QComboBox(self.tabWidgets[3]) for i in range(2): self.areaResetComboBox.addItem(prefStateStrings[i]) self.areaResetComboBox.setCurrentIndex(self.values[14]) | self.areaResetComboBox = QtGui.QCheckBox(self.tabWidgets[3]) self.areaResetComboBox.setCheckState(self.__rCheckState__(self.values[14])) | def __subWidgets__(self): self.labels={} self.boxes={} self.labelbox={} self.tabWidgets={} self.notebook = QtGui.QTabWidget(self.window) for i in range(4): self.labelbox[i]=QtGui.QVBoxLayout() self.tabWidgets[i]=QtGui.QWidget() | be37e1c0f6e2e7ac834bcef036f133de5458c665 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9403/be37e1c0f6e2e7ac834bcef036f133de5458c665/rmdPrefsWidget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1717,
16166,
972,
12,
2890,
4672,
365,
18,
5336,
12938,
365,
18,
15918,
12938,
365,
18,
1925,
2147,
12938,
365,
18,
7032,
16166,
12938,
365,
18,
24422,
273,
23425,
18,
53,
5661,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1717,
16166,
972,
12,
2890,
4672,
365,
18,
5336,
12938,
365,
18,
15918,
12938,
365,
18,
1925,
2147,
12938,
365,
18,
7032,
16166,
12938,
365,
18,
24422,
273,
23425,
18,
53,
5661,
46... |
Bootstrap('automake-1.7', '1.7.6', 'http://ftp.gnu.org/gnu/automake/automake-1.7.6.tar.gz', 713595, | Bootstrap('automake-1.7', '1.7.7', 'http://ftp.gnu.org/gnu/automake/automake-1.7.7.tar.gz', 734007, | def build(self, config): if not self.wants_package(): return | 8c5c050788b8b6f8fcc7fd615c99babf07c94e05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4596/8c5c050788b8b6f8fcc7fd615c99babf07c94e05/bootstrap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
2890,
16,
642,
4672,
309,
486,
365,
18,
91,
4388,
67,
5610,
13332,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
2890,
16,
642,
4672,
309,
486,
365,
18,
91,
4388,
67,
5610,
13332,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
except RoundedDecimalError, P: | except RoundedDecimalError: | def save(self, cart, request): log.debug('saving'); self.full_clean() cartplaces = config_value('SHOP', 'CART_PRECISION') roundfactor = config_value('SHOP', 'CART_ROUNDING') | f2b6e08460653509e628c4199bb860d1ee93d725 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/171/f2b6e08460653509e628c4199bb860d1ee93d725/forms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
7035,
16,
590,
4672,
613,
18,
4148,
2668,
87,
5339,
8284,
365,
18,
2854,
67,
6200,
1435,
7035,
11350,
273,
642,
67,
1132,
2668,
2664,
3665,
2187,
296,
39,
4928,
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,
1923,
12,
2890,
16,
7035,
16,
590,
4672,
613,
18,
4148,
2668,
87,
5339,
8284,
365,
18,
2854,
67,
6200,
1435,
7035,
11350,
273,
642,
67,
1132,
2668,
2664,
3665,
2187,
296,
39,
4928,
67,... |
sdata[tid] += READ_AND_MAP(i); | acc = REDUCE(acc, READ_AND_MAP(i)); | def get_reduction_module(out_type, block_size, neutral, reduce_expr, map_expr, arguments, name="reduce_kernel", keep=False, options=[], preamble=""): from pycuda.compiler import SourceModule src = """ #define BLOCK_SIZE %(block_size)d #define READ_AND_MAP(i) %(map_expr)s #define REDUCE(a, b) %(reduce_expr)s %(preamble)s __global__ void %(name)s(%(out_type)s *out, %(arguments)s, unsigned int seq_count, unsigned int n) { __shared__ %(out_type)s sdata[BLOCK_SIZE]; unsigned int tid = threadIdx.x; unsigned int i = blockIdx.x*BLOCK_SIZE*seq_count + tid; sdata[tid] = %(neutral)s; for (unsigned s = 0; s < seq_count; ++s) { if (i < n) sdata[tid] += READ_AND_MAP(i); i += BLOCK_SIZE; } __syncthreads(); #if (BLOCK_SIZE >= 512) if (tid < 256) { sdata[tid] = REDUCE(sdata[tid], sdata[tid + 256]); } __syncthreads(); #endif #if (BLOCK_SIZE >= 256) if (tid < 128) { sdata[tid] = REDUCE(sdata[tid], sdata[tid + 128]); } __syncthreads(); #endif #if (BLOCK_SIZE >= 128) if (tid < 64) { sdata[tid] = REDUCE(sdata[tid], sdata[tid + 64]); } __syncthreads(); #endif if (tid < 32) { if (BLOCK_SIZE >= 64) sdata[tid] = REDUCE(sdata[tid], sdata[tid + 32]); if (BLOCK_SIZE >= 32) sdata[tid] = REDUCE(sdata[tid], sdata[tid + 16]); if (BLOCK_SIZE >= 16) sdata[tid] = REDUCE(sdata[tid], sdata[tid + 8]); if (BLOCK_SIZE >= 8) sdata[tid] = REDUCE(sdata[tid], sdata[tid + 4]); if (BLOCK_SIZE >= 4) sdata[tid] = REDUCE(sdata[tid], sdata[tid + 2]); if (BLOCK_SIZE >= 2) sdata[tid] = REDUCE(sdata[tid], sdata[tid + 1]); } if (tid == 0) out[blockIdx.x] = sdata[0]; } """ % { "out_type": out_type, "arguments": arguments, "block_size": block_size, "neutral": neutral, "reduce_expr": reduce_expr, "map_expr": map_expr, "name": name, "preamble": preamble} return SourceModule(src, options=options, keep=keep) | a72e4175c52065aba20ed755c1fe81d7094ba07d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12870/a72e4175c52065aba20ed755c1fe81d7094ba07d/reduction.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1118,
4062,
67,
2978,
12,
659,
67,
723,
16,
1203,
67,
1467,
16,
22403,
287,
16,
5459,
67,
8638,
16,
852,
67,
8638,
16,
1775,
16,
508,
1546,
12498,
67,
8111,
3113,
3455,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1118,
4062,
67,
2978,
12,
659,
67,
723,
16,
1203,
67,
1467,
16,
22403,
287,
16,
5459,
67,
8638,
16,
852,
67,
8638,
16,
1775,
16,
508,
1546,
12498,
67,
8111,
3113,
3455,
33,
... |
print recordError("No definition of " + `lhs`) | progress( recordError("No definition of " + `lhs`)) | def yaccProduction(yacc, lhs, tokenRegexps): if lhs is BNF.void: print "\nvoid" return if lhs is BNF.eof: print "\nEOF" return if isinstance(lhs, Literal): literalTerminals[lhs.value()] = 1 | a069dbeddd5ec63ef002105ed0c2481a29043eff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/a069dbeddd5ec63ef002105ed0c2481a29043eff/predictiveParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
677,
8981,
31590,
12,
93,
8981,
16,
8499,
16,
225,
1147,
6628,
1121,
4672,
309,
8499,
353,
605,
26473,
18,
6459,
30,
1172,
1548,
82,
6459,
6,
327,
309,
8499,
353,
605,
26473,
18,
9339,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
677,
8981,
31590,
12,
93,
8981,
16,
8499,
16,
225,
1147,
6628,
1121,
4672,
309,
8499,
353,
605,
26473,
18,
6459,
30,
1172,
1548,
82,
6459,
6,
327,
309,
8499,
353,
605,
26473,
18,
9339,... |
source = root_class(username='a', password='a').resource | password = [ random.choice(string.ascii_letters + string.digits) for x in range(8) ] password = ''.join(password) source = root_class(username='admin', password=password).resource | def init(parser, options, target): try: os.mkdir(target) except OSError: parser.error('can not create the instance (check permissions)') # Create the config file config = get_config() if options.root: config.set('instance', 'root', options.root) if options.port: config.set('instance', 'port', options.port) config.write(open('%s/config.ini' % target, 'w')) # Create the database database = get_database(target) # Load the source if options.source is None: if options.root is None: root_class = Root else: exec('import %s' % options.root) exec('root_class = %s.Root' % options.root) source = root_class(username='a', password='a').resource else: source = get_resource(options.source) if not isinstance(source, base.Folder): parser.error('can not import instance (not a folder)') if not source.has_resource('.metadata'): parser.error('can not import instance (bad folder)') # Initialize the database root_resource = database.get_resource('/') for name in source.get_resource_names(): resource = source.get_resource(name) root_resource.set_resource(name, resource) root_resource.get_transaction().commit() # Index and archive everything (only for new instances, not imported) if options.source is None: root = root_class(root_resource) catalog = root.get_handler('.catalog') for handler, context in root.traverse2(): abspath = handler.get_abspath() if handler.name.startswith('.'): context.skip = True elif abspath == '/ui': context.skip = True elif isinstance(handler, Handler): catalog.index_document(handler) if isinstance(handler, VersioningAware): handler.add_to_archive() transaction = transactions.get_transaction() transaction.commit() # Bravo! print 'To start the new instance type:' print ' %s start %s' % (parser.get_prog_name(), target) | b1a6e98aedf81d2d666fc796ce1e6352fc8eb1d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/b1a6e98aedf81d2d666fc796ce1e6352fc8eb1d2/icms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
4288,
16,
702,
16,
1018,
4672,
775,
30,
1140,
18,
26686,
12,
3299,
13,
1335,
10002,
30,
2082,
18,
1636,
2668,
4169,
486,
752,
326,
791,
261,
1893,
4371,
2506,
13,
225,
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,
1208,
12,
4288,
16,
702,
16,
1018,
4672,
775,
30,
1140,
18,
26686,
12,
3299,
13,
1335,
10002,
30,
2082,
18,
1636,
2668,
4169,
486,
752,
326,
791,
261,
1893,
4371,
2506,
13,
225,
468,
... |
"%s is not a valid url nor a valid path to vistrails.py" %\ (path_to_vistrails)) | generate_latex_error("%s is not a valid url nor a valid path to vistrails.py" %\ (path_to_vistrails))) | def check_url(url): try: p = urlparse(url) h = HTTP(p[1]) h.putrequest('HEAD', p[2]) h.endheaders() if h.getreply()[0] == 200: return True else: return False except: return False | 3123297d6a1b374a7b720af850b6ee46e7955b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6341/3123297d6a1b374a7b720af850b6ee46e7955b16/includevistrail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
718,
12,
718,
4672,
775,
30,
293,
273,
15185,
12,
718,
13,
366,
273,
2239,
12,
84,
63,
21,
5717,
366,
18,
458,
2293,
2668,
12458,
2187,
293,
63,
22,
5717,
366,
18,
409,
24... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
718,
12,
718,
4672,
775,
30,
293,
273,
15185,
12,
718,
13,
366,
273,
2239,
12,
84,
63,
21,
5717,
366,
18,
458,
2293,
2668,
12458,
2187,
293,
63,
22,
5717,
366,
18,
409,
24... |
cmd.append(test.source_path) | cmd.append(test.getSourcePath()) | def execute(self, test, litConfig): if test.config.unsupported: return (Test.UNSUPPORTED, 'Test is unsupported') | cb1b9e247c0348a8bb1b9256c403ec35e7c0e348 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6277/cb1b9e247c0348a8bb1b9256c403ec35e7c0e348/TestFormats.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
1842,
16,
16297,
809,
4672,
309,
1842,
18,
1425,
18,
24666,
30,
327,
261,
4709,
18,
2124,
21134,
16,
296,
4709,
353,
13248,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
1842,
16,
16297,
809,
4672,
309,
1842,
18,
1425,
18,
24666,
30,
327,
261,
4709,
18,
2124,
21134,
16,
296,
4709,
353,
13248,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-... |
dir_items.sort(_sortfunc('name')) | dir_items.sort(_sortfunc(sorttype)) | def _sortfunc(m): return lambda l, o: cmp(l.sort(m).lower(), o.sort(m).lower()) | d7cd1c8d0445ff033006d83e249878a76f0c303a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11399/d7cd1c8d0445ff033006d83e249878a76f0c303a/directory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3804,
644,
12,
81,
4672,
327,
3195,
328,
16,
320,
30,
9411,
12,
80,
18,
3804,
12,
81,
2934,
8167,
9334,
320,
18,
3804,
12,
81,
2934,
8167,
10756,
2,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3804,
644,
12,
81,
4672,
327,
3195,
328,
16,
320,
30,
9411,
12,
80,
18,
3804,
12,
81,
2934,
8167,
9334,
320,
18,
3804,
12,
81,
2934,
8167,
10756,
2,
-100,
-100,
-100,
-100,
-100... |
self._queue_sync(rendering=True) | def _scroll(self, x, y): """ Callback from the animation """ if x: self._x0 -= x for child in self.children: child.x += x if y: self._y0 -= y for child in self.children: child.y += y self._check_items() self._queue_sync(rendering=True) | b47bb145b9afab8cd03f9ba37d4dcd175be8f666 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11702/b47bb145b9afab8cd03f9ba37d4dcd175be8f666/grid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12033,
12,
2890,
16,
619,
16,
677,
4672,
3536,
8444,
628,
326,
8794,
3536,
309,
619,
30,
365,
6315,
92,
20,
3947,
619,
364,
1151,
316,
365,
18,
5906,
30,
1151,
18,
92,
1011,
619... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12033,
12,
2890,
16,
619,
16,
677,
4672,
3536,
8444,
628,
326,
8794,
3536,
309,
619,
30,
365,
6315,
92,
20,
3947,
619,
364,
1151,
316,
365,
18,
5906,
30,
1151,
18,
92,
1011,
619... | |
rlib_init = _librlib.rlib_init | rlib_init = _rlib.rlib_init | def _swig_getattr(self,class_type,name): method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError,name | 5896c3671984e1a35bf6763e59a746d9ce345f8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6831/5896c3671984e1a35bf6763e59a746d9ce345f8b/librlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5328,
360,
67,
588,
1747,
12,
2890,
16,
1106,
67,
723,
16,
529,
4672,
707,
273,
667,
67,
723,
16186,
5328,
360,
67,
588,
5163,
25648,
588,
12,
529,
16,
7036,
13,
309,
707,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5328,
360,
67,
588,
1747,
12,
2890,
16,
1106,
67,
723,
16,
529,
4672,
707,
273,
667,
67,
723,
16186,
5328,
360,
67,
588,
5163,
25648,
588,
12,
529,
16,
7036,
13,
309,
707,
30,
... |
s = decode_header(s.replace('\r', '')) return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s or [])) | if text: text = decode_header(text.replace('\r', '')) return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), text or [])) | def _decode_header(self, s): from email.Header import decode_header s = decode_header(s.replace('\r', '')) return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s or [])) | 58e9a51264038e97e4ac99a3a64ac10d68e4c26a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/58e9a51264038e97e4ac99a3a64ac10d68e4c26a/openerp_mailgate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3922,
67,
3374,
12,
2890,
16,
272,
4672,
628,
2699,
18,
1864,
1930,
2495,
67,
3374,
272,
273,
2495,
67,
3374,
12,
87,
18,
2079,
2668,
64,
86,
2187,
875,
3719,
327,
875,
18,
5701... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3922,
67,
3374,
12,
2890,
16,
272,
4672,
628,
2699,
18,
1864,
1930,
2495,
67,
3374,
272,
273,
2495,
67,
3374,
12,
87,
18,
2079,
2668,
64,
86,
2187,
875,
3719,
327,
875,
18,
5701... |
elif len(sample) and type(sample[0]) is StringType: | elif len(sample) and isinstance(sample[0], basestring): | def Vocabulary(self, content_instance=None): """ Returns a DisplayList. | 6bf0b4d803f7a6c42f16af81053d806d99f67096 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12165/6bf0b4d803f7a6c42f16af81053d806d99f67096/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
776,
23348,
12,
2890,
16,
913,
67,
1336,
33,
7036,
4672,
3536,
2860,
279,
9311,
682,
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,
... | [
1,
1,
1,
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,
776,
23348,
12,
2890,
16,
913,
67,
1336,
33,
7036,
4672,
3536,
2860,
279,
9311,
682,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if lineno is not None: parts.append("%d:"%lineno) if offset is not None: parts.append("%d:"%offset) prefix = "".join(parts) | def _print_error(msg, lineno=None, offset=None, fname=None): """Emit error messages to stderr.""" parts = [] if fname is not None: parts.append("%s:"%fname) if lineno is not None: parts.append("%d:"%lineno) if offset is not None: parts.append("%d:"%offset) prefix = "".join(parts) else: prefix = "error:" if prefix: prefix = prefix+" " print >>sys.stderr, prefix+str(msg) | a99d361cbe005b170b9ffdee4750838f22cefcb5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11302/a99d361cbe005b170b9ffdee4750838f22cefcb5/grammar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1188,
67,
1636,
12,
3576,
16,
7586,
33,
7036,
16,
1384,
33,
7036,
16,
5299,
33,
7036,
4672,
3536,
17982,
555,
2743,
358,
4514,
12123,
2140,
273,
5378,
309,
5299,
353,
486,
599,
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,
389,
1188,
67,
1636,
12,
3576,
16,
7586,
33,
7036,
16,
1384,
33,
7036,
16,
5299,
33,
7036,
4672,
3536,
17982,
555,
2743,
358,
4514,
12123,
2140,
273,
5378,
309,
5299,
353,
486,
599,
30... | |
class SDBPersistenceError(Exception): | class SDBPersistenceError(StandardError): | def __str__(self): return 'S3Error: %s' % self.reason | f408146ce65bb7e2f0f3ac7f0b19dd6a04a8963e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1098/f408146ce65bb7e2f0f3ac7f0b19dd6a04a8963e/exception.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
296,
55,
23,
668,
30,
738,
87,
11,
738,
365,
18,
10579,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
701,
972,
12,
2890,
4672,
327,
296,
55,
23,
668,
30,
738,
87,
11,
738,
365,
18,
10579,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
setupCommand += "tar -zxf %s\n" % os.path.basename(tarballLocation) | setupCommand += "tar -xzf %s\n" % os.path.basename(tarballLocation) | def sherpa(): """ Generator dependent from here This part will only set up the sherpa libs, the actual event generation will be done in the following cmsRun step """ # First line in the config file is the generator name # Second line is the process name # Third line is the tarball name incl version of madgraph file = open(cfgFile, 'r') generatorLine = file.readline() # Not used nameLabel = file.readline().strip() tarballName = file.readline().strip() # // # // Build tarball location within release structure #// if os.environ.get("CMS_PATH", None) == None: msg = "Error: CMS_PATH variable not set" raise RuntimeError, msg if os.environ.get("SCRAM_ARCH", None) == None: msg = "Error: SCRAM_ARCH variable not set" raise RuntimeError, msg tarballLocation = "%s/%s/generatorData/" % (os.environ['CMS_PATH'], os.environ['SCRAM_ARCH']) tarballLocation += "sherpa/" tarballLocation += "%s/" % nameLabel tarballLocation += "%s" % tarballName if not os.path.exists(tarballLocation): msg = "Error: Sherpa Tarball Location not found:\n" msg += tarballLocation msg += "\nDoes not exist" raise RuntimeError(msg) # // # // unpack the tarball #// setupCommand = "/bin/cp %s . \n" % tarballLocation setupCommand += "tar -zxf %s\n" % os.path.basename(tarballLocation) os.system(setupCommand) # // # // link everything so that the cmsRun finds the Sherpa libs #// try: msg = "cd ../cmsRun1; ln -s ../cmsGen1/SherpaRun .;" os.system(msg) except Exception, ex: return 5 return 0 | e2ef955b10c2ec9abac57a8f34b6fc7284ca0ac6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8886/e2ef955b10c2ec9abac57a8f34b6fc7284ca0ac6/cmsGen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
699,
264,
8774,
13332,
3536,
10159,
10460,
628,
2674,
1220,
1087,
903,
1338,
444,
731,
326,
699,
264,
8774,
15042,
16,
326,
3214,
871,
9377,
903,
506,
2731,
316,
326,
3751,
6166,
1997,
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,
699,
264,
8774,
13332,
3536,
10159,
10460,
628,
2674,
1220,
1087,
903,
1338,
444,
731,
326,
699,
264,
8774,
15042,
16,
326,
3214,
871,
9377,
903,
506,
2731,
316,
326,
3751,
6166,
1997,
2... |
check_sensors(ff,defaults) | check_sensors(kat,defaults) | def reset_defaults(ff,defaults): # reset system to default setting as specified by commands above for i in range(len(defaults)): eval(defaults[i][2]) return | eb7c0bb714dcc58391b3db3d8e9b991585e4db9c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5243/eb7c0bb714dcc58391b3db3d8e9b991585e4db9c/check_defaults.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
67,
7606,
12,
1403,
16,
7606,
4672,
468,
2715,
2619,
358,
805,
3637,
487,
1269,
635,
4364,
5721,
364,
277,
316,
1048,
12,
1897,
12,
7606,
3719,
30,
5302,
12,
7606,
63,
77,
6362,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
67,
7606,
12,
1403,
16,
7606,
4672,
468,
2715,
2619,
358,
805,
3637,
487,
1269,
635,
4364,
5721,
364,
277,
316,
1048,
12,
1897,
12,
7606,
3719,
30,
5302,
12,
7606,
63,
77,
6362,
... |
if (optlevel==2): cmd = cmd + ' -DNDEBUG ' if (optlevel==3): cmd = cmd + ' -DNDEBUG ' | if (optlevel==2): cmd = cmd + ' ' if (optlevel==3): cmd = cmd + ' ' | def CompileIgate(ipath,opts,outd,obj,src,module,library,files): outc = obj[:-4]+".cxx" wobj = FindLocation(obj, ipath) woutd = FindLocation(outd, ipath) woutc = "built/tmp/"+outc xipath = ipath + ["built/include"] if (OMIT.count("PYTHON")): WriteFile(woutc,"") WriteFile(woutd,"") CompileCxx(obj,outc,ipath,opts) return if (COMPILER=="MSVC"): cmd = "built/bin/interrogate -srcdir "+src+" -I"+src cmd = cmd + ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -longlong __int64 -D_X86_ -DWIN32_VC -D_WIN32' cmd = cmd + ' -D"_declspec(param)=" -D_near -D_far -D__near -D__far -D__stdcall' optlevel=getoptlevel(opts,OPTIMIZE) if (optlevel==1): cmd = cmd + ' ' if (optlevel==2): cmd = cmd + ' -DNDEBUG ' if (optlevel==3): cmd = cmd + ' -DNDEBUG -DFORCE_INLINING' if (optlevel==4): cmd = cmd + ' -DNDEBUG -DFORCE_INLINING' cmd = cmd + ' -oc ' + woutc + ' -od ' + woutd cmd = cmd + ' -fnames -string -refcount -assert -python-native' cmd = cmd + ' -Sbuilt/include/parser-inc' for x in xipath: cmd = cmd + ' -I' + x cmd = cmd + ' -Sthirdparty/win-python/include' for ver in DXVERSIONS: if ((COMPILER=="MSVC") and PkgSelected(opts,"DX"+ver)): cmd = cmd + ' -S"' + DIRECTXSDK["DX"+ver] + '/include"' for ver in MAYAVERSIONS: if ((COMPILER=="MSVC") and PkgSelected(opts,"MAYA"+ver)): cmd = cmd + ' -S"' + MAYASDK["MAYA"+ver] + '/include"' for pkg in PACKAGES: if (PkgSelected(opts,pkg)): cmd = cmd + " -S" + THIRDPARTYLIBS + pkg.lower() + "/include" building = getbuilding(opts) if (building): cmd = cmd + " -DBUILDING_"+building if (opts.count("WITHINPANDA")): cmd = cmd + " -DWITHIN_PANDA" cmd = cmd + ' -module ' + module + ' -library ' + library for x in files: cmd = cmd + ' ' + x oscmd(cmd) CompileCxx(obj,outc,ipath,opts) return if (COMPILER=="LINUX"): cmd = 'built/bin/interrogate -srcdir '+src cmd = cmd + ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__i386__ -D__const=const' optlevel = getoptlevel(opts,OPTIMIZE) if (optlevel==1): cmd = cmd + ' ' if (optlevel==2): cmd = cmd + ' -DNDEBUG ' if (optlevel==3): cmd = cmd + ' -DNDEBUG ' if (optlevel==4): cmd = cmd + ' -DNDEBUG ' cmd = cmd + ' -oc ' + woutc + ' -od ' + woutd cmd = cmd + ' -fnames -string -refcount -assert -python-native' cmd = cmd + ' -Sbuilt/include/parser-inc' for x in xipath: cmd = cmd + ' -I' + x cmd = cmd + ' -S'+PYTHONSDK for pkg in PACKAGES: if (PkgSelected(opts,pkg)): cmd = cmd + " -S" + THIRDPARTYLIBS + pkg.lower() + "/include" cmd = cmd + ' -S/usr/include' building = getbuilding(opts) if (building): cmd = cmd + " -DBUILDING_"+building if (opts.count("WITHINPANDA")): cmd = cmd + " -DWITHIN_PANDA" cmd = cmd + ' -module ' + module + ' -library ' + library for ver in MAYAVERSIONS: if (PkgSelected(opts, "MAYA"+ver)): cmd = cmd + ' -I"' + MAYASDK["MAYA"+ver] + '/include"' for x in files: cmd = cmd + ' ' + x oscmd(cmd) CompileCxx(obj,outc,ipath,opts) return | 87fdb3df0eedd48a6fbac50a9099c721e03d9e17 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8543/87fdb3df0eedd48a6fbac50a9099c721e03d9e17/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16143,
45,
10115,
12,
625,
421,
16,
4952,
16,
659,
72,
16,
2603,
16,
4816,
16,
2978,
16,
12083,
16,
2354,
4672,
596,
71,
273,
1081,
10531,
17,
24,
3737,
9654,
71,
5279,
6,
341,
2603,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16143,
45,
10115,
12,
625,
421,
16,
4952,
16,
659,
72,
16,
2603,
16,
4816,
16,
2978,
16,
12083,
16,
2354,
4672,
596,
71,
273,
1081,
10531,
17,
24,
3737,
9654,
71,
5279,
6,
341,
2603,... |
def set(self, key, val, coded_val, LegalChars=_LegalChars, idmap=_idmap): | def set(self, key, val, coded_val, LegalChars=_LegalChars): | def set(self, key, val, coded_val, LegalChars=_LegalChars, idmap=_idmap): # First we verify that the key isn't a reserved word # Second we make sure it only contains legal characters if key.lower() in self._reserved: raise CookieError("Attempt to set a reserved key: %s" % key) if "" != key.translate(idmap, LegalChars): raise CookieError("Illegal key value: %s" % key) | 26547c170d08aef825a140b86868c82fbab44447 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/26547c170d08aef825a140b86868c82fbab44447/Cookie.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
498,
16,
1244,
16,
29512,
67,
1125,
16,
17167,
287,
7803,
33,
67,
30697,
7803,
4672,
468,
5783,
732,
3929,
716,
326,
498,
5177,
1404,
279,
8735,
2076,
468,
7631,
732... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
498,
16,
1244,
16,
29512,
67,
1125,
16,
17167,
287,
7803,
33,
67,
30697,
7803,
4672,
468,
5783,
732,
3929,
716,
326,
498,
5177,
1404,
279,
8735,
2076,
468,
7631,
732... |
rasterize_2 | rasterize_2, rasterize_3, | def rasterize_2(): try: x = gdal.RasterizeLayer gdaltest.have_ng = 1 except: gdaltest.have_ng = 0 return 'skip' # Setup working spatial reference sr_wkt = 'LOCAL_CS["arbitrary"]' sr = osr.SpatialReference( sr_wkt ) # Create a memory raster to rasterize into. target_ds = gdal.GetDriverByName('MEM').Create( '', 12, 12, 3, gdal.GDT_Byte ) target_ds.SetGeoTransform( (0,1,0,12,0,-1) ) target_ds.SetProjection( sr_wkt ) # Create a memory layer to rasterize from. cutline_ds = ogr.Open( 'data/cutline.csv' ) # Run the algorithm. gdal.PushErrorHandler( 'CPLQuietErrorHandler' ) err = gdal.RasterizeLayer( target_ds, [3,2,1], cutline_ds.GetLayer(0), burn_values = [200,220,240], options = ["ALL_TOUCHED=TRUE"] ) gdal.PopErrorHandler() if err != 0: print(err) gdaltest.post_reason( 'got non-zero result code from RasterizeLayer' ) return 'fail' # Check results. expected = 121 checksum = target_ds.GetRasterBand(2).Checksum() if checksum != expected: print(checksum) gdaltest.post_reason( 'Did not get expected image checksum' ) gdal.GetDriverByName('GTiff').CreateCopy('tmp/rasterize_2.tif',target_ds) return 'fail' return 'success' | 7bfc91681c6685a5fb2ef11cbf6b3df6458fab07 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10290/7bfc91681c6685a5fb2ef11cbf6b3df6458fab07/rasterize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12553,
554,
67,
22,
13332,
225,
775,
30,
619,
273,
15551,
287,
18,
18637,
554,
4576,
15551,
2390,
395,
18,
21516,
67,
3368,
273,
404,
1335,
30,
15551,
2390,
395,
18,
21516,
67,
3368,
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,
12553,
554,
67,
22,
13332,
225,
775,
30,
619,
273,
15551,
287,
18,
18637,
554,
4576,
15551,
2390,
395,
18,
21516,
67,
3368,
273,
404,
1335,
30,
15551,
2390,
395,
18,
21516,
67,
3368,
2... |
stripe = Rect(x, self.y, r[j+1]-x, self.height) | stripe = Rect(x, self.y, r[j+1]-x, h) | def makeInnerTiles(self): # inner grid lines group = Group() | a87866dcf17fbe0fcc8a157d42b359bc80a48ab3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/a87866dcf17fbe0fcc8a157d42b359bc80a48ab3/grids.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
2857,
27669,
12,
2890,
4672,
468,
3443,
3068,
2362,
1041,
273,
3756,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
2857,
27669,
12,
2890,
4672,
468,
3443,
3068,
2362,
1041,
273,
3756,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
settingsList = ["alignType", "contType", "histogram", "histogram_size", "confidence_percent", "sort_type"] | settingsList = ["alignType", "contType", "histogram", "histogram_size", "confidence_check", "confidence_percent", "sort_type"] | def avg(l): return sum(l)/len(l) | 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,
11152,
12,
80,
4672,
327,
2142,
12,
80,
13176,
1897,
12,
80,
13,
282,
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,
11152,
12,
80,
4672,
327,
2142,
12,
80,
13176,
1897,
12,
80,
13,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
log.FatalError("Error '%s' reading mapping file '%s'" % | Log.FatalError("Error '%s' reading mapping file '%s'" % | def get_string_from_file(filename): if not filename: return None rp = rpath.RPath(Globals.local_connection, filename) try: return rp.get_data() except OSError, e: log.FatalError("Error '%s' reading mapping file '%s'" % (str(e), filename)) | 2798d44530db340111ff64c9375163c31f84aab0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8033/2798d44530db340111ff64c9375163c31f84aab0/Main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1080,
67,
2080,
67,
768,
12,
3459,
4672,
309,
486,
1544,
30,
327,
599,
8715,
273,
436,
803,
18,
54,
743,
12,
19834,
18,
3729,
67,
4071,
16,
1544,
13,
775,
30,
327,
8715,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1080,
67,
2080,
67,
768,
12,
3459,
4672,
309,
486,
1544,
30,
327,
599,
8715,
273,
436,
803,
18,
54,
743,
12,
19834,
18,
3729,
67,
4071,
16,
1544,
13,
775,
30,
327,
8715,
1... |
from distributed import test_env | def test_instantiate_remote_type(self): skip("Land of infinite recursion") from distributed import test_env | 8d20c0f3cb3d2b3a30e9602aaf3f412e8bf4404b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/8d20c0f3cb3d2b3a30e9602aaf3f412e8bf4404b/test_distributed.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
24628,
3840,
67,
7222,
67,
723,
12,
2890,
4672,
2488,
2932,
29398,
434,
14853,
13917,
7923,
628,
16859,
1930,
1842,
67,
3074,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
24628,
3840,
67,
7222,
67,
723,
12,
2890,
4672,
2488,
2932,
29398,
434,
14853,
13917,
7923,
628,
16859,
1930,
1842,
67,
3074,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
".:: <%s> Exit <%s> Rewind <%s> Save <%s> Pastebin ::." % (OPTS.exit_key, OPTS.undo_key, OPTS.save_key, OPTS.pastebin_key), | ".:: <%s> Exit <%s> Rewind <%s> Save <%s> Pastebin ::." % (OPTS.exit_key, OPTS.undo_key, OPTS.save_key, OPTS.pastebin_key), | def init_wins(scr, cols): """Initialise the two windows (the main repl interface and the little status bar at the bottom with some stuff in it)""" | d663900587bb11f566d5ca9141028502a8ee52ef /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6932/d663900587bb11f566d5ca9141028502a8ee52ef/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
91,
2679,
12,
24638,
16,
5347,
4672,
3536,
4435,
784,
326,
2795,
9965,
261,
5787,
2774,
6831,
1560,
471,
326,
12720,
1267,
4653,
622,
326,
5469,
598,
2690,
10769,
316,
518,
155... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1208,
67,
91,
2679,
12,
24638,
16,
5347,
4672,
3536,
4435,
784,
326,
2795,
9965,
261,
5787,
2774,
6831,
1560,
471,
326,
12720,
1267,
4653,
622,
326,
5469,
598,
2690,
10769,
316,
518,
155... |
use_debugger = True if use_profiler and use_debugger: fatal("can't use both profiler and debugger") is_running_suid = os.getuid() != os.geteuid() if is_running_suid and use_debugger: fatal("won't allow debugger while running suid") | commands.use_debugger = True | def main(): if "--version" in sys.argv: print version.get_version() sys.exit(0) install_path = os.path.dirname(__file__) if PATH_LIBEXEC: os.environ['PATH'] = os.path.join(install_path, PATH_LIBEXEC) + ":" + \ os.environ['PATH'] pylib_path = os.path.join(install_path, PATH_LIB) sys.path.insert(0, pylib_path) commands = Commands(pylib_path) use_profiler = False use_debugger = False if len(commands) > 1: av0 = get_av0() # project-name? (symbolic link) try: name = av0[av0.index('-') + 1:] args = sys.argv[1:] except ValueError: try: opts, args = getopt.getopt(sys.argv[1:], 'pdh') except getopt.GetoptError, e: commands.usage(e) for opt, val in opts: if opt == '-h': commands.usage() if opt == '-p': use_profiler = True elif opt == '-d': use_debugger = True if use_profiler and use_debugger: fatal("can't use both profiler and debugger") is_running_suid = os.getuid() != os.geteuid() if is_running_suid and use_debugger: fatal("won't allow debugger while running suid") if not args: commands.usage() name = args[0] args = args[1:] if not commands.exists(name): commands.usage("no such name '%s'" % name) else: name = commands.get_names()[0] args = sys.argv[1:] if use_debugger: commands.debug(name, args) elif use_profiler: commands.profile(name, args) else: commands.run(name, args) | d5f6a54c77ddc0dfcda833eb0969d89d518e16dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5274/d5f6a54c77ddc0dfcda833eb0969d89d518e16dc/wrapper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
309,
5238,
1589,
6,
316,
2589,
18,
19485,
30,
1172,
1177,
18,
588,
67,
1589,
1435,
2589,
18,
8593,
12,
20,
13,
225,
3799,
67,
803,
273,
1140,
18,
803,
18,
12287,
12,
972... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
309,
5238,
1589,
6,
316,
2589,
18,
19485,
30,
1172,
1177,
18,
588,
67,
1589,
1435,
2589,
18,
8593,
12,
20,
13,
225,
3799,
67,
803,
273,
1140,
18,
803,
18,
12287,
12,
972... |
def list_insert__List_Int_ANY(space, w_list, w_where, w_any): _ins1(w_list, w_where.intval, w_any) | def list_insert__List_ANY_ANY(space, w_list, w_where, w_any): _ins1(w_list, space.int_w(w_where), w_any) | def list_insert__List_Int_ANY(space, w_list, w_where, w_any): _ins1(w_list, w_where.intval, w_any) return space.w_None | d2ef39d723741c0a16fa5768572dd71c8e84a3c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/d2ef39d723741c0a16fa5768572dd71c8e84a3c2/listobject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
67,
6387,
972,
682,
67,
15409,
67,
15409,
12,
2981,
16,
341,
67,
1098,
16,
341,
67,
6051,
16,
341,
67,
2273,
4672,
389,
2679,
21,
12,
91,
67,
1098,
16,
3476,
18,
474,
67,
91,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
67,
6387,
972,
682,
67,
15409,
67,
15409,
12,
2981,
16,
341,
67,
1098,
16,
341,
67,
6051,
16,
341,
67,
2273,
4672,
389,
2679,
21,
12,
91,
67,
1098,
16,
3476,
18,
474,
67,
91,
... |
def get_mmp_parms(self): '''Return a list of all the Gamess jig parms (and their values) to be stored in the MMP file. | def get_mmp_parms(self, canonical = False): '''Return a list of pairs (parmname, str(parmvalue)) of all the Gamess jig parms (and str() of their values) to be stored in the MMP file, sorted by parm name. If option canonical = True, canonicalize the values for comparison (i.e. use "False" and "True" rather than "0" and "1", for all booleans). WARNING: This option is only reviewed for correctness in the instance of this class stored in the .ui attribute of its gamesParms object. | def get_mmp_parms(self): '''Return a list of all the Gamess jig parms (and their values) to be stored in the MMP file. ''' items = [] for p in self.parms: | cb18fd8e13b495ff2f5fc622ff2570903aeaa260 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/cb18fd8e13b495ff2f5fc622ff2570903aeaa260/jig_Gamess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
81,
1291,
67,
29927,
12,
2890,
16,
7378,
273,
1083,
4672,
9163,
990,
279,
666,
434,
5574,
261,
1065,
81,
529,
16,
609,
12,
1065,
81,
1132,
3719,
434,
777,
326,
611,
301,
403... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
81,
1291,
67,
29927,
12,
2890,
16,
7378,
273,
1083,
4672,
9163,
990,
279,
666,
434,
5574,
261,
1065,
81,
529,
16,
609,
12,
1065,
81,
1132,
3719,
434,
777,
326,
611,
301,
403... |
name = str(textbox.entry_get()).replace("<br>","") | name = unicode(textbox.entry_get()).replace("<br>","").encode("utf-8") | def run(self, parent, number, name, contact, mode, layout, *args, **kargs): try: self.edje_file = os.path.join(os.path.dirname(__file__), 'people.edj') number_layout = 0 text_layout = 0 send = 0 if contact != None: name = str(contact.name) number = str(contact.tel) layout.elm_obj.hide() if number == "": full = True else: full = False while True: if full or mode == "number": parent.window.elm_obj.keyboard_mode_set(gui.ecore.x.ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) if number_layout == 0: number_layout = gui.elm_layout(parent.window, self.edje_file, "edit_number") edje_obj = number_layout.elm_obj.edje_get() edje_obj.part_text_set('num_field-text', number) number_layout.elm_obj.show() parent.main_layout.elm_obj.hide() else: number_layout.elm_obj.show() parent.bg.elm_obj.content_set("content-swallow", number_layout.elm_obj) i, args = yield tichy.WaitFirst(Wait(number_layout, 'back'), Wait(number_layout, 'next')) if i == 0: #back print "breaking" break if i == 1: #next number_layout.elm_obj.hide() number = edje_obj.part_text_get('num_field-text') if mode == "number": send = 1 break if mode != "number": parent.window.elm_obj.keyboard_mode_set(gui.ecore.x.ECORE_X_VIRTUAL_KEYBOARD_STATE_ON) if text_layout == 0: text_layout = gui.elm_layout(parent.window, self.edje_file, "CreateContact") edje_obj = text_layout.elm_obj.edje_get() text_layout.elm_obj.show() parent.main_layout.elm_obj.hide() textbox = gui.elementary.Entry(parent.window.elm_obj) textbox.single_line_set(True) textbox.color_set(255, 255, 255, 255) textbox.entry_set(name) textbox.size_hint_weight_set(1.0, 1.0) text_layout.elm_obj.content_set('entry', textbox) textbox.editable_set(True) else: text_layout.elm_obj.show() parent.bg.elm_obj.content_set("content-swallow", text_layout.elm_obj) textbox.focus() textbox.show() i, args = yield tichy.WaitFirst(Wait(text_layout, 'back'), Wait(text_layout, 'save')) if i == 0: #back if full: text_layout.elm_obj.hide() parent.window.elm_obj.keyboard_mode_set(gui.ecore.x.ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) continue else: break if i == 1: #save send = 1 break if send == 1: if text_layout: text_layout.elm_obj.edje_get().signal_emit("save-notice","*") contacts_service = tichy.Service.get('Contacts') if contact not in contacts_service.contacts: name = str(textbox.entry_get()).replace("<br>","") new_contact = contacts_service.create(name.strip(),tel=str(number)) contacts_service.add(new_contact) contacts_service.contacts.emit('inserted') else: if mode == "name": name = str(textbox.entry_get()).replace("<br>","") logger.info("updating name") contact.name = name.strip() elif mode == "number": logger.info("updating number") contact.tel = number layout.elm_obj.show() parent.window.elm_obj.keyboard_mode_set(gui.ecore.x.ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) if number_layout: number_layout.delete() if text_layout: text_layout.delete() parent.restore_orig() ret = "done" yield ret except Exception, e: print e print Exception | 448d5369795a6c080c62278ce9c08dfe9aa87b45 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4712/448d5369795a6c080c62278ce9c08dfe9aa87b45/people2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
982,
16,
1300,
16,
508,
16,
5388,
16,
1965,
16,
3511,
16,
380,
1968,
16,
2826,
79,
1968,
4672,
775,
30,
365,
18,
329,
78,
73,
67,
768,
273,
1140,
18,
803,
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,
1086,
12,
2890,
16,
982,
16,
1300,
16,
508,
16,
5388,
16,
1965,
16,
3511,
16,
380,
1968,
16,
2826,
79,
1968,
4672,
775,
30,
365,
18,
329,
78,
73,
67,
768,
273,
1140,
18,
803,
18,
... |
if s[0] in ('-', '+'): | if s[:1] in ('-', '+'): | def zfill(x, width): """zfill(x, width) -> string Pad a numeric string x with zeros on the left, to fill a field of the specified width. The string x is never truncated. """ if type(x) == type(''): s = x else: s = `x` n = len(s) if n >= width: return s sign = '' if s[0] in ('-', '+'): sign, s = s[0], s[1:] return sign + '0'*(width-n) + s | c9bd845ea6af67fca6027db65a3b5e44322d616c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c9bd845ea6af67fca6027db65a3b5e44322d616c/string.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
998,
5935,
12,
92,
16,
1835,
4672,
3536,
94,
5935,
12,
92,
16,
1835,
13,
317,
533,
225,
30961,
279,
6389,
533,
619,
598,
4922,
603,
326,
2002,
16,
358,
3636,
279,
652,
434,
326,
1269... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
998,
5935,
12,
92,
16,
1835,
4672,
3536,
94,
5935,
12,
92,
16,
1835,
13,
317,
533,
225,
30961,
279,
6389,
533,
619,
598,
4922,
603,
326,
2002,
16,
358,
3636,
279,
652,
434,
326,
1269... |
base_command = ("/usr/bin/ssh -a -x %s -o StrictHostKeyChecking=no " | base_command = ("/usr/bin/ssh -a -q -x %s -o StrictHostKeyChecking=no " | def make_ssh_command(user="root", port=22, opts='', connect_timeout=30, alive_interval=300): base_command = ("/usr/bin/ssh -a -x %s -o StrictHostKeyChecking=no " "-o UserKnownHostsFile=/dev/null -o BatchMode=yes " "-o ConnectTimeout=%d -o ServerAliveInterval=%d " "-l %s -p %d") assert isinstance(connect_timeout, (int, long)) assert connect_timeout > 0 # can't disable the timeout return base_command % (opts, connect_timeout, alive_interval, user, port) | 6e48d0d03eed41fb733b88ca78f13e5197c8b7e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12268/6e48d0d03eed41fb733b88ca78f13e5197c8b7e5/abstract_ssh.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
10975,
67,
3076,
12,
1355,
1546,
3085,
3113,
1756,
33,
3787,
16,
1500,
2218,
2187,
3077,
67,
4538,
33,
5082,
16,
13714,
67,
6624,
33,
19249,
4672,
1026,
67,
3076,
273,
7566,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
10975,
67,
3076,
12,
1355,
1546,
3085,
3113,
1756,
33,
3787,
16,
1500,
2218,
2187,
3077,
67,
4538,
33,
5082,
16,
13714,
67,
6624,
33,
19249,
4672,
1026,
67,
3076,
273,
7566,
... |
if request['PATH_INFO'][-1] != '/': | pathinfo=request.get('PATH_INFO','') if pathinfo and pathinfo[-1] != '/': | def dav__init(self, request, response): # By the spec, we are not supposed to accept /foo for a # collection, we are supposed to redirect to /foo/. if request['PATH_INFO'][-1] != '/': raise 'Moved Permanently', request['URL1']+'/' response.setHeader('Connection', 'close', 1) response.setHeader('Date', rfc1123_date(), 1) response.setHeader('DAV', '1', 1) | bc5caa9f9e0632ba9f1c5aa408090542ed2eb817 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/bc5caa9f9e0632ba9f1c5aa408090542ed2eb817/Collection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
842,
972,
2738,
12,
2890,
16,
590,
16,
766,
4672,
468,
2525,
326,
857,
16,
732,
854,
486,
18405,
358,
2791,
342,
11351,
364,
279,
468,
1849,
16,
732,
854,
18405,
358,
3136,
358,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
842,
972,
2738,
12,
2890,
16,
590,
16,
766,
4672,
468,
2525,
326,
857,
16,
732,
854,
486,
18405,
358,
2791,
342,
11351,
364,
279,
468,
1849,
16,
732,
854,
18405,
358,
3136,
358,
... |
notification = self._channel.wait() | try: notification = self._channel.wait() except MediaStreamDidFailError: continue | def end(self): if self.greenlet is not None: api.kill(self.greenlet, api.GreenletExit()) self.greenlet = api.getcurrent() notification_center = NotificationCenter() if self._invitation is None or self._invitation.state in (None, 'disconnecting', 'disconnected'): return self.state = 'terminating' if self._invitation.state == 'connected': notification_center.post_notification('SIPSessionWillEnd', self, TimestampedNotificationData(originator='local')) streams = (self.streams or []) + (self.proposed_streams or []) for stream in list(streams): try: notification_center.remove_observer(self, sender=stream) except KeyError: streams.remove(stream) else: stream.deactivate() cancelling = self._invitation.state != 'connected' try: self._invitation.end(timeout=1) while True: notification = self._channel.wait() if notification.name == 'SIPInvitationChangedState' and notification.data.state == 'disconnected': if cancelling: notification_center.post_notification('SIPSessionDidProcessTransaction', self, TimestampedNotificationData(originator='local', method='INVITE', code=notification.data.code, reason=notification.data.reason)) elif hasattr(notification.data, 'method'): notification_center.post_notification('SIPSessionDidProcessTransaction', self, TimestampedNotificationData(originator='remote', method=notification.data.method, code=200, reason=sip_status_messages[200])) elif notification.data.disconnect_reason == 'user request': notification_center.post_notification('SIPSessionDidProcessTransaction', self, TimestampedNotificationData(originator='local', method='BYE', code=notification.data.code, reason=notification.data.reason)) break except SIPCoreError, e: if cancelling: notification_center.post_notification('SIPSessionDidFail', self, TimestampedNotificationData(originator='local', code=0, reason=None, failure_reason='SIP core error: %s' % str(e), redirect_identities=None)) else: self.end_time = datetime.now() notification_center.post_notification('SIPSessionDidEnd', self, TimestampedNotificationData(originator='local', end_reason='SIP core error: %s' % str(e))) return finally: for stream in streams: stream.end() notification_center.remove_observer(self, sender=self._invitation) self.greenlet = None self.state = 'terminated' if cancelling: notification_center.post_notification('SIPSessionDidFail', self, TimestampedNotificationData(originator='local', code=487, reason='Session Canceled', failure_reason='user request', redirect_identities=None)) else: self.end_time = datetime.now() notification_center.post_notification('SIPSessionDidEnd', self, TimestampedNotificationData(originator='local', end_reason='user request')) | ba7e3deefc10586169fea3b8f1d34d734690a171 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5703/ba7e3deefc10586169fea3b8f1d34d734690a171/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
12,
2890,
4672,
309,
365,
18,
11571,
1810,
353,
486,
599,
30,
1536,
18,
16418,
12,
2890,
18,
11571,
1810,
16,
1536,
18,
21453,
1810,
6767,
10756,
365,
18,
11571,
1810,
273,
1536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
12,
2890,
4672,
309,
365,
18,
11571,
1810,
353,
486,
599,
30,
1536,
18,
16418,
12,
2890,
18,
11571,
1810,
16,
1536,
18,
21453,
1810,
6767,
10756,
365,
18,
11571,
1810,
273,
1536,
... |
flagd['interval']=interval | flagd['interval']=intvl | def getflagcmds(cmdlist, ms_startmjds, ms_endmjds): | 8dfba19976b74ca71681eb70f82bca2dcb101136 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/8dfba19976b74ca71681eb70f82bca2dcb101136/task_flagcmd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
6420,
24680,
12,
4172,
1098,
16,
4086,
67,
1937,
81,
78,
2377,
16,
4086,
67,
409,
81,
78,
2377,
4672,
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,
336,
6420,
24680,
12,
4172,
1098,
16,
4086,
67,
1937,
81,
78,
2377,
16,
4086,
67,
409,
81,
78,
2377,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup | Lookup or create an EmailAddress based on the supplied string. If a matching EmailAddress object is found in the repository, it is returned. If there is no match, then a new item is created and returned. There are two ways to call this method: 1) with something the user typed in nameOrAddressString, which will be parsed, and no fullName is needed 2) with an plain email address in the nameOrAddressString, and a full name in the fullName field If a match is found for both name and address then it will be used. If there is no name specified, a match on address will be returned. If there is no address specified, a match on name will be returned. If both name and address are specified, but there's no entry that matches both, then a new entry is created. @param nameOrAddressString: emailAddress string, or fullName for lookup, or both in the form "name <address>" | def getEmailAddress (cls, nameOrAddressString, fullName=''): """ Lookup or create an EmailAddress based on the supplied string. @param nameOrAddressString: emailAddress string, or fullName for lookup @type nameOrAddressString: C{String} @param fullName: explict fullName to use when a new item is created @type fullName: C{String} @return: C{EmailAddress} or None if not found, and nameOrAddressString is\ not a valid email address. """ import osaf.mail.message as message # avoid circularity | b49ad043cedb1bb6d12fe3f876acb791dd27643e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/b49ad043cedb1bb6d12fe3f876acb791dd27643e/Mail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17297,
1887,
261,
6429,
16,
26840,
1887,
780,
16,
12424,
2218,
11,
4672,
3536,
8834,
578,
752,
392,
8166,
1887,
2511,
603,
326,
4580,
533,
18,
971,
279,
3607,
8166,
1887,
733,
353,
1392,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17297,
1887,
261,
6429,
16,
26840,
1887,
780,
16,
12424,
2218,
11,
4672,
3536,
8834,
578,
752,
392,
8166,
1887,
2511,
603,
326,
4580,
533,
18,
971,
279,
3607,
8166,
1887,
733,
353,
1392,... |
ws = Workspace.objects.get(pk = ws_pk) | ws = DAMWorkspace.objects.get(pk = ws_pk) | def test_keywords(self): ws_pk = 1 params = {'workspace_id':ws_pk} params = self.get_final_parameters(params) response = self.client.get('/api/workspace/%s/get_keywords/'%ws_pk, params, ) resp_dict = json.loads(response.content) | 774c03fcc85d5555c72b71c04da9a7d1a510e957 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4589/774c03fcc85d5555c72b71c04da9a7d1a510e957/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
11771,
12,
2890,
4672,
225,
4945,
67,
5465,
273,
404,
859,
273,
13666,
14915,
67,
350,
4278,
4749,
67,
5465,
97,
859,
273,
365,
18,
588,
67,
6385,
67,
3977,
12,
2010,
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,
1,
1,
1,
1,
1,
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,
11771,
12,
2890,
4672,
225,
4945,
67,
5465,
273,
404,
859,
273,
13666,
14915,
67,
350,
4278,
4749,
67,
5465,
97,
859,
273,
365,
18,
588,
67,
6385,
67,
3977,
12,
2010,
13,
2... |
break; | break | def get(self): if not users.is_current_user_admin(): self.redirect(users.create_login_url(self.request.uri)) return query = Video.all() all_videos = query.fetch(100000) for video in all_videos: potential_id = video.title.replace(' ','-') potential_id = potential_id.replace('(','-') potential_id = potential_id.replace(')','-') potential_id = potential_id.replace('!','') potential_id = potential_id.replace('?','') potential_id = potential_id.replace(':','-') potential_id = potential_id.replace(',','') potential_id = potential_id.replace('/','-') potential_id = potential_id.replace('.','-') potential_id = potential_id.replace("'","") potential_id = potential_id.lower() number_to_add = 0 current_id = potential_id while True: query = Video.all() query.filter('readable_id=', current_id) if (query.get() is None): #id is unique so use it and break out video.readable_id = current_id video.put() break; else: # id is not unique so will have to go through loop again number_to_add+=1 current_id = potential_id+'-'+number_to_add | 4a4c83438b4577fa445eeb376430b1200939f13a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12010/4a4c83438b4577fa445eeb376430b1200939f13a/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
309,
486,
3677,
18,
291,
67,
2972,
67,
1355,
67,
3666,
13332,
365,
18,
7590,
12,
5577,
18,
2640,
67,
5819,
67,
718,
12,
2890,
18,
2293,
18,
1650,
3719,
327,
843,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
309,
486,
3677,
18,
291,
67,
2972,
67,
1355,
67,
3666,
13332,
365,
18,
7590,
12,
5577,
18,
2640,
67,
5819,
67,
718,
12,
2890,
18,
2293,
18,
1650,
3719,
327,
843,... |
if numpy.allclose(Tr1, 0.0) or type(Tr1)==complex: | if numpy.allclose(Tr1, 0.0) or type(Tr1)==numpy.complex_: | def calc_itls_center_of_reaction(iT, iL, iS, origin): """iT is a single float; iL[3,3]; iS[3] """ ## construct TLS tensors from isotropic TLS description T0 = numpy.array([[iT, 0.0, 0.0], [0.0, iT, 0.0], [0.0, 0.0, iT]], float) L0 = iL.copy() S0 = numpy.array([ [ 0.0, 0.0, iS[1]], [iS[0], 0.0, 0.0], [ 0.0, iS[2], 0.0] ], float) ## LSMALL is the smallest magnitude of L before it is considered 0.0 LSMALL = 0.5 * Constants.DEG2RAD2 rdict = {} rdict["T'"] = T0.copy() rdict["L'"] = L0.copy() rdict["S'"] = S0.copy() rdict["rT'"] = T0.copy() rdict["L1_eigen_val"] = 0.0 rdict["L2_eigen_val"] = 0.0 rdict["L3_eigen_val"] = 0.0 rdict["L1_rmsd"] = 0.0 rdict["L2_rmsd"] = 0.0 rdict["L3_rmsd"] = 0.0 rdict["L1_eigen_vec"] = numpy.zeros(3, float) rdict["L2_eigen_vec"] = numpy.zeros(3, float) rdict["L3_eigen_vec"] = numpy.zeros(3, float) rdict["RHO"] = numpy.zeros(3, float) rdict["COR"] = origin rdict["L1_rho"] = numpy.zeros(3, float) rdict["L2_rho"] = numpy.zeros(3, float) rdict["L3_rho"] = numpy.zeros(3, float) rdict["L1_pitch"] = 0.0 rdict["L2_pitch"] = 0.0 rdict["L3_pitch"] = 0.0 rdict["Tr1_eigen_val"] = 0.0 rdict["Tr2_eigen_val"] = 0.0 rdict["Tr3_eigen_val"] = 0.0 rdict["Tr1_rmsd"] = 0.0 rdict["Tr2_rmsd"] = 0.0 rdict["Tr3_rmsd"] = 0.0 ## set the L tensor eigenvalues and eigenvectors (L_evals, RL) = numpy.linalg.eigenvectors(L0) L1, L2, L3 = L_evals good_L_eigens = [] if numpy.allclose(L1, 0.0) or type(L1)==complex: L1 = 0.0 else: good_L_eigens.append(0) if numpy.allclose(L2, 0.0) or type(L2)==complex: L2 = 0.0 else: good_L_eigens.append(1) if numpy.allclose(L3, 0.0) or type(L3)==complex: L3 = 0.0 else: good_L_eigens.append(2) ## no good L eigen values if len(good_L_eigens)==0: Tr1, Tr2, Tr3 = numpy.linalg.eigenvalues(T0) if numpy.allclose(Tr1, 0.0) or type(Tr1)==complex: Tr1 = 0.0 if numpy.allclose(Tr2, 0.0) or type(Tr2)==complex: Tr2 = 0.0 if numpy.allclose(Tr3, 0.0) or type(Tr3)==complex: Tr3 = 0.0 rdict["Tr1_eigen_val"] = Tr1 rdict["Tr2_eigen_val"] = Tr2 rdict["Tr3_eigen_val"] = Tr3 rdict["Tr1_rmsd"] = calc_rmsd(Tr1) rdict["Tr2_rmsd"] = calc_rmsd(Tr2) rdict["Tr3_rmsd"] = calc_rmsd(Tr3) return rdict ## one good eigen value -- reconstruct RL about it elif len(good_L_eigens)==1: i = good_L_eigens[0] evec = RL[i] RZt = numpy.transpose(AtomMath.rmatrixz(evec)) xevec = numpy.matrixmultiply(RZt, numpy.array([1.0, 0.0, 0.0], float)) yevec = numpy.matrixmultiply(RZt, numpy.array([0.0, 1.0, 0.0], float)) if i==0: RL[1] = xevec RL[2] = yevec elif i==1: RL[0] = xevec RL[2] = yevec elif i==2: RL[0] = xevec RL[1] = yevec ## two good eigen values -- reconstruct RL about them elif len(good_L_eigens)==2: i = good_L_eigens[0] j = good_L_eigens[1] xevec = AtomMath.normalize(numpy.cross(RL[i], RL[j])) for k in range(3): if k==i: continue if k==j: continue RL[k] = xevec break rdict["L1_eigen_val"] = L1 rdict["L2_eigen_val"] = L2 rdict["L3_eigen_val"] = L3 rdict["L1_rmsd"] = calc_rmsd(L1) rdict["L2_rmsd"] = calc_rmsd(L2) rdict["L3_rmsd"] = calc_rmsd(L3) rdict["L1_eigen_vec"] = RL[0].copy() rdict["L2_eigen_vec"] = RL[1].copy() rdict["L3_eigen_vec"] = RL[2].copy() ## begin tensor transformations which depend upon ## the eigenvectors of L0 being well-determined ## make sure RLt is right-handed if numpy.allclose(numpy.linalg.determinant(RL), -1.0): I = numpy.identity(3, float) I[0,0] = -1.0 RL = numpy.matrixmultiply(I, RL) if not numpy.allclose(numpy.linalg.determinant(RL), 1.0): return rdict RLt = numpy.transpose(RL) ## carrot-L tensor (tensor WRT principal axes of L) cL = numpy.matrixmultiply(numpy.matrixmultiply(RL, L0), RLt) ## carrot-T tensor (T tensor WRT principal axes of L) cT = numpy.matrixmultiply(numpy.matrixmultiply(RL, T0), RLt) ## carrot-S tensor (S tensor WRT principal axes of L) cS = numpy.matrixmultiply(numpy.matrixmultiply(RL, S0), RLt) ## ^rho: the origin-shift vector in the coordinate system of L L23 = L2 + L3 L13 = L1 + L3 L12 = L1 + L2 ## shift for L1 if not numpy.allclose(L1, 0.0) and abs(L23)>LSMALL: crho1 = (cS[1,2] - cS[2,1]) / L23 else: crho1 = 0.0 if not numpy.allclose(L2, 0.0) and abs(L13)>LSMALL: crho2 = (cS[2,0] - cS[0,2]) / L13 else: crho2 = 0.0 if not numpy.allclose(L3, 0.0) and abs(L12)>LSMALL: crho3 = (cS[0,1] - cS[1,0]) / L12 else: crho3 = 0.0 crho = numpy.array([crho1, crho2, crho3], float) ## rho: the origin-shift vector in orthogonal coordinates rho = numpy.matrixmultiply(RLt, crho) rdict["RHO"] = rho rdict["COR"] = origin + rho ## set up the origin shift matrix PRHO WRT orthogonal axes PRHO = numpy.array([ [ 0.0, rho[2], -rho[1]], [-rho[2], 0.0, rho[0]], [ rho[1], -rho[0], 0.0] ], float) ## set up the origin shift matrix cPRHO WRT libration axes cPRHO = numpy.array([ [ 0.0, crho[2], -crho[1]], [-crho[2], 0.0, crho[0]], [ crho[1], -crho[0], 0.0] ], float) ## calculate tranpose of cPRHO, ans cS cSt = numpy.transpose(cS) cPRHOt = numpy.transpose(cPRHO) ## calculate S'^ = S^ + L^*pRHOt cSp = cS + numpy.matrixmultiply(cL, cPRHOt) ## calculate T'^ = cT + cPRHO*S^ + cSt*cPRHOt + cPRHO*cL*cPRHOt * cTp = cT + numpy.matrixmultiply(cPRHO, cS) + numpy.matrixmultiply(cSt, cPRHOt) + \ numpy.matrixmultiply(numpy.matrixmultiply(cPRHO, cL), cPRHOt) ## transpose of PRHO and S PRHOt = numpy.transpose(PRHO) St = numpy.transpose(S0) ## calculate S' = S + L*PRHOt Sp = S0 + numpy.matrixmultiply(L0, PRHOt) rdict["S'"] = Sp ## calculate T' = T + PRHO*S + St*PRHOT + PRHO*L*PRHOt Tp = T0 + numpy.matrixmultiply(PRHO, S0) + numpy.matrixmultiply(St, PRHOt) + \ numpy.matrixmultiply(numpy.matrixmultiply(PRHO, L0), PRHOt) rdict["T'"] = Tp ## now calculate the TLS motion description using 3 non ## intersecting screw axes, with one ## libration axis 1 shift in the L coordinate system ## you cannot determine axis shifts from the isotropic TLS parameters cL1rho = numpy.zeros(3, float) cL2rho = numpy.zeros(3, float) cL3rho = numpy.zeros(3, float) ## libration axes shifts in the origional orthogonal ## coordinate system rdict["L1_rho"] = numpy.matrixmultiply(RLt, cL1rho) rdict["L2_rho"] = numpy.matrixmultiply(RLt, cL2rho) rdict["L3_rho"] = numpy.matrixmultiply(RLt, cL3rho) ## calculate screw pitches (A*R / R*R) = (A/R) ## no screw pitches either rdict["L1_pitch"] = 0.0 rdict["L2_pitch"] = 0.0 rdict["L3_pitch"] = 0.0 ## rotate the newly calculated reduced-T tensor from the carrot ## coordinate system (coordinate system of L) back to the structure ## coordinate system Tiso = numpy.trace(Tp) / 3.0 rdict["rT'"] = Tiso * numpy.identity(3, float) rdict["Tr1_eigen_val"] = Tiso rdict["Tr2_eigen_val"] = Tiso rdict["Tr3_eigen_val"] = Tiso rdict["Tr1_rmsd"] = calc_rmsd(Tiso) rdict["Tr2_rmsd"] = calc_rmsd(Tiso) rdict["Tr3_rmsd"] = calc_rmsd(Tiso) return rdict | 56f30da138626c8c6f397e7d28b00e0126c279a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10674/56f30da138626c8c6f397e7d28b00e0126c279a7/TLS.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
67,
305,
3251,
67,
5693,
67,
792,
67,
266,
1128,
12,
77,
56,
16,
277,
48,
16,
277,
55,
16,
4026,
4672,
3536,
77,
56,
353,
279,
2202,
1431,
31,
277,
48,
63,
23,
16,
23,
1553... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
67,
305,
3251,
67,
5693,
67,
792,
67,
266,
1128,
12,
77,
56,
16,
277,
48,
16,
277,
55,
16,
4026,
4672,
3536,
77,
56,
353,
279,
2202,
1431,
31,
277,
48,
63,
23,
16,
23,
1553... |
delId = self.menuItems.delete.GetId() | delId = wx.NewId() def OnDelKey(event): self.DispatchCommand('Clear', event) wx.EVT_MENU(self, delId, OnDelKey) | def ToggleOnlyLogAssigned(event): cb = self.statusBar.cb flag = not cb.GetValue() cb.SetValue(flag) eg.config.onlyLogAssigned = flag | 9ee56a35fdb10b99f4946424378c77c9e877b479 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8076/9ee56a35fdb10b99f4946424378c77c9e877b479/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
399,
9891,
3386,
1343,
20363,
12,
2575,
4672,
2875,
273,
365,
18,
2327,
5190,
18,
7358,
2982,
273,
486,
2875,
18,
967,
620,
1435,
2875,
18,
694,
620,
12,
6420,
13,
9130,
18,
1425,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
399,
9891,
3386,
1343,
20363,
12,
2575,
4672,
2875,
273,
365,
18,
2327,
5190,
18,
7358,
2982,
273,
486,
2875,
18,
967,
620,
1435,
2875,
18,
694,
620,
12,
6420,
13,
9130,
18,
1425,
18,
... |
c = HtmlGenerator() c.start() self.threads.append(c) | HtmlGenerator().start() | def run(self): c = HtmlGenerator() c.start() self.threads.append(c) | 9c1cadc3cf0a802150d579af45f298117b3dfe7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/228/9c1cadc3cf0a802150d579af45f298117b3dfe7d/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
276,
273,
5430,
3908,
1435,
276,
18,
1937,
1435,
365,
18,
12495,
18,
6923,
12,
71,
13,
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,
276,
273,
5430,
3908,
1435,
276,
18,
1937,
1435,
365,
18,
12495,
18,
6923,
12,
71,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if props.has_key('assignedto'): assignedto_id = props['assignedto'] if assignedto_id not in props['nosy']: props['nosy'].append(assignedto_id) | self._add_assignedto_to_nosy(props) | def _changenode(self, props): ''' change the node based on the contents of the form ''' cl = self.db.classes[self.classname] # set status to chatting if 'unread' or 'resolved' try: # determine the id of 'unread','resolved' and 'chatting' unread_id = self.db.status.lookup('unread') resolved_id = self.db.status.lookup('resolved') chatting_id = self.db.status.lookup('chatting') current_status = cl.get(self.nodeid, 'status') except KeyError: pass else: if (props['status'] == unread_id or props['status'] == resolved_id and current_status == resolved_id): props['status'] = chatting_id # add assignedto to the nosy list if props.has_key('assignedto'): assignedto_id = props['assignedto'] if assignedto_id not in props['nosy']: props['nosy'].append(assignedto_id) # create the message message, files = self._handle_message() if message: props['messages'] = cl.get(self.nodeid, 'messages') + [message] if files: props['files'] = cl.get(self.nodeid, 'files') + files # make the changes cl.set(self.nodeid, **props) | 660e336bd471b31b5546a3b92a0bec2174158b36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/660e336bd471b31b5546a3b92a0bec2174158b36/cgi_client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
24083,
20680,
12,
2890,
16,
3458,
4672,
9163,
2549,
326,
756,
2511,
603,
326,
2939,
434,
326,
646,
9163,
927,
273,
365,
18,
1966,
18,
4701,
63,
2890,
18,
18340,
65,
468,
444,
1267... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
24083,
20680,
12,
2890,
16,
3458,
4672,
9163,
2549,
326,
756,
2511,
603,
326,
2939,
434,
326,
646,
9163,
927,
273,
365,
18,
1966,
18,
4701,
63,
2890,
18,
18340,
65,
468,
444,
1267... |
'/packages/not_packagename') | '/packages/not_packagename', redirect_params={'packageName' : packageName}) | def name(self, packageName): pkg = model.Package.get_by(name=packageName) if not pkg: raise redirect(config.get('base_url_filter.base_url') + '/packages/not_packagename') return self.id(pkg.id) | 185d62e4410720985a5bed72ded2cf6353e67ff3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9953/185d62e4410720985a5bed72ded2cf6353e67ff3/controllers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
508,
12,
2890,
16,
9929,
4672,
3475,
273,
938,
18,
2261,
18,
588,
67,
1637,
12,
529,
33,
5610,
461,
13,
309,
486,
3475,
30,
1002,
3136,
12,
1425,
18,
588,
2668,
1969,
67,
718,
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,
508,
12,
2890,
16,
9929,
4672,
3475,
273,
938,
18,
2261,
18,
588,
67,
1637,
12,
529,
33,
5610,
461,
13,
309,
486,
3475,
30,
1002,
3136,
12,
1425,
18,
588,
2668,
1969,
67,
718,
67,
... |
return fs.node_prop(self.root, self._scoped_svn_path, name, self.pool()) | return fs.node_prop(self.root, self._scoped_svn_path, name, self.pool()) | def _get_prop(self, name): return fs.node_prop(self.root, self._scoped_svn_path, name, self.pool()) | 3dd37faa9ebf0aaf1d3a2ee519e52fb03d0756d0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2831/3dd37faa9ebf0aaf1d3a2ee519e52fb03d0756d0/svn_fs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
5986,
12,
2890,
16,
508,
4672,
327,
2662,
18,
2159,
67,
5986,
12,
2890,
18,
3085,
16,
365,
6315,
27474,
67,
31505,
67,
803,
16,
508,
16,
365,
18,
6011,
10756,
2,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
588,
67,
5986,
12,
2890,
16,
508,
4672,
327,
2662,
18,
2159,
67,
5986,
12,
2890,
18,
3085,
16,
365,
6315,
27474,
67,
31505,
67,
803,
16,
508,
16,
365,
18,
6011,
10756,
2,
-100,
... |
0.0020969148645 - 0.059981913655*I | 0.0020969148 - 0.059981913*I | def gamma_inc(self, t): """ Return the incomplete Gamma function evaluated at this complex number. | 0f85c81e959512e75d1c3f66db056b379125ea81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/0f85c81e959512e75d1c3f66db056b379125ea81/complex_number.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9601,
67,
9523,
12,
2890,
16,
268,
4672,
3536,
2000,
326,
14715,
25409,
445,
12697,
622,
333,
7233,
1300,
18,
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,
9601,
67,
9523,
12,
2890,
16,
268,
4672,
3536,
2000,
326,
14715,
25409,
445,
12697,
622,
333,
7233,
1300,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
for channelID,dict in tree.items(): | for channelID, dict in tree.items(): | def execute(self): """ The main agent execution method """ # This allows dynamic changing of the throughput timescale self.throughputTimescale = self.am_getOption('ThroughputTimescale',3600) self.throughputTimescale = 60*60*1 #print 'ThroughputTimescale:',self.throughputTimescale ###################################################################################### # # Obtain information on the current state of the channel queues # res = self.TransferDB.getChannelQueues() if not res['OK']: errStr = "ReplicationScheduler._execute: Failed to get channel queues from TransferDB." gLogger.error(errStr, res['Message']) return S_OK() if not res['Value']: gLogger.info("ReplicationScheduler._execute: No active channels found for replication.") return S_OK() channels = res['Value'] res = self.TransferDB.getChannelObservedThroughput(self.throughputTimescale) if not res['OK']: errStr = "ReplicationScheduler._execute: Failed to get observed throughput from TransferDB." gLogger.error(errStr,res['Message']) return S_OK() if not res['Value']: gLogger.info("ReplicationScheduler._execute: No active channels found for replication.") return S_OK() bandwidths = res['Value'] self.strategyHandler = StrategyHandler(bandwidths,channels,self.section) requestsPresent = True while requestsPresent: ###################################################################################### # # The first step is to obtain a transfer request from the RequestDB which should be scheduled. # gLogger.info("ReplicationScheduler._execute: Contacting RequestDB for suitable requests.") res = self.RequestDB.getRequest('transfer') if not res['OK']: gLogger.error("ReplicationScheduler._execute: Failed to get a request list from RequestDB.", res['Message']) continue if not res['Value']: gLogger.info("ReplicationScheduler._execute: No requests found in RequestDB.") requestsPresent = False return S_OK() requestString = res['Value']['RequestString'] requestName = res['Value']['RequestName'] gLogger.info("ReplicationScheduler._execute: Obtained Request %s from RequestDB." % (requestName)) | 9005c0a96ba1bc0698c543bcb4c1886f4eeee344 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9005c0a96ba1bc0698c543bcb4c1886f4eeee344/ReplicationScheduler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
3536,
1021,
2774,
4040,
4588,
707,
3536,
225,
468,
1220,
5360,
5976,
12770,
434,
326,
24677,
1658,
31402,
365,
18,
10064,
458,
10178,
31402,
273,
365,
18,
301,
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,
1836,
12,
2890,
4672,
3536,
1021,
2774,
4040,
4588,
707,
3536,
225,
468,
1220,
5360,
5976,
12770,
434,
326,
24677,
1658,
31402,
365,
18,
10064,
458,
10178,
31402,
273,
365,
18,
301,
67,
... |
return "<%s testFunc=%s>" % (self.__class__, self.__testFunc) | return "<%s testFunc=%s>" % (_strclass(self.__class__), self.__testFunc) | def __repr__(self): return "<%s testFunc=%s>" % (self.__class__, self.__testFunc) | 0ce932f9da9ea97873dfd9e1e5c1dff6ab9328bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/0ce932f9da9ea97873dfd9e1e5c1dff6ab9328bf/unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
327,
3532,
9,
87,
1842,
2622,
5095,
87,
2984,
738,
261,
2890,
16186,
1106,
972,
16,
365,
16186,
3813,
2622,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
327,
3532,
9,
87,
1842,
2622,
5095,
87,
2984,
738,
261,
2890,
16186,
1106,
972,
16,
365,
16186,
3813,
2622,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
fi.close() shutil.copyfileobj(fo, self.wfile) if self.have_popen3: errors = fe.read() fe.close() if errors: self.log_error('%s', errors) sts = fo.close() if sts: self.log_error("CGI script exit status % else: self.log_message("CGI script exited OK") else: save_argv = sys.argv save_stdin = sys.stdin save_stdout = sys.stdout save_stderr = sys.stderr try: save_cwd = os.getcwd() try: sys.argv = [scriptfile] if '=' not in decoded_query: sys.argv.append(decoded_query) sys.stdout = self.wfile sys.stdin = self.rfile execfile(scriptfile, {"__name__": "__main__"}) finally: sys.argv = save_argv sys.stdin = save_stdin sys.stdout = save_stdout sys.stderr = save_stderr os.chdir(save_cwd) except SystemExit, sts: self.log_error("CGI script exit status %s", str(sts)) | stdout, stderr = p.communicate(data) self.wfile.write(stdout) if stderr: self.log_error('%s', stderr) status = p.returncode if status: self.log_error("CGI script exit status % | def run_cgi(self): """Execute a CGI script.""" path = self.path dir, rest = self.cgi_info | 6fd181e7964ee35b817e3c8b7b605cd2a3193c8c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/6fd181e7964ee35b817e3c8b7b605cd2a3193c8c/CGIHTTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
19062,
12,
2890,
4672,
3536,
5289,
279,
385,
13797,
2728,
12123,
589,
273,
365,
18,
803,
1577,
16,
3127,
273,
365,
18,
19062,
67,
1376,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
19062,
12,
2890,
4672,
3536,
5289,
279,
385,
13797,
2728,
12123,
589,
273,
365,
18,
803,
1577,
16,
3127,
273,
365,
18,
19062,
67,
1376,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
sage: a2 == loads(dumps(a2)) True | sage: TestSuite(a2).run() | def __init__(self, A, mdict): """ INPUT: | 7fa05b949ce753ba0d48f2e6f5125e6333b0ed1c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/7fa05b949ce753ba0d48f2e6f5125e6333b0ed1c/weyl_characters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
432,
16,
312,
1576,
4672,
3536,
12943,
30,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
432,
16,
312,
1576,
4672,
3536,
12943,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
configuration.set(self.__section__, id, instance) | configuration.set(instance.__section__, id, instance) | def __new__(cls, id=None): id = id or cls.__id__ if id is None: raise ValueError("id is required for instantiating %s" % cls.__name__) if not isinstance(id, basestring): raise TypeError("id needs to be a string instance") configuration = ConfigurationManager() try: instance = configuration.get(cls.__section__, id) except (UnknownSectionError, UnknownNameError): instance = SettingsState.__new__(cls) except AttributeError: instance = SettingsState.__new__(cls) try: configuration.set(self.__section__, id, instance) configuration.save() except Exception, e: notification_center = NotificationCenter() notification_center.post_notification('CFGManagerSaveFailed', sender=configuration, data=NotificationData(object=instance, exception=e)) else: if not isinstance(instance, cls): # TODO: Should send a notification that this object could not be retrieved instance = SettingsState.__new__(cls) instance.__id__ = id return instance | eb890406e5a656d1f7c027b5555d86535c07e05d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3449/eb890406e5a656d1f7c027b5555d86535c07e05d/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2704,
972,
12,
6429,
16,
612,
33,
7036,
4672,
612,
273,
612,
578,
2028,
16186,
350,
972,
309,
612,
353,
599,
30,
1002,
2068,
2932,
350,
353,
1931,
364,
5934,
22906,
738,
87,
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,
1001,
2704,
972,
12,
6429,
16,
612,
33,
7036,
4672,
612,
273,
612,
578,
2028,
16186,
350,
972,
309,
612,
353,
599,
30,
1002,
2068,
2932,
350,
353,
1931,
364,
5934,
22906,
738,
87,
6,
... |
self.insert(0, t) self.text = self.text[:m.start()+1] | self.insert(0, t) if m.start() == 0: self.text = self.text[1:m.start()+1] else: self.text = self.text[:m.start()+1] | def interpolate(self, stream): """The current interpolation strategy is to translate the interpolation statements into TAL.""" translator = self._translator() if self.text is not None: while self.text: m = translator.interpolate(self.text) if m is None: break | 1f70311cf13c3f12087f3b8cea5cc3b15baaf0a3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9696/1f70311cf13c3f12087f3b8cea5cc3b15baaf0a3/translation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13156,
12,
2890,
16,
1407,
4672,
3536,
1986,
783,
12851,
6252,
353,
358,
4204,
326,
12851,
6317,
1368,
399,
1013,
12123,
225,
8333,
273,
365,
6315,
17879,
1435,
309,
365,
18,
955,
353,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13156,
12,
2890,
16,
1407,
4672,
3536,
1986,
783,
12851,
6252,
353,
358,
4204,
326,
12851,
6317,
1368,
399,
1013,
12123,
225,
8333,
273,
365,
6315,
17879,
1435,
309,
365,
18,
955,
353,
4... |
l.extend(["redirects: %s" % x for x in sorted(set(redirects))]) | def __str__(self): l = [] loadRecipes = [] buildReqs = [] refTroves = [] redirects = [] | 7c7b1da992d2d3b632a649f5f65404da11e06d95 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/7c7b1da992d2d3b632a649f5f65404da11e06d95/clone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
328,
273,
5378,
1262,
426,
3449,
281,
273,
5378,
1361,
6113,
87,
273,
5378,
1278,
56,
303,
3324,
273,
5378,
18064,
273,
5378,
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,
0,
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,
701,
972,
12,
2890,
4672,
328,
273,
5378,
1262,
426,
3449,
281,
273,
5378,
1361,
6113,
87,
273,
5378,
1278,
56,
303,
3324,
273,
5378,
18064,
273,
5378,
2,
-100,
-100,
-100,
-100,
... | |
def awakeFromNib(self): conf_file = os.path.join(NB_SOURCE, 'namebench.cfg') (self.options, self.primary, self.secondary) = config.GetConfiguration(filename=conf_file) self.updateStatus('Populating Form...') self.setFormDefaults() self.updateStatus('Ready') | def awakeFromNib(self): conf_file = os.path.join(NB_SOURCE, 'namebench.cfg') (self.options, self.primary, self.secondary) = config.GetConfiguration(filename=conf_file) self.updateStatus('Populating Form...') self.setFormDefaults() self.updateStatus('Ready') | 2efff298c0e3e5887eb2e75f30d510cdabf74f23 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4170/2efff298c0e3e5887eb2e75f30d510cdabf74f23/controller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1690,
911,
1265,
50,
495,
12,
2890,
4672,
2195,
67,
768,
273,
1140,
18,
803,
18,
5701,
12,
20626,
67,
6537,
16,
296,
529,
22144,
18,
7066,
6134,
261,
2890,
18,
2116,
16,
365,
18,
825... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1690,
911,
1265,
50,
495,
12,
2890,
4672,
2195,
67,
768,
273,
1140,
18,
803,
18,
5701,
12,
20626,
67,
6537,
16,
296,
529,
22144,
18,
7066,
6134,
261,
2890,
18,
2116,
16,
365,
18,
825... | |
catalog = self.catalog_cached(program, ts, force_all, initial_queryset) | catalog = self.catalog_cached(program, ts, force_all, initial_queryset, use_cache=use_cache, cache_only=cache_only) | def catalog(self, program, ts=None, force_all=False, initial_queryset=None): # Try getting the catalog straight from cache print (program, ts, force_all, initial_queryset, True) catalog = self.catalog_cached(program, ts, force_all, initial_queryset, cache_only=True) if catalog is None: # Get it from the DB, then try prefetching class sizes catalog = self.catalog_cached(program, ts, force_all, initial_queryset) else: for cls in catalog: for sec in cls.get_sections(): del sec._count_students | 016321b3aaca8fe6f641390018463ede00b43091 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12041/016321b3aaca8fe6f641390018463ede00b43091/class_.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6222,
12,
2890,
16,
5402,
16,
3742,
33,
7036,
16,
2944,
67,
454,
33,
8381,
16,
2172,
67,
21729,
33,
7036,
4672,
468,
6161,
8742,
326,
6222,
21251,
628,
1247,
1172,
261,
12890,
16,
3742... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6222,
12,
2890,
16,
5402,
16,
3742,
33,
7036,
16,
2944,
67,
454,
33,
8381,
16,
2172,
67,
21729,
33,
7036,
4672,
468,
6161,
8742,
326,
6222,
21251,
628,
1247,
1172,
261,
12890,
16,
3742... |
out(io.getvalue()) | out(string_io.getvalue()) | def summarize(self, out, verbose=None): io = StringIO.StringIO() old_stdout = sys.stdout sys.stdout = io try: res = doctest.DocTestRunner.summarize(self, verbose) finally: sys.stdout = old_stdout out(io.getvalue()) return res | 3826b7851930131ca8662a261ff0260695e3570d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/3826b7851930131ca8662a261ff0260695e3570d/doctest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28712,
12,
2890,
16,
596,
16,
3988,
33,
7036,
4672,
2527,
273,
15777,
18,
780,
4294,
1435,
1592,
67,
10283,
273,
2589,
18,
10283,
2589,
18,
10283,
273,
2527,
775,
30,
400,
273,
31263,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28712,
12,
2890,
16,
596,
16,
3988,
33,
7036,
4672,
2527,
273,
15777,
18,
780,
4294,
1435,
1592,
67,
10283,
273,
2589,
18,
10283,
2589,
18,
10283,
273,
2527,
775,
30,
400,
273,
31263,
... |
self.c.execute(self.sql_insert_str, args) | self.c.execute(self.sql_insert_str % args) | def put_row(self, args): self.c.execute(self.sql_insert_str, args) | 358ddb200817f51495263d12f6df8e9256e27645 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14612/358ddb200817f51495263d12f6df8e9256e27645/vas_db.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
67,
492,
12,
2890,
16,
833,
4672,
365,
18,
71,
18,
8837,
12,
2890,
18,
4669,
67,
6387,
67,
701,
16,
833,
13,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
67,
492,
12,
2890,
16,
833,
4672,
365,
18,
71,
18,
8837,
12,
2890,
18,
4669,
67,
6387,
67,
701,
16,
833,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
slave_fd = slave_open(tty_name) | def fork(): """Fork and make the child a session leader with a controlling terminal. Return (pid, master_fd).""" master_fd, tty_name = master_open() pid = os.fork() if pid == CHILD: # Establish a new session. os.setsid() # Acquire controlling terminal. slave_fd = slave_open(tty_name) os.close(master_fd) # Slave becomes stdin/stdout/stderr of child. os.dup2(slave_fd, STDIN_FILENO) os.dup2(slave_fd, STDOUT_FILENO) os.dup2(slave_fd, STDERR_FILENO) if (slave_fd > STDERR_FILENO): os.close (slave_fd) # Parent and child process. return pid, master_fd | 8cef4cf737878bd8eec648426eebe9b9019b18be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8cef4cf737878bd8eec648426eebe9b9019b18be/pty.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12515,
13332,
3536,
22662,
471,
1221,
326,
1151,
279,
1339,
10302,
598,
279,
3325,
2456,
8651,
18,
2000,
261,
6610,
16,
4171,
67,
8313,
13,
12123,
4171,
67,
8313,
16,
21520,
67,
529,
273... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12515,
13332,
3536,
22662,
471,
1221,
326,
1151,
279,
1339,
10302,
598,
279,
3325,
2456,
8651,
18,
2000,
261,
6610,
16,
4171,
67,
8313,
13,
12123,
4171,
67,
8313,
16,
21520,
67,
529,
273... | |
self.set_undefined_options('install', ('install_lib', 'install_dir')) | self.set_undefined_options('install', ('install_lib', 'install_dir')) | def finalize_options(self): self.set_undefined_options('install', ('install_lib', 'install_dir')) return _install_data.finalize_options(self) | 82bf642178d9bbed43f5e4f85d6a2e14f77b4e29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/82bf642178d9bbed43f5e4f85d6a2e14f77b4e29/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
67,
2116,
12,
2890,
4672,
365,
18,
542,
67,
5978,
67,
2116,
2668,
5425,
2187,
7707,
5425,
67,
2941,
2187,
296,
5425,
67,
1214,
26112,
327,
389,
5425,
67,
892,
18,
30343,
67,
211... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12409,
67,
2116,
12,
2890,
4672,
365,
18,
542,
67,
5978,
67,
2116,
2668,
5425,
2187,
7707,
5425,
67,
2941,
2187,
296,
5425,
67,
1214,
26112,
327,
389,
5425,
67,
892,
18,
30343,
67,
211... |
""" @param file: A string or file object represnting the file to send. | """ @param file: A string or file object represnting the file to send. | def __init__(self, file): """ @param file: A string or file object represnting the file to send. """ | 9b2b7163e441396d9e5e7f46775cd7809b4655be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9b2b7163e441396d9e5e7f46775cd7809b4655be/msn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
585,
4672,
3536,
632,
891,
585,
30,
432,
533,
578,
585,
733,
2071,
455,
496,
310,
326,
585,
358,
1366,
18,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
585,
4672,
3536,
632,
891,
585,
30,
432,
533,
578,
585,
733,
2071,
455,
496,
310,
326,
585,
358,
1366,
18,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
c.execute("""DELETE FROM ticket_change""") | c.execute("DELETE FROM ticket_change") | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "Bugzilla MySQL('%s':'%s':'%s':'%s'): connecting..." % (_db, _host, _user, _password) mysql_con = MySQLdb.connect(host=_host, user=_user, passwd=_password, db=_db, compress=1, cursorclass=MySQLdb.cursors.DictCursor) mysql_cur = mysql_con.cursor() # init Trac environment print "Trac SQLite('%s'): connecting..." % (_env) trac = TracDatabase(_env) # force mode... if _force == 1: print "cleaning all tickets..." c = trac.db().cursor() c.execute("""DELETE FROM ticket_change""") trac.db().commit() c.execute("""DELETE FROM ticket""") trac.db().commit() c.execute("""DELETE FROM attachment""") os.system('rm -rf %s' % trac.env.get_attachments_dir()) os.mkdir(trac.env.get_attachments_dir()) trac.db().commit() print print "1. import severities..." severities = (('blocker', '1'), ('critical', '2'), ('major', '3'), ('normal', '4'), ('minor', '5'), ('trivial', '6'), ('enhancement', '7')) trac.setSeverityList(severities) print print "2. import components..." sql = "SELECT value, initialowner AS owner FROM components" if PRODUCTS: sql += " WHERE %s" % productFilter('program', PRODUCTS) mysql_cur.execute(sql) components = mysql_cur.fetchall() for component in components: component['owner'] = trac.getLoginName(mysql_cur, component['owner']) trac.setComponentList(components, 'value') print print "3. import priorities..." priorities = (('P1', '1'), ('P2', '2'), ('P3', '3'), ('P4', '4'), ('P5', '5')) trac.setPriorityList(priorities) print print "4. import versions..." sql = "SELECT DISTINCTROW value FROM versions" if PRODUCTS: sql += " WHERE %s" % productFilter('program', PRODUCTS) mysql_cur.execute(sql) versions = mysql_cur.fetchall() trac.setVersionList(versions, 'value') print print "5. import milestones..." mysql_cur.execute("SELECT value FROM milestones") milestones = mysql_cur.fetchall() if milestones[0] == '---': trac.setMilestoneList(milestones, 'value') else: trac.setMilestoneList([], '') print print '6. retrieving bugs...' sql = "SELECT * FROM bugs " if PRODUCTS: sql += " WHERE %s" % productFilter('product', PRODUCTS) sql += " ORDER BY bug_id" mysql_cur.execute(sql) bugs = mysql_cur.fetchall() print print "7. import bugs and bug activity..." for bug in bugs: bugid = bug['bug_id'] ticket = {} keywords = [] ticket['id'] = bugid ticket['time'] = bug['creation_ts'] ticket['changetime'] = bug['delta_ts'] ticket['component'] = bug['component'] ticket['severity'] = bug['bug_severity'] ticket['priority'] = bug['priority'] ticket['owner'] = trac.getLoginName(mysql_cur, bug['assigned_to']) ticket['reporter'] = trac.getLoginName(mysql_cur, bug['reporter']) mysql_cur.execute("SELECT * FROM cc WHERE bug_id = %s" % bugid) cc_records = mysql_cur.fetchall() cc_list = [] for cc in cc_records: cc_list.append(trac.getLoginName(mysql_cur, cc['who'])) ticket['cc'] = string.join(cc_list, ', ') ticket['version'] = bug['version'] if bug['target_milestone'] == '---': ticket['milestone'] = '' else: ticket['milestone'] = bug['target_milestone'] bug_status = bug['bug_status'].lower() ticket['status'] = statusXlator[bug_status] ticket['resolution'] = bug['resolution'].lower() # a bit of extra work to do open tickets if bug_status == 'open': if owner != '': ticket['status'] = 'assigned' else: ticket['status'] = 'new' ticket['summary'] = bug['short_desc'] keywords = string.split(bug['keywords'], ' ') mysql_cur.execute("SELECT * FROM longdescs WHERE bug_id = %s" % bugid) longdescs = list(mysql_cur.fetchall()) # check for empty 'longdescs[0]' field... if len(longdescs) == 0: ticket['description'] = '' else: ticket['description'] = longdescs[0]['thetext'] del longdescs[0] for desc in longdescs: ignore = False for comment in IGNORE_COMMENTS: if re.match(comment, desc['thetext']): ignore = True if ignore: continue trac.addTicketComment(ticket=bugid, time=desc['bug_when'], author=trac.getLoginName(mysql_cur, desc['who']), value=desc['thetext']) mysql_cur.execute("SELECT * FROM bugs_activity WHERE bug_id = %s ORDER BY bug_when" % bugid) bugs_activity = mysql_cur.fetchall() resolution = '' ticketChanges = [] for activity in bugs_activity: field_name = trac.getFieldName(mysql_cur, activity['fieldid']).lower() removed = activity[activityFields['removed']] added = activity[activityFields['added']] # statuses and resolutions are in lowercase in trac if field_name == 'resolution' or field_name == 'bug_status': removed = removed.lower() added = added.lower() # remember most recent resolution, we need this later if field_name == 'resolution': resolution = added.lower() keywordChange = False oldKeywords = string.join(keywords, " ") # convert bugzilla field names... if field_name == 'bug_severity': field_name = 'severity' elif field_name == 'assigned_to': field_name = 'owner' elif field_name == 'bug_status': field_name = 'status' if removed in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[removed] if kw in keywords: keywords.remove(kw) else: oldKeywords = string.join(keywords + [ kw ], " ") keywordChange = True if added in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[added] keywords.append(kw) keywordChange = True added = statusXlator[added] removed = statusXlator[removed] elif field_name == 'short_desc': field_name = 'summary' elif field_name == 'product': if removed in PRODUCT_KEYWORDS: kw = PRODUCT_KEYWORDS[removed] if kw in keywords: keywords.remove(kw) else: oldKeywords = string.join(keywords + [ kw ], " ") keywordChange = True if added in PRODUCT_KEYWORDS: kw = PRODUCT_KEYWORDS[added] keywords.append(kw) keywordChange = True ticketChange = {} ticketChange['ticket'] = bugid ticketChange['time'] = activity['bug_when'] ticketChange['author'] = trac.getLoginName(mysql_cur, activity['who']) ticketChange['field'] = field_name ticketChange['oldvalue'] = removed ticketChange['newvalue'] = added if keywordChange: newKeywords = string.join(keywords, " ") ticketChangeKw = ticketChange ticketChangeKw['field'] = 'keywords' ticketChangeKw['oldvalue'] = oldKeywords ticketChangeKw['newvalue'] = newKeywords #trac.addTicketChange(ticket=bugid, time=activity['bug_when'], # author=trac.getLoginName(mysql_cur, activity['who']), # field='keywords', oldvalue=oldKeywords, newvalue=newKeywords) ticketChanges.append(ticketChangeKw) if field_name in IGNORED_ACTIVITY_FIELDS: continue # skip changes that have no effect (think translation!) if added == removed: continue # bugzilla splits large summary changes into two records for oldChange in ticketChanges: if (field_name == 'summary' and oldChange['field'] == ticketChange['field'] and oldChange['time'] == ticketChange['time'] and oldChange['author'] == ticketChange['author']): oldChange['oldvalue'] += " " + ticketChange['oldvalue'] oldChange['newvalue'] += " " + ticketChange['newvalue'] break else: #trac.addTicketChange(ticket=bugid, time=activity['bug_when'], # author=trac.getLoginName(mysql_cur, activity['who']), # field=field_name, oldvalue=removed, newvalue=added) ticketChanges.append (ticketChange) for ticketChange in ticketChanges: trac.addTicketChange (**ticketChange) # for some reason, bugzilla v2.11 seems to clear the resolution # when you mark a bug as closed. let's remember it and restore # it if the ticket is closed but there's no resolution. if not ticket['resolution'] and ticket['status'] == 'closed': ticket['resolution'] = resolution if bug['bug_status'] in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[bug['bug_status']] # may have already been added during activity import if kw not in keywords: keywords.append(kw) if bug['product'] in PRODUCT_KEYWORDS: kw = PRODUCT_KEYWORDS[bug['product']] # may have already been added during activity import if kw not in keywords: keywords.append(kw) mysql_cur.execute("SELECT * FROM attachments WHERE bug_id = %s" % bugid) attachments = mysql_cur.fetchall() for a in attachments: author = trac.getLoginName(mysql_cur, a['submitter_id']) tracAttachment = Attachment(a['filename'], a['thedata']) trac.addAttachment(bugid, tracAttachment, a['description'], author) ticket['keywords'] = string.join(keywords) ticketid = trac.addTicket(**ticket) print "Success!" | d0a718cdc641402f4871e728629c7ce1e81b3158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/d0a718cdc641402f4871e728629c7ce1e81b3158/bugzilla2trac.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
24899,
1966,
16,
389,
2564,
16,
389,
1355,
16,
389,
3664,
16,
389,
3074,
16,
389,
5734,
4672,
5728,
2314,
273,
2286,
12233,
1435,
225,
468,
2236,
364,
12156,
5244,
434,
7934,
15990... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
24899,
1966,
16,
389,
2564,
16,
389,
1355,
16,
389,
3664,
16,
389,
3074,
16,
389,
5734,
4672,
5728,
2314,
273,
2286,
12233,
1435,
225,
468,
2236,
364,
12156,
5244,
434,
7934,
15990... |
EXAMPLES: | EXAMPLES:: | def bezier3d(path, **options): """ Draws a 3-dimensional bezier path. Input is similar to bezier_path, but each point in the path and each control point is required to have 3 coordinates. INPUT: - ``path`` - a list of curves, which each is a list of points. See further detail below. - ``thickness`` - (default: 2) - ``color`` - a word that describes a color - ``opacity`` - (default: 1) if less than 1 then is transparent - ``aspect_ratio`` - (default:[1,1,1]) The path is a list of curves, and each curve is a list of points. Each point is a tuple (x,y,z). The first curve contains the endpoints as the first and last point in the list. All other curves assume a starting point given by the last entry in the preceding list, and take the last point in the list as their opposite endpoint. A curve can have 0, 1 or 2 control points listed between the endpoints. In the input example for path below, the first and second curves have 2 control points, the third has one, and the fourth has no control points: path = [[p1, c1, c2, p2], [c3, c4, p3], [c5, p4], [p5], ...] In the case of no control points, a straight line will be drawn between the two endpoints. If one control point is supplied, then the curve at each of the endpoints will be tangent to the line from that endpoint to the control point. Similarly, in the case of two control points, at each endpoint the curve will be tangent to the line connecting that endpoint with the control point immediately after or immediately preceding it in the list. So in our example above, the curve between p1 and p2 is tangent to the line through p1 and c1 at p1, and tangent to the line through p2 and c2 at p2. Similarly, the curve between p2 and p3 is tangent to line(p2,c3) at p2 and tangent to line(p3,c4) at p3. Curve(p3,p4) is tangent to line(p3,c5) at p3 and tangent to line(p4,c5) at p4. Curve(p4,p5) is a straight line. EXAMPLES: sage: path = [[(0,0,0),(.5,.1,.2),(.75,3,-1),(1,1,0)],[(.5,1,.2),(1,.5,0)],[(.7,.2,.5)]] sage: b = bezier3d(path, color='green') sage: b To construct a simple curve, create a list containing a single list: sage: path = [[(0,0,0),(1,0,0),(0,1,0),(0,1,1)]] sage: curve = bezier3d(path, thickness=5, color='blue') sage: curve """ import parametric_plot3d as P3D from sage.modules.free_module_element import vector from sage.calculus.calculus import var p0 = vector(path[0][-1]) t = var('t') if len(path[0]) > 2: B = (1-t)**3*vector(path[0][0])+3*t*(1-t)**2*vector(path[0][1])+3*t**2*(1-t)*vector(path[0][-2])+t**3*p0 G = P3D.parametric_plot3d(list(B), (0, 1), color=options['color'], aspect_ratio=options['aspect_ratio'], thickness=options['thickness'], opacity=options['opacity']) else: G = line3d([path[0][0], p0], color=options['color'], thickness=options['thickness'], opacity=options['opacity']) for curve in path[1:]: if len(curve) > 1: p1 = vector(curve[0]) p2 = vector(curve[-2]) p3 = vector(curve[-1]) B = (1-t)**3*p0+3*t*(1-t)**2*p1+3*t**2*(1-t)*p2+t**3*p3 G += P3D.parametric_plot3d(list(B), (0, 1), color=options['color'], aspect_ratio=options['aspect_ratio'], thickness=options['thickness'], opacity=options['opacity']) else: G += line3d([p0,curve[0]], color=options['color'], thickness=options['thickness'], opacity=options['opacity']) p0 = curve[-1] return G | c85cd8e70aed89c86059888b9925f160e190c0a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/c85cd8e70aed89c86059888b9925f160e190c0a7/shapes2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29368,
23,
72,
12,
803,
16,
2826,
2116,
4672,
3536,
10184,
87,
279,
890,
17,
31236,
29368,
589,
18,
225,
2741,
353,
7281,
358,
29368,
67,
803,
16,
1496,
1517,
1634,
316,
326,
589,
471,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29368,
23,
72,
12,
803,
16,
2826,
2116,
4672,
3536,
10184,
87,
279,
890,
17,
31236,
29368,
589,
18,
225,
2741,
353,
7281,
358,
29368,
67,
803,
16,
1496,
1517,
1634,
316,
326,
589,
471,... |
zebra.set_video_device(video_device) zebra.connect("decoded", decoded) | zebra.connect("decoded-text", decoded) | def decoded(widget, symbol, data): if not results: return buf = results.props.buffer end = buf.get_end_iter() buf.insert(end, str(symbol) + ":" + data + "\n") results.scroll_to_iter(end, 0) | e91b12e9caffe8d1b7a62381fc4da37263468591 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10284/e91b12e9caffe8d1b7a62381fc4da37263468591/test_pygtk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6383,
12,
6587,
16,
3273,
16,
501,
4672,
309,
486,
1686,
30,
327,
1681,
273,
1686,
18,
9693,
18,
4106,
679,
273,
1681,
18,
588,
67,
409,
67,
2165,
1435,
1681,
18,
6387,
12,
409,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6383,
12,
6587,
16,
3273,
16,
501,
4672,
309,
486,
1686,
30,
327,
1681,
273,
1686,
18,
9693,
18,
4106,
679,
273,
1681,
18,
588,
67,
409,
67,
2165,
1435,
1681,
18,
6387,
12,
409,
16,
... |
if recordings or (next_rec_time > 0 and (next_rec_time - time()) < 120): | if recordings or (next_rec_time > 0 and (next_rec_time - time.time()) < 120): | def purgeAll(self): recordings = self.session.nav.getRecordings() next_rec_time = -1 if not recordings: next_rec_time = self.session.nav.RecordTimer.getNextRecordingTime() if recordings or (next_rec_time > 0 and (next_rec_time - time()) < 120): msg = "\n" + _("Recording(s) are in progress or coming up in few seconds!") else: msg = "" self.session.openWithCallback(self.purgeConfirmed, MessageBox, _("Permanently delete all recordings in the trashcan?") + msg) | f430335c3638f5cc789c938457e10b6cf878d516 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6652/f430335c3638f5cc789c938457e10b6cf878d516/MovieSelection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11668,
1595,
12,
2890,
4672,
1409,
899,
273,
365,
18,
3184,
18,
11589,
18,
588,
2115,
899,
1435,
1024,
67,
3927,
67,
957,
273,
300,
21,
309,
486,
1409,
899,
30,
1024,
67,
3927,
67,
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,
11668,
1595,
12,
2890,
4672,
1409,
899,
273,
365,
18,
3184,
18,
11589,
18,
588,
2115,
899,
1435,
1024,
67,
3927,
67,
957,
273,
300,
21,
309,
486,
1409,
899,
30,
1024,
67,
3927,
67,
9... |
TixWidget.__init__(self, master, 'tixLabelEntry', ['labelside','options'], cnf, kw) self.subwidget_list['label'] = _dummyLabel(self, 'label') self.subwidget_list['entry'] = _dummyEntry(self, 'entry') | TixWidget.__init__(self, master, 'tixLabelEntry', ['labelside','options'], cnf, kw) self.subwidget_list['label'] = _dummyLabel(self, 'label') self.subwidget_list['entry'] = _dummyEntry(self, 'entry') | def __init__ (self,master=None,cnf={}, **kw): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
7525,
33,
7036,
16,
10305,
74,
28793,
2826,
9987,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
7525,
33,
7036,
16,
10305,
74,
28793,
2826,
9987,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
invoice = Document.get_invoice(request.user, prog.anchor, li_types, dont_duplicate=True, get_complete=True) | invoice = Document.get_invoice(user, prog.anchor, li_types, dont_duplicate=True, get_complete=True) | def paiditems(self, request, tl, one, two, module, extra, prog): | 39624cf6546bbec2f3895136f326c12ac66753b9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12041/39624cf6546bbec2f3895136f326c12ac66753b9/onsitepaiditemsmodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30591,
3319,
12,
2890,
16,
590,
16,
8332,
16,
1245,
16,
2795,
16,
1605,
16,
2870,
16,
11243,
4672,
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,
30591,
3319,
12,
2890,
16,
590,
16,
8332,
16,
1245,
16,
2795,
16,
1605,
16,
2870,
16,
11243,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
em = startmark + int(self.swapsize * 1000) | em = startmark + self.swap_mb | def forward(self): if self.expert.get_active(): mainWindow.goto('manualPart') return | 2f74cfb88502c7fe6ae7fb78ca644ae3d1b628f1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2375/2f74cfb88502c7fe6ae7fb78ca644ae3d1b628f1/partitions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5104,
12,
2890,
4672,
309,
365,
18,
338,
672,
18,
588,
67,
3535,
13332,
2774,
3829,
18,
75,
6302,
2668,
19840,
1988,
6134,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5104,
12,
2890,
4672,
309,
365,
18,
338,
672,
18,
588,
67,
3535,
13332,
2774,
3829,
18,
75,
6302,
2668,
19840,
1988,
6134,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def __init__(self, dirs=None, dirdepth=100, ignoreprefix='.', hasher=md5_hasher, depsname='.deps'): | def __init__(self, dirs=None, dirdepth=100, ignoreprefix='.', hasher=md5_hasher, depsname='.deps'): | def __init__(self, dirs=None, dirdepth=100, ignoreprefix='.', hasher=md5_hasher, depsname='.deps'): """ Initialise a Builder with the given options. | 35a4c940cd25ac86249d9109056febf30a36afd7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7381/35a4c940cd25ac86249d9109056febf30a36afd7/fabricate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
7717,
33,
7036,
16,
1577,
5979,
33,
6625,
16,
2305,
3239,
2218,
1093,
16,
15764,
33,
1264,
25,
67,
2816,
264,
16,
8740,
529,
2218,
18,
14877,
11,
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,
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,
7717,
33,
7036,
16,
1577,
5979,
33,
6625,
16,
2305,
3239,
2218,
1093,
16,
15764,
33,
1264,
25,
67,
2816,
264,
16,
8740,
529,
2218,
18,
14877,
11,
4672,
... |
def reload_spin(self, entry, spin): self.load_spin(entry['group'], entry['key'], spin) | def reload_spin(self, group, key, value, spin): self.load_spin(group, key, spin) | def reload_spin(self, entry, spin): self.load_spin(entry['group'], entry['key'], spin) | 6e5ef9d2ff04626633394808ed3d5531bb4809af /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8416/6e5ef9d2ff04626633394808ed3d5531bb4809af/awnClass.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7749,
67,
22876,
12,
2890,
16,
1241,
16,
12490,
4672,
365,
18,
945,
67,
22876,
12,
4099,
3292,
1655,
17337,
1241,
3292,
856,
17337,
12490,
13,
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,
7749,
67,
22876,
12,
2890,
16,
1241,
16,
12490,
4672,
365,
18,
945,
67,
22876,
12,
4099,
3292,
1655,
17337,
1241,
3292,
856,
17337,
12490,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if not candidates: unretrievables.append((prepare_code.BadArchive, package_spec)) return prepare_code.BadArchive else: | if candidates: | def prepare(package_spec): """ global variables used : * repositories """ # Parse the version specifications try: package_version = VersionPredicate(package_spec) except ValueError: unretrievables.append((prepare_code.BadName, package_spec)) return prepare_code.NoAvailableCandidate # Repository listing repo_candidates = [] for repo_str in repositories: try: repo = Server(repo_str) for repo_ver in repo.package_releases(package_version.name): if package_version.satisfied_by(repo_ver): releases = repo.release_urls(package_version.name, repo_ver) # XXX # Take only acceptable package type and with python version # compatible for release in releases: # We must check following attributes #release['packagetype'] == 'bdist_egg', # 'bdist_wininst', 'bdist_rpm', 'bdist_dumb', # 'bdist_msi' #release['python_version'] == '2.4', '2.5', 'any', # 'source' if release['packagetype'] == 'sdist': release['name'] = package_version.name release['version'] = LooseVersion(repo_ver) release['str_version'] = repo_ver release['pypi_server'] = repo release['pypi_location'] = repo_str repo_candidates.append(release) # Any error related to the CheeseShop server except (IOError, ExpatError, ProtocolError): print "WARNING: %s is not a valid CheeseShop repository" % repo_str # Cache listing if not exists(CACHE_DIR): make_folder(CACHE_DIR) cache_candidates = [] cache_dir = vfs.open(CACHE_DIR) for filename in cache_dir.get_names('.'): dist = parse_package_name(filename) if dist['name'] == package_version.name and\ dist['extension'] in EXTENSIONS: try: dist['version'] = LooseVersion(dist['version']) cache_candidates.append(dist) except ValueError: continue # Candidates sorting candidates = [(dist['version'], 'cache', dist)\ for dist in cache_candidates] candidates += [(dist['version'], 'repository', dist)\ for dist in repo_candidates] candidates.sort(key=itemgetter(0)) while candidates: # Iterate over candidates until "usable" package found bestmatch_version, bestmatch_from, bestmatch = candidates.pop() if bestmatch_from == 'cache': dist_loc = join(CACHE_DIR, bestmatch['file']) dist = Dist(str(dist_loc)) if dist == None: if not candidates: unretrievables.append((prepare_code.BadArchive, package_spec)) return prepare_code.BadArchive else: continue if not dist.fromsetuptools and dist.has_metadata('Requires'): requirements = dist.get_metadata('Requires').split(',') elif bestmatch_from == 'repository': pypi_server = bestmatch['pypi_server'] release_data = pypi_server.release_data(package_version.name, bestmatch['str_version']) requirements = release_data['requires'] for requirement in requirements: return_code = prepare(requirement) if return_code != prepare_code.Ok: unretrievables.append((return_code, requirement)) installed_package = find_installed_package(package_version) if installed_package == None: packages_to_install.append(('N', None, bestmatch_from, dist, bestmatch)) elif installed_package['version'] == bestmatch_version: packages_to_install.append(('R', installed_package['version'], bestmatch_from, dist, bestmatch)) elif installed_package['version'] < bestmatch_version: packages_to_install.append(('U', installed_package['version'], bestmatch_from, dist, bestmatch)) elif installed_package['version'] > bestmatch_version: packages_to_install.append(('D', installed_package['version'], bestmatch_from, dist, bestmatch)) return prepare_code.Ok else: # No candidates return prepare_code.NoAvailableCandidate | a0336473754527a1d295829900c404062038a481 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/a0336473754527a1d295829900c404062038a481/isetup-install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
12,
5610,
67,
2793,
4672,
3536,
2552,
3152,
1399,
294,
380,
14531,
3536,
468,
2884,
326,
1177,
21950,
775,
30,
2181,
67,
1589,
273,
4049,
8634,
12,
5610,
67,
2793,
13,
1335,
2068,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
12,
5610,
67,
2793,
4672,
3536,
2552,
3152,
1399,
294,
380,
14531,
3536,
468,
2884,
326,
1177,
21950,
775,
30,
2181,
67,
1589,
273,
4049,
8634,
12,
5610,
67,
2793,
13,
1335,
2068,
... |
def endTagBr(self, name): | def endTagBodyHtmlBr(self, name): | def endTagBr(self, name): #This is not currently in the spec self.anythingElse() self.parser.phase.processEndTag("br") | d6cb7966cf60b6de063bc806d0944426346a21a1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10463/d6cb7966cf60b6de063bc806d0944426346a21a1/html5parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
2250,
4353,
19114,
12,
2890,
16,
508,
4672,
468,
2503,
353,
486,
4551,
316,
326,
857,
365,
18,
2273,
4274,
12427,
1435,
365,
18,
4288,
18,
13961,
18,
2567,
25633,
2932,
2848,
7923... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
29765,
2250,
4353,
19114,
12,
2890,
16,
508,
4672,
468,
2503,
353,
486,
4551,
316,
326,
857,
365,
18,
2273,
4274,
12427,
1435,
365,
18,
4288,
18,
13961,
18,
2567,
25633,
2932,
2848,
7923... |
try: align.append(type(int(item)) is int and 'admintdright') except ValueError: align.append('admintdleft') | if type(item) is int: align.append('admintdright') else: align.append('admintdleft') | def tupletotable(header=[], tuple=[], start='', end='', extracolumn=''): """create html table for a tuple. header - optional header for the columns tuple - create table of this start - text to be added in the beginning, most likely beginning of a form end - text to be added in the end, mot likely end of a form. extracolumn - mainly used to put in a button. """ # study first row in tuple for alignment align = [] try: firstrow = tuple[0] if type(firstrow) in [int, long]: align = ['admintdright'] elif type(firstrow) in [str, dict]: align = ['admintdleft'] else: for item in firstrow: try: align.append(type(int(item)) is int and 'admintdright') except ValueError: align.append('admintdleft') except IndexError: firstrow = [] tblstr = '' for h in header + ['']: tblstr += ' <th class="adminheader">%s</th>\n' % (h, ) if tblstr: tblstr = ' <tr>\n%s\n </tr>\n' % (tblstr, ) tblstr = start + '<table class="admin_wvar_nomargin">\n' + tblstr # extra column try: extra = '<tr>' if type(firstrow) not in [int, long, str, dict]: # for data in firstrow: extra += '<td class="%s">%s</td>\n' % ('admintd', data) for i in range(len(firstrow)): extra += '<td class="%s">%s</td>\n' % (align[i], firstrow[i]) else: extra += ' <td class="%s">%s</td>\n' % (align[0], firstrow) extra += '<td rowspan="%s" style="vertical-align: top">\n%s\n</td>\n</tr>\n' % (len(tuple), extracolumn) except IndexError: extra = '' tblstr += extra # for i in range(1, len(tuple)): for row in tuple[1:]: tblstr += ' <tr>\n' # row = tuple[i] if type(row) not in [int, long, str, dict]: # for data in row: tblstr += '<td class="admintd">%s</td>\n' % (data,) for i in range(len(row)): tblstr += '<td class="%s">%s</td>\n' % (align[i], row[i]) else: tblstr += ' <td class="%s">%s</td>\n' % (align[0], row) tblstr += ' </tr> \n' tblstr += '</table> \n ' tblstr += end return tblstr | 965acd5ef7bd4ad208e161629a2f97743d4a6e13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/965acd5ef7bd4ad208e161629a2f97743d4a6e13/bibrankadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28325,
1469,
352,
429,
12,
3374,
22850,
6487,
3193,
22850,
6487,
787,
2218,
2187,
679,
2218,
2187,
7582,
1077,
355,
755,
2218,
11,
4672,
3536,
2640,
1729,
1014,
364,
279,
3193,
18,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28325,
1469,
352,
429,
12,
3374,
22850,
6487,
3193,
22850,
6487,
787,
2218,
2187,
679,
2218,
2187,
7582,
1077,
355,
755,
2218,
11,
4672,
3536,
2640,
1729,
1014,
364,
279,
3193,
18,
225,
... |
else: | if check_config: | def checkLatexConfig(check_config, bool_docbook, bool_linuxdoc): ''' Explore the LaTeX configuration ''' print 'checking LaTeX configuration... ', # First, remove the files that we want to re-create removeFiles(['textclass.lst', 'packages.lst', 'chkconfig.sed']) # if not check_config: print ' default values' print '+checking list of textclasses... ' tx = open('textclass.lst', 'w') tx.write(''' | 7329719becedc6b15b3baaec18945cc946718a56 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7514/7329719becedc6b15b3baaec18945cc946718a56/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
6607,
338,
809,
12,
1893,
67,
1425,
16,
1426,
67,
2434,
3618,
16,
1426,
67,
20132,
2434,
4672,
9163,
7784,
383,
266,
326,
21072,
21575,
60,
1664,
9163,
1172,
296,
24609,
21072,
2157... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
6607,
338,
809,
12,
1893,
67,
1425,
16,
1426,
67,
2434,
3618,
16,
1426,
67,
20132,
2434,
4672,
9163,
7784,
383,
266,
326,
21072,
21575,
60,
1664,
9163,
1172,
296,
24609,
21072,
2157... |
index = self.keys.index(val) | index = self.choices.index(text) | def textToValue(self, text): text = Param.textToValue(self, text) tmp = locale.atof(text) val = int(tmp) try: index = self.keys.index(val) except ValueError: index = 0 return index | 1f6160b06a4444687324525ba5d4c2d9892fbf5c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11522/1f6160b06a4444687324525ba5d4c2d9892fbf5c/userparams.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
977,
31183,
12,
2890,
16,
977,
4672,
977,
273,
3014,
18,
955,
31183,
12,
2890,
16,
977,
13,
1853,
273,
2573,
18,
270,
792,
12,
955,
13,
1244,
273,
509,
12,
5645,
13,
775,
30,
770,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
977,
31183,
12,
2890,
16,
977,
4672,
977,
273,
3014,
18,
955,
31183,
12,
2890,
16,
977,
13,
1853,
273,
2573,
18,
270,
792,
12,
955,
13,
1244,
273,
509,
12,
5645,
13,
775,
30,
770,
... |
first_line = fileobj.readline().strip() | first_line = fileobj.readline().strip().replace('"', '').replace(' ', '') | def _import_lang(self, cr, uid, data, context): form=data['form'] fileobj = TemporaryFile('w+') fileobj.write( base64.decodestring(form['data']) ) | 807c34c1b25eefc5886270762281c3863a2b000d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/807c34c1b25eefc5886270762281c3863a2b000d/wizard_import_lang.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5666,
67,
4936,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
646,
33,
892,
3292,
687,
3546,
17041,
273,
22791,
812,
2668,
91,
15,
6134,
17041,
18,
2626,
12,
1026,
1105,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
5666,
67,
4936,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
646,
33,
892,
3292,
687,
3546,
17041,
273,
22791,
812,
2668,
91,
15,
6134,
17041,
18,
2626,
12,
1026,
1105,
... |
if re.search("\s*$", line): | if re.search("^\s*$", line): | def pre_check_line(line): """ Pre-checks the line Returns: 0 = active line, with "# Added by timekpr" 1 = active line, without "# Added by timekpr" 2 = ignore this line """ # Ignore whitespace-only line if re.search("\s*$", line): return 2 # timekpr lines have "# Added by timekpr" in the end if line[-18::] != "# Added by timekpr": return 0 return 1 | 064ed28690d608f50d417bcb01501cf27c3c2757 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1574/064ed28690d608f50d417bcb01501cf27c3c2757/timekprpam-pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
675,
67,
1893,
67,
1369,
12,
1369,
4672,
3536,
2962,
17,
12366,
326,
980,
2860,
30,
374,
273,
2695,
980,
16,
598,
6619,
25808,
635,
813,
79,
683,
6,
404,
273,
2695,
980,
16,
2887,
66... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
675,
67,
1893,
67,
1369,
12,
1369,
4672,
3536,
2962,
17,
12366,
326,
980,
2860,
30,
374,
273,
2695,
980,
16,
598,
6619,
25808,
635,
813,
79,
683,
6,
404,
273,
2695,
980,
16,
2887,
66... |
record.append(resource[4]) record.append(resource[5].isoformat(' ')) record.append(resource[6]) record.append(resource[7]) | record.append(storageElement[3]) record.append(storageElement[4].isoformat(' ')) record.append(storageElement[5]) record.append(storageElement[6]) | def getMonitoredsStatusWeb(self, granularity, selectDict, sortList, startItem, maxItems): """ Get present sites status list, for the web. Calls :meth:`DIRAC.ResourceStatusSystem.DB.ResourceStatusDB.ResourceStatusDB.getMonitoredsList` and :meth:`DIRAC.ResourceStatusSystem.DB.ResourceStatusDB.ResourceStatusDB.getMonitoredsHistory` :params: :attr:`selectDict`: { 'SiteName':['XX', ...] , 'ExpandSiteHistory': ['XX', ...], 'Status': ['XX', ...]} and equivalents for the other monitoreds :attr:`sortList` :attr:`startItem` :attr:`maxItems` :return: { :attr:`ParameterNames`: ['SiteName', 'Tier', 'GridType', 'Country', 'Status', 'DateEffective', 'FormerStatus', 'Reason', 'StatusInTheMask'], :attr:'Records': [[], [], ...], :attr:'TotalRecords': X, :attr:'Extras': {} } """ if granularity in ('Site', 'Sites'): paramNames = ['SiteName', 'Tier', 'GridType', 'Country', 'Status', 'DateEffective', 'FormerStatus', 'Reason'] paramsList = ['SiteName', 'SiteType', 'Status', 'DateEffective', 'FormerStatus', 'Reason'] elif granularity in ('Service', 'Services'): paramNames = ['ServiceName', 'ServiceType', 'Site', 'Country', 'Status', 'DateEffective', 'FormerStatus', 'Reason'] paramsList = ['ServiceName', 'ServiceType', 'SiteName', 'Status', 'DateEffective', 'FormerStatus', 'Reason'] elif granularity in ('Resource', 'Resources'): paramNames = ['ResourceName', 'ServiceName', 'SiteName', 'ResourceType', 'Country', 'Status', 'DateEffective', 'FormerStatus', 'Reason'] paramsList = ['ResourceName', 'ServiceName', 'SiteName', 'ResourceType', 'Status', 'DateEffective', 'FormerStatus', 'Reason'] elif granularity in ('StorageElement', 'StorageElements'): paramNames = ['StorageElementName', 'ResourceName', 'SiteName', 'Country', 'Status', 'DateEffective', 'FormerStatus', 'Reason'] paramsList = ['StorageElementName', 'ResourceName', 'SiteName', 'Status', 'DateEffective', 'FormerStatus', 'Reason'] else: raise InvalidRes, where(self, self.getMonitoredsStatusWeb) | 7cdead35ce10e89d2d03fb0b96d1584b90c9036d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/7cdead35ce10e89d2d03fb0b96d1584b90c9036d/ResourceStatusDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2108,
265,
305,
479,
2377,
1482,
4079,
12,
2890,
16,
25380,
16,
2027,
5014,
16,
1524,
682,
16,
787,
1180,
16,
943,
3126,
4672,
3536,
968,
3430,
9180,
1267,
666,
16,
364,
326,
3311,
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,
2108,
265,
305,
479,
2377,
1482,
4079,
12,
2890,
16,
25380,
16,
2027,
5014,
16,
1524,
682,
16,
787,
1180,
16,
943,
3126,
4672,
3536,
968,
3430,
9180,
1267,
666,
16,
364,
326,
3311,
18,... |
xrange(0, (1 + len(sep)) * cnum + my_sum(colw))]) | xrange(0, (1 + len(sep)) * cnum + sum(colw))]) | def print_listing(self, headers, data, sep=' ', decor=True): ldata = list(data) if decor: ldata.insert(0, headers) print colw = [] ncols = len(ldata[0]) # assumes all rows are of equal length for cnum in xrange(0, ncols): mw = 0 for cell in [str(d[cnum]) or '' for d in ldata]: if len(cell) > mw: mw = len(cell) colw.append(mw) for rnum in xrange(len(ldata)): for cnum in xrange(ncols): if decor and rnum == 0: sp = ('%%%ds' % len(sep)) % ' ' # No separator in header else: sp = sep if cnum + 1 == ncols: sp = '' # No separator after last column print ('%%-%ds%s' % (colw[cnum], sp)) \ % (ldata[rnum][cnum] or ''), print if rnum == 0 and decor: print ''.join(['-' for x in xrange(0, (1 + len(sep)) * cnum + my_sum(colw))]) print | 8bfd000da40b8168bc7c6543227d6aa794adcb52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/8bfd000da40b8168bc7c6543227d6aa794adcb52/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
21228,
12,
2890,
16,
1607,
16,
501,
16,
5478,
2218,
2265,
4839,
33,
5510,
4672,
328,
892,
273,
666,
12,
892,
13,
309,
4839,
30,
328,
892,
18,
6387,
12,
20,
16,
1607,
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,
1172,
67,
21228,
12,
2890,
16,
1607,
16,
501,
16,
5478,
2218,
2265,
4839,
33,
5510,
4672,
328,
892,
273,
666,
12,
892,
13,
309,
4839,
30,
328,
892,
18,
6387,
12,
20,
16,
1607,
13,
... |
if computed and hasattr(self, 'visibility'): | if computed: | def getWidgetMode(self, object, field, mode): """ return the rendering macro used by the widget | 6b0f27c062ad81c84b9340eead9f149bbef4f0e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/6b0f27c062ad81c84b9340eead9f149bbef4f0e6/Widget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23434,
2309,
12,
2890,
16,
733,
16,
652,
16,
1965,
4672,
3536,
327,
326,
9782,
11522,
1399,
635,
326,
3604,
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,
23434,
2309,
12,
2890,
16,
733,
16,
652,
16,
1965,
4672,
3536,
327,
326,
9782,
11522,
1399,
635,
326,
3604,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
compositions = IntegerListsLex(range(*l), | compositions = IntegerListsLex(range(*arg), | def iter_morphisms(self, l=None, codomain=None, min_length=1): r""" Iterate over all morphisms with domain ``self`` and the given codmain. | ea0105ebeeb1b7b0ad31af91c2a4d8009f5a46e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ea0105ebeeb1b7b0ad31af91c2a4d8009f5a46e9/words.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
67,
81,
7657,
23749,
12,
2890,
16,
328,
33,
7036,
16,
11012,
1530,
33,
7036,
16,
1131,
67,
2469,
33,
21,
4672,
436,
8395,
11436,
1879,
777,
14354,
23749,
598,
2461,
12176,
2890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
67,
81,
7657,
23749,
12,
2890,
16,
328,
33,
7036,
16,
11012,
1530,
33,
7036,
16,
1131,
67,
2469,
33,
21,
4672,
436,
8395,
11436,
1879,
777,
14354,
23749,
598,
2461,
12176,
2890,
... |
startWxDate = self.GetStartDate(); endWxDate = startWxDate + wx.DateSpan.Month() + wx.DateSpan.Month() + wx.DateSpan.Month() startDate = date(startWxDate.GetYear(), startWxDate.GetMonth() + 1, startWxDate.GetDay()) month = startDate.month + 3 if month > 12: endDate = startDate.replace(year=startDate.year+1, month=month - 12) else: endDate = startDate.replace(month=month) numDays = (endDate - startDate).days busyFractions = {} defaultTzinfo = ICUtzinfo.getDefault() for item in self.blockItem.getItemsInRange( (datetime.combine(startDate, time(0)), datetime.combine(endDate, time(0))), timedItems=True, dayItems=True): if item.transparency == "confirmed": if item.startTime.tzinfo is not None: startTime = item.startTime.astimezone(defaultTzinfo) | self._doDrawing() def _doDrawing(self): startWxDate = self.GetStartDate(); endWxDate = startWxDate + wx.DateSpan.Month() + wx.DateSpan.Month() + wx.DateSpan.Month() startDate = date(startWxDate.GetYear(), startWxDate.GetMonth() + 1, startWxDate.GetDay()) month = startDate.month + 3 if month > 12: endDate = startDate.replace(year=startDate.year+1, month=month - 12) else: endDate = startDate.replace(month=month) numDays = (endDate - startDate).days busyFractions = {} defaultTzinfo = ICUtzinfo.getDefault() def updateBusy(event, start): if event.transparency == "confirmed": if event.allDay: hours = 12.0 else: hours = event.duration.seconds / (60 * 60) if start.tzinfo is not None: start = start.astimezone(defaultTzinfo) offset = (start.date() - startDate).days fraction = busyFractions.get(offset, 0.25) fraction += (hours / 12.0) busyFractions[offset] = min(fraction, 1.0) self.blockItem.EnsureIndexes() startDatetime = datetime.combine(startDate, time(0)) endDatetime = datetime.combine(endDate, time(0)) for item in self.blockItem.eventsInRange(startDatetime, endDatetime, dayItems=True, timedItems=True): updateBusy(item, item.startTime) events = self.blockItem.contents.rep view = self.blockItem.itsView app = schema.ns("osaf.app", view) allEvents = app.events.rep masterEvents = app.masterEvents.rep keys = self.blockItem.getKeysInRange(startDatetime, 'effectiveStartTime', 'effectiveStart', allEvents, endDatetime, 'recurrenceEnd', 'recurrenceEnd', masterEvents, events, '__adhoc__') for key in keys: masterEvent = view[key] rruleset = masterEvent.createDateUtilFromRule() tzinfo = masterEvent.startTime.tzinfo startDatetime = startDatetime.replace(tzinfo=tzinfo) endDatetime = endDatetime.replace(tzinfo=tzinfo) modifications = list(masterEvent.modifications or []) for recurDatetime in rruleset.between(startDatetime, endDatetime, True): matchingMod = None for mod in modifications: if Calendar.datetimeOp(recurDatetime, '==', mod.recurrenceID): matchingMod = mod break if matchingMod is None: updateBusy(masterEvent, recurDatetime) else: modStart = matchingMod.startTime if modStart.tzinfo is None: modStart = modStart.replace(tzinfo=tzinfo) | def _checkRedraw(self): if self._redrawCount > 0: self._redrawCount = 0 | 7696df6706210830fba4dea5b789d3565a8e26cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/7696df6706210830fba4dea5b789d3565a8e26cf/CalendarBlocks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
3715,
1899,
12,
2890,
4672,
309,
365,
6315,
1118,
1899,
1380,
405,
374,
30,
365,
6315,
1118,
1899,
1380,
273,
374,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
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,
1893,
3715,
1899,
12,
2890,
4672,
309,
365,
6315,
1118,
1899,
1380,
405,
374,
30,
365,
6315,
1118,
1899,
1380,
273,
374,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
wxDialog.__init__(self, id = wxID_COMMONDEFDLG, name = 'CommonDefDlg', parent = prnt, pos = wxPoint(398, 249), size = wxSize(192, 220), style = wxDEFAULT_DIALOG_STYLE, title = 'Common definition') self.SetClientSize(wxSize(184, 200)) self.propTypeRBx = wxRadioBox(choices = ['Colour value', 'Font face', 'Size value'], id = wxID_COMMONDEFDLGPROPTYPERBX, label = 'Property type', majorDimension = 1, name = 'propTypeRBx', parent = self, point = wxPoint(8, 8), size = wxSize(168, 92), style = wxRA_SPECIFY_COLS, validator = wxDefaultValidator) | wx.Dialog.__init__(self, id = wxID_COMMONDEFDLG, name = 'CommonDefDlg', parent = prnt, pos = wx.Point(398, 249), size = wx.Size(192, 220), style= wx.DEFAULT_DIALOG_STYLE, title = 'Common definition') self.SetClientSize(wx.Size(184, 200)) self.propTypeRBx = wx.RadioBox(choices = ['Colour value', 'Font face', 'Size value'], id = wxID_COMMONDEFDLGPROPTYPERBX, label = 'Property type', majorDimension = 1, name = 'propTypeRBx', parent = self, point = wx.Point(8, 8), size = wx.Size(168, 92), style= wx.RA_SPECIFY_COLS) | def _init_ctrls(self, prnt): wxDialog.__init__(self, id = wxID_COMMONDEFDLG, name = 'CommonDefDlg', parent = prnt, pos = wxPoint(398, 249), size = wxSize(192, 220), style = wxDEFAULT_DIALOG_STYLE, title = 'Common definition') self.SetClientSize(wxSize(184, 200)) | 1e19321bfb8d6ff348cd85bdad3a1a4c2f517fa0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/1e19321bfb8d6ff348cd85bdad3a1a4c2f517fa0/STCStyleEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
273,
7075,
734,
67,
4208,
17667,
12904,
8914,
43,
16,
508,
273,
296,
6517,
3262... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
273,
7075,
734,
67,
4208,
17667,
12904,
8914,
43,
16,
508,
273,
296,
6517,
3262... |
repomap[repo].diff(repo, files) | repomap[repo].diff(repo, list(files)) | def diff(ui, repo, *files, **opts): """diff of the current patch""" repomap[repo].diff(repo, files) return 0 | 2026f0267f9460e6a17af1248ad8bd782eba93a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/2026f0267f9460e6a17af1248ad8bd782eba93a4/mq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3122,
12,
4881,
16,
3538,
16,
380,
2354,
16,
2826,
4952,
4672,
3536,
5413,
434,
326,
783,
4729,
8395,
225,
2071,
362,
438,
63,
7422,
8009,
5413,
12,
7422,
16,
666,
12,
2354,
3719,
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,
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,
3122,
12,
4881,
16,
3538,
16,
380,
2354,
16,
2826,
4952,
4672,
3536,
5413,
434,
326,
783,
4729,
8395,
225,
2071,
362,
438,
63,
7422,
8009,
5413,
12,
7422,
16,
666,
12,
2354,
3719,
327,... |
self.server_bind() self.server_activate() | if bind_and_activate: self.server_bind() self.server_activate() | def __init__(self, server_address, RequestHandlerClass, ssl_context): """ Superclass says: Constructor. May be extended, do not override. This class says: Ho-hum. """ self.server_address=server_address self.RequestHandlerClass=RequestHandlerClass self.ssl_ctx=ssl_context self.socket=Connection(self.ssl_ctx) self.server_bind() self.server_activate() | cac4ec2c1257d56dd717a09e8b822d9c7dcef584 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10522/cac4ec2c1257d56dd717a09e8b822d9c7dcef584/SSLServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1438,
67,
2867,
16,
25106,
797,
16,
5832,
67,
2472,
4672,
3536,
14845,
1106,
20185,
30,
11417,
18,
16734,
506,
7021,
16,
741,
486,
3849,
18,
1220,
667,
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,
1001,
2738,
972,
12,
2890,
16,
1438,
67,
2867,
16,
25106,
797,
16,
5832,
67,
2472,
4672,
3536,
14845,
1106,
20185,
30,
11417,
18,
16734,
506,
7021,
16,
741,
486,
3849,
18,
1220,
667,
2... |
""" | """ | def nextTimepoint(self): """ Created: 18.07.2005, KP Description: Go to next timepoint """ if self.timepoint < self.maxTimepoint: Logging.info("Setting timepoint to ", self.timepoint + 1, kw = "visualizer") self.setTimepoint(self.timepoint + 1) self.blockTpUpdate = 1 lib.messenger.send(None, "timepoint_changed", self.timepoint) self.blockTpUpdate = 0 | 228d177ed04eda3e5752ade67b1e400d3b569646 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2877/228d177ed04eda3e5752ade67b1e400d3b569646/Visualizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
950,
1153,
12,
2890,
4672,
3536,
12953,
30,
6549,
18,
8642,
18,
6976,
25,
16,
1475,
52,
6507,
30,
4220,
358,
1024,
813,
1153,
3536,
309,
365,
18,
957,
1153,
411,
365,
18,
1896,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
950,
1153,
12,
2890,
4672,
3536,
12953,
30,
6549,
18,
8642,
18,
6976,
25,
16,
1475,
52,
6507,
30,
4220,
358,
1024,
813,
1153,
3536,
309,
365,
18,
957,
1153,
411,
365,
18,
1896,
... |
command = '%s/bibupload -ri %s ' % (bindir, convertpath) | command = '%s/bibupload -r -i %s ' % (bindir, convertpath) | def call_bibupload(convertpath): """ A method that uploads a file to the database - calls bibUpload """ command = '%s/bibupload -ri %s ' % (bindir, convertpath) p=os.system(command) return p | 12175fb165af0163017174733b194dcc5ca708e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/12175fb165af0163017174733b194dcc5ca708e8/oaiharvestlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
67,
70,
495,
6327,
12,
6283,
803,
4672,
3536,
432,
707,
716,
18427,
279,
585,
358,
326,
2063,
300,
4097,
25581,
4777,
3536,
1296,
273,
1995,
87,
19,
70,
495,
6327,
300,
86,
300,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
67,
70,
495,
6327,
12,
6283,
803,
4672,
3536,
432,
707,
716,
18427,
279,
585,
358,
326,
2063,
300,
4097,
25581,
4777,
3536,
1296,
273,
1995,
87,
19,
70,
495,
6327,
300,
86,
300,
... |
if data['center_json'] == 'null' or not data['center_json']: data['center_json'] = False | if data['center_json'] == 'null': data['geocode_failed'] = True; | def people_map(request): data = {} data['people'] = Person.objects.all().order_by('user__username') data['person_id2data_as_json'] = simplejson.dumps(dict([ (person.pk, {'name': person.get_full_name_or_username(), 'location': person.location_display_name}) for person in Person.objects.all() if person.location_display_name])) data['test_js'] = request.GET.get('test', None) data['num_of_persons_with_locations'] = len([p for p in Person.objects.all() if p.location_display_name]) if 'center' in request.GET: data['center_json'] = mysite.base.controllers.cached_geocoding_in_json( request.GET.get('center', '')) if data['center_json'] == 'null' or not data['center_json']: data['center_json'] = False data['center_name'] = request.GET.get('center', '') data['center_name_json'] = simplejson.dumps(request.GET.get('center', '')) return (request, 'profile/map.html', data) | a30813303f34a65b4e208771b5a7b2a9785d38d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11976/a30813303f34a65b4e208771b5a7b2a9785d38d2/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16951,
67,
1458,
12,
2293,
4672,
501,
273,
2618,
501,
3292,
28035,
3546,
273,
11573,
18,
6911,
18,
454,
7675,
1019,
67,
1637,
2668,
1355,
972,
5053,
6134,
501,
3292,
12479,
67,
350,
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,
16951,
67,
1458,
12,
2293,
4672,
501,
273,
2618,
501,
3292,
28035,
3546,
273,
11573,
18,
6911,
18,
454,
7675,
1019,
67,
1637,
2668,
1355,
972,
5053,
6134,
501,
3292,
12479,
67,
350,
22,
... |
member_id = url_quote(member_id, '') return BaseMembershipTool.createMemberarea(self, member_id, minimal) | if hasattr(members, 'aq_explicit'): members=members.aq_explicit if members is None: return safe_member_id = url_quote(member_id,'') if hasattr(members, safe_member_id): return _createObjectByType('Folder', members, id=safe_member_id) acl_users = self.__getPUS() user = acl_users.getUser(member_id) if user is not None: user= user.__of__(acl_users) else: user= getSecurityManager().getUser() if user.getId() != member_id: raise NotImplementedError, \ 'cannot get user for member area creation' properties = getToolByName(self, 'portal_properties') charset = properties.site_properties.getProperty('default_charset', 'utf-8') self.REQUEST.RESPONSE.setHeader('Content-Type', 'text/html;charset=%s' % charset) member_folder_title = translate( 'plone', 'title_member_folder', {'member': member_id}, self, default = "%s's Home" % member_id) member_folder_description = translate( 'plone', 'description_member_folder', {'member': member_id}, self, default = 'Home page area that contains the items created ' \ 'and collected by %s' % member_id) member_folder_index_html_title = translate( 'plone', 'title_member_folder_index_html', {'member': member_id}, self, default = "Home page for %s" % member_id) personal_folder_title = translate( 'plone', 'title_member_personal_folder', {'member': member_id}, self, default = "Personal Items for %s" % member_id) personal_folder_description = translate( 'plone', 'description_member_personal_folder', {'member': member_id}, self, default = 'contains personal workarea items for %s' % member_id) member_folder = self.getHomeFolder(member_id) member_folder.changeOwnership(user) member_folder.__ac_local_roles__ = None member_folder.manage_setLocalRoles(member_id, ['Owner']) member_folder.edit(title=member_folder_title, description=member_folder_description) member_folder.reindexObject() _createObjectByType('Folder', member_folder, id=self.personal_id) personal = getattr(member_folder, self.personal_id) personal.edit(title=personal_folder_title, description=personal_folder_description) personal.changeOwnership(user) personal.__ac_local_roles__ = None personal.manage_setLocalRoles(member_id, ['Owner']) catalog.unindexObject(personal) if minimal: return homepageText = getattr(self, 'homePageText', None) if homepageText: member_object = self.getMemberById(member_id) portal = getToolByName(self, 'portal_url') content = homepageText(member=member_object, portal=portal).strip() _createObjectByType('Document', member_folder, id='index_html') hpt = getattr(member_folder, 'index_html') hpt.setTitle(member_folder_index_html_title) if hpt.meta_type == 'Document': hpt.edit(text_format='structured-text', text=content) else: hpt.update(text=content) hpt.setFormat('structured-text') hpt.reindexObject() hpt.changeOwnership(user) hpt.__ac_local_roles__ = None hpt.manage_setLocalRoles(member_id, ['Owner']) notify_script = getattr(member_folder, 'notifyMemberAreaCreated', None) if notify_script is not None: notify_script() | def createMemberarea(self, member_id=None, minimal=0): """ Create a member area for 'member_id' or the authenticated user. Specially instrumented to for URL-quoted-member-id folder names. """ if not member_id: # member_id is optional (see CMFCore.interfaces.portal_membership: # Create a member area for 'member_id' or authenticated user.) member = membership.getAuthenticatedMember() member_id = member.getId() member_id = url_quote(member_id, '') # we provide the 'safe' # param because want '/' # encoded return BaseMembershipTool.createMemberarea(self, member_id, minimal) | a80729a7a9edf1a5cc03cde376738e7aebeb8161 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12230/a80729a7a9edf1a5cc03cde376738e7aebeb8161/membership.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
4419,
5036,
12,
2890,
16,
3140,
67,
350,
33,
7036,
16,
16745,
33,
20,
4672,
3536,
1788,
279,
3140,
5091,
364,
296,
5990,
67,
350,
11,
578,
326,
9370,
729,
18,
4185,
6261,
10353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4419,
5036,
12,
2890,
16,
3140,
67,
350,
33,
7036,
16,
16745,
33,
20,
4672,
3536,
1788,
279,
3140,
5091,
364,
296,
5990,
67,
350,
11,
578,
326,
9370,
729,
18,
4185,
6261,
10353,
... |
col.set_spacing(6) | col.set_spacing(15) | def populateProductDialog(self): state_icon_map = {"Expired" : gtk.STOCK_DIALOG_WARNING, "Not Subscribed" : gtk.STOCK_DIALOG_QUESTION, "Subscribed" : gtk.STOCK_APPLY, } self.tv_products = self.subsxml.get_widget("treeview_updates") self.productList = gtk.ListStore(gtk.gdk.Pixbuf, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING) self.warn_count = 0 for product in managerlib.getInstalledProductStatus(): markup_status = product[1] if product[1] in ["Expired", "Not Subscribed"]: self.warn_count += 1 markup_status = '<span foreground="red"><b>%s</b></span>' % product[1] self.status_icon = self.tv_products.render_icon(state_icon_map[product[1]], size=gtk.ICON_SIZE_MENU) self.productList.append((self.status_icon, product[0], markup_status, product[2])) self.tv_products.set_model(self.productList) | 8ee7f8dce081e8fd2c064fe92fa21d196ca993ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11137/8ee7f8dce081e8fd2c064fe92fa21d196ca993ab/managergui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
4133,
6353,
12,
2890,
4672,
919,
67,
3950,
67,
1458,
273,
12528,
10556,
6,
294,
22718,
18,
31487,
3507,
67,
2565,
18683,
67,
9511,
16,
315,
1248,
2592,
15802,
6,
294,
22718,
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,
6490,
4133,
6353,
12,
2890,
4672,
919,
67,
3950,
67,
1458,
273,
12528,
10556,
6,
294,
22718,
18,
31487,
3507,
67,
2565,
18683,
67,
9511,
16,
315,
1248,
2592,
15802,
6,
294,
22718,
18,
... |
sys.stdout.write( " Checking QTDIR enviroment variable: " ) if ( os.environ.has_key("QTDIR") and os.path.exists( os.environ["QTDIR"] ) ): | global qt_dir sys.stdout.write( " Checking QT installation: " ) if not options.qt_dir: if ( os.environ.has_key("QTDIR") and os.path.exists( os.environ["QTDIR"] ) ): qt_dir = os.environ["QTDIR"] sys.stdout.write( green("Pass\n") ) sys.stdout.write( " Found value for QTDIR: %s\n" % qt_dir ) else: sys.stdout.write( red("Fail") + "\n" ) sys.stdout.write( " You must properly setup the QTDIR environment variable or use --qt-directory parameter!\n" ) sys.exit(); else: qt_dir = options.qt_dir | def checkQt(): sys.stdout.write("Checking QT Configuration:\n") if sys.platform == "win32": QMAKE_EXECUTABLE = "qmake.exe" else: QMAKE_EXECUTABLE = "qmake" sys.stdout.write( " Checking QTDIR enviroment variable: " ) if ( os.environ.has_key("QTDIR") and os.path.exists( os.environ["QTDIR"] ) ): sys.stdout.write( green("Pass\n") ) sys.stdout.write( " Found value for QTDIR: %s\n" % os.environ["QTDIR"] ) else: sys.stdout.write( red("Fail") + "\n" ) sys.stdout.write( " You must properly setup the QTDIR environment variable!\n" ) sys.exit(); sys.stdout.write( " Searching for qmake executable: " ) temp = "" QMAKESEARCHPATH = [ os.path.join(os.path.join(os.environ["QTDIR"], "bin"), QMAKE_EXECUTABLE) ] for dir in string.split( os.environ["PATH"], os.path.pathsep ): QMAKESEARCHPATH.append( os.path.join( dir, QMAKE_EXECUTABLE ) ) qmake_file, qmake_path = findFile(QMAKESEARCHPATH) global qt_qmake; qt_qmake = os.path.join(qmake_path, qmake_file) sys.stdout.write( "%s\n" % qt_qmake ) sys.stdout.write("\n") return True | 78484cd2a4d87b0d0e002bff43e1f469895e77f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/78484cd2a4d87b0d0e002bff43e1f469895e77f6/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
23310,
13332,
2589,
18,
10283,
18,
2626,
2932,
14294,
2238,
56,
4659,
5581,
82,
7923,
309,
2589,
18,
9898,
422,
315,
8082,
1578,
6877,
2238,
5535,
6859,
67,
15271,
1693,
2782,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
23310,
13332,
2589,
18,
10283,
18,
2626,
2932,
14294,
2238,
56,
4659,
5581,
82,
7923,
309,
2589,
18,
9898,
422,
315,
8082,
1578,
6877,
2238,
5535,
6859,
67,
15271,
1693,
2782,
273,
... |
assert_mv_rval(index.move(files, force=True)) | assert_mv_rval(index.move(files, f=True)) | def assert_mv_rval(rval): for source, dest in rval: assert not os.path.exists(source) and os.path.exists(dest) # END for each renamed item | 8858a63cb33319f3e739edcbfafdae3ec0fefa33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13767/8858a63cb33319f3e739edcbfafdae3ec0fefa33/test_index.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
67,
17509,
67,
86,
1125,
12,
86,
1125,
4672,
364,
1084,
16,
1570,
316,
14267,
30,
1815,
486,
1140,
18,
803,
18,
1808,
12,
3168,
13,
471,
1140,
18,
803,
18,
1808,
12,
10488,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
67,
17509,
67,
86,
1125,
12,
86,
1125,
4672,
364,
1084,
16,
1570,
316,
14267,
30,
1815,
486,
1140,
18,
803,
18,
1808,
12,
3168,
13,
471,
1140,
18,
803,
18,
1808,
12,
10488,
13,... |
if handler is logging.StreamHandler and os.name != 'nt': | if logging_to_stdout and os.name != 'nt': | def init_logger(): import os logger = logging.getLogger() # create a format for log messages and dates formatter = logging.Formatter('[%(asctime)s] %(levelname)s:%(name)s:%(message)s', '%a %b %d %Y %H:%M:%S') if tools.config['syslog']: # SysLog Handler if os.name == 'nt': handler = logging.handlers.NTEventLogHandler("%s %s" % (release.description, release.version)) else: handler = logging.handlers.SysLogHandler('/dev/log') formatter = logging.Formatter("%s %s" % (release.description, release.version) + ':%(levelname)s:%(name)s:%(message)s') elif tools.config['logfile']: # LogFile Handler logf = tools.config['logfile'] try: dirname = os.path.dirname(logf) if dirname and not os.path.isdir(dirname): os.makedirs(dirname) handler = logging.handlers.TimedRotatingFileHandler(logf,'D',1,30) except Exception, ex: sys.stderr.write("ERROR: couldn't create the logfile directory\n") handler = logging.StreamHandler(sys.stdout) else: # Normal Handler on standard output handler = logging.StreamHandler(sys.stdout) # tell the handler to use this format handler.setFormatter(formatter) # add the handler to the root logger logger.addHandler(handler) logger.setLevel(tools.config['log_level'] or '0') if handler is logging.StreamHandler and os.name != 'nt': # change color of level names # uses of ANSI color codes # see http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html # maybe use http://code.activestate.com/recipes/574451/ colors = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', None, 'default'] foreground = lambda f: 30 + colors.index(f) background = lambda f: 40 + colors.index(f) mapping = { 'DEBUG_RPC': ('blue', 'white'), 'DEBUG': ('blue', 'default'), 'INFO': ('green', 'default'), 'WARNING': ('yellow', 'default'), 'ERROR': ('red', 'default'), 'CRITICAL': ('white', 'red'), } for level, (fg, bg) in mapping.items(): msg = "\x1b[%dm\x1b[%dm%s\x1b[0m" % (foreground(fg), background(bg), level) logging.addLevelName(getattr(logging, level), msg) | 27240361ca5ead2597ae8f0c63043bab0e969001 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/27240361ca5ead2597ae8f0c63043bab0e969001/netsvc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
4901,
13332,
1930,
1140,
225,
1194,
273,
2907,
18,
588,
3328,
1435,
468,
752,
279,
740,
364,
613,
2743,
471,
7811,
4453,
273,
2907,
18,
5074,
2668,
14451,
12,
345,
21261,
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,
1208,
67,
4901,
13332,
1930,
1140,
225,
1194,
273,
2907,
18,
588,
3328,
1435,
468,
752,
279,
740,
364,
613,
2743,
471,
7811,
4453,
273,
2907,
18,
5074,
2668,
14451,
12,
345,
21261,
13,
... |
HAVING ABS(SUM(debit-credit)) <> %s AND count(*)>0"%(account_id, 0.0) | HAVING ABS(SUM(debit-credit)) = %s AND count(*)>0"%(account_id, 0.0) | def reconcile(self, cr, uid, ids, context=None): move_line_obj = self.pool.get('account.move.line') obj_model = self.pool.get('ir.model.data') if context is None: context = {} form = self.read(cr, uid, ids, [])[0] max_amount = form.get('max_amount', 0.0) power = form['power'] reconciled = unreconciled = 0 if not form['account_ids']: raise osv.except_osv(_('UserError'), _('You must select accounts to reconcile')) for account_id in form['account_ids']: if not context.get('allow_write_off', False): query = "SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL \ AND state <> 'draft' GROUP BY partner_id \ HAVING ABS(SUM(debit-credit)) <> %s AND count(*)>0"%(account_id, 0.0) else: query = "SELECT partner_id FROM account_move_line WHERE account_id=%s AND reconcile_id IS NULL \ AND state <> 'draft' GROUP BY partner_id \ HAVING ABS(SUM(debit-credit)) <= %s AND count(*)>0"%(account_id, max_amount or 0.0) # reconcile automatically all transactions from partners whose balance is 0 cr.execute(query) partner_ids = [id for (id,) in cr.fetchall()] for partner_id in partner_ids: cr.execute( "SELECT id " \ "FROM account_move_line " \ "WHERE account_id=%s " \ "AND partner_id=%s " \ "AND state <> 'draft' " \ "AND reconcile_id IS NULL", (account_id, partner_id)) line_ids = [id for (id,) in cr.fetchall()] if len(line_ids): reconciled += len(line_ids) if not context.get('allow_write_off', False): move_line_obj.reconcile_partial(cr, uid, line_ids, 'manual', context={}) else: move_line_obj.reconcile(cr, uid, line_ids, 'auto', form['writeoff_acc_id'], form['period_id'], form['journal_id'], context) | 68464d2e8adc26cc6cbade3f829ab919e98963b0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/68464d2e8adc26cc6cbade3f829ab919e98963b0/account_automatic_reconcile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27163,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
3635,
67,
1369,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
4631,
18,
8501,
18,
1369,
6134,
1081,
67,
2284,
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,
27163,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
3635,
67,
1369,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
4631,
18,
8501,
18,
1369,
6134,
1081,
67,
2284,
2... |
MetaInformation.smart_update(self, other, replace_metadata=True) | MetaInformation.smart_update(self, other, replace_metadata) | def smart_update(self, other): ''' Merge the information in C{other} into self. In case of conflicts, the information in C{other} takes precedence, unless the information in C{other} is NULL. ''' | 17c9b2f206825d166cf1775eb6e1e5ef304c88f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/17c9b2f206825d166cf1775eb6e1e5ef304c88f1/books.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13706,
67,
2725,
12,
2890,
16,
1308,
4672,
9163,
8964,
326,
1779,
316,
385,
95,
3011,
97,
1368,
365,
18,
657,
648,
434,
14450,
16,
326,
1779,
316,
385,
95,
3011,
97,
5530,
14172,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13706,
67,
2725,
12,
2890,
16,
1308,
4672,
9163,
8964,
326,
1779,
316,
385,
95,
3011,
97,
1368,
365,
18,
657,
648,
434,
14450,
16,
326,
1779,
316,
385,
95,
3011,
97,
5530,
14172,
16,
... |
cmd = '/usr/bin/ffmpeg -i "{0}" {1} -bufsize {2} -s {3}x{4} -{5} {6} -{7} {6} -aspect {11} -ab {8} -b {9} {10}'.format( | cmd = '/usr/bin/ffmpeg -i "{0}" {1} -bufsize {2} -s {3}x{4} -{5} {6} -{7} {6} -aspect {11} -ab {8} -b {9} "{10}"'.format( | def process_files(files, options): if len(files) == 0: print 'Error: no valid files could be found.' sys.exit(1) return print 'Found %s files to be processed' % len(files) for f in files: print ' processing: %s' % f outfile = os.path.splitext(os.path.basename(f))[0] + '.mp4' outfile = os.path.join(options.outdir, outfile) print ' outfile:', outfile #ext = os.path.splitext(f)[1] #print ' {0} {1} {2}'.format(f, outfile, ext) # open the file to figure out the aspect ratio duration, time_f, w, h = 0.0, 0.0, 0, 0 cmd = '/usr/bin/ffmpeg -i "%s" ' % f print cmd print '' returncode, output = encode(cmd) | 566018de6a0a6077ee66e7ffe9ad587694d5f59d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13781/566018de6a0a6077ee66e7ffe9ad587694d5f59d/mp4ize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2354,
12,
2354,
16,
702,
4672,
225,
309,
562,
12,
2354,
13,
422,
374,
30,
1172,
296,
668,
30,
1158,
923,
1390,
3377,
506,
1392,
1093,
2589,
18,
8593,
12,
21,
13,
327,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2354,
12,
2354,
16,
702,
4672,
225,
309,
562,
12,
2354,
13,
422,
374,
30,
1172,
296,
668,
30,
1158,
923,
1390,
3377,
506,
1392,
1093,
2589,
18,
8593,
12,
21,
13,
327,
225,
... |
pth_file.cleanup() | pth_file.cleanup(prep=True) | def test_addpackage(self): # Make sure addpackage() imports if the line starts with 'import', # adds directories to sys.path for any line in the file that is not a # comment or import that is a valid directory name for where the .pth # file resides; invalid directories are not added pth_file = PthFile() pth_file.cleanup() # to make sure that nothing is pre-existing that # shouldn't be try: pth_file.create() site.addpackage(pth_file.base_dir, pth_file.filename, set()) unittest.FunctionTestCase(pth_file.test) finally: pth_file.cleanup() | 3620fe8a2fa3efdf994d0306c037b2abdc71ecd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3620fe8a2fa3efdf994d0306c037b2abdc71ecd3/test_site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1289,
5610,
12,
2890,
4672,
468,
4344,
3071,
527,
5610,
1435,
10095,
309,
326,
980,
2542,
598,
296,
5666,
2187,
468,
4831,
6402,
358,
2589,
18,
803,
364,
1281,
980,
316,
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,
1842,
67,
1289,
5610,
12,
2890,
4672,
468,
4344,
3071,
527,
5610,
1435,
10095,
309,
326,
980,
2542,
598,
296,
5666,
2187,
468,
4831,
6402,
358,
2589,
18,
803,
364,
1281,
980,
316,
326,
... |
return round(open*100./total) | return round(closed*100./total) | def _progress(self, cr, uid, context=None): total = self.pool.get('ir.actions.todo')\ .search_count(cr, uid, [], context) open = self.pool.get('ir.actions.todo')\ .search_count(cr, uid, [('state','<>','open')], context) if total: return round(open*100./total) return 100. | 14679fd073db60c1e622a5aa73fa635961b193d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/14679fd073db60c1e622a5aa73fa635961b193d3/res_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8298,
12,
2890,
16,
4422,
16,
4555,
16,
819,
33,
7036,
4672,
2078,
273,
365,
18,
6011,
18,
588,
2668,
481,
18,
4905,
18,
9012,
11,
5153,
263,
3072,
67,
1883,
12,
3353,
16,
4555,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8298,
12,
2890,
16,
4422,
16,
4555,
16,
819,
33,
7036,
4672,
2078,
273,
365,
18,
6011,
18,
588,
2668,
481,
18,
4905,
18,
9012,
11,
5153,
263,
3072,
67,
1883,
12,
3353,
16,
4555,... |
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. | 5b0f4a342a90f9133d5a4484b9cfea6b03f24a35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/5b0f4a342a90f9133d5a4484b9cfea6b03f24a35/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,
-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.