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 num_files > 70: print >>sys.stderr else: print >>sys.stderr, ']' | if num_modules <= 70: sys.stderr.write(']') print >>sys.stderr | def progress_callback(file, doc, verbosity=options['verbosity'], num_files=num_files, file_num=[1]): if verbosity==1: if file_num[0] == 1 and num_files <= 70: sys.stderr.write(' [') if (file_num[0] % 60) == 1 and num_files > 70: sys.stderr.write(' [%3d%%] ' % (100.0*file_num[0]/num_files)) sys.stderr.write('.') if (file_num[0] % 60) == 0 and num_files > 70: print >>sys.stderr if file_num[0] == num_files: if num_files > 70: print >>sys.stderr else: print >>sys.stderr, ']' elif verbosity>1: TRACE_FORMAT = ((' [%%%dd/%d]' % (len(`num_files`), num_files)) + ' Writing docs for %s %s') if doc and doc.uid().is_module(): print >>sys.stderr, (TRACE_FORMAT % (file_num[0], 'module:', doc.uid())) elif doc and doc.uid().is_class(): print >>sys.stderr, (TRACE_FORMAT % (file_num[0], 'class: ', doc.uid())) else: print >>sys.stderr, (TRACE_FORMAT % (file_num[0], 'file: ', os.path.basename(file))) file_num[0] += 1 | 868f2f4415ae76aa54be6db8cb3aff0366684222 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/868f2f4415ae76aa54be6db8cb3aff0366684222/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4007,
67,
3394,
12,
768,
16,
997,
16,
11561,
33,
2116,
3292,
16629,
8807,
17337,
818,
67,
2354,
33,
2107,
67,
2354,
16,
585,
67,
2107,
22850,
21,
65,
4672,
309,
11561,
631,
21,
30,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4007,
67,
3394,
12,
768,
16,
997,
16,
11561,
33,
2116,
3292,
16629,
8807,
17337,
818,
67,
2354,
33,
2107,
67,
2354,
16,
585,
67,
2107,
22850,
21,
65,
4672,
309,
11561,
631,
21,
30,
3... |
has_header = "X-Spambayes-Exception: " in new_msg.as_string() | has_header = new_msg.as_string().find("X-Spambayes-Exception: ") != -1 | def test_get_bad_message(self): self.msg.id = "unittest" self.msg.imap_server.login(IMAP_USERNAME, IMAP_PASSWORD) self.msg.imap_server.select() self.msg.uid = 103 # id of malformed message in dummy server self.msg.folder = IMAPFolder("Inbox", self.msg.imap_server) print "\nWith email package versions less than 3.0, you should " \ "see an error parsing the message." new_msg = self.msg.get_full_message() # With Python < 2.4 (i.e. email < 3.0) we get an exception # header. With more recent versions, we get a defects attribute. # XXX I can't find a message that generates a defect! Until # message 103 is replaced with one that does, this will fail with # Python 2.4/email 3.0. has_header = "X-Spambayes-Exception: " in new_msg.as_string() has_defect = hasattr(new_msg, "defects") and len(new_msg.defects) > 0 self.assert_(has_header or has_defect) | f8d176655bad5a1f86f5910d066a0bd3a98d779b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/f8d176655bad5a1f86f5910d066a0bd3a98d779b/test_sb_imapfilter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
67,
8759,
67,
2150,
12,
2890,
4672,
365,
18,
3576,
18,
350,
273,
315,
4873,
3813,
6,
365,
18,
3576,
18,
12161,
67,
3567,
18,
5819,
12,
3445,
2203,
67,
21292,
16,
6246,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
67,
8759,
67,
2150,
12,
2890,
4672,
365,
18,
3576,
18,
350,
273,
315,
4873,
3813,
6,
365,
18,
3576,
18,
12161,
67,
3567,
18,
5819,
12,
3445,
2203,
67,
21292,
16,
6246,... |
xreadlines(self.log))) | self.log.readlines())) | def run(self, list): 'Run all test programs given in LIST.' self._open_log('w') failed = 0 for prog in list: failed = self._run_test(prog) or failed if failed: print 'At least one test FAILED, checking ' + self.logfile self._open_log('r') map(sys.stdout.write, filter(lambda x: x[:4] == 'FAIL', xreadlines(self.log))) self._close_log() | 51c219b0f85c3f30fc012518bf73c428b8d3dd61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6036/51c219b0f85c3f30fc012518bf73c428b8d3dd61/run-tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
666,
4672,
296,
1997,
777,
1842,
25038,
864,
316,
15130,
1093,
365,
6315,
3190,
67,
1330,
2668,
91,
6134,
2535,
273,
374,
364,
11243,
316,
666,
30,
2535,
273,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
666,
4672,
296,
1997,
777,
1842,
25038,
864,
316,
15130,
1093,
365,
6315,
3190,
67,
1330,
2668,
91,
6134,
2535,
273,
374,
364,
11243,
316,
666,
30,
2535,
273,
365,
... |
return self.recalculateSharesForEntity( tqDefDict[ 'OwnerDN' ], tqDefDict[ 'OwnerGroup' ], connObj = connObj ) | return self.setTaskQueueState( tqId, True ) | def insertJob( self, jobId, tqDefDict, jobPriority ): """ Insert a job in a task queue Returns S_OK( tqId ) / S_ERROR """ self.log.info( "Inserting job %s" % jobId ) retVal = self._getConnection() if not retVal[ 'OK' ]: return S_ERROR( "Can't insert job: %s" % retVal[ 'Message' ] ) connObj = retVal[ 'Value' ] retVal = self._checkTaskQueueDefinition( tqDefDict ) if not retVal[ 'OK' ]: self.log.error( "TQ definition check failed", retVal[ 'Value' ] ) return retVal tqDefDict[ 'CPUTime' ] = self.fitCPUTimeToSegments( tqDefDict[ 'CPUTime' ] ) retVal = self.findTaskQueue( tqDefDict, skipDefinitionCheck = True, connObj = connObj ) if not retVal[ 'OK' ]: return retVal tqInfo = retVal[ 'Value' ] newTq = False if not tqInfo[ 'found' ]: self.log.info( "Createing a TQ for job %s requirements" % jobId ) retVal = self.createTaskQueue( tqDefDict, 0, connObj = connObj ) if not retVal[ 'OK' ]: return retVal tqId = retVal[ 'Value' ] newTq = True else: tqId = tqInfo[ 'tqId' ] jobPriority = min( max( int( jobPriority ), self.__jobPriorityBoundaries[0] ), self.__jobPriorityBoundaries[1] ) result = self.insertJobInTaskQueue( jobId, tqId, jobPriority, checkTQExists = False, connObj = connObj ) if not result[ 'OK' ]: return result if not newTq: return result return self.recalculateSharesForEntity( tqDefDict[ 'OwnerDN' ], tqDefDict[ 'OwnerGroup' ], connObj = connObj ) | 2dd586e522aba814548b98441e2917cc3dcd65d0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/2dd586e522aba814548b98441e2917cc3dcd65d0/TaskQueueDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2243,
2278,
12,
365,
16,
13845,
16,
20061,
3262,
5014,
16,
1719,
8183,
262,
30,
3536,
8040,
279,
1719,
316,
279,
1562,
2389,
2860,
348,
67,
3141,
12,
20061,
548,
262,
342,
348,
67,
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,
2243,
2278,
12,
365,
16,
13845,
16,
20061,
3262,
5014,
16,
1719,
8183,
262,
30,
3536,
8040,
279,
1719,
316,
279,
1562,
2389,
2860,
348,
67,
3141,
12,
20061,
548,
262,
342,
348,
67,
358... |
import StringIO,sys S = StringIO.StringIO() sys.stdout = S run_one_example() sys.stdout=sys.__stdout__ assert not show_diff(S.getvalue(),expected_output) | EX = get_one_example() input_sym_subgroups = EX.get_input_symmetry_subgroups() metric_sym_subgroups = EX.get_metric_symmetry_subgroups() input_sym = expected_subgroup_lists[0] input_sym_list = EX.get_string_as_list(input_sym) EX.compare_lists(input_sym_list, EX.get_best_subsym_list(input_sym_subgroups)) metric_sym = expected_subgroup_lists[1] metric_sym_list = EX.get_string_as_list(metric_sym) EX.compare_lists(metric_sym_list, EX.get_best_subsym_list(metric_sym_subgroups)) | def run_one_example(): # symmetry from 3ged crystal_symmetry = crystal.symmetry( unit_cell=uctbx.unit_cell((124.287,124.287,162.608,90.0,90.0,90.0)), space_group=sgtbx.space_group_info('I 41 2 2').group()) cb_op_input_to_primitive = crystal_symmetry.change_of_basis_op_to_primitive_setting() primitive_symmetry = crystal_symmetry.primitive_setting() cb_op_input_to_minimum = primitive_symmetry.change_of_basis_op_to_minimum_cell() * cb_op_input_to_primitive subgroup_list = iotbx_converter( crystal_symmetry.change_basis(cb_op_input_to_minimum).unit_cell(),max_delta=3.0, bravais_types_only=False, space_group_symbol= str(crystal_symmetry.change_basis(cb_op_input_to_minimum).space_group_info()), force_minimum=False,interest_focus="input_symmetry") for subgroup in subgroup_list: subgroup['best_subsym'].show_summary() print # for comparision subgroup_list = lattice_symmetry.metric_subgroups( crystal_symmetry,3.0,bravais_types_only=False, best_monoclinic_beta=False).result_groups for subgroup in subgroup_list: subgroup['best_subsym'].show_summary() print | 0ab86c61448327eb063d01b796ae714dcae8a2b2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/696/0ab86c61448327eb063d01b796ae714dcae8a2b2/tst_iotbx_converter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
476,
67,
8236,
13332,
468,
26144,
628,
890,
2423,
4422,
31365,
67,
8117,
18042,
273,
4422,
31365,
18,
8117,
18042,
12,
2836,
67,
3855,
33,
853,
70,
92,
18,
4873,
67,
3855,
12... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
476,
67,
8236,
13332,
468,
26144,
628,
890,
2423,
4422,
31365,
67,
8117,
18042,
273,
4422,
31365,
18,
8117,
18042,
12,
2836,
67,
3855,
33,
853,
70,
92,
18,
4873,
67,
3855,
12... |
print "proj_x:" + str(proj_x) | def update(self): if self.alive: # FIXME - Need to figure out how to get time into this formula for y #print "projectile y: " + str(proj_y) (curr_x, curr_y) = self.pos tx = self.t/10.0 proj_y = self.h0 + (tx * self.velocity * math.sin(self.rad_angle)) - (self.gravity * tx * tx) / 2 size = ((proj_y / 20) + self.min_size) self.image = pygame.Surface((size,size)) self.image.fill(self.color) proj_x = self.velocity * math.cos(self.rad_angle) * tx if proj_y < 0: print "proj_x:" + str(proj_x) self.hit_ground() if (curr_y >= 500 and curr_y <= 600): if (proj_y < 10): self.bounce = True print proj_y if (self.bounce == False): self.pos = (curr_x, (SCREEN_WIDTH - ((proj_x * 20)) + 20 )) else: self.pos = (curr_x, (curr_y + (tx*10))) self.rect.center = self.pos self.t = self.t + 1 | 25adcc4c56b6447a6930c8e2f3924510c2cd6046 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12377/25adcc4c56b6447a6930c8e2f3924510c2cd6046/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
4672,
309,
365,
18,
11462,
30,
468,
9852,
300,
12324,
358,
7837,
596,
3661,
358,
336,
813,
1368,
333,
8013,
364,
677,
468,
1188,
315,
4406,
398,
677,
30,
315,
397,
609,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
4672,
309,
365,
18,
11462,
30,
468,
9852,
300,
12324,
358,
7837,
596,
3661,
358,
336,
813,
1368,
333,
8013,
364,
677,
468,
1188,
315,
4406,
398,
677,
30,
315,
397,
609,... | |
yield (str(key), repr(particle)) | def pso_map(self, key, value): comparator = self.function.comparator particle = unpack(value) assert particle.id == int(key) self.move_and_evaluate(particle) | c17158bcdc55ff8955cb6ec99a286f564b0eadb5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/966/c17158bcdc55ff8955cb6ec99a286f564b0eadb5/standardpso.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
2048,
67,
1458,
12,
2890,
16,
498,
16,
460,
4672,
8862,
273,
365,
18,
915,
18,
832,
2528,
20036,
273,
6167,
12,
1132,
13,
1815,
20036,
18,
350,
422,
509,
12,
856,
13,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
2048,
67,
1458,
12,
2890,
16,
498,
16,
460,
4672,
8862,
273,
365,
18,
915,
18,
832,
2528,
20036,
273,
6167,
12,
1132,
13,
1815,
20036,
18,
350,
422,
509,
12,
856,
13,
365,
18,
... | |
return True | return True | def connect(self): opener = web_proxy.urllib2.build_opener(web_proxy.urllib2.HTTPCookieProcessor()) web_proxy.urllib2.install_opener(opener) response = web_proxy.urllib2.urlopen(web_proxy.urllib2.Request("https://login.facebook.com/login.php?m&next=http%3A%2F%2Fm.facebook.com%2Fhome.php","email=%s&pass=%s&login=Login" % (self.email, self.password))) if "form action=\"https://login.facebook.com/login.php" in response.read(): return False else: return True | e8169ef5d3a898d3fa46885d245f8bcfad05cd05 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10818/e8169ef5d3a898d3fa46885d245f8bcfad05cd05/watch_sn_facebook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
12,
2890,
4672,
20532,
273,
3311,
67,
5656,
18,
718,
2941,
22,
18,
3510,
67,
25098,
12,
4875,
67,
5656,
18,
718,
2941,
22,
18,
3693,
6151,
5164,
10756,
3311,
67,
5656,
18,
718,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
12,
2890,
4672,
20532,
273,
3311,
67,
5656,
18,
718,
2941,
22,
18,
3510,
67,
25098,
12,
4875,
67,
5656,
18,
718,
2941,
22,
18,
3693,
6151,
5164,
10756,
3311,
67,
5656,
18,
718,
... |
sb.appendData(m1) msg = sb.getOneMessage() | sb.append(m1) msg = sb.extract_message() | def test_getOneMessage(self): """ Make sure we get a Frame back from getNextMessage() """ sb = StompFrameBuffer() m1 = self.createMessage('connect', {'session': uuid.uuid4()}, 'This is the body') sb.appendData(m1) msg = sb.getOneMessage() assert isinstance(msg, stomper.Frame) assert m1 == msg.pack() | d449f708e10a4ccd6e53d9237356e9b70565b11d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10258/d449f708e10a4ccd6e53d9237356e9b70565b11d/test_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
3335,
1079,
12,
2890,
4672,
3536,
4344,
3071,
732,
336,
279,
8058,
1473,
628,
6927,
1079,
1435,
3536,
2393,
273,
934,
20667,
3219,
1892,
1435,
312,
21,
273,
365,
18,
2640,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
3335,
1079,
12,
2890,
4672,
3536,
4344,
3071,
732,
336,
279,
8058,
1473,
628,
6927,
1079,
1435,
3536,
2393,
273,
934,
20667,
3219,
1892,
1435,
312,
21,
273,
365,
18,
2640,... |
"SELECT MAX(date_planned) AS stop "\ | "SELECT MAX(mrp_production.date_planned) AS stop,MIN(mrp_production.date_planned) AS start "\ | def create(self, cr, uid, ids, datas, context={}): assert len(ids), 'You should provide some ids!' colors = choice_colors(len(ids)) ids_str = ','.join(map(str, ids)) cr.execute( "SELECT MAX(date_planned) AS stop "\ "FROM mrp_workcenter, mrp_production, mrp_production_workcenter_line "\ "WHERE mrp_production_workcenter_line.production_id=mrp_production.id "\ "AND mrp_production_workcenter_line.workcenter_id=mrp_workcenter.id "\ "AND mrp_production.state NOT IN ('cancel','done') "\ "AND mrp_workcenter.id IN (%s)" % ids_str) res = cr.dictfetchone() if not res['stop']: res['stop'] = time.strftime('%Y-%m-%d') dates = self._compute_dates(datas['form']['time_unit'], time.strftime('%Y-%m-%d'), res['stop'][:10]) dates_list = dates.keys() dates_list.sort() x_index = [] for date in dates_list: x_index.append((dates[date]['name'], date)) pdf_string = StringIO.StringIO() can = canvas.init(fname=pdf_string, format='pdf') chart_object.set_defaults(line_plot.T, line_style=None) if datas['form']['measure_unit'] == 'cycles': y_label = "Load (Cycles)" else: y_label = "Load (Hours)" ar = area.T(legend = legend.T(), x_grid_style = line_style.gray70_dash1, x_axis = axis.X(label="Periods", format="/a90/hC%s"), x_coord = category_coord.T(x_index, 0), y_axis = axis.Y(label=y_label), y_range = (0, None), size = (640,480)) bar_plot.fill_styles.reset(); | 570e8dbc4b762d97e7e00762a67e03737d4091bf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/570e8dbc4b762d97e7e00762a67e03737d4091bf/workcenter_load.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
5386,
16,
819,
12938,
4672,
1815,
562,
12,
2232,
3631,
296,
6225,
1410,
5615,
2690,
3258,
5124,
5740,
273,
6023,
67,
9724,
12,
1897,
12... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
5386,
16,
819,
12938,
4672,
1815,
562,
12,
2232,
3631,
296,
6225,
1410,
5615,
2690,
3258,
5124,
5740,
273,
6023,
67,
9724,
12,
1897,
12... |
""" % (fld_dict[fldID], (fldvID !="" and "with fieldvalue '%s'" % fldv_dict[fldvID] or ''), col_dict[colID]) | """ % (fld_dict[fldID], (fldvID != -1 and "with fieldvalue '%s'" % fldv_dict[fldvID] or ''), col_dict[colID]) | def perform_addexistingfield(colID, ln=cdslang, fldID=-1, fldvID=-1, fmeth='', callback='yes', confirm=-1): """form to add an existing field to a collection. colID - the collection to add the field to fldID - the field to add score - the importance of the field. position - the position of the field on the page sel_ln - the language of the field""" subtitle = """<a name="6.2"></a><a name="7.2"></a><a name="8.2"></a>Add existing field to collection""" output = "" colID = int(colID) lang = dict(get_languages()) res = get_current_name('', ln, get_fld_nametypes()[0][0], "field") col_dict = dict(get_current_name('', ln, get_col_nametypes()[0][0], "collection")) fld_dict = dict(res) col_fld = dict(map(lambda x: (x[0], x[1]), get_col_fld(colID, fmeth))) fld_value = get_fld_value() fldv_dict = dict(map(lambda x: (x[0], x[1]), fld_value)) if fldvID: fldvID = int(fldvID) text = """ <span class="adminlabel">Field</span> <select name="fldID" class="admin_w200"> <option value="-1">- Select field -</option> """ for (id, var) in res: if fmeth == 'seo' or (fmeth != 'seo' and not col_fld.has_key(id)): text += """<option value="%s" %s>%s</option> """ % (id, id == int(fldID) and 'selected="selected"' or '', fld_dict[id]) text += """</select><br>""" if fmeth == 'seo': text += """ <span class="adminlabel">Fieldvalue</span> <select name="fldvID" class="admin_w200"> <option value="-1">- Select fieldvalue -</option> """ res = run_sql("SELECT id,name,value FROM fieldvalue ORDER BY name") for (id, name, value) in res: text += """<option value="%s" %s>%s</option> """ % (id, id == int(fldvID) and 'selected="selected"' or '', name) text += """</select><br>""" output += createhiddenform(action="addexistingfield#6.2", text=text, button="Add", colID=colID, fmeth=fmeth, ln=ln, confirm=0) if fldID not in [-1, "-1"]: fldID = int(fldID) if confirm in [0, "0"]: text = """<b>Do you want to add the field '%s' %s to the collection '%s'.</b> """ % (fld_dict[fldID], (fldvID !="" and "with fieldvalue '%s'" % fldv_dict[fldvID] or ''), col_dict[colID]) output += createhiddenform(action="%s/admin/websearch/websearchadmin.py/addexistingfield#6.2" % weburl, text=text, button="Confirm", colID=colID, fldID=fldID, fldvID=fldvID, fmeth=fmeth, ln=ln, confirm=1) elif confirm in [1, "1"]: res = add_col_fld(colID, fldID, fmeth, fldvID) if res: output += """<b><span class="info">Added the field '%s' %s to the collection '%s'.</span></b> """ % (fld_dict[fldID], (fldvID !="" and "with fieldvalue '%s'" % fldv_dict[fldvID] or ''), col_dict[colID]) else: output += """<b><span class="info">Cannot add the field '%s' %s to the collection '%s'.</span></b> """ % (fld_dict[fldID], (fldvID !="" and "with fieldvalue '%s'" % fldv_dict[fldvID] or ''), col_dict[colID]) elif fldID in [-1, "-1"] and confirm in [0, "0"]: output += """<b><span class="info">Select a field.</span></b> """ try: body = [output, extra] except NameError: body = [output] output = "<br>" + addadminbox(subtitle, body) if fmeth == "soo": return perform_showsortoptions(colID, ln, content=output) elif fmeth == "sew": return perform_showsearchfields(colID, ln, content=output) elif fmeth == "seo": return perform_showsearchoptions(colID, ln, content=output) | beda71fdc80661821084d0fd30dadb0e7e956b74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/beda71fdc80661821084d0fd30dadb0e7e956b74/websearchadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
361,
561,
376,
310,
1518,
12,
1293,
734,
16,
7211,
33,
4315,
2069,
539,
16,
9880,
734,
29711,
21,
16,
9880,
90,
734,
29711,
21,
16,
10940,
546,
2218,
2187,
1348,
2218,
9707,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
361,
561,
376,
310,
1518,
12,
1293,
734,
16,
7211,
33,
4315,
2069,
539,
16,
9880,
734,
29711,
21,
16,
9880,
90,
734,
29711,
21,
16,
10940,
546,
2218,
2187,
1348,
2218,
9707,
... |
sage: P4 = simplicial_complexes.RealProjectiveSpace(4) sage: P4.f_vector() | sage: P4 = simplicial_complexes.RealProjectiveSpace(4) sage: P4.f_vector() | def RealProjectiveSpace(self, n): r""" A triangulation of `\Bold{R}P^n` for any `n \geq 0`. | 48bcc4068d651cff86f439b3ba106c1b2aa53157 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/48bcc4068d651cff86f439b3ba106c1b2aa53157/examples.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15987,
4109,
688,
3819,
12,
2890,
16,
290,
4672,
436,
8395,
432,
6882,
539,
6234,
434,
1375,
64,
38,
1673,
95,
54,
97,
52,
66,
82,
68,
364,
1281,
1375,
82,
521,
908,
85,
374,
8338,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15987,
4109,
688,
3819,
12,
2890,
16,
290,
4672,
436,
8395,
432,
6882,
539,
6234,
434,
1375,
64,
38,
1673,
95,
54,
97,
52,
66,
82,
68,
364,
1281,
1375,
82,
521,
908,
85,
374,
8338,
... |
os.putenv('WXWIN', os.getcwd()) | os.putenv('WXWIN', buildenv['root_dos'] + "\\..\\..\\internal\\wx\\wxPython-2.5") | def build(buildenv): version = buildenv['version'] if buildenv['os'] in ('osx', 'posix'): # Create the build directory buildDir = os.path.abspath("build_%s" % version) if os.access(buildDir, os.F_OK): hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Temporary build directory exists: " + buildDir) else: hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Temporary build directory doesn't exist; creating: " + \ buildDir) os.mkdir(buildDir) os.chdir(buildDir) # Prepare the wxWidgets command line buildOptions = [ buildenv['sh'], '../configure', '--prefix=%s' % os.path.join(buildenv['root'],version), '--disable-monolithic', '--enable-geometry', '--enable-sound', '--with-sdl', '--enable-display', '--with-libpng=builtin', ] if version == "debug": buildOptions.append("--enable-debug") else: buildOptions.append("--enable-optimized") if buildenv['os'] == "osx": buildOptions.append("--with-mac") buildOptions.append("--with-opengl") if buildenv['os'] == "posix": buildOptions.append("--with-gtk") buildOptions.append("--enable-gtk2") buildOptions.append("--enable-unicode") # Configure if os.access('Makefile', os.F_OK): hardhatlib.log(buildenv, hardhatlib.HARDHAT_MESSAGE, info['name'], "Already configured") else: hardhatlib.executeCommand(buildenv, info['name'], buildOptions, "Configuring wxWindows %s" % version) # Make hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make']], "Making wxWindows") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/gizmos'], "Making gizmos") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/ogl', 'CXXFLAGS="-DwxUSE_DEPRECATED=0"', ], "Making ogl") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/stc'], "Making stc") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/xrc'], "Making xrc") # Install hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], 'install'], "Installing wxWindows") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/gizmos', 'install'], "Installing gizmos") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/ogl', 'install'], "Installing ogl") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/stc', 'install'], "Installing stc") hardhatlib.executeCommand(buildenv, info['name'], [buildenv['make'], '-Ccontrib/src/xrc', 'install'], "Installing xrc") # wxPython if version == "debug": python = buildenv['python_d'] else: python = buildenv['python'] os.chdir("../wxPython") buildOptions = [ python, 'setup.py', 'BUILD_OGL=0', 'BUILD_GLCANVAS=0', 'BUILD_BASE=build_%s' % version, 'WX_CONFIG='+buildenv['root']+'/%s/bin/wx-config' % version, 'build', 'install', ] if version == "debug": buildOptions.append("FINAL=0") if buildenv['os'] == "posix": buildOptions.append("WXPORT=gtk2") buildOptions.append("UNICODE=1") hardhatlib.executeCommand(buildenv, info['name'], buildOptions, "Building and Installing wxPython") # Windows if buildenv['os'] == 'win': hardhatlib.executeCommand( buildenv, info['name'], [buildenv['compiler'], "build/msw/msw.sln", "/build", version.capitalize(), "/out", "output.txt"], "Building %s %s" % (info['name'], version), 0, "output.txt") os.putenv('WXWIN', os.getcwd()) if version == 'release': destination = os.path.join (buildenv['pythonlibdir'], 'site-packages', 'wx') hardhatlib.copyFiles('lib/vc_dll', destination, ['*251_*.dll']) os.chdir("wxPython") hardhatlib.executeCommand (buildenv, info['name'], [buildenv['python'], 'setup.py', 'build_ext', '--inplace', 'install', 'FINAL=1', 'HYBRID=0'], "Building wxPython") # _*.pyd also copies _*_d.pyd, which is unnecessary, however, the # files that should have been created are _*.pyc, so when we fix that # we should change '_*.pyd' to '_*.pyc' in the following line hardhatlib.copyFiles('wx', destination, ['_*.pyd']) elif version == 'debug': destination = os.path.join (buildenv['pythonlibdir_d'], 'site-packages', 'wx') hardhatlib.copyFiles('lib/vc_dll', destination, ['*251d_*.dll']) os.chdir("wxPython") hardhatlib.executeCommand (buildenv, info['name'], [buildenv['python_d'], 'setup.py', 'build_ext', '--inplace', '--debug', 'install', 'FINAL=1', 'HYBRID=0'], "Building wxPython") hardhatlib.copyFiles('wx', destination, ['_*_d.pyd']) | df6a43875526b2ec11184c5781aefe91839d295b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/df6a43875526b2ec11184c5781aefe91839d295b/__hardhat__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
3510,
3074,
4672,
225,
1177,
273,
1361,
3074,
3292,
1589,
3546,
225,
309,
1361,
3074,
3292,
538,
3546,
316,
7707,
538,
92,
2187,
296,
24463,
11,
4672,
282,
468,
1788,
326,
1361... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
3510,
3074,
4672,
225,
1177,
273,
1361,
3074,
3292,
1589,
3546,
225,
309,
1361,
3074,
3292,
538,
3546,
316,
7707,
538,
92,
2187,
296,
24463,
11,
4672,
282,
468,
1788,
326,
1361... |
"contact_email", "licence", "classifiers", | "contact_email", "license", "classifiers", | def is_pure (self): return (self.has_pure_modules() and not self.has_ext_modules() and not self.has_c_libraries()) | 0e40b2ec36d978dea37571af5374f47be98c5a02 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/0e40b2ec36d978dea37571af5374f47be98c5a02/dist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
84,
594,
261,
2890,
4672,
327,
261,
2890,
18,
5332,
67,
84,
594,
67,
6400,
1435,
471,
486,
365,
18,
5332,
67,
408,
67,
6400,
1435,
471,
486,
365,
18,
5332,
67,
71,
67,
314... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
353,
67,
84,
594,
261,
2890,
4672,
327,
261,
2890,
18,
5332,
67,
84,
594,
67,
6400,
1435,
471,
486,
365,
18,
5332,
67,
408,
67,
6400,
1435,
471,
486,
365,
18,
5332,
67,
71,
67,
314... |
except: self.disconnect(error="Network error!") | self.disconnect(error="Network error!") | def on_readable(self): reply = self.socket.recv(8192) if reply: self.buffer = self.buffer + reply lines, self.buffer = self.buffer.rsplit("\r\n",1) for line in lines.split('\r\n'): if DEBUG: print ">>> %s" % line | 2b4b0dd317f474502ef8367dd7ef20de02608d45 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10693/2b4b0dd317f474502ef8367dd7ef20de02608d45/irc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
11018,
12,
2890,
4672,
4332,
273,
365,
18,
7814,
18,
18334,
12,
28,
15561,
13,
225,
309,
4332,
30,
365,
18,
4106,
273,
365,
18,
4106,
397,
4332,
225,
2362,
16,
365,
18,
4106... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
11018,
12,
2890,
4672,
4332,
273,
365,
18,
7814,
18,
18334,
12,
28,
15561,
13,
225,
309,
4332,
30,
365,
18,
4106,
273,
365,
18,
4106,
397,
4332,
225,
2362,
16,
365,
18,
4106... |
command += '--py-cfg=' + step2[sample['conditions']]['outputname']+ ' \\\n' | command += '--py-cfg=' + step2[sample['RECOtag']]['outputname']+ ' \\\n' | def main(argv) : """ prepareRelValworkflows prepare workflows for chained processing of RelVal samples - parse file holding cmsDriver commands for 1st and 2nd steps - prepare workflows - prepare WorkflowInjector:Input script - prepare ForceMerge script - prepare DBSMigrationToGlobal script - prepare PhEDExInjection script - prepare local DBS query script required parameters --samples <textfile> : list of RelVal sample parameter-sets in plain text file, one sample per line, # marks comment --version <processing version> : processing version (v1, v2, ... ) --DBSURL <URL> : URL of the local DBS (http://cmsdbsprod.cern.ch/cms_dbs_prod_local_07/servlet/DBSServlet, http://cmssrv46.fnal.gov:8080/DBS126/servlet/DBSServlet) optional parameters : --lumi <number> : initial run for generation (default: 666666), set it to 777777 for high statistics samples --event <number> : initial event number --help (-h) : help --debug (-d) : debug statements """ # default try: version = os.environ.get("CMSSW_VERSION") except: print '' print 'CMSSW version cannot be determined from $CMSSW_VERSION' sys.exit(2) try: architecture = os.environ.get("SCRAM_ARCH") except: print '' print 'CMSSW architecture cannot be determined from $SCRAM_ARCH' sys.exit(2) samples = None processing_version = None initial_run = "666666" initial_event = None debug = 0 DBSURL = None try: opts, args = getopt.getopt(argv, "", ["help", "debug", "samples=", "version=", "DBSURL=", "event=", "lumi="]) except getopt.GetoptError: print main.__doc__ sys.exit(2) # check command line parameter for opt, arg in opts : if opt == "--help" : print main.__doc__ sys.exit() elif opt == "--debug" : debug = 1 elif opt == "--samples" : samples = arg elif opt == "--version" : processing_version = arg | b74a22b85cc9cbbc45fc20dac1245123cb4ff30c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/b74a22b85cc9cbbc45fc20dac1245123cb4ff30c/prepareRelValWorkflows.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
13,
294,
3536,
225,
2911,
1971,
3053,
13815,
87,
225,
2911,
31738,
364,
20269,
4929,
434,
4275,
3053,
5216,
225,
300,
1109,
585,
19918,
6166,
4668,
4364,
364,
404,
334,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
13,
294,
3536,
225,
2911,
1971,
3053,
13815,
87,
225,
2911,
31738,
364,
20269,
4929,
434,
4275,
3053,
5216,
225,
300,
1109,
585,
19918,
6166,
4668,
4364,
364,
404,
334,
... |
for i, padding, start, anim in zip(self.children, spacings, self.start_times, self.anim_times): | for i, padding, cst, cat in zip(self.children, spacings, csts, cats): | def render(self, width, height, st, at): | 705dc5f53bd1199bf068dd8701bdde3bd275cc6b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10962/705dc5f53bd1199bf068dd8701bdde3bd275cc6b/layout.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1835,
16,
2072,
16,
384,
16,
622,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1835,
16,
2072,
16,
384,
16,
622,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
platform = 'macosx' | if platform.processor() == 'i386': platform = 'maciosx' else: platform = 'macosx' | def UploadToStaging(nowString, log, rsyncProgram, rsyncServer): timestamp = nowString.replace("-", "") timestamp = timestamp.replace(":", "") timestamp = timestamp.replace(" ", "") if not os.path.isdir(timestamp): print "skipping rsync to staging area, no dir", timestamp log.write("skipping rsync to staging area, no dir\n") else: if os.name == 'nt' or sys.platform == 'cygwin': platform = 'windows' elif sys.platform == 'darwin': platform = 'macosx' else: platform = 'linux' print "Rsyncing to staging area..." log.write('rsync -e ssh -avzp ' + timestamp + ' ' + rsyncServer + ':staging/' + platform) outputList = hardhatutil.executeCommandReturnOutputRetry( [rsyncProgram, "-e", "ssh", "-avzp", timestamp, rsyncServer + ":staging/" + platform]) hardhatutil.dumpOutputList(outputList, log) completedFile = timestamp + os.sep + "completed" open(completedFile, "w").close() log.write('rsync -e ssh -avzp ' + completedFile + ' ' + rsyncServer + ':staging/' + platform + "/" + timestamp) outputList = hardhatutil.executeCommandReturnOutputRetry( [rsyncProgram, "-e", "ssh", "-avzp", completedFile, rsyncServer + ":staging/" + platform + "/" + timestamp]) hardhatutil.dumpOutputList(outputList, log) hardhatutil.rmdirRecursive(timestamp) | dacf6cfeb5fa4f21150262137a4415d04b647af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/dacf6cfeb5fa4f21150262137a4415d04b647af8/tinderbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9414,
774,
510,
5755,
12,
3338,
780,
16,
613,
16,
3597,
1209,
9459,
16,
3597,
1209,
2081,
4672,
2858,
273,
2037,
780,
18,
2079,
2932,
17,
3113,
1408,
13,
2858,
273,
2858,
18,
2079,
293... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9414,
774,
510,
5755,
12,
3338,
780,
16,
613,
16,
3597,
1209,
9459,
16,
3597,
1209,
2081,
4672,
2858,
273,
2037,
780,
18,
2079,
2932,
17,
3113,
1408,
13,
2858,
273,
2858,
18,
2079,
293... |
if len(self.__posts) > self.options['length']: self.__posts = self.__posts[0:self.options['length'] - 1] self.__posts = self.__posts[0:(self.options['length'] - len(tmpPosts) - 1)] self.__posts.reverse() tmpPosts.reverse() for post in tmpPosts: self.__posts.append(post) self.__posts.reverse() self.__lock.release() try: try: self.__lock.acquire() f = codecs.open(os.path.join(self.libraryDir,self.mediaId + ".pickled"),mode='w',encoding="utf-8") cPickle.dump(self.__posts, f) finally: f.close() self.__lock.release() except IOError: self.log.log(0,"error","Unable to write serialised representation of the posts array") except: self.log.log(0,"error","Unexpected exception trying to write serialised representation of the posts array") time.sleep(self.options['updateInterval'] * 60) | self.log.log(0,"audit","%s: Posts are still fresh." % self.mediaId) self.log.log(0,"audit","%s: Sleeping 60 seconds" % self.mediaId) time.sleep(60) self.log.log(0,"audit","%s: Media has completed. Stopping updating." % self.mediaId) | def run(self): # Start the region timer so the media dies at the right time. self.p.enqueue('timer',(int(self.duration) * 1000,self.timerElapsed)) # Pointer to the currently displayed post: self.__pointer = -1 # Open previous cache file (if exists) and begin playing out posts # Lock the semaphore as we write to __posts to avoid changing the array as the display thread reads it. # Serialize self.__posts for next time try: try: self.__lock.acquire() self.__posts = cPickle.load(file(os.path.join(self.libraryDir,self.mediaId + ".pickled"))) finally: self.__lock.release() except: # Load in some data to get us going self.__lock.acquire() self.__posts = [{'xibo_src': 1, u'iso_language_code': u'en_GB', u'text': u"Welcome to xibo Microblog Search Media", u'created_at': u'Thu, 08 Apr 2010 08:03:38 +0000', u'profile_image_url': u'http://avatar.identi.ca/1102-96-20081013131713.png', u'to_user': None, u'source': u'web', u'from_user': u'alexharrington', u'from_user_id': u'13737', u'to_user_id': None, u'id': u'27725072'}] self.__lock.release() | f580f3dfbfe6ebbb3cfcd5504a83cc0760005ef4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5464/f580f3dfbfe6ebbb3cfcd5504a83cc0760005ef4/MicroblogSearchMedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
468,
3603,
326,
3020,
5441,
1427,
326,
3539,
27890,
622,
326,
2145,
813,
18,
365,
18,
84,
18,
21798,
2668,
12542,
2187,
12,
474,
12,
2890,
18,
8760,
13,
380,
4336... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
468,
3603,
326,
3020,
5441,
1427,
326,
3539,
27890,
622,
326,
2145,
813,
18,
365,
18,
84,
18,
21798,
2668,
12542,
2187,
12,
474,
12,
2890,
18,
8760,
13,
380,
4336... |
uom = False, partner_id = sale.partner_id.id, fiscal_position = sale.fiscal_position.id) | uom = False, partner_id = sale.partner_id.id, fposition_id = sale.fiscal_position.id) | def create_invoices(self, cr, uid, ids, context={}): """ To create invoices. | 1e839d87977dd845d70d5633acf70bb08a16ce41 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1e839d87977dd845d70d5633acf70bb08a16ce41/sale_make_invoice_advance.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
5768,
17725,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
3536,
2974,
752,
2198,
17725,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
5768,
17725,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
3536,
2974,
752,
2198,
17725,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
fd, name = tempfile.mkstemp() fileobj = os.fdopen(fd, "w+b") try: | with TemporaryFile("w+") as fileobj: | def test_read_long_with_rest(self): fd, name = tempfile.mkstemp() fileobj = os.fdopen(fd, "w+b") try: fileobj.write("1,2,abc,4,5,6\r\n") fileobj.seek(0) reader = csv.DictReader(fileobj, fieldnames=["f1", "f2"], restkey="_rest") self.assertEqual(next(reader), {"f1": '1', "f2": '2', "_rest": ["abc", "4", "5", "6"]}) finally: fileobj.close() os.unlink(name) | 2837440cd7e82f53ee7e194e97a8b6ffcc4e97cf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/2837440cd7e82f53ee7e194e97a8b6ffcc4e97cf/test_csv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
896,
67,
5748,
67,
1918,
67,
8792,
12,
2890,
4672,
598,
22791,
812,
2932,
91,
15,
7923,
487,
17041,
30,
17041,
18,
2626,
2932,
21,
16,
22,
16,
18947,
16,
24,
16,
25,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
896,
67,
5748,
67,
1918,
67,
8792,
12,
2890,
4672,
598,
22791,
812,
2932,
91,
15,
7923,
487,
17041,
30,
17041,
18,
2626,
2932,
21,
16,
22,
16,
18947,
16,
24,
16,
25,
16,
... |
if not data: return | def run(self): dt=15 while True: try: data = self.getData() except (socket.error, httplib.BadStatusLine, ServerError): # Print the traceback of the caught exception output(u''.join(traceback.format_exception(*sys.exc_info()))) output(u'DBG> got network error in GetAll.run. Sleeping for %d seconds...' % dt) time.sleep(dt) if dt <= 60: dt += 15 elif dt < 360: dt += 60 else: # Because language lists are filled in a lazy way in the family # files of Wikimedia projects (using Family.knownlanguages), you # may encounter pages from non-existing wikis such as # http://eo.wikisource.org/ if data.find("<title>Wiki does not exist</title>") != -1: return elif data.find("<siteinfo>") == -1: # This probably means we got a 'temporary unaivalable' output(u'Got incorrect export page. Sleeping for %d seconds...' % dt) time.sleep(dt) if dt <= 60: dt += 15 elif dt < 360: dt += 60 else: break if not data: return R = re.compile(r"\s*<\?xml([^>]*)\?>(.*)",re.DOTALL) m = R.match(data) if m: data = m.group(2) handler = xmlreader.MediaWikiXmlHandler() handler.setCallback(self.oneDone) handler.setHeaderCallback(self.headerDone) #f = open("backup.txt", "w") #f.write(data) #f.close() try: xml.sax.parseString(data, handler) except (xml.sax._exceptions.SAXParseException, ValueError), err: debugDump( 'SaxParseBug', self.site, err, data ) raise except PageNotFound: return # All of the ones that have not been found apparently do not exist for pl in self.pages: if not hasattr(pl,'_contents') and not hasattr(pl,'_getexception'): pl._getexception = NoPage | 5f6008d079b10b9c5ea277de249b8152a044835f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/5f6008d079b10b9c5ea277de249b8152a044835f/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
3681,
33,
3600,
1323,
1053,
30,
775,
30,
501,
273,
365,
18,
588,
751,
1435,
1335,
261,
7814,
18,
1636,
16,
15851,
6673,
18,
6434,
1482,
1670,
16,
19012,
4672,
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,
1086,
12,
2890,
4672,
3681,
33,
3600,
1323,
1053,
30,
775,
30,
501,
273,
365,
18,
588,
751,
1435,
1335,
261,
7814,
18,
1636,
16,
15851,
6673,
18,
6434,
1482,
1670,
16,
19012,
4672,
468... | |
self.actorNode.getPhysicsObject().setOriented(self.rotatePhysics) | self.actorNode.getPhysicsObject().setOriented(1) | def initializeCollisions(self, collisionTraverser, avatarNodePath, wallBitmask, floorBitmask, avatarRadius = 1.4, floorOffset = 1.0): """ Set up the avatar collisions """ assert(self.debugPrint("initializeCollisions()")) assert not avatarNodePath.isEmpty() self.cTrav = collisionTraverser | ff162e6b6bbdfa3219fdd78044bc7b872cf16b82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/ff162e6b6bbdfa3219fdd78044bc7b872cf16b82/PhysicsWalker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
13535,
12682,
12,
2890,
16,
17740,
15844,
264,
16,
16910,
907,
743,
16,
17662,
5775,
4455,
16,
6346,
5775,
4455,
16,
16910,
10196,
273,
404,
18,
24,
16,
6346,
2335,
273,
404,
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,
4046,
13535,
12682,
12,
2890,
16,
17740,
15844,
264,
16,
16910,
907,
743,
16,
17662,
5775,
4455,
16,
6346,
5775,
4455,
16,
16910,
10196,
273,
404,
18,
24,
16,
6346,
2335,
273,
404,
18,
... |
vncpasswd = vnc_config.get('vncpasswd') if not vncpasswd: vncpasswd = xenopts().get_vncpasswd_default() if vncpasswd is None: raise VmError('vncpasswd is not setup in vmconfig or ' 'xend-config.sxp') if vncpasswd != '': self.vm.storeVm('vncpasswd', vncpasswd) | def parseDeviceModelArgs(self, vmConfig): ret = ["-domain-name", str(self.vm.info['name_label'])] | 830b88c45bc84a0ab80e2ed8c109813884145dee /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6195/830b88c45bc84a0ab80e2ed8c109813884145dee/image.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
3654,
1488,
2615,
12,
2890,
16,
4268,
809,
4672,
325,
273,
8247,
17,
4308,
17,
529,
3113,
609,
12,
2890,
18,
3489,
18,
1376,
3292,
529,
67,
1925,
19486,
65,
2,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
3654,
1488,
2615,
12,
2890,
16,
4268,
809,
4672,
325,
273,
8247,
17,
4308,
17,
529,
3113,
609,
12,
2890,
18,
3489,
18,
1376,
3292,
529,
67,
1925,
19486,
65,
2,
-100,
-100,
-100,
... | |
cmd = "cd " + self.ptMount + "; echo tar -" + option + "f \"" + self.fileName + "\" ." | cmd = "cd '" + self.ptMount + "'; echo tar -" + option + "f \"" + self.fileName + "\" ." | def BackupRestoreGPS( self, widget, type ): | 80409b0c1bd73a06ef6008e89a7706fb6832ba11 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/603/80409b0c1bd73a06ef6008e89a7706fb6832ba11/pytomtom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11856,
10874,
28983,
12,
365,
16,
3604,
16,
618,
262,
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,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11856,
10874,
28983,
12,
365,
16,
3604,
16,
618,
262,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return shortmem['feed_item']['blip_user'] | return _fp_get(shortmem, 'user') | def get_user(url, shortmem=None): return shortmem['feed_item']['blip_user'] | c2641ad3d0c90762965fdef928704cb09207b2d0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12246/c2641ad3d0c90762965fdef928704cb09207b2d0/blip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1355,
12,
718,
16,
3025,
3917,
33,
7036,
4672,
327,
389,
7944,
67,
588,
12,
6620,
3917,
16,
296,
1355,
6134,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1355,
12,
718,
16,
3025,
3917,
33,
7036,
4672,
327,
389,
7944,
67,
588,
12,
6620,
3917,
16,
296,
1355,
6134,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ret.seek(0) | try: ret.seek(0) except IOError: pass | def test_image_save_works_with_opengl_surfaces(self): if 'image__save_gl_surface_test_.py' not in os.listdir('.'): cmd = 'test/' else: cmd = '' | 90e41c461fca583701808f266042c687afaaf580 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1298/90e41c461fca583701808f266042c687afaaf580/image__save_gl_surface_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2730,
67,
5688,
67,
18597,
67,
1918,
67,
3190,
7043,
67,
10050,
4601,
12,
2890,
4672,
225,
309,
296,
2730,
972,
5688,
67,
7043,
67,
18266,
67,
3813,
27799,
2074,
11,
486,
316... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2730,
67,
5688,
67,
18597,
67,
1918,
67,
3190,
7043,
67,
10050,
4601,
12,
2890,
4672,
225,
309,
296,
2730,
972,
5688,
67,
7043,
67,
18266,
67,
3813,
27799,
2074,
11,
486,
316... |
r.legend('topright', legend=self.legend, **args) | r.legend(legend=self.legend, **args) | def _plot(self, pop): "Evaluate expression in pop and save result. Plot all data if needed" gen = pop.dvars().gen rep = pop.dvars().rep # create a new graphical device if needed if not hasattr(self, 'device'): self.device = newDevice() else: # if there are multiple devices, set it back r.dev_set(self.device) # call the preHook function if given if self.preHook is not None: self.preHook(r) # call par in case some parameter is provided parParam = self.args.getArgs('par', pop) if len(parParam) > 0: r.par(**parParam) # x = pop.indInfo(self.infoFields[0]) y = pop.indInfo(self.infoFields[1]) xlim = [min(x), max(x)] ylim = [min(y), max(y)] # if there is no subpopulation, easy if len(self.subPops) == 0: r.plot(x, y, **self.args.getArgs('plot', pop, type='p', xlim=xlim, ylim=ylim)) else: parPlot = self.args.getArgs('plot', pop, type='n', xlim=xlim, ylim=ylim) parPlot['type'] = 'n' r.plot(x[0], y[0], **parPlot) for idx,sp in enumerate(self.subPops): x = pop.indInfo(self.infoFields[0], sp) y = pop.indInfo(self.infoFields[1], sp) r.points(x, y, **self.args.getArgs('points', pop, sp=idx)) # legend if len(self.legend) > 0: args = self.args.getLegendArgs('points', pop, ['col', 'pch', 'lwd', 'cex'], 'sp', range(len(self.subPops))) args.update(self.args.getArgs('legend', pop)) r.legend('topright', legend=self.legend, **args) # call the postHook function if given if self.postHook is not None: self.postHook(r) if self.saveAs != '': file, ext = os.path.splitext(self.saveAs) filename = '%s_%d_%d%s' % (file, gen, rep, ext) saveFigure(**self.args.getArgs('dev_print', pop, file=filename)) return True | c53fdafda3b1414b2342a27ce72ba24507ef678d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/401/c53fdafda3b1414b2342a27ce72ba24507ef678d/plotter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4032,
12,
2890,
16,
1843,
4672,
315,
15369,
2652,
316,
1843,
471,
1923,
563,
18,
15211,
777,
501,
309,
3577,
6,
3157,
273,
1843,
18,
72,
4699,
7675,
4507,
2071,
273,
1843,
18,
72,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4032,
12,
2890,
16,
1843,
4672,
315,
15369,
2652,
316,
1843,
471,
1923,
563,
18,
15211,
777,
501,
309,
3577,
6,
3157,
273,
1843,
18,
72,
4699,
7675,
4507,
2071,
273,
1843,
18,
72,... |
def runit(name=name, doc=doc, filename=filename, lineno=lineno): _utest(tester, name, doc, filename, lineno) suite.addTest(unittest.FunctionTestCase( runit, description="doctest of " + name)) | suite.addTest(DocTestTestCase( tester, name, doc, filename, lineno, setUp, tearDown)) | def runit(name=name, doc=doc, filename=filename, lineno=lineno): _utest(tester, name, doc, filename, lineno) | a643b658a7cd1d820fd561665402705f0f76b1d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a643b658a7cd1d820fd561665402705f0f76b1d0/doctest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
305,
12,
529,
33,
529,
16,
997,
33,
2434,
16,
1544,
33,
3459,
16,
7586,
33,
17782,
4672,
389,
322,
395,
12,
1078,
387,
16,
508,
16,
997,
16,
1544,
16,
7586,
13,
2,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1086,
305,
12,
529,
33,
529,
16,
997,
33,
2434,
16,
1544,
33,
3459,
16,
7586,
33,
17782,
4672,
389,
322,
395,
12,
1078,
387,
16,
508,
16,
997,
16,
1544,
16,
7586,
13,
2,
-100,
-100... |
t = ["Empate!","Ganaste!","Perdiste!"] | t = ["Empate!","Jugador Uno!","Jugador Dos!"] if t[result] != t[0]: self._title('Bien',y - 80,x) | def render_gameover(self,result): self.back.blit(self.desk,(0,0)) y = 275 x = 300 t = ["Empate!","Ganaste!","Perdiste!"] self._title(t[result],y,x); y+=50 self._text("Pulsa el raton para volver a jugar!",y,x) | cd7078f076adde84568929144c189264b9653acb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6287/cd7078f076adde84568929144c189264b9653acb/gameboard.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
13957,
1643,
12,
2890,
16,
2088,
4672,
365,
18,
823,
18,
3083,
305,
12,
2890,
18,
5489,
79,
16,
12,
20,
16,
20,
3719,
677,
273,
576,
5877,
619,
273,
11631,
268,
273,
8247,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
13957,
1643,
12,
2890,
16,
2088,
4672,
365,
18,
823,
18,
3083,
305,
12,
2890,
18,
5489,
79,
16,
12,
20,
16,
20,
3719,
677,
273,
576,
5877,
619,
273,
11631,
268,
273,
8247,
... |
return list(self._GetElementGeneratorFromLinkFinder( ret, gdata.apps.EmailListFeedFromString)) | return self.AddAllElementsFromAllPages( ret, gdata.apps.EmailListFeedFromString) | def RetrieveAllEmailLists(self): """Retrieve all email list of a domain.""" | f782ca38e1731b86de1a2d5f641097ecaf437672 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5609/f782ca38e1731b86de1a2d5f641097ecaf437672/service.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10708,
1595,
4134,
7432,
12,
2890,
4672,
3536,
5767,
777,
2699,
666,
434,
279,
2461,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
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,
10708,
1595,
4134,
7432,
12,
2890,
4672,
3536,
5767,
777,
2699,
666,
434,
279,
2461,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
@type docs: C{list} of L{ObjDoc} | @type docs: C{list} of (L{UID} or L{Link} or C{Var}) | def _sort(self, docs, sortorder=None): """ Sort and filter a list of C{ObjDoc}s. In particular, if C{sortorder} is not C{None}, then sort according to its contents; otherwise, sort using L{_cmp_name}. If L{_show_private} is true, then filter out all private objects; otherwise, perform no filtering. | 60b4598f963657af72659f4c3492b6028c51c37e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/60b4598f963657af72659f4c3492b6028c51c37e/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3804,
12,
2890,
16,
3270,
16,
1524,
1019,
33,
7036,
4672,
3536,
5928,
471,
1034,
279,
666,
434,
385,
95,
2675,
1759,
97,
87,
18,
225,
657,
6826,
16,
309,
385,
95,
29068,
97,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3804,
12,
2890,
16,
3270,
16,
1524,
1019,
33,
7036,
4672,
3536,
5928,
471,
1034,
279,
666,
434,
385,
95,
2675,
1759,
97,
87,
18,
225,
657,
6826,
16,
309,
385,
95,
29068,
97,
353... |
buildscript.execute(cmd, 'git-svn', cwd=copydir) else: buildscript.execute(cmd, 'git-svn', cwd=self.config.checkoutroot) | buildscript.execute(cmd, cwd=copydir) else: buildscript.execute(cmd, cwd=self.config.checkoutroot) | def _checkout(self, buildscript, copydir=None): if self.config.sticky_date: raise FatalError(_('date based checkout not yet supported\n')) | 1a224b0a56aeaf262d7650245ef6abcabae0d850 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4596/1a224b0a56aeaf262d7650245ef6abcabae0d850/git.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
17300,
12,
2890,
16,
1361,
4263,
16,
1610,
1214,
33,
7036,
4672,
309,
365,
18,
1425,
18,
334,
13055,
67,
712,
30,
1002,
10375,
668,
24899,
2668,
712,
2511,
13926,
486,
4671,
3260,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
17300,
12,
2890,
16,
1361,
4263,
16,
1610,
1214,
33,
7036,
4672,
309,
365,
18,
1425,
18,
334,
13055,
67,
712,
30,
1002,
10375,
668,
24899,
2668,
712,
2511,
13926,
486,
4671,
3260,
... |
logWarning('unknown keydown: ' + str(c)) | def keydown(key): #c = chr(int(key.keyCode)).lower() #c = int(key.keyCode) try: logWarning("Keydown pressed") c = key.keyCode if c > ord('0') and c < ord('9'): addPlayer(int(chr(c))) #for i in km.keymappings: # log(str(i)) if c in km.keymappings: logWarning('adding' + str(c)) km.add_key_down(km.keymappings[c]) #else: logWarning('unknown keydown: ' + str(c)) except Exception, e: log(str(e)) | f878ccc0a8247d58101494484a85a8dc6a023062 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/f878ccc0a8247d58101494484a85a8dc6a023062/start_bnb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
498,
2378,
12,
856,
4672,
468,
71,
273,
4513,
12,
474,
12,
856,
18,
856,
1085,
13,
2934,
8167,
1435,
468,
71,
273,
509,
12,
856,
18,
856,
1085,
13,
775,
30,
613,
6210,
2932,
653,
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,
498,
2378,
12,
856,
4672,
468,
71,
273,
4513,
12,
474,
12,
856,
18,
856,
1085,
13,
2934,
8167,
1435,
468,
71,
273,
509,
12,
856,
18,
856,
1085,
13,
775,
30,
613,
6210,
2932,
653,
2... | |
else: | elif play: | def addTrack(path, play=False): try: file_url = 'file://' + path mp = bus.get_object('org.freedesktop.MediaPlayer', '/TrackList') mp.AddTrack(file_url, play) except DBusException: try: if subprocess.call(['audtool','playlist-addurl',file_url]): print "ERROR: audtool fallback returned an error for: %s" % file_url else: os.system('audtool playlist-jump `audtool playlist-length`; audtool playback-play') except OSError: print "ERROR: Unable to call audtool as a fallback for: %s" % file_url | 2be1e1070435f6a601b886064d6db2361a13a5a0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11853/2be1e1070435f6a601b886064d6db2361a13a5a0/lap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
4402,
12,
803,
16,
6599,
33,
8381,
4672,
775,
30,
585,
67,
718,
273,
296,
768,
8931,
397,
589,
6749,
273,
5766,
18,
588,
67,
1612,
2668,
3341,
18,
74,
15656,
281,
11869,
18,
541... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
4402,
12,
803,
16,
6599,
33,
8381,
4672,
775,
30,
585,
67,
718,
273,
296,
768,
8931,
397,
589,
6749,
273,
5766,
18,
588,
67,
1612,
2668,
3341,
18,
74,
15656,
281,
11869,
18,
541... |
def get_module_stream(self, name): mod = __import__(name) for token in name.split('.')[1:]: mod = getattr(mod, token) f = mod.__file__ f = re.sub('\.py$', '\.pyc', f) | def load_stream(self, name): f = os.path.join(os.path.dirname(testbase.__file__), name) | def get_module_stream(self, name): mod = __import__(name) for token in name.split('.')[1:]: mod = getattr(mod, token) f = mod.__file__ f = re.sub('\.py$', '\.pyc', f) # put a number less than the typical MySQL default BLOB size return file(f).read(59473) | 76597e533f20b700596a77dcb49403c3d0d2c791 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1074/76597e533f20b700596a77dcb49403c3d0d2c791/testtypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
3256,
12,
2890,
16,
508,
4672,
284,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
3813,
1969,
16186,
768,
972,
3631,
508,
13,
468,
1378,
279,
1300,
5242,
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,
1262,
67,
3256,
12,
2890,
16,
508,
4672,
284,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
3813,
1969,
16186,
768,
972,
3631,
508,
13,
468,
1378,
279,
1300,
5242,
2... |
def _table_header(self, heading): | def _table_header(self, heading, css_class): | def _table_header(self, heading): 'Return a header for an HTML table' return self._start_of(heading)+\ '<TABLE BORDER="1" CELLPADDING="3" ' +\ 'CELLSPACING="0" WIDTH="100%" BGCOLOR="white">\n' +\ '<TR BGCOLOR="#70b0f0">\n'+\ '<TD COLSPAN=2><FONT SIZE="+2">\n<B>' + heading + \ '</B></FONT></TD></TR>\n' | 07991a6224980123acb6be68dd2d39634e5ac591 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/07991a6224980123acb6be68dd2d39634e5ac591/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2121,
67,
3374,
12,
2890,
16,
11053,
16,
3747,
67,
1106,
4672,
296,
990,
279,
1446,
364,
392,
3982,
1014,
11,
327,
365,
6315,
1937,
67,
792,
12,
19948,
13,
16971,
2368,
7775,
605,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2121,
67,
3374,
12,
2890,
16,
11053,
16,
3747,
67,
1106,
4672,
296,
990,
279,
1446,
364,
392,
3982,
1014,
11,
327,
365,
6315,
1937,
67,
792,
12,
19948,
13,
16971,
2368,
7775,
605,... |
return string.atof(v) | if v: return string.atof(v) raise ValueError, 'Empty entry when floating-point number expected' | def field2float(v): try: v=v.read() except: v=str(v) return string.atof(v) | e4d209501bbb231c07d5e6c2f30b761bb8a056fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/e4d209501bbb231c07d5e6c2f30b761bb8a056fc/Publish.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
652,
22,
5659,
12,
90,
4672,
775,
30,
331,
33,
90,
18,
896,
1435,
1335,
30,
331,
33,
701,
12,
90,
13,
225,
309,
331,
30,
327,
533,
18,
270,
792,
12,
90,
13,
1002,
2068,
16,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
652,
22,
5659,
12,
90,
4672,
775,
30,
331,
33,
90,
18,
896,
1435,
1335,
30,
331,
33,
701,
12,
90,
13,
225,
309,
331,
30,
327,
533,
18,
270,
792,
12,
90,
13,
1002,
2068,
16,
296,
... |
return fct_src(db, uid, passwd, object, method, *args) rule_ids=pool.get('audittrail.rule').search(cr, uid, [('object_id','=',obj_ids[0]),('state','=','subscribed')]) | return fct_src(db, uid, object, method, *args) rule_ids=pool.get('audittrail.rule').search(cr, uid, [('object_id', '=', obj_ids[0]), ('state', '=', 'subscribed')]) | def my_fct(db, uid, passwd, object, method, *args): field = method rule = False obj_ids= pool.get('ir.model').search(cr, uid,[('model','=',object_name)]) for obj_name in pool.obj_list(): if obj_name == 'audittrail.rule': rule = True if not rule: return fct_src(db, uid, passwd, object, method, *args) if not len(obj_ids): return fct_src(db, uid, passwd, object, method, *args) rule_ids=pool.get('audittrail.rule').search(cr, uid, [('object_id','=',obj_ids[0]),('state','=','subscribed')]) if not len(rule_ids): return fct_src(db, uid, passwd, object, method, *args) | d8781cd0f2eee29372e5a54862aa63c732ae3150 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/d8781cd0f2eee29372e5a54862aa63c732ae3150/audittrail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3399,
67,
74,
299,
12,
1966,
16,
4555,
16,
19093,
16,
733,
16,
707,
16,
380,
1968,
4672,
652,
273,
707,
1720,
273,
1083,
1081,
67,
2232,
33,
2845,
18,
588,
2668,
481,
18,
2284,
16063... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3399,
67,
74,
299,
12,
1966,
16,
4555,
16,
19093,
16,
733,
16,
707,
16,
380,
1968,
4672,
652,
273,
707,
1720,
273,
1083,
1081,
67,
2232,
33,
2845,
18,
588,
2668,
481,
18,
2284,
16063... |
self.overlay.close() | if self.overlay and self.overlay.is_visible(): self.overlay.close() | def hide_controls(self): _window().window.set_cursor(self.hidden_cursor) self.overlay.close() | 08c556075000a687fd6cae298184d47dd6b5ff97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/08c556075000a687fd6cae298184d47dd6b5ff97/video.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6853,
67,
24350,
12,
2890,
4672,
389,
5668,
7675,
5668,
18,
542,
67,
9216,
12,
2890,
18,
6345,
67,
9216,
13,
365,
18,
17312,
18,
4412,
1435,
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,
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,
6853,
67,
24350,
12,
2890,
4672,
389,
5668,
7675,
5668,
18,
542,
67,
9216,
12,
2890,
18,
6345,
67,
9216,
13,
365,
18,
17312,
18,
4412,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
result = result + \ '<dd>\n%s</dd>\n' % self.doctree(entry, modname, classes, c) | result = result + '<dd>\n%s</dd>\n' % self.formattree( entry, modname, classes, c) | def doctree(self, tree, modname, classes={}, parent=None): """Produce HTML for a class tree as given by inspect.getclasstree().""" result = '' for entry in tree: if type(entry) is type(()): c, bases = entry result = result + '<dt><font face="helvetica, arial"><small>' result = result + self.classlink(c, modname, classes) if bases and bases != (parent,): parents = [] for base in bases: parents.append(self.classlink(base, modname, classes)) result = result + '(' + join(parents, ', ') + ')' result = result + '\n</small></font></dt>' elif type(entry) is type([]): result = result + \ '<dd>\n%s</dd>\n' % self.doctree(entry, modname, classes, c) return '<dl>\n%s</dl>\n' % result | 54a838fe1421d6e6829cabc42e7f398722140804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54a838fe1421d6e6829cabc42e7f398722140804/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31263,
992,
12,
2890,
16,
2151,
16,
16037,
16,
3318,
28793,
982,
33,
7036,
4672,
3536,
25884,
3982,
364,
279,
667,
2151,
487,
864,
635,
5334,
18,
588,
830,
345,
334,
992,
1435,
12123,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31263,
992,
12,
2890,
16,
2151,
16,
16037,
16,
3318,
28793,
982,
33,
7036,
4672,
3536,
25884,
3982,
364,
279,
667,
2151,
487,
864,
635,
5334,
18,
588,
830,
345,
334,
992,
1435,
12123,
... |
(comp[key].encode('utf-8'), comp['owner'].encode('utf-8'))) | (comp[key], comp['owner'])) | def setComponentList(self, l, key): """Remove all components, set them to `l`""" self.assertNoTickets() | 3c880bacc20a99c1c09f23abe68ea43a4bd475ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9317/3c880bacc20a99c1c09f23abe68ea43a4bd475ab/bugzilla2trac.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
1841,
682,
12,
2890,
16,
328,
16,
498,
4672,
3536,
3288,
777,
4085,
16,
444,
2182,
358,
1375,
80,
68,
8395,
365,
18,
11231,
2279,
6264,
2413,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
1841,
682,
12,
2890,
16,
328,
16,
498,
4672,
3536,
3288,
777,
4085,
16,
444,
2182,
358,
1375,
80,
68,
8395,
365,
18,
11231,
2279,
6264,
2413,
1435,
2,
-100,
-100,
-100,
-100,
-100... |
refstr = '%s ORDER BY name'%(self.service_types) if not self.preEnterPath(refstr): ref = eServiceReference(refstr) currentRoot = self.getRoot() if currentRoot is None or currentRoot != ref: self.clearPath() self.enterPath(ref) def showSatellites(self): refstr = '%s FROM SATELLITES ORDER BY satellitePosition'%(self.service_types) if not self.preEnterPath(refstr): ref = eServiceReference(refstr) justSet=False prev = None if self.isBasePathEqual(ref): if self.isPrevPathEqual(ref): justSet=True prev = self.pathUp(justSet) else: currentRoot = self.getRoot() if currentRoot is None or currentRoot != ref: justSet=True self.clearPath() self.enterPath(ref, True) if justSet: serviceHandler = eServiceCenter.getInstance() servicelist = serviceHandler.list(ref) if not servicelist is None: while True: service = servicelist.getNext() if not service.valid(): break orbpos = service.getData(4) >> 16 if service.getPath().find("FROM PROVIDER") != -1: service_name = _("Providers") else: service_name = _("Services") try: service_name += str(' - %s'%(nimmanager.getSatDescription(orbpos))) service.setName(service_name) except: if orbpos > 1800: service.setName("%s (%3.1f" + _("W") + ")" %(str, (0 - (orbpos - 3600)) / 10.0)) else: service.setName("%s (%3.1f" + _("E") + ")" % (str, orbpos / 10.0)) self.servicelist.addService(service) self.servicelist.finishFill() if prev is not None: self.setCurrentSelection(prev) def showProviders(self): refstr = '%s FROM PROVIDERS ORDER BY name'%(self.service_types) if not self.preEnterPath(refstr): ref = eServiceReference(refstr) if self.isBasePathEqual(ref): self.pathUp() else: | if not self.pathChangedDisabled: refstr = '%s ORDER BY name'%(self.service_types) if not self.preEnterPath(refstr): ref = eServiceReference(refstr) | def showAllServices(self): refstr = '%s ORDER BY name'%(self.service_types) if not self.preEnterPath(refstr): ref = eServiceReference(refstr) currentRoot = self.getRoot() if currentRoot is None or currentRoot != ref: self.clearPath() self.enterPath(ref) | 54adc39b6d67358842acda8f56d911a3b5f0edd9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/54adc39b6d67358842acda8f56d911a3b5f0edd9/ChannelSelection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
1595,
5676,
12,
2890,
4672,
1278,
701,
273,
1995,
87,
10205,
6953,
508,
11,
17105,
2890,
18,
3278,
67,
2352,
13,
309,
486,
365,
18,
1484,
10237,
743,
12,
1734,
701,
4672,
1278,
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,
2405,
1595,
5676,
12,
2890,
4672,
1278,
701,
273,
1995,
87,
10205,
6953,
508,
11,
17105,
2890,
18,
3278,
67,
2352,
13,
309,
486,
365,
18,
1484,
10237,
743,
12,
1734,
701,
4672,
1278,
2... |
Before using this command, you will need to enable email in your hgrc. See the [email] section in hgrc(5) for details. | Before using this command, you will need to enable email in your hgrc. See the [email] section in hgrc(5) for details. | def patchbomb(ui, repo, *revs, **opts): '''send changesets by email By default, diffs are sent in the format generated by hg export, one per message. The series starts with a "[PATCH 0 of N]" introduction, which describes the series as a whole. Each patch email has a Subject line of "[PATCH M of N] ...", using the first line of the changeset description as the subject text. The message contains two or three body parts. First, the rest of the changeset description. Next, (optionally) if the diffstat program is installed, the result of running diffstat on the patch. Finally, the patch itself, as generated by "hg export". With --outgoing, emails will be generated for patches not found in the destination repository (or only those which are ancestors of the specified revisions if any are provided) With --bundle, changesets are selected as for --outgoing, but a single email containing a binary Mercurial bundle as an attachment will be sent. Examples: hg email -r 3000 # send patch 3000 only hg email -r 3000 -r 3001 # send patches 3000 and 3001 hg email -r 3000:3005 # send patches 3000 through 3005 hg email 3000 # send patch 3000 (deprecated) hg email -o # send all patches not in default hg email -o DEST # send all patches not in DEST hg email -o -r 3000 # send all ancestors of 3000 not in default hg email -o -r 3000 DEST # send all ancestors of 3000 not in DEST hg email -b # send bundle of all patches not in default hg email -b DEST # send bundle of all patches not in DEST hg email -b -r 3000 # bundle of all ancestors of 3000 not in default hg email -b -r 3000 DEST # bundle of all ancestors of 3000 not in DEST Before using this command, you will need to enable email in your hgrc. See the [email] section in hgrc(5) for details. ''' _charsets = mail._charsets(ui) def outgoing(dest, revs): '''Return the revisions present locally but not in dest''' dest = ui.expandpath(dest or 'default-push', dest or 'default') revs = [repo.lookup(rev) for rev in revs] other = hg.repository(ui, dest) ui.status(_('comparing with %s\n') % dest) o = repo.findoutgoing(other) if not o: ui.status(_("no changes found\n")) return [] o = repo.changelog.nodesbetween(o, revs or None)[0] return [str(repo.changelog.rev(r)) for r in o] def getpatches(revs): for r in cmdutil.revrange(repo, revs): output = cStringIO.StringIO() patch.export(repo, [r], fp=output, opts=patch.diffopts(ui, opts)) yield output.getvalue().split('\n') def getbundle(dest): tmpdir = tempfile.mkdtemp(prefix='hg-email-bundle-') tmpfn = os.path.join(tmpdir, 'bundle') try: commands.bundle(ui, repo, tmpfn, dest, **opts) return open(tmpfn, 'rb').read() finally: try: os.unlink(tmpfn) except: pass os.rmdir(tmpdir) if not (opts.get('test') or opts.get('mbox')): # really sending mail.validateconfig(ui) if not (revs or opts.get('rev') or opts.get('outgoing') or opts.get('bundle') or opts.get('patches')): raise util.Abort(_('specify at least one changeset with -r or -o')) cmdutil.setremoteconfig(ui, opts) if opts.get('outgoing') and opts.get('bundle'): raise util.Abort(_("--outgoing mode always on with --bundle;" " do not re-specify --outgoing")) if opts.get('outgoing') or opts.get('bundle'): if len(revs) > 1: raise util.Abort(_("too many destinations")) dest = revs and revs[0] or None revs = [] if opts.get('rev'): if revs: raise util.Abort(_('use only one form to specify the revision')) revs = opts.get('rev') if opts.get('outgoing'): revs = outgoing(dest, opts.get('rev')) if opts.get('bundle'): opts['revs'] = revs # start if opts.get('date'): start_time = util.parsedate(opts.get('date')) else: start_time = util.makedate() def genmsgid(id): return '<%s.%s@%s>' % (id[:20], int(start_time[0]), socket.getfqdn()) def getdescription(body, sender): if opts.get('desc'): body = open(opts.get('desc')).read() else: ui.write(_('\nWrite the introductory message for the ' 'patch series.\n\n')) body = ui.edit(body, sender) return body def getpatchmsgs(patches, patchnames=None): jumbo = [] msgs = [] ui.write(_('This patch series consists of %d patches.\n\n') % len(patches)) name = None for i, p in enumerate(patches): jumbo.extend(p) if patchnames: name = patchnames[i] msg = makepatch(ui, repo, p, opts, _charsets, i + 1, len(patches), name) msgs.append(msg) if len(patches) > 1 or opts.get('intro'): tlen = len(str(len(patches))) subj = '[PATCH %0*d of %d] %s' % ( tlen, 0, len(patches), opts.get('subject') or prompt(ui, 'Subject:', rest=' [PATCH %0*d of %d] ' % (tlen, 0, len(patches)))) body = '' if opts.get('diffstat'): d = cdiffstat(ui, _('Final summary:\n'), jumbo) if d: body = '\n' + d body = getdescription(body, sender) msg = mail.mimeencode(ui, body, _charsets, opts.get('test')) msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get('test')) msgs.insert(0, (msg, subj)) return msgs def getbundlemsgs(bundle): subj = (opts.get('subject') or prompt(ui, 'Subject:', 'A bundle for your repository')) body = getdescription('', sender) msg = email.MIMEMultipart.MIMEMultipart() if body: msg.attach(mail.mimeencode(ui, body, _charsets, opts.get('test'))) datapart = email.MIMEBase.MIMEBase('application', 'x-mercurial-bundle') datapart.set_payload(bundle) bundlename = '%s.hg' % opts.get('bundlename', 'bundle') datapart.add_header('Content-Disposition', 'attachment', filename=bundlename) email.Encoders.encode_base64(datapart) msg.attach(datapart) msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get('test')) return [(msg, subj)] sender = (opts.get('from') or ui.config('email', 'from') or ui.config('patchbomb', 'from') or prompt(ui, 'From', ui.username())) # internal option used by pbranches patches = opts.get('patches') if patches: msgs = getpatchmsgs(patches, opts.get('patchnames')) elif opts.get('bundle'): msgs = getbundlemsgs(getbundle(dest)) else: msgs = getpatchmsgs(list(getpatches(revs))) def getaddrs(opt, prpt, default = None): addrs = opts.get(opt) or (ui.config('email', opt) or ui.config('patchbomb', opt) or prompt(ui, prpt, default)).split(',') return [mail.addressencode(ui, a.strip(), _charsets, opts.get('test')) for a in addrs if a.strip()] to = getaddrs('to', 'To') cc = getaddrs('cc', 'Cc', '') bcc = opts.get('bcc') or (ui.config('email', 'bcc') or ui.config('patchbomb', 'bcc') or '').split(',') bcc = [mail.addressencode(ui, a.strip(), _charsets, opts.get('test')) for a in bcc if a.strip()] ui.write('\n') parent = None sender_addr = email.Utils.parseaddr(sender)[1] sender = mail.addressencode(ui, sender, _charsets, opts.get('test')) sendmail = None for m, subj in msgs: try: m['Message-Id'] = genmsgid(m['X-Mercurial-Node']) except TypeError: m['Message-Id'] = genmsgid('patchbomb') if parent: m['In-Reply-To'] = parent m['References'] = parent else: parent = m['Message-Id'] m['Date'] = util.datestr(start_time, "%a, %d %b %Y %H:%M:%S %1%2") start_time = (start_time[0] + 1, start_time[1]) m['From'] = sender m['To'] = ', '.join(to) if cc: m['Cc'] = ', '.join(cc) if bcc: m['Bcc'] = ', '.join(bcc) if opts.get('test'): ui.status(_('Displaying '), subj, ' ...\n') ui.flush() if 'PAGER' in os.environ: fp = util.popen(os.environ['PAGER'], 'w') else: fp = ui generator = email.Generator.Generator(fp, mangle_from_=False) try: generator.flatten(m, 0) fp.write('\n') except IOError, inst: if inst.errno != errno.EPIPE: raise if fp is not ui: fp.close() elif opts.get('mbox'): ui.status(_('Writing '), subj, ' ...\n') fp = open(opts.get('mbox'), 'In-Reply-To' in m and 'ab+' or 'wb+') generator = email.Generator.Generator(fp, mangle_from_=True) date = util.datestr(start_time, '%a %b %d %H:%M:%S %Y') fp.write('From %s %s\n' % (sender_addr, date)) generator.flatten(m, 0) fp.write('\n\n') fp.close() else: if not sendmail: sendmail = mail.connect(ui) ui.status(_('Sending '), subj, ' ...\n') # Exim does not remove the Bcc field del m['Bcc'] fp = cStringIO.StringIO() generator = email.Generator.Generator(fp, mangle_from_=False) generator.flatten(m, 0) sendmail(sender, to + bcc + cc, fp.getvalue()) | bdfdc723e45c2d0dd28f2f5b8a7176ea0f2a76d4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/bdfdc723e45c2d0dd28f2f5b8a7176ea0f2a76d4/patchbomb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4729,
70,
16659,
12,
4881,
16,
3538,
16,
380,
266,
6904,
16,
2826,
4952,
4672,
9163,
4661,
3478,
2413,
635,
2699,
225,
2525,
805,
16,
15250,
854,
3271,
316,
326,
740,
4374,
635,
22576,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4729,
70,
16659,
12,
4881,
16,
3538,
16,
380,
266,
6904,
16,
2826,
4952,
4672,
9163,
4661,
3478,
2413,
635,
2699,
225,
2525,
805,
16,
15250,
854,
3271,
316,
326,
740,
4374,
635,
22576,
... |
sage: print L.nr_distinct_symbols() | sage: L.nr_distinct_symbols() | def nr_distinct_symbols(self): """ Returns the number of distinct symbols in the partial latin square self. | 9087d14f978c663baae98e9a365c4a3aa2a6f24c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/9087d14f978c663baae98e9a365c4a3aa2a6f24c/latin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9884,
67,
24592,
67,
15536,
12,
2890,
4672,
3536,
2860,
326,
1300,
434,
10217,
7963,
316,
326,
4702,
30486,
8576,
365,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
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,
9884,
67,
24592,
67,
15536,
12,
2890,
4672,
3536,
2860,
326,
1300,
434,
10217,
7963,
316,
326,
4702,
30486,
8576,
365,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for t, f in list(self._active_fetchers): if f is fetcher: self._active_fetchers.remove((t, f)) f._deactivated() return | self._lock.acquire() try: for t, f in list(self._active_fetchers): if f is fetcher: self._active_fetchers.remove((t, f)) f._deactivated() return finally: self._lock.release() | def remove_fetcher(self, fetcher): """Remove a running fetcher from the list of active fetchers. | 0565c1af1db0e5a1d306ebc4583856d6a63afa5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12769/0565c1af1db0e5a1d306ebc4583856d6a63afa5f/cache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
5754,
264,
12,
2890,
16,
20521,
4672,
3536,
3288,
279,
3549,
20521,
628,
326,
666,
434,
2695,
2158,
414,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
5754,
264,
12,
2890,
16,
20521,
4672,
3536,
3288,
279,
3549,
20521,
628,
326,
666,
434,
2695,
2158,
414,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.check_access() | def open_config(self, unused): """ Callers are responsible for closing the returned ConfigXml object. """ self.check_access() cfg_xml = self.ctx.dir / "etc" / "grid" / "config.xml" cfg_tmp = self.ctx.dir / "etc" / "grid" / "config.xml.tmp" if not cfg_xml.exists(): if cfg_tmp.exists(): self.ctx.dbg("Removing old config.xml.tmp") cfg_tmp.remove() config = omero.config.ConfigXml(str(cfg_tmp)) try: self.ctx.controls["config"].upgrade(None, config) finally: config.close() self.ctx.err("Creating %s" % cfg_xml) cfg_tmp.rename(str(cfg_xml)) | fbbf8a3d00479bd8578b88c3bb4a1f9d3edc4af7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/fbbf8a3d00479bd8578b88c3bb4a1f9d3edc4af7/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
1425,
12,
2890,
16,
10197,
4672,
3536,
3049,
414,
854,
14549,
364,
7647,
326,
2106,
1903,
4432,
733,
18,
3536,
2776,
67,
2902,
273,
365,
18,
5900,
18,
1214,
342,
315,
14175,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
1425,
12,
2890,
16,
10197,
4672,
3536,
3049,
414,
854,
14549,
364,
7647,
326,
2106,
1903,
4432,
733,
18,
3536,
2776,
67,
2902,
273,
365,
18,
5900,
18,
1214,
342,
315,
14175,
... | |
out('<div class="py-src">\n') | def write_sourcecode(self, out, doc): filename = doc.filename name = str(doc.canonical_name) # Header self.write_header(out, name) self.write_navbar(out, doc) self.write_breadcrumbs(out, doc, self.pysrc_url(doc)) | ead96d86090e18fdeec64a06319b925d20efd2b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/ead96d86090e18fdeec64a06319b925d20efd2b2/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
3168,
710,
12,
2890,
16,
596,
16,
997,
4672,
1544,
273,
997,
18,
3459,
508,
273,
609,
12,
2434,
18,
18288,
67,
529,
13,
225,
468,
4304,
365,
18,
2626,
67,
3374,
12,
659,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
3168,
710,
12,
2890,
16,
596,
16,
997,
4672,
1544,
273,
997,
18,
3459,
508,
273,
609,
12,
2434,
18,
18288,
67,
529,
13,
225,
468,
4304,
365,
18,
2626,
67,
3374,
12,
659,
... | |
print phase | print phase.encode('UTF-8') | def install(pkgpath, choicesXMLpath=''): """ Uses the apple installer to install the package or metapackage at pkgpath. Prints status messages to STDOUT. Returns the installer return code and true if a restart is needed. """ restartneeded = False installeroutput = [] cmd = ['/usr/sbin/installer', '-pkginfo', '-pkg', pkgpath] p = subprocess.Popen(cmd, shell=False, bufsize=1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (output, err) = p.communicate() packagename = output.splitlines()[0] if munkicommon.munkistatusoutput: munkistatus.message("Installing %s..." % packagename) # clear indeterminate progress bar munkistatus.percent(0) munkicommon.log("Installing %s from %s" % (packagename, os.path.basename(pkgpath).encode('UTF-8'))) cmd = ['/usr/sbin/installer', '-query', 'RestartAction', '-pkg', pkgpath] if choicesXMLpath: cmd.extend(['-applyChoiceChangesXML', choicesXMLpath]) p = subprocess.Popen(cmd, shell=False, bufsize=1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (output, err) = p.communicate() restartaction = output.rstrip("\n") if restartaction == "RequireRestart": munkicommon.display_status("%s requires a restart after installation." % packagename) restartneeded = True # get the OS version; we need it later when processing installer's output, # which varies depnding on OS version. osvers = int(os.uname()[2].split('.')[0]) cmd = ['/usr/sbin/installer', '-verboseR', '-pkg', pkgpath, '-target', '/'] if choicesXMLpath: cmd.extend(['-applyChoiceChangesXML', choicesXMLpath]) p = subprocess.Popen(cmd, shell=False, bufsize=1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) while True: installinfo = p.stdout.readline() if not installinfo and (p.poll() != None): break if installinfo.startswith("installer:"): # save all installer output in case there is # an error so we can dump it to the log installeroutput.append(installinfo) msg = installinfo[10:].rstrip("\n") if msg.startswith("PHASE:"): phase = msg[6:] if phase: if munkicommon.munkistatusoutput: munkistatus.detail(phase) else: print phase sys.stdout.flush() elif msg.startswith("STATUS:"): status = msg[7:] if status: if munkicommon.munkistatusoutput: munkistatus.detail(status) else: print status sys.stdout.flush() elif msg.startswith("%"): if munkicommon.munkistatusoutput: percent = float(msg[1:]) if osvers < 10: # Leopard uses a float from 0 to 1 percent = int(percent * 100) munkistatus.percent(percent) elif msg.startswith(" Error"): if munkicommon.munkistatusoutput: munkistatus.detail(msg) else: print >>sys.stderr, msg munkicommon.log(msg) elif msg.startswith(" Cannot install"): if munkicommon.munkistatusoutput: munkistatus.detail(msg) else: print >>sys.stderr, msg munkicommon.log(msg) else: munkicommon.log(msg) retcode = p.poll() if retcode: munkicommon.display_status("Install of %s failed." % packagename) munkicommon.display_error("-------------------------------------------------") for line in installeroutput: munkicommon.display_error(line.rstrip("\n")) munkicommon.display_error("-------------------------------------------------") restartneeded = False else: munkicommon.log("Install of %s was successful." % packagename) if munkicommon.munkistatusoutput: munkistatus.percent(100) return (retcode, restartneeded) | 89239f7f143c9ea7b3c22409407bfe201c79c988 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6241/89239f7f143c9ea7b3c22409407bfe201c79c988/installer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
12,
10657,
803,
16,
7246,
4201,
803,
2218,
11,
4672,
3536,
14854,
326,
595,
298,
16050,
358,
3799,
326,
2181,
578,
5100,
438,
1270,
622,
3475,
803,
18,
3038,
87,
1267,
2743,
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,
3799,
12,
10657,
803,
16,
7246,
4201,
803,
2218,
11,
4672,
3536,
14854,
326,
595,
298,
16050,
358,
3799,
326,
2181,
578,
5100,
438,
1270,
622,
3475,
803,
18,
3038,
87,
1267,
2743,
358,
... |
'zh': u'User talk', | def __init__(self): family.Family.__init__(self) self.name = 'uncyclopedia' | 5291e54d99c50e05679c62b06fbab03ab3f57e0d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/5291e54d99c50e05679c62b06fbab03ab3f57e0d/uncyclopedia_family.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
6755,
18,
9203,
16186,
2738,
972,
12,
2890,
13,
365,
18,
529,
273,
296,
551,
93,
7550,
1845,
1155,
11,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
6755,
18,
9203,
16186,
2738,
972,
12,
2890,
13,
365,
18,
529,
273,
296,
551,
93,
7550,
1845,
1155,
11,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
self.sslContext.set_verify( GSI.SSL.VERIFY_PEER|GSI.SSL.VERIFY_FAIL_IF_NO_PEER_CERT, None, gsiEnable ) | self.sslContext.set_verify( GSI.SSL.VERIFY_PEER | GSI.SSL.VERIFY_FAIL_IF_NO_PEER_CERT, None, gsiEnable ) | def __createContext( self ): clientContext = self.__getValue( 'clientMode', False ) # Initialize context if clientContext: methodSuffix = "CLIENT_METHOD" else: methodSuffix = "SERVER_METHOD" if 'sslMethod' in self.infoDict: methodName = "%s_%s" % ( self.infoDict[ 'sslMethod' ], methodSuffix ) else: methodName = "TLSv1_%s" % ( methodSuffix ) try: method = getattr( GSI.SSL, methodName ) except: return S_ERROR( "SSL method %s is not valid" % self.infoDict[ 'sslMethod' ] ) self.sslContext = GSI.SSL.Context( method ) #Enable GSI? gsiEnable = False if not clientContext or self.__getValue( 'gsiEnable', False ): gsiEnable = True #DO CA Checks? if not self.__getValue( 'skipCACheck', False ): #self.sslContext.set_verify( SSL.VERIFY_PEER|SSL.VERIFY_FAIL_IF_NO_PEER_CERT, self.verifyCallback ) # Demand a certificate self.sslContext.set_verify( GSI.SSL.VERIFY_PEER|GSI.SSL.VERIFY_FAIL_IF_NO_PEER_CERT, None, gsiEnable ) # Demand a certificate casPath = Locations.getCAsLocation() if not casPath: return S_ERROR( "No valid CAs location found" ) gLogger.debug( "CAs location is %s" % casPath ) self.sslContext.load_verify_locations_path( casPath ) else: self.sslContext.set_verify( GSI.SSL.VERIFY_NONE, None, gsiEnable ) # Demand a certificate return S_OK() | 81ff31576d2080209ded20b22fb2233a3640a6dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/81ff31576d2080209ded20b22fb2233a3640a6dd/SocketInfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2640,
1042,
12,
365,
262,
30,
1004,
1042,
273,
365,
16186,
24805,
12,
296,
2625,
2309,
2187,
1083,
262,
468,
9190,
819,
309,
1004,
1042,
30,
707,
5791,
273,
315,
11935,
67,
5327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2640,
1042,
12,
365,
262,
30,
1004,
1042,
273,
365,
16186,
24805,
12,
296,
2625,
2309,
2187,
1083,
262,
468,
9190,
819,
309,
1004,
1042,
30,
707,
5791,
273,
315,
11935,
67,
5327,
... |
proxy_to_store = proxy | proxy_to_store = proxy | def storeProxy(self,proxy,dn,group): """ Store user proxy into the Proxy repository for a user specified by his DN and group. The grid proxy will be converted into a VOMS proxy if possible """ | 8d9be402f0921fd362c60672a9d99525f2e3eeed /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/8d9be402f0921fd362c60672a9d99525f2e3eeed/ProxyRepositoryDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1707,
3886,
12,
2890,
16,
5656,
16,
5176,
16,
1655,
4672,
3536,
4994,
729,
2889,
1368,
326,
7659,
3352,
364,
279,
729,
1269,
635,
18423,
18001,
471,
1041,
18,
1021,
3068,
2889,
903,
506,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1707,
3886,
12,
2890,
16,
5656,
16,
5176,
16,
1655,
4672,
3536,
4994,
729,
2889,
1368,
326,
7659,
3352,
364,
279,
729,
1269,
635,
18423,
18001,
471,
1041,
18,
1021,
3068,
2889,
903,
506,... |
bitesized_keyword='easy') | bitesized_keyword='easy', bug_project_name_format='{project}') | def __init__(self): TracBugTracker.__init__(self, project_name='Django', base_url='http://code.djangoproject.com/', bitesized_keyword='easy') | 492ed0e9fe59cd560a17e8afa9f302c46097de7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11976/492ed0e9fe59cd560a17e8afa9f302c46097de7b/trac_instances.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2197,
71,
19865,
8135,
16186,
2738,
972,
12,
2890,
16,
1984,
67,
529,
2218,
40,
9142,
2187,
1026,
67,
718,
2218,
2505,
2207,
710,
18,
31646,
539,
556,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2197,
71,
19865,
8135,
16186,
2738,
972,
12,
2890,
16,
1984,
67,
529,
2218,
40,
9142,
2187,
1026,
67,
718,
2218,
2505,
2207,
710,
18,
31646,
539,
556,
... |
self.pool = PoolStack(self) self.turned = TurnedStack(self) | x = x + XSPACING | def __init__(self, master): | 20ce2dd6aa77ea628b49c0c6b820d66211a9a61d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20ce2dd6aa77ea628b49c0c6b820d66211a9a61d/solitaire.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Output("if (myPyMac_GetFSSpec(v, &((%s *)self)->ob_itself)) return 0;", self.objecttype) | Output("if (PyMac_GetFSSpec(v, &((%s *)self)->ob_itself)) return 0;", self.objecttype) | def output_tp_initBody(self): Output("PyObject *v = NULL;") Output("char *rawdata = NULL;") Output("int rawdatalen = 0;") Output("char *kw[] = {\"itself\", \"rawdata\", 0};") Output() Output("if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|Os#\", kw, &v, &rawdata, &rawdatalen))") Output("return -1;") Output("if (v && rawdata)") OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"Only one of itself or rawdata may be specified\");") Output("return -1;") OutRbrace() Output("if (!v && !rawdata)") OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"One of itself or rawdata must be specified\");") Output("return -1;") OutRbrace() Output("if (rawdata)") OutLbrace() Output("if (rawdatalen != sizeof(%s))", self.itselftype) OutLbrace() Output("PyErr_SetString(PyExc_TypeError, \"%s rawdata incorrect size\");", self.itselftype) Output("return -1;") OutRbrace() Output("memcpy(&((%s *)self)->ob_itself, rawdata, rawdatalen);", self.objecttype) Output("return 0;") OutRbrace() Output("if (myPyMac_GetFSSpec(v, &((%s *)self)->ob_itself)) return 0;", self.objecttype) Output("return -1;") | 8ed30da29d0fd0d5df3fd27bfcaffe5b4b71a5f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/8ed30da29d0fd0d5df3fd27bfcaffe5b4b71a5f5/filesupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
876,
67,
6834,
67,
2738,
2250,
12,
2890,
4672,
3633,
2932,
9413,
921,
380,
90,
273,
3206,
4868,
13,
3633,
2932,
3001,
380,
1899,
892,
273,
3206,
4868,
13,
3633,
2932,
474,
1831,
72,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
876,
67,
6834,
67,
2738,
2250,
12,
2890,
4672,
3633,
2932,
9413,
921,
380,
90,
273,
3206,
4868,
13,
3633,
2932,
3001,
380,
1899,
892,
273,
3206,
4868,
13,
3633,
2932,
474,
1831,
72,
31... |
filter_by(min_MAF=pd.min_MAF).filter_by(get_closest=pd.get_closest).filter_by(test_type=pd.test_type) | filter_by(min_MAF=pd.min_MAF).filter_by(get_closest=pd.get_closest).filter_by(test_type_id=pd.test_type_id) testType = CandidateGeneRankSumTestResultMethodType.get(pd.test_type_id) | def run_wilcox_test(self, pd): """ 2008-10-15 more test_types 2008-08-20 use pd to summarize all parameters 2008-08-15 fix option max_pvalue_per_gene, to have the choice to take the most significant SNP associated with one gene or not 2008-08-14 add min_MAF just prepareDataForRankTest(). 2008-07-24 fix a bug. still using self.list_type_id, rather than just list_type_id in one line 2008-07-17 split out as a standalone function so that MpiGeneListRankTest.py could call it more easily. """ if self.debug: sys.stderr.write("Running wilcox test ... ") if pd.results_type==1: ResultsClass = ResultsMethod TestResultClass = CandidateGeneRankSumTestResultMethod rm = ResultsClass.get(pd.results_id) min_distance = pd.min_distance min_MAF = pd.min_MAF get_closest = pd.get_closest elif pd.results_type==2: ResultsClass = ResultsByGene TestResultClass = CandidateGeneRankSumTestResult rm = ResultsClass.get(pd.results_id) min_distance = rm.min_distance min_MAF = rm.min_MAF get_closest = rm.get_closest else: sys.stderr.write("Invalid results type : %s.\n"%pd.results_type) return None if not rm: sys.stderr.write("No results method available for results_id=%s.\n"%pd.results_id) return None db_results = TestResultClass.query.filter_by(results_id=pd.results_id).\ filter_by(list_type_id=pd.list_type_id).filter_by(min_distance=pd.min_distance).\ filter_by(min_MAF=pd.min_MAF).filter_by(get_closest=pd.get_closest).filter_by(test_type=pd.test_type) if db_results.count()>0: #done before db_result = db_results.first() sys.stderr.write("It's done already. id=%s, results_id=%s, list_type_id=%s, pvalue=%s, statistic=%s.\n"%\ (db_result.id, db_result.results_id, db_result.list_type_id, db_result.pvalue, db_result.statistic)) return None try: import rpy candidate_gene_list = self.dealWithCandidateGeneList(pd.list_type_id) #internal cache if pd.test_type>3: allow_two_sample_overlapping = 1 else: allow_two_sample_overlapping = 0 param_data = PassingData(results_directory=pd.results_directory, candidate_gene_list=candidate_gene_list, \ min_MAF=pd.min_MAF, allow_two_sample_overlapping=allow_two_sample_overlapping) if pd.results_type==2: passingdata = self.prepareDataForRankTestFromResultsByGene(rm, param_data) candidate_sample_size = len(passingdata.candidate_gene_pvalue_list) non_candidate_sample_size = len(passingdata.non_candidate_gene_pvalue_list) if candidate_sample_size>=pd.min_sample_size and non_candidate_sample_size>=pd.min_sample_size: #2008-08-14 w_result = rpy.r.wilcox_test(passingdata.candidate_gene_pvalue_list, passingdata.non_candidate_gene_pvalue_list, alternative='greater', conf_int=rpy.r.TRUE) else: sys.stderr.write("Ignore. sample size less than %s. %s vs %s.\n"%(pd.min_sample_size, candidate_sample_size, non_candidate_sample_size)) return None statistic=w_result['statistic']['W'] pvalue=w_result['p.value'] elif pd.results_type==1: #for ResultsMethod permData = self.prepareDataForPermutationRankTest(rm, pd.snps_context_wrapper, param_data) candidate_sample_size = len(permData.candidate_gene_snp_rank_ls) non_candidate_sample_size = len(permData.non_candidate_gene_snp_rank_ls) not_enough_sample = 0 if candidate_sample_size<pd.min_sample_size or non_candidate_sample_size<pd.min_sample_size: sys.stderr.write("Ignore. sample size less than %s. %s vs %s.\n"%(pd.min_sample_size, candidate_sample_size, non_candidate_sample_size)) return None if pd.test_type%3==1: w_result = rpy.r.wilcox_test(permData.candidate_gene_snp_rank_ls, permData.non_candidate_gene_snp_rank_ls, alternative='greater') statistic=w_result['statistic']['W'] pvalue=w_result['p.value'] elif pd.test_type%3==2 or pd.test_type%3==0: if pd.test_type%3==2: pd.permutation_type = 1 elif pd.test_type%3==0: pd.permutation_type = 2 rank_sum_stat, pvalue = self.getPermutationRankSumPvalue(permData.chr2rank_ls, permData.candidate_gene_snp_index_ls, permData.non_candidate_gene_snp_index_ls,\ permData.rank_sum_stat, \ permData.no_of_snps, permData.chr2no_of_snps, permutation_type=pd.permutation_type, \ no_of_permutations=pd.no_of_permutations, no_of_min_breaks=pd.no_of_min_breaks) statistic = rank_sum_stat-(candidate_sample_size*(candidate_sample_size-1))/2. else: sys.stderr.write("Test_type %s not supported.\n"%(pd.test_type)) return None else: sys.stderr.write("Results_type %s not supported.\n"%(pd.results_type)) return None except: sys.stderr.write("Exception happened for results_id=%s, list_type_id=%s.\n"%(pd.results_id, pd.list_type_id)) traceback.print_exc() sys.stderr.write('%s.\n'%repr(sys.exc_info())) return None candidate_gene_rank_sum_test_result = TestResultClass(list_type_id=pd.list_type_id, statistic=statistic,\ pvalue=pvalue) candidate_gene_rank_sum_test_result.results_id = pd.results_id candidate_gene_rank_sum_test_result.min_distance = min_distance candidate_gene_rank_sum_test_result.min_MAF = min_MAF candidate_gene_rank_sum_test_result.get_closest = get_closest candidate_gene_rank_sum_test_result.candidate_sample_size = candidate_sample_size candidate_gene_rank_sum_test_result.non_candidate_sample_size = non_candidate_sample_size candidate_gene_rank_sum_test_result.test_type = pd.test_type candidate_gene_rank_sum_test_result.max_pvalue_per_gene = 0 #always set to 0 in order to be compatible with previous approaches if self.debug: sys.stderr.write("Done.\n") return candidate_gene_rank_sum_test_result | 0cbc1eb0d025ba7f421937353b64926f439623e5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9645/0cbc1eb0d025ba7f421937353b64926f439623e5/GeneListRankTest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
91,
330,
71,
2409,
67,
3813,
12,
2890,
16,
4863,
4672,
3536,
4044,
28,
17,
2163,
17,
3600,
1898,
1842,
67,
2352,
4044,
28,
17,
6840,
17,
3462,
999,
4863,
358,
28712,
777,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
91,
330,
71,
2409,
67,
3813,
12,
2890,
16,
4863,
4672,
3536,
4044,
28,
17,
2163,
17,
3600,
1898,
1842,
67,
2352,
4044,
28,
17,
6840,
17,
3462,
999,
4863,
358,
28712,
777,
1... |
convert_script.write(""" | convert_script.write(""" | def setup_cacheconv(self,cp): # create a shell script to call convertlalcache.pl if the value of $RETURN is 0 convert_script = open('cacheconv.sh','w') | cbd6ac162cb6bf2eb4ad5ce9c3d03753b881f67f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/cbd6ac162cb6bf2eb4ad5ce9c3d03753b881f67f/stfu_pipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
67,
17703,
17181,
90,
12,
2890,
16,
4057,
4672,
468,
752,
279,
5972,
2728,
358,
745,
1765,
80,
287,
2493,
18,
412,
309,
326,
460,
434,
271,
14033,
353,
374,
1765,
67,
4263,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
67,
17703,
17181,
90,
12,
2890,
16,
4057,
4672,
468,
752,
279,
5972,
2728,
358,
745,
1765,
80,
287,
2493,
18,
412,
309,
326,
460,
434,
271,
14033,
353,
374,
1765,
67,
4263,
273,
... |
from security import Default | from MoinMoin.security import Default | def __init__(self, request, id=None, name="", password=None, auth_username="", **kw): """ Initialize User object @param request: the request object @param id: (optional) user ID @param name: (optional) user name @param password: (optional) user password @param auth_username: (optional) already authenticated user name (e.g. when using http basic auth) @keyword auth_method: method that was used for authentication, default: 'internal' @keyword auth_attribs: tuple of user object attribute names that are determined by auth method and should not be changed by UserPreferences form, default: (). First tuple element was used for authentication. """ self._cfg = request.cfg self.valid = 0 self.trusted = 0 self.id = id self.auth_username = auth_username self.auth_method = kw.get('auth_method', 'internal') self.auth_attribs = kw.get('auth_attribs', ()) | 8af877ccc3f00946cd15a67d75ecb3b90e31c477 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/8af877ccc3f00946cd15a67d75ecb3b90e31c477/user.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
590,
16,
612,
33,
7036,
16,
508,
1546,
3113,
2201,
33,
7036,
16,
1357,
67,
5053,
1546,
3113,
2826,
9987,
4672,
3536,
9190,
2177,
733,
225,
632,
891,
590,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
590,
16,
612,
33,
7036,
16,
508,
1546,
3113,
2201,
33,
7036,
16,
1357,
67,
5053,
1546,
3113,
2826,
9987,
4672,
3536,
9190,
2177,
733,
225,
632,
891,
590,... |
'state': lambda *a: 'uninstalled', 'demo': lambda *a: False, 'license': lambda *a: 'AGPL-3', | 'state': 'uninstalled', 'demo': False, 'license': 'AGPL-3', | def _get_views(self, cr, uid, ids, field_name=None, arg=None, context={}): res = {} model_data_obj = self.pool.get('ir.model.data') view_obj = self.pool.get('ir.ui.view') report_obj = self.pool.get('ir.actions.report.xml') menu_obj = self.pool.get('ir.ui.menu') mlist = self.browse(cr, uid, ids, context=context) mnames = {} for m in mlist: mnames[m.name] = m.id res[m.id] = { 'menus_by_module':[], 'reports_by_module':[], 'views_by_module': [] } view_id = model_data_obj.search(cr,uid,[('module','in', mnames.keys()), ('model','in',('ir.ui.view','ir.actions.report.xml','ir.ui.menu'))]) for data_id in model_data_obj.browse(cr,uid,view_id,context): # We use try except, because views or menus may not exist try: key = data_id['model'] if key=='ir.ui.view': v = view_obj.browse(cr,uid,data_id.res_id) aa = v.inherit_id and '* INHERIT ' or '' res[mnames[data_id.module]]['views_by_module'].append(aa + v.name + '('+v.type+')') elif key=='ir.actions.report.xml': res[mnames[data_id.module]]['reports_by_module'].append(report_obj.browse(cr,uid,data_id.res_id).name) elif key=='ir.ui.menu': res[mnames[data_id.module]]['menus_by_module'].append(menu_obj.browse(cr,uid,data_id.res_id).complete_name) except KeyError, e: pass for key, value in res.iteritems() : for k, v in res[key].iteritems() : res[key][k] = "\n".join(sorted(v)) return res | d4c36de1e04f70d7a0ae8479f77b8a6d38aed4c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/d4c36de1e04f70d7a0ae8479f77b8a6d38aed4c1/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
7061,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
529,
33,
7036,
16,
1501,
33,
7036,
16,
819,
12938,
4672,
400,
273,
2618,
938,
67,
892,
67,
2603,
273,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
7061,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
529,
33,
7036,
16,
1501,
33,
7036,
16,
819,
12938,
4672,
400,
273,
2618,
938,
67,
892,
67,
2603,
273,
365,
... |
self.assertEquals(where.as_sql(), "(cn=*te\\2ast*)") | self.assertEquals(where.as_sql(), ("(cn=*te\\2ast*)", [])) | def test_char_field_contains(self): where = WhereNode() where.add((Constraint("cn", "cn", CharField()), 'contains', "test"), AND) self.assertEquals(where.as_sql(), "(cn=*test*)") | 3a2264a2aa93a43c1409541b81d56fc98973f384 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12933/3a2264a2aa93a43c1409541b81d56fc98973f384/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3001,
67,
1518,
67,
12298,
12,
2890,
4672,
1625,
273,
12177,
907,
1435,
1625,
18,
1289,
12443,
5806,
2932,
10305,
3113,
315,
10305,
3113,
3703,
974,
1435,
3631,
296,
12298,
2187,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3001,
67,
1518,
67,
12298,
12,
2890,
4672,
1625,
273,
12177,
907,
1435,
1625,
18,
1289,
12443,
5806,
2932,
10305,
3113,
315,
10305,
3113,
3703,
974,
1435,
3631,
296,
12298,
2187,... |
oldincx = self.canvas["xscrollincrement"] oldincy = self.canvas["yscrollincrement"] self.canvas["xscrollincrement"] = 1 self.canvas["yscrollincrement"] = 1 self.canvas.xview_moveto(0.0) self.canvas.yview_moveto(0.0) self.canvas.xview_scroll(int(nsx)+1, UNITS) self.canvas.yview_scroll(int(nsy)+1, UNITS) self.canvas["xscrollincrement"] = oldincx self.canvas["yscrollincrement"] = oldincy | offset_x = +1 if nsx >= 0 else 0 offset_y = +1 if nsy >= 0 else 0 self.canvas.xview_moveto(float(nsx + offset_x)/new_width) self.canvas.yview_moveto(float(nsy + offset_y)/new_height) | def resize_image_to_zoom(self, delta=None, zoom=None, center=None, forcereload=False): """Parameters: delta : How much to increase/decrease the current zoom? zoom : Set zoom to this absolute value. center : Uses these coordinates (x,y) as the zoom center, scrolling the canvas as needed. These are "window coordinates", relative to the widget's top-left corner. forcereload: Clears the zoom cache, forces reloading the canvas from self.pil_image. """ | a2c6793b7b40c0b3646f334392ae0ce850f396a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14979/a2c6793b7b40c0b3646f334392ae0ce850f396a0/mainwindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7041,
67,
2730,
67,
869,
67,
14932,
12,
2890,
16,
3622,
33,
7036,
16,
7182,
33,
7036,
16,
4617,
33,
7036,
16,
364,
2750,
292,
6189,
33,
8381,
4672,
3536,
2402,
30,
3622,
1377,
294,
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,
7041,
67,
2730,
67,
869,
67,
14932,
12,
2890,
16,
3622,
33,
7036,
16,
7182,
33,
7036,
16,
4617,
33,
7036,
16,
364,
2750,
292,
6189,
33,
8381,
4672,
3536,
2402,
30,
3622,
1377,
294,
9... |
if hasattr(self, "backgroundColor"): widget.SetBackgroundColour(self.backgroundColor.wxColor()) if hasattr(self, "foregroundColor"): widget.SetForegroundColour(self.foregroundColor.wxColor()) | widget.SetBackgroundColour(self.backgroundColor.wxColor()) widget.SetForegroundColour(self.foregroundColor.wxColor()) | def synchronizeColor(self, block): widget = block.widget if widget: if hasattr(self, "backgroundColor"): widget.SetBackgroundColour(self.backgroundColor.wxColor()) if hasattr(self, "foregroundColor"): widget.SetForegroundColour(self.foregroundColor.wxColor()) | 443449161cb48a3a7afffabc0595f1f6680b375e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/443449161cb48a3a7afffabc0595f1f6680b375e/Styles.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16978,
2957,
12,
2890,
16,
1203,
4672,
3604,
273,
1203,
18,
6587,
309,
3604,
30,
3604,
18,
694,
8199,
26404,
12,
2890,
18,
9342,
2957,
18,
27226,
2957,
10756,
3604,
18,
694,
23206,
26404... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16978,
2957,
12,
2890,
16,
1203,
4672,
3604,
273,
1203,
18,
6587,
309,
3604,
30,
3604,
18,
694,
8199,
26404,
12,
2890,
18,
9342,
2957,
18,
27226,
2957,
10756,
3604,
18,
694,
23206,
26404... |
return | return def depsToConsole(classDepsIter): oPackageId = oClassId = oLoadOrRun = '' self._console.indent() self._console.indent() for (packageId, classId, depId, loadOrRun) in classDepsIter: if packageId != oPackageId: oPackageId = packageId self._console.outdent() self._console.outdent() self._console.info("Package %s" % packageId) self._console.indent() for partId in parts: if packageId in parts[partId]: self._console.info("Part %s" % partId) self._console.indent() self._console.indent() if classId != oClassId: oClassId = classId self._console.outdent() self._console.outdent() self._console.info("Class: %s" % classId) self._console.indent() self._console.indent() if loadOrRun != oLoadOrRun: oLoadOrRun = loadOrRun self._console.outdent() if loadOrRun == 'load': self._console.info("Uses (load):") elif loadOrRun == 'run': self._console.info("Uses (run):") self._console.indent() self._console.info("%s" % depId) self._console.outdent() self._console.outdent() return def graphAddEdges(classDepsIter, gr, pLoadOrRun): loadAttrs = [('color','red')] runAttrs = [] for (packageId, classId, depId, loadOrRun) in classDepsIter: if loadOrRun == 'load' and pLoadOrRun != "runtime": gr.add_edge(classId, depId, attrs = loadAttrs) elif loadOrRun == 'run' and pLoadOrRun != "loadtime": gr.add_edge(classId, depId, attrs = runAttrs) return def graphAddNodes(gr, clsList): for cid in clsList: fsize = self._classes[cid]['size'] if fsize > 20000: color = "red" elif fsize > 5000: color = "green" else: color = "blue" gr.add_node(cid, attrs=[("color", color)]) return def usedByDeps(logConf): for packageId, package in enumerate(packages): self._console.info("Package %s" % packageId) self._console.indent() for partId in parts: if packageId in parts[partId]: self._console.info("Part %s" % partId) for classId in sorted(package): self._console.info("Class: %s" % classId) self._console.indent() for otherClassId in package: otherClassDeps = self._depLoader.getDeps(otherClassId, variants) if classId in otherClassDeps["load"]: self._console.info("Used by: %s (load)" % otherClassId) if classId in otherClassDeps["run"]: self._console.info("Used by: %s (run)" % otherClassId) self._console.outdent() self._console.outdent() return def usingDeps(logConf, dset): if logConf.get('format', None) == 'dot': gr = graph.digraph() graphAddNodes(gr, self._classList) graphAddEdges(lookupUsingDeps(packages), gr, dset) depsToDotFile(logConf, gr) else: depsToConsole(lookupUsingDeps(packages)) return | def usingDeps(logConf, dset): #if dset == "loadtime": # gr = grLoad # file = logConf.get('file', "loaddeps.dot") #elif dset == "runtime": # gr = grRun # file = logConf.get('file', "rundeps.dot") #else: gr = graph.digraph() #gr.add_nodes(self._classList) for cid in self._classList: fsize = self._classes[cid]['size'] if fsize > 20000: color = "red" elif fsize > 5000: color = "green" else: color = "blue" gr.add_node(cid, attrs=[("color", color)]) | 0c557769fd8c5281018ba8f72d96ce1e01932491 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/0c557769fd8c5281018ba8f72d96ce1e01932491/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1450,
14430,
12,
1330,
3976,
16,
23626,
4672,
468,
430,
23626,
422,
315,
945,
957,
6877,
468,
565,
3821,
273,
3821,
2563,
468,
565,
585,
273,
613,
3976,
18,
588,
2668,
768,
2187,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1450,
14430,
12,
1330,
3976,
16,
23626,
4672,
468,
430,
23626,
422,
315,
945,
957,
6877,
468,
565,
3821,
273,
3821,
2563,
468,
565,
585,
273,
613,
3976,
18,
588,
2668,
768,
2187,
315,
... |
if Common.online_update_notification_enabled: | if online_update_notification_enabled: | def __general_page(self): """Return a widget containing the general page""" | f182e0250c4b33ff68dd68561c83c4b50050f14d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7853/f182e0250c4b33ff68dd68561c83c4b50050f14d/GuiPreferences.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12259,
67,
2433,
12,
2890,
4672,
3536,
990,
279,
3604,
4191,
326,
7470,
1363,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
12259,
67,
2433,
12,
2890,
4672,
3536,
990,
279,
3604,
4191,
326,
7470,
1363,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
result, data = yield inner.thread(mailbox.fetch, num, fetch) list(inner) | result, data = yield inner.sub(self.call("uid", "FETCH", uid, fetch)) | def fetch(inner): list(inner) fetch = "(BODY.PEEK[%s])" % path result, data = yield inner.thread(mailbox.fetch, num, fetch) list(inner) for parts in data: if not isinstance(parts, tuple) or len(parts) != 2: continue reader = StringIO(parts[1]) inner.finish(StringIO(parts[1])) | 03f9267fe39b8fc29637e9fabadc16ea290e1fb0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14361/03f9267fe39b8fc29637e9fabadc16ea290e1fb0/imapbot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
12,
7872,
4672,
666,
12,
7872,
13,
2158,
273,
7751,
16691,
18,
1423,
11325,
14451,
87,
65,
2225,
738,
589,
563,
16,
501,
273,
2824,
3443,
18,
1717,
12,
2890,
18,
1991,
2932,
1911... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
12,
7872,
4672,
666,
12,
7872,
13,
2158,
273,
7751,
16691,
18,
1423,
11325,
14451,
87,
65,
2225,
738,
589,
563,
16,
501,
273,
2824,
3443,
18,
1717,
12,
2890,
18,
1991,
2932,
1911... |
def rcpt(self,recip): | def rcpt(self,recip,options=[]): | def rcpt(self,recip): """ SMTP 'rcpt' command. Indicates 1 recipient for this mail. """ self.putcmd("rcpt","to:%s" % quoteaddr(recip)) return self.getreply() | 2fa5f60664065d7f143e96d9f7ecc34ac6c401ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2fa5f60664065d7f143e96d9f7ecc34ac6c401ed/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4519,
337,
12,
2890,
16,
266,
3449,
16,
2116,
33,
8526,
4672,
3536,
18102,
296,
1310,
337,
11,
1296,
18,
18336,
404,
8027,
364,
333,
4791,
18,
3536,
365,
18,
458,
4172,
2932,
1310,
337... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4519,
337,
12,
2890,
16,
266,
3449,
16,
2116,
33,
8526,
4672,
3536,
18102,
296,
1310,
337,
11,
1296,
18,
18336,
404,
8027,
364,
333,
4791,
18,
3536,
365,
18,
458,
4172,
2932,
1310,
337... |
self.plugin.addSuccess(test.test) | capt = test.capturedOutput self.plugin.addSuccess(test.test, capt) | def addSuccess(self, test): if not hasattr(self.plugin, 'addSuccess'): return self.plugin.addSuccess(test.test) | a387affaa133b93fc7c38f6ade4f465caeb9c3b9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11821/a387affaa133b93fc7c38f6ade4f465caeb9c3b9/manager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
4510,
12,
2890,
16,
1842,
4672,
309,
486,
3859,
12,
2890,
18,
4094,
16,
296,
1289,
4510,
11,
4672,
327,
365,
18,
4094,
18,
1289,
4510,
12,
3813,
18,
3813,
13,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
527,
4510,
12,
2890,
16,
1842,
4672,
309,
486,
3859,
12,
2890,
18,
4094,
16,
296,
1289,
4510,
11,
4672,
327,
365,
18,
4094,
18,
1289,
4510,
12,
3813,
18,
3813,
13,
2,
-100,
-100,
-10... |
self.table.setText(row, col+2, mdict[attr] and prec % mdict[attr] or "NA") | self.table.setText(row, col+2, mdict[attr] != None and prec % mdict[attr] or "NA") | def reprint(self, noSort = False): if not self.data: return prec = " %%.%df" % self.nDecimals | 010066d330ea0d69e9808aea44f10d74156c62f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/010066d330ea0d69e9808aea44f10d74156c62f8/OWRank.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
1188,
12,
2890,
16,
1158,
4416,
273,
1083,
4672,
309,
486,
365,
18,
892,
30,
327,
225,
13382,
273,
315,
26510,
7866,
2180,
6,
738,
365,
18,
82,
31809,
2,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
1188,
12,
2890,
16,
1158,
4416,
273,
1083,
4672,
309,
486,
365,
18,
892,
30,
327,
225,
13382,
273,
315,
26510,
7866,
2180,
6,
738,
365,
18,
82,
31809,
2,
-100,
-100,
-100,
-100,
... |
assert_arrays_equal(actual, desired) | self.assertRavelEqual(actual, desired) | def test_antialias_round(self): """ fix me: How to make this test work for multiple renderers? """ antialias = True width = 3 line_cap = kiva.CAP_BUTT line_join = kiva.JOIN_ROUND gc = self.helper(antialias, width, line_cap, line_join) actual = gc.bmp_array[:,:,0] desired = array([[255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 127, 0, 0, 127, 255], [255, 255, 255, 255, 255, 127, 0, 0, 127, 255], [255, 255, 255, 255, 255, 127, 0, 0, 127, 255], [255, 255, 255, 255, 255, 127, 0, 0, 127, 255], [255, 127, 127, 127, 127, 0, 0, 0, 127, 255], [255, 0, 0, 0, 0, 0, 0, 0, 127, 255], [255, 0, 0, 0, 0, 0, 0, 0, 170, 255], [255, 127, 127, 127, 127, 127, 127, 172, 254, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]) assert_arrays_equal(actual, desired) | 693c25b8cee266233747e042e57a3325b339258d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13166/693c25b8cee266233747e042e57a3325b339258d/join_stroke_path_test_case.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
970,
649,
1795,
67,
2260,
12,
2890,
4672,
3536,
2917,
1791,
30,
9017,
358,
1221,
333,
1842,
1440,
364,
3229,
27577,
35,
3536,
17841,
649,
1795,
273,
1053,
1835,
273,
890,
980,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
970,
649,
1795,
67,
2260,
12,
2890,
4672,
3536,
2917,
1791,
30,
9017,
358,
1221,
333,
1842,
1440,
364,
3229,
27577,
35,
3536,
17841,
649,
1795,
273,
1053,
1835,
273,
890,
980,
... |
"""create a new repository or copy an existing one""" | """create a new repository or (deprecated, use clone) copy an existing one""" | def init(ui, source=None, **opts): """create a new repository or copy an existing one""" if source: paths = {} for name, path in ui.configitems("paths"): paths[name] = path if source in paths: source = paths[source] link = 0 if not source.startswith("http://"): d1 = os.stat(os.getcwd()).st_dev d2 = os.stat(source).st_dev if d1 == d2: link = 1 if link: ui.debug("copying by hardlink\n") os.system("cp -al %s/.hg .hg" % source) try: os.remove(".hg/dirstate") except: pass repo = hg.repository(ui, ".") else: repo = hg.repository(ui, ".", create=1) other = hg.repository(ui, source) cg = repo.getchangegroup(other) repo.addchangegroup(cg) f = repo.opener("hgrc", "w") f.write("[paths]\n") f.write("default = %s\n" % source) if opts['update']: update(ui, repo) else: repo = hg.repository(ui, ".", create=1) | 66017adc3729a7ac17f7407484deddbb12301315 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/66017adc3729a7ac17f7407484deddbb12301315/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
4881,
16,
1084,
33,
7036,
16,
2826,
4952,
4672,
3536,
2640,
279,
394,
3352,
578,
261,
14089,
16,
999,
3236,
13,
1610,
392,
2062,
1245,
8395,
225,
309,
1084,
30,
2953,
273,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
4881,
16,
1084,
33,
7036,
16,
2826,
4952,
4672,
3536,
2640,
279,
394,
3352,
578,
261,
14089,
16,
999,
3236,
13,
1610,
392,
2062,
1245,
8395,
225,
309,
1084,
30,
2953,
273,
26... |
v={} | v = {} | def onchange_shop_id(self, cr, uid, ids, shop_id): v={} if shop_id: shop=self.pool.get('sale.shop').browse(cr,uid,shop_id) v['project_id']=shop.project_id.id # Que faire si le client a une pricelist a lui ? if shop.pricelist_id.id: v['pricelist_id']=shop.pricelist_id.id #v['payment_default_id']=shop.payment_default_id.id return {'value':v} | fa29dc7d9e6d87f49bc3316e2b56fa977448ad6c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/fa29dc7d9e6d87f49bc3316e2b56fa977448ad6c/sale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
5020,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
12122,
67,
350,
4672,
331,
273,
2618,
309,
12122,
67,
350,
30,
12122,
33,
2890,
18,
6011,
18,
588,
2668,
87,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
5020,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
12122,
67,
350,
4672,
331,
273,
2618,
309,
12122,
67,
350,
30,
12122,
33,
2890,
18,
6011,
18,
588,
2668,
87,... |
AAAA8AAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1v ZGUuDQ0KJAAAAAAAAABwj7aMNO7Y3zTu2N807tjfT/LU3zXu2N+38tbfNu7Y39zx3N827tjfVvHL 3zzu2N807tnfae7Y3zTu2N857tjf3PHS3znu2N+M6N7fNe7Y31JpY2g07tjfAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAUEUAAEwBAwAu6+E5AAAAAAAAAADgAA8BCwEGAABAAAAAEAAAAJAAAPDUAAAA oAAAAOAAAAAAQAAAEAAAAAIAAAQAAAAAAAAABAAAAAAAAAAA8AAAAAQAAAAAAAACAAAAAAAQAAAQ AAAAABAAABAAAAAAAAAQAAAAAAAAAAAAAAAw4QAAcAEAAADgAAAwAQAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVUFgwAAAAAACQAAAAEAAAAAAAAAAEAAAA AAAAAAAAAAAAAACAAADgVVBYMQAAAAAAQAAAAKAAAAA4AAAABAAAAAAAAAAAAAAAAAAAQAAA4C5y c3JjAAAAABAAAADgAAAABAAAADwAAAAAAAAAAAAAAAAAAEAAAMAAAAAAAAAAAAAAAAAAAAAAAAAA | AAAA4AAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1v ZGUuDQ0KJAAAAAAAAABwr7eMNM7Z3zTO2d80ztnfT9LV3zXO2d+30tffNs7Z39zR3d82ztnfVtHK 3zzO2d80ztjfVM7Z3zTO2d85ztnf3NHT3znO2d+MyN/fNc7Z31JpY2g0ztnfAAAAAAAAAABQRQAA TAEDAG/hkDoAAAAAAAAAAOAADwELAQYAAEAAAAAQAAAAkAAAwNUAAACgAAAA4AAAAABAAAAQAAAA AgAABAAAAAAAAAAEAAAAAAAAAADwAAAABAAAAAAAAAIAAAAAABAAABAAAAAAEAAAEAAAAAAAABAA AAAAAAAAAAAAADDhAABsAQAAAOAAADABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAFVQWDAAAAAAAJAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAIAAAOBV UFgxAAAAAABAAAAAoAAAADgAAAAEAAAAAAAAAAAAAAAAAABAAADgLnJzcmMAAAAAEAAAAOAAAAAE AAAAPAAAAAAAAAAAAAAAAAAAQAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA | def get_exe_bytes (self): import base64 return base64.decodestring(EXEDATA) | 7ce11c16fe851b7b7acd509e2153406fbeae56f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7ce11c16fe851b7b7acd509e2153406fbeae56f9/bdist_wininst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
14880,
67,
3890,
261,
2890,
4672,
1930,
1026,
1105,
327,
1026,
1105,
18,
4924,
1145,
371,
12,
2294,
2056,
3706,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
14880,
67,
3890,
261,
2890,
4672,
1930,
1026,
1105,
327,
1026,
1105,
18,
4924,
1145,
371,
12,
2294,
2056,
3706,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
destFile = '%s/%s' % (url,'dirac_directory') | destFile = '%s/%s' % (path,'dirac_directory') | def __makeDir(self,path): # First create a local file that will be used as a directory place holder in storage name space dfile = open("dirac_directory",'w') dfile.write("This is a DIRAC system directory") dfile.close() srcFile = '%s/%s' % (os.getcwd(),'dirac_directory') size = getSize(srcFile) if size == -1: infoStr = "SRM2Storage.createDirectory: Failed to get file size." gLogger.error(infoStr,srcFile) return S_ERROR(infoStr) | 0c142939ddc410eebdc2cef5627d4332317e31b1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12864/0c142939ddc410eebdc2cef5627d4332317e31b1/SRM2Storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
6540,
1621,
12,
2890,
16,
803,
4672,
468,
5783,
752,
279,
1191,
585,
716,
903,
506,
1399,
487,
279,
1867,
3166,
10438,
316,
2502,
508,
3476,
302,
768,
273,
1696,
2932,
3211,
8836,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6540,
1621,
12,
2890,
16,
803,
4672,
468,
5783,
752,
279,
1191,
585,
716,
903,
506,
1399,
487,
279,
1867,
3166,
10438,
316,
2502,
508,
3476,
302,
768,
273,
1696,
2932,
3211,
8836,
... |
if (uid is None or ((not self._show_private) and uid.is_private()) or (not uid.is_variable() and not self._docmap.has_key(uid)) or (uid.is_variable() and not self._docmap.has_key(uid.parent()))): | if not self._documented(uid): | def _uid_to_href(self, uid, label=None, css_class=None, code=1): """ @return: The HTML code to link to the given UID. This code consists of an anchor with an href to the page for C{uid}. If C{label} is not C{None}, then it is used as the text for the link; otherwise, C{uid} is used as the text. If C{uid} is not documented, then the HTML code will just contain the name, and no href. @rtype: C{string} @type uid: L{uid.UID} @type label: C{string} @param code: Whether or not to include C{<code>...</code>} tags around the label. """ # We shouldn't need this, but include it just in case. if uid is None and label is None: return '<code>??</code>' # Find a default value for the label. if label is None: label = uid.name() | f7b2c53b55b95c2d978b7e3afe6f6de360ab7b8d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/f7b2c53b55b95c2d978b7e3afe6f6de360ab7b8d/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1911,
67,
869,
67,
7547,
12,
2890,
16,
4555,
16,
1433,
33,
7036,
16,
3747,
67,
1106,
33,
7036,
16,
981,
33,
21,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
358,
1692,
358,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1911,
67,
869,
67,
7547,
12,
2890,
16,
4555,
16,
1433,
33,
7036,
16,
3747,
67,
1106,
33,
7036,
16,
981,
33,
21,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
358,
1692,
358,
326,
... |
regex_white_template = re.compile(r'\{\{(?:template:|)%s' % l, re.IGNORECASE) | regex_white_template = re.compile(r'\{\{(?:template:|)(?:%s|creator)' % l, re.IGNORECASE) | def checkbot(): """ Main function """ # Command line configurable parameters repeat = True # Restart after having check all the images? limit = 80 # How many images check? time_sleep = 30 # How many time sleep after the check? skip_number = 0 # How many images to skip before checking? wait_number = 0 # How many time sleep before the check? commonsActive = False # Check if on commons there's an image with the same name? normal = False # Check the new images or use another generator? urlUsed = False # Use the url-related function instead of the new-pages generator regexGen = False # Use the regex generator untagged = False # Use the untagged generator skip_list = list() # Inizialize the skip list used below duplicatesActive = False # Use the duplicate option duplicatesReport = False # Use the duplicate-report option sendemailActive = False # Use the send-email smartdetection = False # Enable the smart detection # Here below there are the parameters. for arg in wikipedia.handleArgs(): if arg.startswith('-limit'): if len(arg) == 7: limit = int(wikipedia.input(u'How many images do you want to check?')) else: limit = int(arg[7:]) if arg.startswith('-time'): if len(arg) == 5: time_sleep = int(wikipedia.input(u'How many seconds do you want runs to be apart?')) else: time_sleep = int(arg[6:]) elif arg == '-break': repeat = False elif arg == '-commons': commonsActive = True elif arg.startswith('-duplicates'): duplicatesActive = True if len(arg) == 11: duplicates_rollback = 1 elif len(arg) > 11: duplicates_rollback = int(arg[12:]) elif arg == '-duplicatereport': duplicatesReport = True elif arg == '-sendemail': sendemailActive = True elif arg == '-smartdetection': smartdetection = True elif arg.startswith('-skip'): if len(arg) == 5: skip = True skip_number = int(wikipedia.input(u'How many images do you want to skip?')) elif len(arg) > 5: skip = True skip_number = int(arg[6:]) elif arg.startswith('-wait'): if len(arg) == 5: wait = True wait_number = int(wikipedia.input(u'How many time do you want to wait before checking the images?')) elif len(arg) > 5: wait = True wait_number = int(arg[6:]) elif arg.startswith('-start'): if len(arg) == 6: firstPageTitle = str(wikipedia.input(u'From witch page do you want to start?')) elif len(arg) > 6: firstPageTitle = str(arg[7:]) generator = wikipedia.getSite().allpages(start=firstPageTitle ,namespace=6) repeat = False elif arg.startswith('-page'): if len(arg) == 5: regexPageName = str(wikipedia.input(u'Which page do you want to use for the regex?')) elif len(arg) > 5: regexPageName = str(arg[6:]) repeat = False regexGen = True elif arg.startswith('-url'): if len(arg) == 4: regexPageUrl = str(wikipedia.input(u'Which url do you want to use for the regex?')) elif len(arg) > 4: regexPageUrl = str(arg[5:]) urlUsed = True repeat = False regexGen = True elif arg.startswith('-regex'): if len(arg) == 6: regexpToUse = str(wikipedia.input(u'Which regex do you want to use?')) elif len(arg) > 6: regexpToUse = str(arg[7:]) generator = 'regex' repeat = False elif arg.startswith('-cat'): if len(arg) == 4: catName = str(wikipedia.input(u'In which category do I work?')) elif len(arg) > 4: catName = str(arg[5:]) catSelected = catlib.Category(wikipedia.getSite(), 'Category:%s' % catName) generator = pagegenerators.CategorizedPageGenerator(catSelected) repeat = False elif arg.startswith('-ref'): if len(arg) == 4: refName = str(wikipedia.input(u'The references of what page should I parse?')) elif len(arg) > 4: refName = str(arg[5:]) generator = pagegenerators.ReferringPageGenerator(wikipedia.Page(wikipedia.getSite(), refName)) repeat = False elif arg.startswith('-untagged'): untagged = True if len(arg) == 9: projectUntagged = str(wikipedia.input(u'In which project should I work?')) elif len(arg) > 9: projectUntagged = str(arg[10:]) # Understand if the generator it's the default or not. try: generator except NameError: normal = True # Define the site. site = wikipedia.getSite() # Block of text to translate the parameters set above. image_n = site.image_namespace() image_namespace = "%s:" % image_n # Example: "User_talk:" unvertext = wikipedia.translate(site, n_txt) di = wikipedia.translate(site, delete_immediately) dih = wikipedia.translate(site, delete_immediately_head) din = wikipedia.translate(site, delete_immediately_notification) nh = wikipedia.translate(site, nothing_head) nn = wikipedia.translate(site, nothing_notification) dels = wikipedia.translate(site, del_comm) smwl = wikipedia.translate(site, second_message_without_license) TextFind = wikipedia.translate(site, txt_find) # If the images to skip are 0, set the skip variable to False (the same for the wait time) if skip_number == 0: skip = False if wait_number == 0: wait = False # nothing = Defining an empty image description nothing = ['', ' ', ' ', ' ', '\n', '\n ', '\n ', '\n\n', '\n \n', ' \n', ' \n ', ' \n \n'] # something = Minimal requirements for an image description. # If this fits, no tagging will take place (if there aren't other issues) # MIT license is ok on italian wikipedia, let also this here something = ['{{'] # Don't put "}}" here, please. Useless and can give problems. # Unused file extensions. Does not contain PDF. notallowed = ("xcf", "xls", "sxw", "sxi", "sxc", "sxd") # A little block-statement to ensure that the bot will not start with en-parameters if site.lang not in project_inserted: wikipedia.output(u"Your project is not supported by this script. You have to edit the script and add it!") return # Some formatting for delete immediately template di = '\n%s' % di dels = dels % di # Reading the log of the new images if another generator is not given. if normal == True: if limit == 1: wikipedia.output(u"Retrieving the latest file for checking...") else: wikipedia.output(u"Retrieving the latest %d files for checking..." % limit) # Main Loop while 1: # Defing the Main Class. mainClass = main(site, sendemailActive = sendemailActive, duplicatesReport = duplicatesReport, smartdetection = smartdetection) # Untagged is True? Let's take that generator if untagged == True: generator = mainClass.untaggedGenerator(projectUntagged, limit) normal = False # Ensure that normal is False # Normal True? Take the default generator if normal == True: generator = pagegenerators.NewimagesPageGenerator(number = limit, site = site) # if urlUsed and regexGen, get the source for the generator if urlUsed == True and regexGen == True: textRegex = site.getUrl(regexPageUrl, no_hostname = True) # Not an url but a wiki page as "source" for the regex elif regexGen == True: pageRegex = wikipedia.Page(site, regexPageName) try: textRegex = pageRegex.get() except wikipedia.NoPage: wikipedia.output(u"%s doesn't exist!" % page.title()) textRegex = '' # No source, so the bot will quit later. # If generator is the regex' one, use your own Generator using an url or page and a regex. if generator == 'regex' and regexGen == True: generator = mainClass.regexGenerator(regexpToUse, textRegex) # Ok, We (should) have a generator, so let's go on. try: # Take the additional settings for the Project tupla_written = mainClass.takesettings() except wikipedia.Error: # Error? Settings = None wikipedia.output(u'Problems with loading the settigs, run without them.') tupla_written = None some_problem = False # Ensure that if the list given is empty it will be converted to "None" # (but it should be already done in the takesettings() function) if tupla_written == []: tupla_written = None # Real-Time page loaded if tupla_written != None: wikipedia.output(u'\t >> Loaded the real-time page... <<') # No settings found, No problem, continue. else: wikipedia.output(u'\t >> No additional settings found! <<') # Load the white templates(hidden template is the same as white template, regarding the meaning) hiddentemplate = mainClass.loadHiddenTemplates() # Load the notification for only white templates images HiddenTN = wikipedia.translate(site, HiddenTemplateNotification) # Not the main, but the most important loop. #parsed = False for image in generator: # When you've a lot of image to skip before working use this workaround, otherwise # let this commented, thanks. [ decoment also parsed = False if you want to use it # #if image.title() != u'Immagine:Nytlogo379x64.gif' and not parsed: # wikipedia.output(u"%s already parsed." % image.title()) # continue #else: # parsed = True # If I don't inizialize the generator, wait part and skip part are useless if wait: printWithTimeZone(u'Waiting %s seconds before checking the images,' % wait_number) # Let's sleep... time.sleep(wait_number) # Never sleep again (we are in a loop) wait = False # If the generator returns something that is not an image, simply skip it. if normal == False and regexGen == False: if image_namespace.lower() not in image.title().lower() and \ 'image:' not in image.title().lower(): wikipedia.output(u'%s seems not an image, skip it...' % image.title()) continue try: imageName = image.title().split(image_namespace)[1] # Deleting the namespace (useless here) except IndexError:# Namespace image not found, that's not an image! Let's skip... wikipedia.output(u"%s is not an image, skipping..." % image.title()) continue mainClass.setParameters(imageName) # Setting the image for the main class # Skip block if skip == True: # If the images to skip are more the images to check, make them the same number if skip_number > limit: skip_number = limit # Print a starting message only if no images has been skipped if skip_list == []: if skip_number == 1: wikipedia.output(u'Skipping the first image:\n') else: wikipedia.output(u'Skipping the first %s images:\n' % skip_number) # If we still have pages to skip: if len(skip_list) < skip_number: wikipedia.output(u'Skipping %s...' % imageName) skip_list.append(imageName) if skip_number == 1: wikipedia.output('') skip = False continue else: wikipedia.output('') # Print a blank line. skip = False elif skip_list == []: # Skip must be false if we are here but # the user has set 0 as images to skip wikipedia.output(u'\t\t>> No images to skip...<<') skip_list.append('skip = Off') # Only to print it once parentesi = False # parentesi are these in italian: { ( ) } [] delete = False tagged = False extension = imageName.split('.')[-1] # get the extension from the image's name # Page => ImagePage p = wikipedia.ImagePage(site, image.title()) # Get the text in the image (called g) try: g = p.get() except wikipedia.NoPage: wikipedia.output(u"Skipping %s because it has been deleted." % imageName) continue except wikipedia.IsRedirectPage: wikipedia.output(u"The file description for %s is a redirect?!" % imageName) continue # Check on commons if there's already an image with the same name if commonsActive == True: response = mainClass.checkImageOnCommons() if response == False: continue # Check if there are duplicates of the image on the project selected if duplicatesActive == True: response2 = mainClass.checkImageDuplicated(duplicates_rollback) if response2 == False: continue # Is the image already tagged? If yes, no need to double-check, skip for i in TextFind: # If there are {{ use regex, otherwise no (if there's not the {{ may not be a template # and the regex will be wrong) if '{{' in i: regexP = re.compile('\{\{(?:template|)%s ?(?:\||\n|\}) ?' % i.split('{{')[1].replace(' ', '[ _]'), re.I) result = regexP.findall(g) if result != []: tagged = True elif i.lower() in g: tagged = True # Deleting the useless template from the description (before adding something # in the image the original text will be reloaded, don't worry). hiddenTemplateFound = False white_template_found = 0 for l in hiddentemplate: if tagged == False: res = re.findall(r'\{\{(?:[Tt]emplate:|)%s[ \n]*?(?:\n|\||\})' % l.lower(), g.lower()) if res != []: white_template_found += 1 if l != '' and l != ' ': # Check that l is not nothing or a space # Deleting! (replace the template with nothing) regex_white_template = re.compile(r'\{\{(?:template:|)%s' % l, re.IGNORECASE) g = regex_white_template.sub(r'', g) hiddenTemplateFound = True if white_template_found == 1: wikipedia.output(u'A white template found, skipping the template...') elif white_template_found == 0: pass # if nothing found, print nothing else: wikipedia.output(u'White templates found: %s; skipping those templates...' % white_template_found) for a_word in something: # something is the array with {{, MIT License and so on. if a_word in g: # There's a template, probably a license (or I hope so) parentesi = True # Is the extension allowed? (is it an image or f.e. a .xls file?) for parl in notallowed: if parl.lower() in extension.lower(): delete = True some_problem = False # If it has "some_problem" it must check # the additional settings. # if tupla_writte, use addictional settings if tupla_written != None: # In every tupla there's a setting configuration for tupla in tupla_written: name = tupla[1] find_tipe = tupla[2] find = tupla[3] find_list = mainClass.load(find) imagechanges = tupla[4] if imagechanges.lower() == 'false': imagestatus = False elif imagechanges.lower() == 'true': imagestatus = True else: wikipedia.output(u"Error! Imagechanges set wrongly!") tupla_written = None break summary = tupla[5] head_2 = tupla[6] text = tupla[7] text = text % imageName mexCatched = tupla[8] wikipedia.setAction(summary) for k in find_list: if find_tipe.lower() == 'findonly': if k.lower() == g.lower(): some_problem = True text_used = text head_used = head_2 imagestatus_used = imagestatus name_used = name summary_used = summary mex_used = mexCatched break elif find_tipe.lower() == 'find': if k.lower() in g.lower(): some_problem = True text_used = text head_used = head_2 imagestatus_used = imagestatus name_used = name summary_used = summary mex_used = mexCatched continue # If the image exists (maybe it has been deleting during the oder # checking parts or something, who knows? ;-)) if p.exists(): # Here begins the check block. if tagged == True: # Tagged? Yes, skip. printWithTimeZone(u'%s is already tagged...' % imageName) continue if some_problem == True: if mex_used in g: wikipedia.output(u'Image already fixed. Skip.') continue wikipedia.output(u"The image description for %s contains %s..." % (imageName, name_used)) if mex_used.lower() == 'default': mex_used = unvertext if imagestatus_used == False: reported = mainClass.report_image(imageName) else: reported = True if reported == True: #if imagestatus_used == True: mainClass.report(mex_used, imageName, text_used, "\n%s\n" % head_used, None, imagestatus_used, summary_used) else: wikipedia.output(u"Skipping the image...") some_problem = False continue elif parentesi == True: seems_ok = False license_found = None if smartdetection: license_found = mainClass.smartDetection(g) else: printWithTimeZone(u"%s seems ok..." % imageName) # It works also without this... but i want only to be sure ^^ parentesi = False continue elif delete == True: wikipedia.output(u"%s is not a file!" % imageName) # Modify summary text wikipedia.setAction(dels) canctext = di % extension notification = din % imageName head = dih mainClass.report(canctext, imageName, notification, head) delete = False continue elif g in nothing: wikipedia.output(u"The image description for %s does not contain a license template!" % imageName) if hiddenTemplateFound and HiddenTN != None and HiddenTN != '' and HiddenTN != ' ': notification = HiddenTN % imageName else: notification = nn % imageName head = nh mainClass.report(unvertext, imageName, notification, head, smwl) continue else: wikipedia.output(u"%s has only text and not the specific license..." % imageName) if hiddenTemplateFound and HiddenTN != None and HiddenTN != '' and HiddenTN != ' ': notification = HiddenTN % imageName else: notification = nn % imageName head = nh mainClass.report(unvertext, imageName, notification, head, smwl) continue # A little block to perform the repeat or to break. if repeat == True: printWithTimeZone(u"Waiting for %s seconds," % time_sleep) time.sleep(time_sleep) elif repeat == False: wikipedia.output(u"\t\t\t>> STOP! <<") return True # Exit | b0c4875002727aeb1e9a1d785abed36ae1ba5658 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/b0c4875002727aeb1e9a1d785abed36ae1ba5658/checkimages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
4819,
13332,
3536,
12740,
445,
3536,
468,
3498,
980,
14593,
1472,
7666,
273,
1053,
468,
20709,
1839,
7999,
866,
777,
326,
4602,
35,
1800,
273,
8958,
468,
9017,
4906,
4602,
866,
35,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4819,
13332,
3536,
12740,
445,
3536,
468,
3498,
980,
14593,
1472,
7666,
273,
1053,
468,
20709,
1839,
7999,
866,
777,
326,
4602,
35,
1800,
273,
8958,
468,
9017,
4906,
4602,
866,
35,
... |
assert(self.debugPrint("enableAvatarControls()")) | assert self.notify.debugStateCall(self) | def enableAvatarControls(self): """ Activate the arrow keys, etc. """ assert(self.debugPrint("enableAvatarControls()")) assert self.collisionsActive | 279b0b95d73beb43864e40b8f39c02e406b03967 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/279b0b95d73beb43864e40b8f39c02e406b03967/GravityWalker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4237,
23999,
16795,
12,
2890,
4672,
3536,
30936,
326,
12274,
1311,
16,
5527,
18,
3536,
1815,
365,
18,
12336,
18,
4148,
1119,
1477,
12,
2890,
13,
1815,
365,
18,
12910,
12682,
3896,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4237,
23999,
16795,
12,
2890,
4672,
3536,
30936,
326,
12274,
1311,
16,
5527,
18,
3536,
1815,
365,
18,
12336,
18,
4148,
1119,
1477,
12,
2890,
13,
1815,
365,
18,
12910,
12682,
3896,
2,
-10... |
'result': { 'type': 'form', 'arch': report_list_form1, 'fields': report_list_fields1, 'state': [('end', 'Cancel'), ('init2', 'Select Segment'),], } }, 'init2': { 'actions': [_set_segment], 'result': { 'type': 'form', 'arch': report_list_form2, 'fields': report_list_fields2, 'state': [('end', 'Cancel'), ('print_report', 'Print Report'), ('send_report', 'Send Report'),], } }, | 'result': {'type': 'form', 'arch': report_list_form, 'fields': report_list_fields, 'state': [('end', 'Cancel'),('print_report', 'Print Report'), ('send_report', 'Send Report'),]} }, | def _set_segment(self, cr, uid, data, context): address = data['form']['address_id'] | b69e0ff6222fffdf5d7938c8aefd8c12c4ce59bc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/b69e0ff6222fffdf5d7938c8aefd8c12c4ce59bc/dm_document_report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
9273,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
1758,
273,
501,
3292,
687,
21712,
2867,
67,
350,
3546,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
9273,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
1758,
273,
501,
3292,
687,
21712,
2867,
67,
350,
3546,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if is_skipped_module(name): continue | def add_missing_type(name, func): try: list = missing_types[name] list.append(func) except: missing_types[name] = [func] | b1b3a3e924d919d20cc25b29ad48fc38dae066ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12659/b1b3a3e924d919d20cc25b29ad48fc38dae066ee/gentest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
7337,
67,
723,
12,
529,
16,
1326,
4672,
775,
30,
666,
273,
3315,
67,
2352,
63,
529,
65,
666,
18,
6923,
12,
644,
13,
1335,
30,
3315,
67,
2352,
63,
529,
65,
273,
306,
644,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
527,
67,
7337,
67,
723,
12,
529,
16,
1326,
4672,
775,
30,
666,
273,
3315,
67,
2352,
63,
529,
65,
666,
18,
6923,
12,
644,
13,
1335,
30,
3315,
67,
2352,
63,
529,
65,
273,
306,
644,
... | |
cell_x_len = SNPID2PCAPosInfo.step | cell_x_len = getattr(SNPID2PCAPosInfo, 'step', None) | def drawSNPMtrix(self, axe_snp_matrix, subSNPData, top_snp_data, StrainID2PCAPosInfo, SNPID2PCAPosInfo, \ ecotype_info, strain_id_label_x_offset=0.9, snp_id_label_y_offset=0.9, strain_snp_label_font_size=1, draw_snp_id_label=True): """ 2008-10-07 1. allele=1 no color (white), 2(red) 2. snpData.snp_id2index_type. index_type=1(polarized), shape=rectangle. index_type=2(MAF), circle. index_type=3(weirdo), triangle 3. alpha of each cell determined by the score in top_snp_data.score_ls 4. label strain, snp plainlys """ sys.stderr.write("Drawing SNP matrix ...") no_of_snps = len(top_snp_data.snp_id_ls) max_score = max(top_snp_data.score_ls) min_score = min(top_snp_data.score_ls) cell_x_len = SNPID2PCAPosInfo.step cell_y_len = StrainID2PCAPosInfo.step radius = min(cell_x_len, cell_y_len)/2. #half of the smaller one for i in range(no_of_snps): snp_id = top_snp_data.snp_id_ls[i] #draw snp label snp_img_x_pos = SNPID2PCAPosInfo.snp_id2img_x_pos[snp_id] if draw_snp_id_label: axe_snp_matrix.text(snp_img_x_pos, snp_id_label_y_offset, snp_id, rotation='vertical', \ horizontalalignment ='left', verticalalignment='bottom', size=strain_snp_label_font_size) col_index = subSNPData.col_id2col_index[snp_id] index_type = subSNPData.snp_id2index_type[snp_id] score = top_snp_data.score_ls[i] alpha = (score-min_score)/(max_score-min_score)*(1-0.2)+0.2 #alpha from 0.2 to 1. can't be low. for strain_id in StrainID2PCAPosInfo.strain_id_ls: strain_img_y_pos = StrainID2PCAPosInfo.strain_id2img_y_pos[strain_id] row_index = subSNPData.row_id2row_index[strain_id] allele = subSNPData.data_matrix[row_index][col_index] if allele==1: facecolor = 'w' elif allele==2: facecolor = 'r' else: facecolor = 'b' if i ==0: #draw strain label, first SNP ecotype_id = int(strain_id) ecotype_obj = ecotype_info.ecotype_id2ecotype_obj.get(ecotype_id) if ecotype_obj: nativename = ecotype_obj.nativename country = ecotype_obj.country else: nativename = '' country = 'UNK' #nativename = ecotype_info.ecotype_id2ecotype_obj[ecotype_id].nativename strain_label = '%s_%s_%s'%(strain_id, nativename, country) #add country into strain label axe_snp_matrix.text(strain_id_label_x_offset, strain_img_y_pos, strain_label, \ horizontalalignment ='left', verticalalignment='bottom', size=strain_snp_label_font_size) center = (snp_img_x_pos+cell_x_len/2., strain_img_y_pos+cell_y_len/2.) if index_type==1: xs = [snp_img_x_pos, snp_img_x_pos+cell_x_len, snp_img_x_pos+cell_x_len, snp_img_x_pos] ys = [strain_img_y_pos, strain_img_y_pos, strain_img_y_pos+cell_y_len, strain_img_y_pos+cell_y_len] patch = Polygon(zip(xs,ys), facecolor=facecolor, linewidth=0, alpha=alpha) # elif index_type==2: patch = Ellipse(center, cell_x_len, cell_y_len, facecolor=facecolor, linewidth=0, alpha=alpha) else: xs = [snp_img_x_pos, snp_img_x_pos+cell_x_len, snp_img_x_pos+cell_x_len/2.] ys = [strain_img_y_pos, strain_img_y_pos, strain_img_y_pos+cell_y_len] patch = Polygon(zip(xs,ys), facecolor=facecolor, linewidth=0, alpha=alpha) axe_snp_matrix.add_patch(patch) sys.stderr.write("Done.\n") | 3a57f0d6776dda5e4e7730ee45f6fae043cbb4f1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9645/3a57f0d6776dda5e4e7730ee45f6fae043cbb4f1/PlotGroupOfSNPs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
13653,
12728,
313,
697,
12,
2890,
16,
1740,
73,
67,
87,
6782,
67,
5667,
16,
720,
13653,
52,
751,
16,
1760,
67,
87,
6782,
67,
892,
16,
3978,
530,
734,
22,
3513,
37,
1616,
966,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
13653,
12728,
313,
697,
12,
2890,
16,
1740,
73,
67,
87,
6782,
67,
5667,
16,
720,
13653,
52,
751,
16,
1760,
67,
87,
6782,
67,
892,
16,
3978,
530,
734,
22,
3513,
37,
1616,
966,
... |
type_name = xmlnode.attrib['name'] (get_type, c_symbol_prefix) = self._split_type_and_symbol_prefix(xmlnode) try: enum_name = self._transformer.strip_identifier(type_name) except TransformerException, e: message.fatal(e) | def _introspect_enum(self, xmlnode): members = [] for member in xmlnode.findall('member'): # Keep the name closer to what we'd take from C by default; # see http://bugzilla.gnome.org/show_bug.cgi?id=575613 name = member.attrib['nick'].replace('-', '_') members.append(ast.Member(name, member.attrib['value'], member.attrib['name'], member.attrib['nick'])) | 8916db0a3831cb5e6c3b714125f7596f43d6aa6a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2770/8916db0a3831cb5e6c3b714125f7596f43d6aa6a/gdumpparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
474,
26170,
67,
7924,
12,
2890,
16,
2025,
2159,
4672,
4833,
273,
5378,
364,
3140,
316,
2025,
2159,
18,
4720,
454,
2668,
5990,
11,
4672,
468,
10498,
326,
508,
13306,
358,
4121,
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,
389,
474,
26170,
67,
7924,
12,
2890,
16,
2025,
2159,
4672,
4833,
273,
5378,
364,
3140,
316,
2025,
2159,
18,
4720,
454,
2668,
5990,
11,
4672,
468,
10498,
326,
508,
13306,
358,
4121,
732,
... | |
result = createVOMSProxy(proxy_string,voms_attr) | result = createVOMSProxy(proxy_string,voms_attr) | def renewProxy(proxy,lifetime=72, server="myproxy.cern.ch", server_key="/opt/dirac/etc/grid-security/serverkey.pem", server_cert="/opt/dirac/etc/grid-security/servercert.pem", vo='lhcb'): """ This function returns the VOMS proxy as a string. lifetime is a preferable lifetime of returned proxy. server is the address of MyProxy service server. """ #print proxy,lifetime,server,server_key,server_cert,vo rm_proxy = 0 try: if not os.path.exists(proxy): result = setupProxy(proxy) if result["OK"]: new_proxy,old_proxy = result["Value"] rm_proxy = 1 else: return S_ERROR('Failed to setup given proxy. Proxy is: %s' % (proxy)) else: new_proxy = proxy except ValueError: return S_ERROR('Failed to setup given proxy. Proxy is: %s' % (proxy)) # Get voms extensions if any and convert it to option format result = getVOMSAttributes(new_proxy,"option") if result["OK"]: voms_attr = result["Value"] else: voms_attr = "" # Get proxy from MyProxy service try: f_descriptor,my_proxy = tempfile.mkstemp() os.close(f_descriptor)#### except IOError: if os.path.exists(new_proxy) and rm_proxy == 1: os.remove(new_proxy) restoreProxy(new_proxy,old_proxy) return S_ERROR('Failed to create temporary file for store proxy from MyProxy service') #os.chmod(my_proxy, stat.S_IRUSR | stat.S_IWUSR) # myproxy-get-delegation works only with environment variables old_server_key = '' if os.environ.has_key("X509_USER_KEY"): old_server_key = os.environ["X509_USER_KEY"] old_server_cert = '' if os.environ.has_key("X509_USER_CERT"): old_server_cert = os.environ["X509_USER_CERT"] os.environ["X509_USER_KEY"] = server_key os.environ["X509_USER_CERT"] = server_cert # Here "lifetime + 1" used just for get rid off warning status rised by voms-proxy-init cmd = "myproxy-get-delegation -s %s -a %s -d -t %s -o %s" % (server, new_proxy, lifetime + 1, my_proxy) result = shellCall(PROXY_COMMAND_TIMEOUT,cmd) if not result['OK']: return S_ERROR('Call to myproxy-get-delegation failed') status,output,error = result['Value'] # Clean-up files if status: if os.path.exists(new_proxy) and rm_proxy == 1: restoreProxy(new_proxy,old_proxy) if os.path.exists(my_proxy): os.remove(my_proxy) return S_ERROR('Failed to get delegations. Command: %s; StdOut: %s; StdErr: %s' % (cmd,result,error)) if old_server_key: os.environ["X509_USER_KEY"] = old_server_key else: del os.environ["X509_USER_KEY"] if old_server_cert: os.environ["X509_USER_CERT"] = old_server_cert else: del os.environ["X509_USER_CERT"] try: f = open(my_proxy, 'r') proxy_string = f.read() # extended proxy as a string f.close() except IOError: if os.path.exists(new_proxy) and rm_proxy == 1: restoreProxy(new_proxy,old_proxy) if os.path.exists(my_proxy): os.remove(my_proxy) return S_ERROR('Failed to read proxy received from MyProxy service') if len(voms_attr) > 0: result = createVOMSProxy(proxy_string,voms_attr) if result["OK"]: proxy_string = result["Value"] else: if os.path.exists(new_proxy) and rm_proxy == 1: restoreProxy(new_proxy,old_proxy) if os.path.exists(my_proxy): os.remove(my_proxy) return S_ERROR('Failed to create VOMS proxy') if os.path.exists(new_proxy) and rm_proxy == 1: restoreProxy(new_proxy,old_proxy) if os.path.exists(my_proxy): os.remove(my_proxy) return S_OK(proxy_string) | 2e16b51beb0514385f39b1f9bc35e7bd56d5f66c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/2e16b51beb0514385f39b1f9bc35e7bd56d5f66c/GridCredentials.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15723,
3886,
12,
5656,
16,
17155,
33,
9060,
16,
1438,
1546,
4811,
5656,
18,
14770,
18,
343,
3113,
1438,
67,
856,
1546,
19,
3838,
19,
3211,
8836,
19,
14175,
19,
5222,
17,
7462,
19,
3567... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15723,
3886,
12,
5656,
16,
17155,
33,
9060,
16,
1438,
1546,
4811,
5656,
18,
14770,
18,
343,
3113,
1438,
67,
856,
1546,
19,
3838,
19,
3211,
8836,
19,
14175,
19,
5222,
17,
7462,
19,
3567... |
print "Nothing in work queue: Thread %s dying." % self.thread_num | print "Nothing in work_queue: Thread %s dying." % self.thread_num | def run(self): """ The workhorse of our thread. """ while True: task = self.__input_queue.get() if task is None: # Nothing in the queue, so we're either done, or something bad has happened # and the main thread can't fill the Queue fast enough. print "Nothing in work queue: Thread %s dying." % self.thread_num break else: # Check to make sure the output queue isn't full. # This shouldn't be the case, as Network Speed >>>> RNAHybrid Output Speed while self.__output_queue.full(): print "Output queue is full! (Strange. Network issues?) Sleeping." time.sleep(1) # DO SOME WORK HERE print "Doing work." # Value = (mfe, p-value, pos_from_3prime, target_3prime, target_bind, mirna_bind, mirna_5prime) time.sleep(2) ## Results contains: ## (success_flag, invals, outvals) results = 'abcdef' self.__output_queue.put(results, True) # Block until a free slot is available. | 486c694f2104aa1ef623239e33ccb12a0d0194fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12607/486c694f2104aa1ef623239e33ccb12a0d0194fb/scan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
3536,
1021,
1440,
76,
23035,
434,
3134,
2650,
18,
3536,
1323,
1053,
30,
1562,
273,
365,
16186,
2630,
67,
4000,
18,
588,
1435,
309,
1562,
353,
599,
30,
468,
13389,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
3536,
1021,
1440,
76,
23035,
434,
3134,
2650,
18,
3536,
1323,
1053,
30,
1562,
273,
365,
16186,
2630,
67,
4000,
18,
588,
1435,
309,
1562,
353,
599,
30,
468,
13389,
... |
if output: output += ' and ' | if output: output += ' and ' | def headerstrong(query=1, **ids): """transform keyword=value pairs to string with value in strong text. **ids - a dictionary of pairs to create string from query - 1 -> try to find names to ids of role, user and action. 0 -> do not try to find names, use the value passed on """ output = '' value = '' table = '' for key in ids.keys(): if key in ['User', 'user']: value, table = 'email', 'user' elif key in ['Role', 'role']: value, table = 'name', 'accROLE' elif key in ['Action', 'action']: value, table = 'name', 'accACTION' else: if output: output += ' and ' output += ' %s <strong>%s</strong>' % (key, ids[key]) continue if query: res = run_sql("""SELECT %%s FROM %s WHERE id = %%s""" % table, (value, ids[key])) if res: if output: output += ' and ' output += ' %s <strong>%s</strong>' % (key, res[0][0]) else: if output: output += ' and ' output += ' %s <strong>%s</strong>' % (key, ids[key]) return output | 23f82669a784517b3dd8a1acd98ec74aa6e40517 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1931/23f82669a784517b3dd8a1acd98ec74aa6e40517/webaccessadmin_lib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1607,
313,
932,
12,
2271,
33,
21,
16,
2826,
2232,
4672,
3536,
6547,
4932,
33,
1132,
5574,
358,
533,
598,
460,
316,
11773,
977,
18,
225,
2826,
2232,
300,
279,
3880,
434,
5574,
358,
752,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1607,
313,
932,
12,
2271,
33,
21,
16,
2826,
2232,
4672,
3536,
6547,
4932,
33,
1132,
5574,
358,
533,
598,
460,
316,
11773,
977,
18,
225,
2826,
2232,
300,
279,
3880,
434,
5574,
358,
752,... |
"""Returns the reverse complement sequence. | """Returns the reverse complement sequence. new Seq object. | def reverse_complement(self): """Returns the reverse complement sequence. """ if seq.alphabet in (IUPAC.ambiguous_dna, IUPAC.unambiguous_dna): d = ambiguous_dna_complement elif seq.alphabet in (IUPAC.ambiguous_rna, IUPAC.unambiguous_rna): d = ambiguous_rna_complement elif 'U' in self.data: d = ambiguous_rna_complement else: d = ambiguous_dna_complement before = ''.join(d.keys()) after = ''.join(d.values()) ttable = maketrans(before, after) #Much faster on really long sequences than the previous loop based one. #thx to Michael Palmer, University of Waterloo s = self.data[-1::-1].translate(ttable) return Seq(s, self.alphabet) | 6e6c0cae5f1ae5dfcf2df97f8282731973c2b62e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/6e6c0cae5f1ae5dfcf2df97f8282731973c2b62e/Seq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4219,
67,
2919,
806,
12,
2890,
4672,
3536,
1356,
326,
4219,
17161,
3102,
18,
394,
14367,
733,
18,
3536,
309,
3833,
18,
287,
8907,
316,
261,
45,
3079,
2226,
18,
2536,
10623,
67,
5176,
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,
4219,
67,
2919,
806,
12,
2890,
4672,
3536,
1356,
326,
4219,
17161,
3102,
18,
394,
14367,
733,
18,
3536,
309,
3833,
18,
287,
8907,
316,
261,
45,
3079,
2226,
18,
2536,
10623,
67,
5176,
6... |
s = None | s = None | def m2i(self, pkt, m): s = None try: # It can happen we have sth shorter than 40 bytes s = self.cls(m) except: return Raw(m) return s | a0c215dfa13c2d1b967dfa8f0694d24072bc56fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7311/a0c215dfa13c2d1b967dfa8f0694d24072bc56fd/inet6.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
312,
22,
77,
12,
2890,
16,
11536,
16,
312,
4672,
272,
273,
599,
775,
30,
468,
2597,
848,
5865,
732,
1240,
24139,
19623,
2353,
8063,
1731,
272,
273,
365,
18,
6429,
12,
81,
13,
1335,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
312,
22,
77,
12,
2890,
16,
11536,
16,
312,
4672,
272,
273,
599,
775,
30,
468,
2597,
848,
5865,
732,
1240,
24139,
19623,
2353,
8063,
1731,
272,
273,
365,
18,
6429,
12,
81,
13,
1335,
3... |
description=_(u'These class names styles are not allowed in class ' | description=_(u'These class names are not allowed in class ' | def __init__(self, tags='', attributes=''): self.tags = tags self.attributes = attributes | 032935f9d98194e4072ad4d4f2815413e8b171f1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12189/032935f9d98194e4072ad4d4f2815413e8b171f1/filter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2342,
2218,
2187,
1677,
2218,
11,
4672,
365,
18,
4156,
273,
2342,
365,
18,
4350,
273,
1677,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2342,
2218,
2187,
1677,
2218,
11,
4672,
365,
18,
4156,
273,
2342,
365,
18,
4350,
273,
1677,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
('check_vat', 'unvalid_vat'), | ('check_vat', 'invalid_vat'), | def __init__(self): super(Party, self).__init__() self._sql_constraints = [ ('code_uniq', 'UNIQUE(code)', 'The code of the party must be unique!') ] self._constraints += [ ('check_vat', 'unvalid_vat'), ] self._error_messages.update({ 'unvalid_vat': 'Unvalid VAT number!', }) self._order.insert(0, ('name', 'ASC')) | 5d4601fc9f428604b96ba7bde6f8f33b8abad07b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9269/5d4601fc9f428604b96ba7bde6f8f33b8abad07b/party.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2240,
12,
17619,
16,
365,
2934,
972,
2738,
972,
1435,
365,
6315,
4669,
67,
11967,
273,
306,
7707,
710,
67,
31649,
2187,
296,
16879,
12,
710,
13,
2187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2240,
12,
17619,
16,
365,
2934,
972,
2738,
972,
1435,
365,
6315,
4669,
67,
11967,
273,
306,
7707,
710,
67,
31649,
2187,
296,
16879,
12,
710,
13,
2187,
... |
val = long(mod.certificat) % 97 == 29 | val = long(mod.certificate) % 97 == 29 | def _check_certificat(self, cr, uid, ids): if not ids: return True | 63d6e4443f732e89575e572aa847fb865fb79aa7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/63d6e4443f732e89575e572aa847fb865fb79aa7/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
71,
2303,
270,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
4672,
309,
486,
3258,
30,
327,
1053,
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,
389,
1893,
67,
71,
2303,
270,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
4672,
309,
486,
3258,
30,
327,
1053,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
authmethod = None for method in preferred_auths: if method in authlist: authmethod = method break if authmethod == AUTH_CRAM_MD5: (code, resp) = self.docmd("AUTH", AUTH_CRAM_MD5) if code == 503: return (code, resp) (code, resp) = self.docmd(encode_cram_md5(resp, user, password)) elif authmethod == AUTH_PLAIN: (code, resp) = self.docmd("AUTH", AUTH_PLAIN + " " + encode_plain(user, password)) elif authmethod == AUTH_LOGIN: (code, resp) = self.docmd("AUTH", "%s %s" % (AUTH_LOGIN, encode_base64(user.encode('ascii'), eol=''))) if code != 334: raise SMTPAuthenticationError(code, resp) (code, resp) = self.docmd(encode_base64(password.encode('ascii'), eol='')) elif authmethod is None: | authlist = [auth for auth in preferred_auths if auth in advertised_authlist] if not authlist: | def encode_plain(user, password): s = "\0%s\0%s" % (user, password) return encode_base64(s.encode('ascii'), eol='') | b35e4efd9e3f99e8a38b5a609a2d5317f5390c37 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/b35e4efd9e3f99e8a38b5a609a2d5317f5390c37/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
67,
7446,
12,
1355,
16,
2201,
4672,
272,
273,
1548,
20,
9,
87,
64,
20,
9,
87,
6,
738,
261,
1355,
16,
2201,
13,
327,
2017,
67,
1969,
1105,
12,
87,
18,
3015,
2668,
9184,
19899,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2017,
67,
7446,
12,
1355,
16,
2201,
4672,
272,
273,
1548,
20,
9,
87,
64,
20,
9,
87,
6,
738,
261,
1355,
16,
2201,
13,
327,
2017,
67,
1969,
1105,
12,
87,
18,
3015,
2668,
9184,
19899,... |
res[val.id]['invoice_state']=invoice_state | res[val.id]['invoice_state'] = invoice_state | def _product_margin(self, cr, uid, ids, field_names, arg, context=None): res = {} if context is None: context = {} for val in self.browse(cr, uid, ids,context=context): res[val.id] = {} date_from = context.get('date_from', time.strftime('%Y-01-01')) date_to = context.get('date_to', time.strftime('%Y-12-31')) invoice_state = context.get('invoice_state', 'open_paid') if 'date_from' in field_names: res[val.id]['date_from']=date_from if 'date_to' in field_names: res[val.id]['date_to']=date_to if 'invoice_state' in field_names: res[val.id]['invoice_state']=invoice_state invoice_types = () states = () if invoice_state=='paid': states=('paid',) elif invoice_state=='open_paid': states=('open','paid') elif invoice_state=='draft_open_paid': states=('draft','open','paid') | c5de222c6616c268ab9364a76ab481c145c8110b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c5de222c6616c268ab9364a76ab481c145c8110b/product_margin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5896,
67,
10107,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
1973,
16,
1501,
16,
819,
33,
7036,
4672,
400,
273,
2618,
309,
819,
353,
599,
30,
819,
273,
2618,
364,
1244,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5896,
67,
10107,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
1973,
16,
1501,
16,
819,
33,
7036,
4672,
400,
273,
2618,
309,
819,
353,
599,
30,
819,
273,
2618,
364,
1244,... |
self.noescape = False | self.noescape -= 1 | def _write_sig(self, spec, args): # don't escape "*" in signatures self.noescape = True for c in spec: if c.isdigit(): self.visit_node(self.get_textonly_node(args[int(c)])) else: self.curpar.append(c) self.noescape = False | c4314343086f37fc9d243c7cee0ef8295e97c14b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1278/c4314343086f37fc9d243c7cee0ef8295e97c14b/restwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
67,
7340,
12,
2890,
16,
857,
16,
833,
4672,
468,
2727,
1404,
4114,
10971,
316,
14862,
365,
18,
2135,
6939,
273,
1053,
364,
276,
316,
857,
30,
309,
276,
18,
291,
11052,
13332... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
67,
7340,
12,
2890,
16,
857,
16,
833,
4672,
468,
2727,
1404,
4114,
10971,
316,
14862,
365,
18,
2135,
6939,
273,
1053,
364,
276,
316,
857,
30,
309,
276,
18,
291,
11052,
13332... |
if meta_dict['inetref'] == '99999999': | if meta_dict['inetref'] == '99999999': | def processMythTvMetaData(self): '''Check each video file in the mythvideo directories download graphics files and meta data then update MythTV data base meta data with any new information. ''' # If there were directories specified move them and update the MythTV db meta data accordingly if self.config['video_dir']: if len(self.config['video_dir']) % 2 == 0: validFiles = self._moveVideoFiles(self.config['video_dir']) else: sys.stderr.write(u"\n! Error: When specifying target (file or directory) to move to a destination (directory) they must always be in pairs (target and destination directory).\nYou specified an uneven number of variables (%d) for target and destination pairs.\nVariable count (%s)\n" % (len(self.config['video_dir']), self.config['video_dir'])) sys.exit(False) | 6089d4d60f2dab84c6af9981c242684b162de38e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/6089d4d60f2dab84c6af9981c242684b162de38e/jamu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12062,
451,
56,
90,
6998,
12,
2890,
4672,
9163,
1564,
1517,
6191,
585,
316,
326,
3399,
451,
9115,
6402,
4224,
17313,
1390,
471,
2191,
501,
1508,
1089,
8005,
451,
15579,
501,
1026,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12062,
451,
56,
90,
6998,
12,
2890,
4672,
9163,
1564,
1517,
6191,
585,
316,
326,
3399,
451,
9115,
6402,
4224,
17313,
1390,
471,
2191,
501,
1508,
1089,
8005,
451,
15579,
501,
1026,
... |
r""" Return integer for bitstring $x$ of length $n$. | """ Return integer for bitstring ``x`` of length ``n``. | def from_bits(self, x, n=None): r""" Return integer for bitstring $x$ of length $n$. | 16527da1ddc0ac750f609cd58858c5b45d932696 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/16527da1ddc0ac750f609cd58858c5b45d932696/sbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
67,
6789,
12,
2890,
16,
619,
16,
290,
33,
7036,
4672,
436,
8395,
2000,
3571,
364,
2831,
1080,
271,
92,
8,
434,
769,
271,
82,
8,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
628,
67,
6789,
12,
2890,
16,
619,
16,
290,
33,
7036,
4672,
436,
8395,
2000,
3571,
364,
2831,
1080,
271,
92,
8,
434,
769,
271,
82,
8,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return findUID(name[5:], container, docmap) | return findUID(name[5:], original_container, docmap) | def findUID(name, container=None, docmap=None): """ Attempt to find the UID for the object that can be accessed with the name C{name} from the module C{module}. @param name: The name used to identify the object. @type name: C{string} @param container: The UID of the class or module containing the object. If no container is specified, then L{__builtin__} is used. @type container: L{UID} or C{None} @param docmap: A documentation map, which is used to check if C{name} is the name of a module variable, class variable, or instance variable. @type docmap: L{objdoc.DocMap} @return: The UID for the object that can be accessed with the name C{name} from the module C{module}; or C{None} if no object was found. @rtype: L{UID} or C{None} """ if name == '': return None name = re.sub(r'\(.*\)$', '', name) if container and not (container.is_module() or container.is_class()): raise ValueError('Bad container %r' % container) if container is None: try: container = make_uid(sys.modules['__builtin__']) except: pass # Is it the short name for a member of the containing class? if container and container.is_class(): if _is_variable_in(name, container, docmap): val = None # it may not be a real object return make_uid(val, container, name) elif container.value().__dict__.has_key(name): cls = container.value() obj = cls.__dict__[name] if type(obj) is _FunctionType: return make_uid(new.instancemethod(obj, None, cls), container, name) else: return make_uid(obj, container, name) else: container = container.module() if container: components = name.split('.') module = container.value() # Is it a variable in the containing module? if _is_variable_in(name, container, docmap): val = None # it may not be a real object return make_uid(val, container, name) # Is it an object in the containing module? try: obj = module for component in components: obj_parent = obj obj_name = component try: obj = obj.__dict__[component] except: raise KeyError() try: return make_uid(obj, make_uid(obj_parent), obj_name) except: pass except KeyError: pass if container: container_name = container.name() else: container_name = '' # Is it a module name? The module name may be relative to the # containing module, or any of its ancestors. modcomponents = container_name.split('.') for i in range(len(modcomponents)-1, -1, -1): try: modname = '.'.join(modcomponents[:i]+[name]) return(make_uid(import_module(modname))) except: pass # Is it an object in a module? The module part of the name may be # relative to the containing module, or any of its ancestors. modcomponents = container_name.split('.') components = name.split('.') for i in range(len(modcomponents)-1, -1, -1): for j in range(len(components)-1, 0, -1): try: modname = '.'.join(modcomponents[:i]+components[:j]) objname = '.'.join(components[j:]) mod = import_module(modname) if _is_variable_in(name, make_uid(mod), docmap): val = None # it may not be a real object return make_uid(val, container, name) obj = getattr(import_module(modname), objname) return make_uid(obj, make_uid(mod), objname) except: pass # Is it an field of a class in a module? The module part of the # name may be relative to the containing module, or any of its # ancestors. modcomponents = container_name.split('.') components = name.split('.') for i in range(len(modcomponents)-1, -1, -1): for j in range(len(components)-1, 0, -1): try: modname = '.'.join(modcomponents[:i]+components[:j]) objname = '.'.join(components[j:-1]) fieldname = components[-1] mod = import_module(modname) if _is_variable_in(name, make_uid(mod), docmap): val = None # it may not be a real object return make_uid(val, container, name) obj = getattr(import_module(modname), objname) field = getattr(obj, fieldname) return make_uid(field, make_uid(obj), fieldname) except: pass # If the name starts with 'self.', then try leaving that off. if name.startswith('self.'): return findUID(name[5:], container, docmap) ## Is it a parameter of a function/method? If so, return the UID ## of the function/method. #if '.' in name and docmap: # components = name.split('.') # parent = '.'.join(components[:-1]) # param = components[-1] # parent = findUID(parent, container, docmap) # if parent is not None and parent.is_routine(): # if _is_parameter_for(param, parent, docmap): # return parent # We couldn't find it; return None. return None | f2efada598a03b112566cb14de407579eb41246c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/f2efada598a03b112566cb14de407579eb41246c/uid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
3060,
12,
529,
16,
1478,
33,
7036,
16,
997,
1458,
33,
7036,
4672,
3536,
12864,
358,
1104,
326,
10034,
364,
326,
733,
716,
848,
506,
15539,
598,
326,
508,
385,
95,
529,
97,
628,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
3060,
12,
529,
16,
1478,
33,
7036,
16,
997,
1458,
33,
7036,
4672,
3536,
12864,
358,
1104,
326,
10034,
364,
326,
733,
716,
848,
506,
15539,
598,
326,
508,
385,
95,
529,
97,
628,
... |
self.blockvisit(node.else_, loop_frame, force_generator=False) | self.blockvisit(node.else_, loop_frame) | self.writeline('def loop(reciter, loop_render_func):', node) | f40c8844ebf05d1447a11976b571d9e37db1f04d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14446/f40c8844ebf05d1447a11976b571d9e37db1f04d/compiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
365,
18,
5363,
3027,
2668,
536,
2798,
12,
3927,
2165,
16,
2798,
67,
5902,
67,
644,
4672,
2187,
756,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
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,
365,
18,
5363,
3027,
2668,
536,
2798,
12,
3927,
2165,
16,
2798,
67,
5902,
67,
644,
4672,
2187,
756,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
stack = stack[frame_stack_len + 2:] frame_stack_len = len(stack) | def getStackInfo(self): try: if self.exc_info is not None: exc_type, exc_value, exc_tb = self.exc_info try: exc_type = exc_type.__name__ except AttributeError: # Python 2.x -> ustr()? exc_type = "%s" % str(exc_type) if exc_value is not None: exc_value = str(exc_value) stack, frame_stack_len = self.get_stack( exc_tb.tb_frame, exc_tb) | 012f113a464af15e6ce8b226da475a23a61f446a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/012f113a464af15e6ce8b226da475a23a61f446a/IsolatedDebugger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18457,
966,
12,
2890,
4672,
775,
30,
309,
365,
18,
10075,
67,
1376,
353,
486,
599,
30,
3533,
67,
723,
16,
3533,
67,
1132,
16,
3533,
67,
18587,
273,
365,
18,
10075,
67,
1376,
775,
30,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18457,
966,
12,
2890,
4672,
775,
30,
309,
365,
18,
10075,
67,
1376,
353,
486,
599,
30,
3533,
67,
723,
16,
3533,
67,
1132,
16,
3533,
67,
18587,
273,
365,
18,
10075,
67,
1376,
775,
30,... | |
if no_updates: base.filter(id__in=no_updates).update(cached=datetime.now()) | base.update(cached=datetime.now()) | def _update_cache(): """ Updates the cache for all all VirtualMachines in all clusters. This method processes the data in bulk, where possible, to reduce runtime. Generally this should be faster than refreshing individual VirtualMachines. """ timer = Timer() print '------[cache update]-------------------------------' for cluster in Cluster.objects.all(): print '%s:' % cluster.hostname infos = cluster.instances(bulk=True) timer.tick('info fetched from ganeti ') no_updates = [] mtimes = cluster.virtual_machines.all() \ .values_list('hostname', 'id', 'mtime', 'status') d = {} for name, id, mtime, status in mtimes: d[name] = (id, mtime, status) timer.tick('mtimes fetched from db ') for info in infos: try: name = info['name'] id, mtime, status = d[name] if not mtime or mtime < datetime.fromtimestamp(info['mtime']) \ or status != info['status']: #print ' Virtual Machine (updated) : %s' % name #print ' %s :: %s' % (mtime, datetime.fromtimestamp(info['mtime'])) # only update the whole object if it is new or modified. # # XXX status changes will not always be reflected in mtime # explicitly check status to see if it has changed. failing # to check this would result in state changes being lost data = VirtualMachine.parse_persistent_info(info) VirtualMachine.objects.filter(pk=id) \ .update(serialized_info=cPickle.dumps(info), **data) else: # no changes to this VirtualMachine #print ' Virtual Machine : %s' % name no_updates.append(id) except VirtualMachine.DoesNotExist: # new vm vm = VirtualMachine(cluster=cluster, hostname=info['name']) vm.info = info vm.save() # batch update the cache update time for VMs that weren't modified if no_updates: base.filter(id__in=no_updates).update(cached=datetime.now()) timer.tick('records or timestamps updated') print ' updated: %s out of %s' % (len(infos)-len(no_updates), len(infos)) timer.stop() | c85399a80e7e2b15f31a85c29e315abb723e3963 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10509/c85399a80e7e2b15f31a85c29e315abb723e3963/cache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
67,
2493,
13332,
3536,
15419,
326,
1247,
364,
777,
777,
7269,
25222,
316,
777,
9566,
18,
225,
1220,
707,
8488,
326,
501,
316,
8280,
16,
1625,
3323,
16,
358,
5459,
3099,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
67,
2493,
13332,
3536,
15419,
326,
1247,
364,
777,
777,
7269,
25222,
316,
777,
9566,
18,
225,
1220,
707,
8488,
326,
501,
316,
8280,
16,
1625,
3323,
16,
358,
5459,
3099,
18,
... |
summary += """ | summary += """ | def run_test(self, cr, uid, module_path, module_state): no_terp = False list_files = os.listdir(module_path) for i in list_files: path = os.path.join(module_path, i) if os.path.isdir(path): for j in os.listdir(path): list_files.append(os.path.join(i, j)) | 4d98bb97bc773396c958ccb7266aac4cb120a998 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/4d98bb97bc773396c958ccb7266aac4cb120a998/terp_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
3813,
12,
2890,
16,
4422,
16,
4555,
16,
1605,
67,
803,
16,
1605,
67,
2019,
4672,
1158,
67,
387,
84,
273,
1083,
666,
67,
2354,
273,
1140,
18,
1098,
1214,
12,
2978,
67,
803,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
3813,
12,
2890,
16,
4422,
16,
4555,
16,
1605,
67,
803,
16,
1605,
67,
2019,
4672,
1158,
67,
387,
84,
273,
1083,
666,
67,
2354,
273,
1140,
18,
1098,
1214,
12,
2978,
67,
803,
... |
size+=len(str(data)) | size+=data and data.get_size() or 0 | def get_size(self, instance): """Get size of the stored data used for get_size in BaseObject """ sizes = self.getAvailableSizes(instance) size=0 size+=len(str(self.get(instance))) | cadc09ebc2cb28fe0a3b6f47369c227ca6474dee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/cadc09ebc2cb28fe0a3b6f47369c227ca6474dee/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1467,
12,
2890,
16,
791,
4672,
3536,
967,
963,
434,
326,
4041,
501,
1399,
364,
336,
67,
1467,
316,
3360,
921,
3536,
8453,
273,
365,
18,
588,
5268,
11923,
12,
1336,
13,
963,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1467,
12,
2890,
16,
791,
4672,
3536,
967,
963,
434,
326,
4041,
501,
1399,
364,
336,
67,
1467,
316,
3360,
921,
3536,
8453,
273,
365,
18,
588,
5268,
11923,
12,
1336,
13,
963,
... |
return traceReturnTypeMap.get(type, defaultTraceType)[0] def getTraceInfoType(type): | return traceReturnTypeMap.get(type, defaultReturnTraceType)[0] def getTraceInfoParamType(type): assert type is not '[jsval]' | def getTraceReturnType(type): type = getBuiltinOrNativeTypeName(type) return traceReturnTypeMap.get(type, defaultTraceType)[0] | 2fa0c6b4d6c84eedf3bba5ad940113fd4dff1584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11102/2fa0c6b4d6c84eedf3bba5ad940113fd4dff1584/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18698,
9102,
12,
723,
4672,
618,
273,
2882,
4853,
267,
1162,
9220,
7947,
12,
723,
13,
327,
2606,
9102,
863,
18,
588,
12,
723,
16,
805,
3448,
559,
25146,
20,
65,
225,
2,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18698,
9102,
12,
723,
4672,
618,
273,
2882,
4853,
267,
1162,
9220,
7947,
12,
723,
13,
327,
2606,
9102,
863,
18,
588,
12,
723,
16,
805,
3448,
559,
25146,
20,
65,
225,
2,
-100,
-100,
-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.