rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
def thumbnail(files): for file in files: im = Image.open(os.path.join(BASE_ROOT, file)) new_location = os.path.join(__DIR__, file) if os.path.exists(new_location): try: os.remove(new_location) except WindowsError: print '%s est utilisé par un autre programme' % file im.save(new_location, quality=95) def resize(files): pass | class Test(): @classmethod def thumbnail(self, files): for file in files: im = Image.open(os.path.join(BASE_ROOT, file)) new_location = os.path.join(__DIR__, file) if os.path.exists(new_location): try: os.remove(new_location) except WindowsError: print '%s est utilisé par un autre programme' % file im.save(new_location, quality=95) @classmethod def resize(self, files): pass @classmethod def crop(self, files): for file in files: im = Image.open(os.path.join(BASE_ROOT, file)) crop = im.crop((100, 100, 800, 800)) crop.save(os.path.join(__DIR__, file), quality=95) | def thumbnail(files): for file in files: im = Image.open(os.path.join(BASE_ROOT, file)) new_location = os.path.join(__DIR__, file) if os.path.exists(new_location): try: os.remove(new_location) except WindowsError: print '%s est utilisé par un autre programme' % file im.save(new_location, quality=95) | d54f25435adbff08da206ffef8882757ca950b01 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4038/d54f25435adbff08da206ffef8882757ca950b01/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9134,
12,
2354,
4672,
364,
585,
316,
1390,
30,
709,
273,
3421,
18,
3190,
12,
538,
18,
803,
18,
5701,
12,
8369,
67,
9185,
16,
585,
3719,
394,
67,
3562,
273,
1140,
18,
803,
18,
5701,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9134,
12,
2354,
4672,
364,
585,
316,
1390,
30,
709,
273,
3421,
18,
3190,
12,
538,
18,
803,
18,
5701,
12,
8369,
67,
9185,
16,
585,
3719,
394,
67,
3562,
273,
1140,
18,
803,
18,
5701,
... |
if self.m_f_pull_builtins_hack: self.m_f_pull_builtins_hack = False frame.f_globals['__builtins__'] = sys.modules['__builtin__'] | def trace_dispatch_init(self, frame, event, arg): """ Initial tracing method. """ if event not in ['call', 'line', 'return']: return None | 691ce9ecd8713cae38e843db3324ec1689560d28 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9402/691ce9ecd8713cae38e843db3324ec1689560d28/rpdb2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2606,
67,
10739,
67,
2738,
12,
2890,
16,
2623,
16,
871,
16,
1501,
4672,
3536,
10188,
17144,
707,
18,
3536,
225,
309,
871,
486,
316,
10228,
1991,
2187,
296,
1369,
2187,
296,
2463,
3546,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2606,
67,
10739,
67,
2738,
12,
2890,
16,
2623,
16,
871,
16,
1501,
4672,
3536,
10188,
17144,
707,
18,
3536,
225,
309,
871,
486,
316,
10228,
1991,
2187,
296,
1369,
2187,
296,
2463,
3546,
... | |
xmlhttp_key=None, media_paths=None, **params): | xmlhttp_key=None, media_paths=None, templating_formatters=None, **params): | def __init__(self, application, global_conf=None, error_template=None, xmlhttp_key=None, media_paths=None, **params): self.application = application self.error_template = error_template self.debug_infos = {} if xmlhttp_key is None: if global_conf is None: xmlhttp_key = '_' else: xmlhttp_key = global_conf.get('xmlhttp_key', '_') self.xmlhttp_key = xmlhttp_key self.media_paths = media_paths or {} for s in ['head', 'traceback_data', 'extra_data', 'template_data']: if "%("+s+")s" not in self.error_template: raise InvalidTemplate("Could not find %s in template"%("%("+s+")s")) try: error_template % {'head': '', 'traceback_data': '', 'extra_data':'', 'template_data':'', 'set_tab':'', 'prefix':''} except: raise Exception('Invalid template. Please ensure all % signs are properly ' 'quoted as %% and no extra substitution strings are present.') | c947095f3d485eebd8b8d7fb05362ec6ce1b2e94 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12946/c947095f3d485eebd8b8d7fb05362ec6ce1b2e94/middleware.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2521,
16,
2552,
67,
3923,
33,
7036,
16,
555,
67,
3202,
33,
7036,
16,
2025,
2505,
67,
856,
33,
7036,
16,
3539,
67,
4481,
33,
7036,
16,
28923,
67,
2139,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2521,
16,
2552,
67,
3923,
33,
7036,
16,
555,
67,
3202,
33,
7036,
16,
2025,
2505,
67,
856,
33,
7036,
16,
3539,
67,
4481,
33,
7036,
16,
28923,
67,
2139,
... |
import pygtk pygtk.require('2.0') | def enter_callback(self, widget, data = None): | 365a264392b9d5a2dda1f15633d7ecd4de1b6ab1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9947/365a264392b9d5a2dda1f15633d7ecd4de1b6ab1/traduisons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6103,
67,
3394,
12,
2890,
16,
3604,
16,
501,
273,
599,
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,
6103,
67,
3394,
12,
2890,
16,
3604,
16,
501,
273,
599,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
else: | elif page_num == 2: | def remove(self, widget): if self.notebook.get_current_page() == 0: model, selected = self.current.get_selection().get_selected_rows() iters = [model.get_iter(path) for path in selected] for iter in iters: self.conn.do.deleteid(self.currentdata.get_value(iter, 0)) else: model, selected = self.playlists.get_selection().get_selected_rows() iters = [model.get_iter(path) for path in selected] for iter in iters: self.conn.do.rm(self.playlistsdata.get_value(iter, 1)) self.playlists_populate() self.iterate_now() | 9a1189ef0a6c014f0c3d64fa26fdc291b0f3a6e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2312/9a1189ef0a6c014f0c3d64fa26fdc291b0f3a6e6/sonata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
12,
2890,
16,
3604,
4672,
309,
365,
18,
24422,
18,
588,
67,
2972,
67,
2433,
1435,
422,
374,
30,
938,
16,
3170,
273,
365,
18,
2972,
18,
588,
67,
10705,
7675,
588,
67,
8109,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
12,
2890,
16,
3604,
4672,
309,
365,
18,
24422,
18,
588,
67,
2972,
67,
2433,
1435,
422,
374,
30,
938,
16,
3170,
273,
365,
18,
2972,
18,
588,
67,
10705,
7675,
588,
67,
8109,
67,
... |
parameters.append('; Domain=%s' % cookie.domain) | parameters.append('; domain=%s' % cookie.domain) | def to_str(self): state = self.state | 6c2d2d650798878146be18225f8e3ae8bf1ff2a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/6c2d2d650798878146be18225f8e3ae8bf1ff2a6/response.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
701,
12,
2890,
4672,
919,
273,
365,
18,
2019,
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,
358,
67,
701,
12,
2890,
4672,
919,
273,
365,
18,
2019,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.listMatch[jobRequirements] = {'LastListMatch': now} self.listMatch[jobRequirements]['AvailableCEs'] = availableCEs | if List != False: self.listMatch[jobRequirements] = {'LastListMatch': now} self.listMatch[jobRequirements]['AvailableCEs'] = availableCEs | def submitPilot(self, jobDict, director): """ Submit pilot for the given job, this is done from the Thread Pool job """ try: job = jobDict['JobID'] ret = jobDB.getJobAttribute(job, 'Status') if ret['OK'] and not ret['Value'] == MAJOR_WAIT: self.log.warn( 'Job is no longer in %s Status:' % MAJOR_WAIT, job ) return S_ERROR( 'Job is no longer in %s Status:' % MAJOR_WAIT ) self.log.verbose( 'Submitting Pilot' ) ceMask = self.__resolveCECandidates( jobDict ) if not ceMask: return S_ERROR( 'No CE available for job' ) self.workDir = director.workDir workingDirectory = os.path.join( self.workDir, job) if os.path.isdir( workingDirectory ): shutil.rmtree( workingDirectory ) elif os.path.lexists( workingDirectory ): os.remove( workingDirectory ) os.makedirs(workingDirectory) inputSandbox = [] pilotOptions = [] if jobDict['PilotType'].lower()=='private': self.log.verbose('Job %s will be submitted with a privat pilot' % job) ownerDN = jobDict['OwnerDN'] ownerGroup = jobDict['OwnerGroup'] # User Group requirement pilotOptions.append( '-G %s' % jobDict['OwnerGroup'] ) # check if group allows jobsharing ownerGroupProperties = getPropertiesForGroup( ownerGroup ) if not 'JobSharing' in ownerGroupProperties: # Add Owner requirement to pilot pilotOptions.append( "-O '%s'" % ownerDN ) pilotOptions.append( '-o /AgentJobRequirements/PilotType=private' ) pilotOptions.append( '-o /Resources/Computing/InProcess/PilotType=private' ) else: self.log.verbose('Job %s will be submitted with a generic pilot' % job) ownerDN = self.genericPilotDN ownerGroup = self.genericPilotGroup pilotOptions.append( '-o /AgentJobRequirements/PilotType=generic' ) pilotOptions.append( '-o /Resources/Computing/InProcess/PilotType=generic' ) # Requested version of DIRAC pilotOptions.append( '-v %s' % self.diracVersion ) # Requested CPU time pilotOptions.append( '-T %s' % jobDict['MaxCPUTime'] ) # Default Setup. It may be overwriten by the Arguments in the Job JDL pilotOptions.append( '-o /DIRAC/Setup=%s' % self.diracSetup ) # Write JDL retDict = self._prepareJDL( jobDict, pilotOptions, ceMask ) jdl = retDict['JDL'] jobRequirements = retDict['Requirements'] pilots = retDict['Pilots'] if not jdl: try: shutil.rmtree( workingDirectory ) except: pass updateJobStatus( self.log, AGENT_NAME, job, MAJOR_WAIT, MINOR_SUBMIT, logRecord=True ) return S_ERROR( 'Could not create JDL:', job ) # get a valid proxy ret = gProxyManager.getPilotProxyFromDIRACGroup( ownerDN, ownerGroup ) if not ret['OK']: self.log.error( ret['Message'] ) self.log.error( 'Could not get proxy:', 'User "%s", Group "%s"' % ( ownerDN, ownerGroup ) ) try: shutil.rmtree( workingDirectory ) except: pass updateJobStatus( self.log, AGENT_NAME, job, MAJOR_WAIT, MINOR_SUBMIT, logRecord=True ) return S_ERROR( 'Could not get proxy' ) proxy = ret['Value'] # Need to get VOMS extension for the later interctions with WMS ret = gProxyManager.getVOMSAttributes(proxy) if not ret['OK']: updateJobStatus( self.log, AGENT_NAME, job, MAJOR_WAIT, MINOR_SUBMIT, logRecord=True ) return ret if not ret['Value']: updateJobStatus( self.log, AGENT_NAME, job, MAJOR_WAIT, MINOR_SUBMIT, logRecord=True ) return S_ERROR( 'getPilotProxyFromDIRACGroup returns a proxy without VOMS Extensions' ) vomsGroup = ret['Value'][0] # Check that there are available queues for the Job: if self.enableListMatch: availableCEs = [] now = Time.dateTime() if not jobRequirements in self.listMatch: availableCEs = self._listMatch( proxy, job, jdl ) self.listMatch[jobRequirements] = {'LastListMatch': now} self.listMatch[jobRequirements]['AvailableCEs'] = availableCEs else: availableCEs = self.listMatch[jobRequirements]['AvailableCEs'] if not Time.timeInterval( self.listMatch[jobRequirements]['LastListMatch'], self.listMatchDelay * Time.minute ).includes( now ): availableCEs = self._listMatch( proxy, job, jdl ) self.listMatch[jobRequirements]['AvailableCEs'] = availableCEs self.listMatch[jobRequirements] = {'LastListMatch': now} else: self.log.verbose( 'LastListMatch', self.listMatch[jobRequirements]['LastListMatch'] ) self.log.verbose( 'AvailableCEs ', availableCEs ) if type(availableCEs) == types.ListType : jobDB.setJobParameter( job, 'Available_CEs' , '%s CEs returned from list-match on %s' % ( len(availableCEs), Time.toString() ) ) if not availableCEs: # FIXME: set Job Minor Status try: shutil.rmtree( workingDirectory ) except: pass updateJobStatus( self.log, AGENT_NAME, job, MAJOR_WAIT, MINOR_SUBMIT, logRecord=True ) return S_ERROR( 'No queue available for job' ) # Now we are ready for the actual submission, so self.log.verbose('Submitting Pilot Agent for job:', job ) submitRet = self._submitPilot( proxy, job, jdl ) try: shutil.rmtree( workingDirectory ) except: pass if not submitRet: updateJobStatus( self.log, AGENT_NAME, job, MAJOR_WAIT, MINOR_SUBMIT, logRecord=True ) return S_ERROR( 'Pilot Submission Failed' ) pilotReference, resourceBroker = submitRet # Now, update the job Minor Status if pilots > 1 : pilotReference = self._getChildrenReferences( proxy, pilotReference, job ) else: pilotReference = [pilotReference] pilotAgentsDB.addPilotReference( pilotReference, job, ownerDN, vomsGroup, broker=resourceBroker, gridType=self.gridMiddleware, requirements=jobRequirements ) ret = jobDB.getJobAttribute(job, 'Status') if ret['OK'] and ret['Value'] == MAJOR_WAIT: updateJobStatus( self.log, AGENT_NAME, job, MAJOR_WAIT, MINOR_RESPONSE, logRecord=True ) else: self.log.warn( 'Job is no longer in %s Status:' % MAJOR_WAIT, job ) | 55aab95db444ff98cd23fd04eb657d65d41e983f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/55aab95db444ff98cd23fd04eb657d65d41e983f/Director.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4879,
52,
22797,
12,
2890,
16,
1719,
5014,
16,
2657,
280,
4672,
3536,
17320,
293,
22797,
364,
326,
864,
1719,
16,
333,
353,
2731,
628,
326,
4884,
8828,
1719,
3536,
775,
30,
1719,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4879,
52,
22797,
12,
2890,
16,
1719,
5014,
16,
2657,
280,
4672,
3536,
17320,
293,
22797,
364,
326,
864,
1719,
16,
333,
353,
2731,
628,
326,
4884,
8828,
1719,
3536,
775,
30,
1719,
273,
... |
self.assertRaises(Queue.Empty, self.done.get, True, 0.2) self.sl.release() | self.assertRaises(Queue.Empty, self.done.get_nowait) self.sl.release() self._waitThreads() | def testWaitingExclusiveBlocksSharer(self): self.sl.acquire(shared=1) # the lock is acquired in shared mode... Thread(target=self._doItExclusive).start() # ...but now an exclusive is waiting... time.sleep(0.05) Thread(target=self._doItSharer).start() # ...so the sharer should be blocked as well self.assertRaises(Queue.Empty, self.done.get, True, 0.2) self.sl.release() # The exclusive passed before self.assertEqual(self.done.get(True, 1), 'EXC') self.assertEqual(self.done.get(True, 1), 'SHR') | 4607c978b8f973b63c49547f1b8d6061fdbd78d3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/4607c978b8f973b63c49547f1b8d6061fdbd78d3/ganeti.locking_unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
15946,
17075,
6450,
1555,
14500,
12,
2890,
4672,
365,
18,
2069,
18,
1077,
1039,
12,
11574,
33,
21,
13,
468,
326,
2176,
353,
20598,
316,
5116,
1965,
2777,
4884,
12,
3299,
33,
2890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
15946,
17075,
6450,
1555,
14500,
12,
2890,
4672,
365,
18,
2069,
18,
1077,
1039,
12,
11574,
33,
21,
13,
468,
326,
2176,
353,
20598,
316,
5116,
1965,
2777,
4884,
12,
3299,
33,
2890,
... |
content.append(ModelGroupReference()) | content.append(ModelGroupReference(self)) | def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) content = [] | 6d624a54ef4e80f277c247ef300c646e01f4568e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13054/6d624a54ef4e80f277c247ef300c646e01f4568e/XMLSchema.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
8832,
12,
2890,
16,
756,
4672,
365,
18,
542,
2498,
12,
2159,
13,
2939,
273,
365,
18,
588,
6323,
12,
2159,
13,
913,
273,
5378,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
628,
8832,
12,
2890,
16,
756,
4672,
365,
18,
542,
2498,
12,
2159,
13,
2939,
273,
365,
18,
588,
6323,
12,
2159,
13,
913,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
widget, widgets, buttons, on_write, notebook_list2, cursor_widget2 = \ | widget, widgets, buttons, spam, notebook_list2, cursor_widget2 = \ | def parse(self, model, root_node, fields, notebook=None, paned=None, tooltips=None): dict_widget = {} button_list = [] notebook_list = [] attrs = common.node_attributes(root_node) on_write = attrs.get('on_write', '') if not tooltips: tooltips = gtk.Tooltips() container = _container(tooltips) container.new(col=int(attrs.get('col', 4))) cursor_widget = attrs.get('cursor') | ea21f3e543433e674ffa99f8b7c2abdbbc952a5a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9151/ea21f3e543433e674ffa99f8b7c2abdbbc952a5a/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
938,
16,
1365,
67,
2159,
16,
1466,
16,
14718,
33,
7036,
16,
2800,
329,
33,
7036,
16,
358,
4397,
7146,
33,
7036,
4672,
2065,
67,
6587,
273,
2618,
3568,
67,
1098,
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,
1109,
12,
2890,
16,
938,
16,
1365,
67,
2159,
16,
1466,
16,
14718,
33,
7036,
16,
2800,
329,
33,
7036,
16,
358,
4397,
7146,
33,
7036,
4672,
2065,
67,
6587,
273,
2618,
3568,
67,
1098,
2... |
@staticmethod def _sql_pkgKey2po(repo, cur, pkgs=None): | def _sql_pkgKey2po(self, repo, cur, pkgs=None): | def searchAll(self,name, query_type='like'): # this function is just silly and it reduces down to just this return self.searchPrco(name, 'provides') | 866295de82f15b1a15df27cc44b9968e5e633fec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5445/866295de82f15b1a15df27cc44b9968e5e633fec/sqlitesack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
1595,
12,
2890,
16,
529,
16,
843,
67,
723,
2218,
5625,
11,
4672,
468,
333,
445,
353,
2537,
17714,
715,
471,
518,
30568,
2588,
358,
2537,
333,
327,
365,
18,
3072,
28763,
83,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
1595,
12,
2890,
16,
529,
16,
843,
67,
723,
2218,
5625,
11,
4672,
468,
333,
445,
353,
2537,
17714,
715,
471,
518,
30568,
2588,
358,
2537,
333,
327,
365,
18,
3072,
28763,
83,
12,
... |
elif ch==curses.KEY_RIGHT and self.carx<self.width-1: | elif ch==curses.KEY_RIGHT and self.carx<self.width-1 and self.slip<=0: | def key(self, ch): delta = 0 if ch==curses.KEY_LEFT and self.carx>0: delta = -1 elif ch==curses.KEY_RIGHT and self.carx<self.width-1: delta = 1 elif ch==ESC: self.esc=1 self.carx += delta self.update_car(delta) | 717e9879a73c846fbf680bc197a2645c41e4a83e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4193/717e9879a73c846fbf680bc197a2645c41e4a83e/pyrace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
498,
12,
2890,
16,
462,
4672,
3622,
273,
374,
309,
462,
631,
1397,
2420,
18,
3297,
67,
10066,
471,
365,
18,
9815,
92,
34,
20,
30,
3622,
273,
300,
21,
1327,
462,
631,
1397,
2420,
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,
498,
12,
2890,
16,
462,
4672,
3622,
273,
374,
309,
462,
631,
1397,
2420,
18,
3297,
67,
10066,
471,
365,
18,
9815,
92,
34,
20,
30,
3622,
273,
300,
21,
1327,
462,
631,
1397,
2420,
18,
... |
], CONTEXT) | ], 0, None, None, CONTEXT) | def test0040numeric(self): ''' Test Numeric. ''' numeric1_id = self.numeric.create({ 'numeric': Decimal('1.1'), }, CONTEXT) self.assert_(numeric1_id) | 52062c763bf1737b3f2071e48338f60845edc54d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9266/52062c763bf1737b3f2071e48338f60845edc54d/test_tryton.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
713,
7132,
5246,
12,
2890,
4672,
9163,
7766,
16980,
18,
9163,
6389,
21,
67,
350,
273,
365,
18,
5246,
18,
2640,
12590,
296,
5246,
4278,
11322,
2668,
21,
18,
21,
19899,
19879,
13862,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
713,
7132,
5246,
12,
2890,
4672,
9163,
7766,
16980,
18,
9163,
6389,
21,
67,
350,
273,
365,
18,
5246,
18,
2640,
12590,
296,
5246,
4278,
11322,
2668,
21,
18,
21,
19899,
19879,
13862,... |
dbg ("TConfig: Looking for: '%s'"%keyname) | def __getattr__ (self, keyname): dbg ("TConfig: Looking for: '%s'"%keyname) for source in self.sources: try: val = getattr (source, keyname) dbg (" TConfig: got: '%s' from a '%s'"%(val, source.type)) return (val) except: pass | 59655b9cf3e9c4f7bd4cf151c551d81fd23b218e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1032/59655b9cf3e9c4f7bd4cf151c551d81fd23b218e/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
1747,
972,
261,
2890,
16,
27567,
4672,
364,
1084,
316,
365,
18,
10141,
30,
775,
30,
1244,
273,
3869,
261,
3168,
16,
27567,
13,
28966,
7566,
399,
809,
30,
2363,
30,
1995,
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,
1001,
588,
1747,
972,
261,
2890,
16,
27567,
4672,
364,
1084,
316,
365,
18,
10141,
30,
775,
30,
1244,
273,
3869,
261,
3168,
16,
27567,
13,
28966,
7566,
399,
809,
30,
2363,
30,
1995,
87,... | |
def search_directory(self, search_string=u''): | def search_directory(self, search_string=u'', sort_by=''): | def search_directory(self, search_string=u''): """ """ search_string = search_string.lower() local_users_list = self.search_local_users(search_string) external_users_list = self.search_external_users(search_string) user_list = local_users_list + external_users_list return self.user_list_html(search_string=search_string, user_list=user_list) | 672d89929cb9d511f2b6fae48847312a65ab5eba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/672d89929cb9d511f2b6fae48847312a65ab5eba/directory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
5149,
12,
2890,
16,
1623,
67,
1080,
33,
89,
11,
2187,
1524,
67,
1637,
2218,
11,
4672,
3536,
3536,
1623,
67,
1080,
273,
1623,
67,
1080,
18,
8167,
1435,
1191,
67,
5577,
67,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
5149,
12,
2890,
16,
1623,
67,
1080,
33,
89,
11,
2187,
1524,
67,
1637,
2218,
11,
4672,
3536,
3536,
1623,
67,
1080,
273,
1623,
67,
1080,
18,
8167,
1435,
1191,
67,
5577,
67,
1... |
self._deps[filename] = self.parse_deps(filename) | self._deps[filename] = self.parse_deps(filename, ext_module) | def immediate_deps(self, filename): """ Returns a list of files directly referenced by this file. """ if (filename not in self._deps or self.timestamp(filename) < self._last_parse[filename]): self._deps[filename] = self.parse_deps(filename) self._last_parse[filename] = self.timestamp(filename) return self._deps[filename] | 031b02486f3aa60bbe6ec46c81307116288d5734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/031b02486f3aa60bbe6ec46c81307116288d5734/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14483,
67,
14877,
12,
2890,
16,
1544,
4672,
3536,
2860,
279,
666,
434,
1390,
5122,
8042,
635,
333,
585,
18,
3536,
309,
261,
3459,
486,
316,
365,
6315,
14877,
578,
365,
18,
5508,
12,
34... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14483,
67,
14877,
12,
2890,
16,
1544,
4672,
3536,
2860,
279,
666,
434,
1390,
5122,
8042,
635,
333,
585,
18,
3536,
309,
261,
3459,
486,
316,
365,
6315,
14877,
578,
365,
18,
5508,
12,
34... |
"""Parse a tiem from a string. | """Parse a time from a string. | def parse_time(string, locale=LC_TIME): """Parse a tiem from a string. This function uses the time format for the locale as a hint to determine the order in which the time fields appear in the string. >>> parse_time('15:30:00', locale='en_US') datetime.time(15, 30) :param string: the string containing the time :param locale: a `Locale` object or a locale identifier :return: the parsed time :rtype: `time` """ # TODO: try ISO format first? format = get_time_format(locale=locale).pattern.lower() hour_idx = format.index('h') if hour_idx < 0: hour_idx = format.index('k') min_idx = format.index('m') sec_idx = format.index('s') indexes = [(hour_idx, 'H'), (min_idx, 'M'), (sec_idx, 'S')] indexes.sort() indexes = dict([(item[1], idx) for idx, item in enumerate(indexes)]) # FIXME: support 12 hour clock, and 0-based hour specification numbers = re.findall('(\d+)', string) hour = int(numbers[indexes['H']]) minute = int(numbers[indexes['M']]) second = int(numbers[indexes['S']]) return time(hour, minute, second) | 9a0dee0c20adc741fc7aabed2d8d9ca4c0304db5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8909/9a0dee0c20adc741fc7aabed2d8d9ca4c0304db5/dates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
957,
12,
1080,
16,
2573,
33,
13394,
67,
4684,
4672,
3536,
3201,
279,
813,
628,
279,
533,
18,
225,
1220,
445,
4692,
326,
813,
740,
364,
326,
2573,
487,
279,
7380,
358,
4199,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
957,
12,
1080,
16,
2573,
33,
13394,
67,
4684,
4672,
3536,
3201,
279,
813,
628,
279,
533,
18,
225,
1220,
445,
4692,
326,
813,
740,
364,
326,
2573,
487,
279,
7380,
358,
4199,
... |
self._snapshot = (dec_flags, input_chunk, len(decoded)) | self._snapshot = (dec_flags, input_chunk) | def seek(self, cookie, whence=0): if not self._seekable: raise IOError("underlying stream is not seekable") if whence == 1: # seek relative to current position if cookie != 0: raise IOError("can't do nonzero cur-relative seeks") # Seeking to the current position should attempt to # sync the underlying buffer with the current position. whence = 0 cookie = self.tell() if whence == 2: # seek relative to end of file if cookie != 0: raise IOError("can't do nonzero end-relative seeks") self.flush() position = self.buffer.seek(0, 2) self._decoded_text = "" self._snapshot = None if self._decoder: self._decoder.reset() return position if whence != 0: raise ValueError("invalid whence (%r, should be 0, 1 or 2)" % (whence,)) if cookie < 0: raise ValueError("negative seek position %r" % (cookie,)) self.flush() | 2e00b1ed3eaf2ada4c0cb16b188516bd10ad5f0c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/2e00b1ed3eaf2ada4c0cb16b188516bd10ad5f0c/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6520,
12,
2890,
16,
3878,
16,
23692,
33,
20,
4672,
309,
486,
365,
6315,
16508,
429,
30,
1002,
8340,
2932,
9341,
6291,
1407,
353,
486,
6520,
429,
7923,
309,
23692,
422,
404,
30,
468,
65... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6520,
12,
2890,
16,
3878,
16,
23692,
33,
20,
4672,
309,
486,
365,
6315,
16508,
429,
30,
1002,
8340,
2932,
9341,
6291,
1407,
353,
486,
6520,
429,
7923,
309,
23692,
422,
404,
30,
468,
65... |
logCompression="", errorparser="unix"): | logCompression="", errorparser="unix", columnName=None): | def __init__(self, fromaddr, tree, extraRecipients, categories=None, builders=None, relayhost="localhost", subject="buildbot %(result)s in %(builder)s", binaryURL="", logCompression="", errorparser="unix"): """ @type fromaddr: string @param fromaddr: the email address to be used in the 'From' header. | a2c86bb2c7624114bfd6e87b5621e1a51a19dcc7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13067/a2c86bb2c7624114bfd6e87b5621e1a51a19dcc7/tinderbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
628,
4793,
16,
2151,
16,
2870,
22740,
16,
6477,
33,
7036,
16,
19916,
33,
7036,
16,
18874,
2564,
1546,
13014,
3113,
3221,
1546,
3510,
4819,
8975,
2088,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
628,
4793,
16,
2151,
16,
2870,
22740,
16,
6477,
33,
7036,
16,
19916,
33,
7036,
16,
18874,
2564,
1546,
13014,
3113,
3221,
1546,
3510,
4819,
8975,
2088,
13,
... |
fieldwin.addstr(2, 0, fieldw * '_', curses.A_BOLD) fieldwin.addstr(2, 0, self.progress, curses.A_BOLD) fieldwin.addstr(3, 0, self.status) fieldwin.addstr(4, 0, self.downRate) fieldwin.addstr(5, 0, self.upRate) | fieldwin.addstr(3, 0, self.progress, curses.A_BOLD) fieldwin.addstr(4, 0, self.status) fieldwin.addstr(5, 0, self.downRate) fieldwin.addstr(6, 0, self.upRate) | def display(self, fractionDone = None, timeEst = None, downRate = None, upRate = None, activity = None): if activity is not None and not self.done: self.activity = activity elif timeEst is not None: self.activity = 'finishing in %s' % fmttime(timeEst) if fractionDone is not None: self.status = '%s (%.1f%%)' % (self.activity, fractionDone * 100) self.progress = int(fieldw * fractionDone) * '#' else: self.status = self.activity if downRate is not None: self.downRate = '%.1f KB/s' % (float(downRate) / (1 << 10)) if upRate is not None: self.upRate = '%.1f KB/s' % (float(upRate) / (1 << 10)) | 475bc2502a2632d7599dddb0ed5ed686f6cf773d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/475bc2502a2632d7599dddb0ed5ed686f6cf773d/btdownloadcurses.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
12,
2890,
16,
8330,
7387,
273,
599,
16,
813,
9122,
273,
599,
16,
2588,
4727,
273,
599,
16,
731,
4727,
273,
599,
16,
5728,
273,
599,
4672,
309,
5728,
353,
486,
599,
471,
486,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
12,
2890,
16,
8330,
7387,
273,
599,
16,
813,
9122,
273,
599,
16,
2588,
4727,
273,
599,
16,
731,
4727,
273,
599,
16,
5728,
273,
599,
4672,
309,
5728,
353,
486,
599,
471,
486,
36... |
return self.alias | return self.alias | def name( self ): """Introspect to get a name for our function""" if self.alias: return self.alias # okay, so do some introspection... if hasattr( self.py_function, '__name__' ): return self.py_function.__name__ raise ValueError( """Don't know how to get name for %r type"""%( self.py_function.__class__, )) | 5e441a6d3c8bf4a1d1361e5553c2257c04555ada /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1545/5e441a6d3c8bf4a1d1361e5553c2257c04555ada/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
508,
12,
365,
262,
30,
3536,
1702,
26170,
358,
336,
279,
508,
364,
3134,
445,
8395,
309,
365,
18,
4930,
30,
327,
365,
18,
4930,
468,
21194,
16,
1427,
741,
2690,
18446,
7017,
2777,
309,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
508,
12,
365,
262,
30,
3536,
1702,
26170,
358,
336,
279,
508,
364,
3134,
445,
8395,
309,
365,
18,
4930,
30,
327,
365,
18,
4930,
468,
21194,
16,
1427,
741,
2690,
18446,
7017,
2777,
309,... |
config = ServerConfiguration() | config = WebappConfiguration() | def testFromCommandLine(self): """For this test to not fail, the configuration file must define the database as being 'maay' """ data = [('maay', ('localhost', 'maay')), ('maay --db-name maille', ('localhost', 'maille')), ('maay --db-host foo', ('foo', 'maay')), ('maay --db-host foo --db-name maille', ('foo', 'maille')), ] for cmdLine, (expectedHost, expectedDatabase) in data: config = ServerConfiguration() sys.argv = cmdLine.split() config.load() self.assertEquals(config.db_host, expectedHost) self.assertEquals(config.db_name, expectedDatabase) | 931fccb5e641c53bc956ccf0fd1dd903df9e8a5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2259/931fccb5e641c53bc956ccf0fd1dd903df9e8a5f/test_configuration.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1265,
21391,
12,
2890,
4672,
3536,
1290,
333,
1842,
358,
486,
2321,
16,
326,
1664,
585,
1297,
4426,
326,
2063,
487,
3832,
296,
2540,
528,
11,
3536,
501,
273,
306,
2668,
2540,
528,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1265,
21391,
12,
2890,
4672,
3536,
1290,
333,
1842,
358,
486,
2321,
16,
326,
1664,
585,
1297,
4426,
326,
2063,
487,
3832,
296,
2540,
528,
11,
3536,
501,
273,
306,
2668,
2540,
528,
... |
f_edge_used = lambda u,v : edge_used[ (u,v) if hash(u) < hash(v) else (v,u) ] | f_edge_used = lambda u, v: edge_used[ (u,v) if hash(u) < hash(v) else (v,u)] | def longest_path(self, s = None, t = None, weighted = False, algorithm = "MILP", solver = None, verbose = 0): r""" Returns a longest path of ``self``. | 1ce3f98f3b3a6c76baa509a4ebc0110ea7853d74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1ce3f98f3b3a6c76baa509a4ebc0110ea7853d74/generic_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12163,
67,
803,
12,
2890,
16,
272,
273,
599,
16,
268,
273,
599,
16,
13747,
273,
1083,
16,
4886,
273,
315,
49,
2627,
52,
3113,
12776,
273,
599,
16,
3988,
273,
374,
4672,
436,
8395,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12163,
67,
803,
12,
2890,
16,
272,
273,
599,
16,
268,
273,
599,
16,
13747,
273,
1083,
16,
4886,
273,
315,
49,
2627,
52,
3113,
12776,
273,
599,
16,
3988,
273,
374,
4672,
436,
8395,
28... |
para = paragraph_stream(stream, 'p', {}, parameters.getSampleStyleSheet()) | para = paragraph_stream(stream, 'p', {}, parameters) | def test_formatting(self): parameters = Param() data = '<p>TXT <i>TEXT<u>TEXT</u></i></p>' stream = XMLParser(data) stream.next() para = paragraph_stream(stream, 'p', {}, parameters.getSampleStyleSheet()) self.assertEqual(para.text, '<para>TXT <i>TEXT<u>TEXT</u></i></para>') | e3c78fc65729ed0a33412c3127995be39d356e50 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/e3c78fc65729ed0a33412c3127995be39d356e50/test_rml2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2139,
1787,
12,
2890,
4672,
1472,
273,
3014,
1435,
501,
273,
2368,
84,
34,
29399,
411,
77,
34,
5151,
32,
89,
34,
5151,
1757,
89,
4695,
77,
4695,
84,
1870,
1407,
273,
3167,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2139,
1787,
12,
2890,
4672,
1472,
273,
3014,
1435,
501,
273,
2368,
84,
34,
29399,
411,
77,
34,
5151,
32,
89,
34,
5151,
1757,
89,
4695,
77,
4695,
84,
1870,
1407,
273,
3167,
... |
added += 1 | def readMoreFields(self, number): """ Read more number fields, or do nothing if parsing is done. | 59c1b5817103d40245b6789f3613969074e6f2a0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9327/59c1b5817103d40245b6789f3613969074e6f2a0/generic_field_set.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
7417,
2314,
12,
2890,
16,
1300,
4672,
3536,
2720,
1898,
1300,
1466,
16,
578,
741,
5083,
309,
5811,
353,
2731,
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,
855,
7417,
2314,
12,
2890,
16,
1300,
4672,
3536,
2720,
1898,
1300,
1466,
16,
578,
741,
5083,
309,
5811,
353,
2731,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
for iNumber in [ random.randint( 1,20 ) for uNothing in range( iWorkUnits ) ]: | for iNumber in [ random.randint( 1, 20 ) for uNothing in range( iWorkUnits ) ]: | def generateWork( iWorkUnits ): for iNumber in [ random.randint( 1,20 ) for uNothing in range( iWorkUnits ) ]: oTJ = ThreadedJob( doSomething, args = ( iNumber, ), oCallback = showResult, oExceptionCallback = showException ) oTP.queueJob( oTJ ) | fae2bf3e9a26fb4ceef61672a4ef6231fbfd33f8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/fae2bf3e9a26fb4ceef61672a4ef6231fbfd33f8/ThreadPool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
2421,
12,
277,
2421,
7537,
262,
30,
364,
277,
1854,
316,
306,
2744,
18,
7884,
474,
12,
404,
16,
4200,
262,
364,
582,
23814,
316,
1048,
12,
277,
2421,
7537,
262,
308,
30,
320,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
2421,
12,
277,
2421,
7537,
262,
30,
364,
277,
1854,
316,
306,
2744,
18,
7884,
474,
12,
404,
16,
4200,
262,
364,
582,
23814,
316,
1048,
12,
277,
2421,
7537,
262,
308,
30,
320,
5... |
and type(conversion) is not type(""): | and type(conversion) is not StringType: | def subconvert(self, endchar=None, depth=0): stack = [] line = self.line if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _comment_rx.match(line) if m: text = m.group(1) if text: self.write("(COMMENT\n- %s \n)COMMENT\n-\\n\n" % encode(text)) line = line[m.end():] continue m = _begin_env_rx.match(line) if m: # re-write to use the macro handler line = r"\%s %s" % (m.group(1), line[m.end():]) continue m = _end_env_rx.match(line) if m: # end of environment envname = m.group(1) if envname == "document": # special magic for n in stack[1:]: if n not in self.autoclosing: raise LaTeXFormatError( "open element on stack: " + `n`) # should be more careful, but this is easier to code: stack = [] self.write(")document\n") elif stack and envname == stack[-1]: self.write(")%s\n" % envname) del stack[-1] popping(envname, "a", len(stack) + depth) else: self.err_write("stack: %s\n" % `stack`) raise LaTeXFormatError( "environment close for %s doesn't match" % envname) line = line[m.end():] continue m = _begin_macro_rx.match(line) if m: # start of macro macroname = m.group(1) if macroname == "verbatim": # really magic case! pos = string.find(line, "\\end{verbatim}") text = line[m.end(1):pos] self.write("(verbatim\n") self.write("-%s\n" % encode(text)) self.write(")verbatim\n") line = line[pos + len("\\end{verbatim}"):] continue numbered = 1 opened = 0 if macroname[-1] == "*": macroname = macroname[:-1] numbered = 0 if macroname in self.autoclosing and macroname in stack: while stack[-1] != macroname: top = stack.pop() if top and top not in self.discards: self.write(")%s\n-\\n\n" % top) popping(top, "b", len(stack) + depth) if macroname not in self.discards: self.write("-\\n\n)%s\n-\\n\n" % macroname) popping(macroname, "c", len(stack) + depth - 1) del stack[-1] # if macroname in self.discards: self.push_output(StringIO.StringIO()) else: self.push_output(self.ofp) # params, optional, empty, environ = self.start_macro(macroname) if not numbered: self.write("Anumbered TOKEN no\n") # rip off the macroname if params: if optional and len(params) == 1: line = line[m.end():] else: line = line[m.end(1):] elif empty: line = line[m.end(1):] else: line = line[m.end():] # # Very ugly special case to deal with \item[]. The catch # is that this needs to occur outside the for loop that # handles attribute parsing so we can 'continue' the outer # loop. # if optional and type(params[0]) is type(()): # the attribute name isn't used in this special case pushing(macroname, "a", depth + len(stack)) stack.append(macroname) self.write("(%s\n" % macroname) m = _start_optional_rx.match(line) if m: self.line = line[m.end():] line = self.subconvert("]", depth + len(stack)) line = "}" + line continue # handle attribute mappings here: for attrname in params: if optional: optional = 0 if type(attrname) is type(""): m = _optional_rx.match(line) if m: line = line[m.end():] self.write("A%s TOKEN %s\n" % (attrname, encode(m.group(1)))) elif type(attrname) is type(()): # This is a sub-element; but don't place the # element we found on the stack (\section-like) pushing(macroname, "b", len(stack) + depth) stack.append(macroname) self.write("(%s\n" % macroname) macroname = attrname[0] m = _start_group_rx.match(line) if m: line = line[m.end():] elif type(attrname) is type([]): # A normal subelement: <macroname><attrname>...</>... attrname = attrname[0] if not opened: opened = 1 self.write("(%s\n" % macroname) pushing(macroname, "c", len(stack) + depth) self.write("(%s\n" % attrname) pushing(attrname, "sub-elem", len(stack) + depth + 1) self.line = skip_white(line)[1:] line = self.subconvert("}", len(stack) + depth + 1)[1:] dbgmsg("subconvert() ==> " + `line[:20]`) popping(attrname, "sub-elem", len(stack) + depth + 1) self.write(")%s\n" % attrname) else: m = _parameter_rx.match(line) if not m: raise LaTeXFormatError( "could not extract parameter %s for %s: %s" % (attrname, macroname, `line[:100]`)) value = m.group(1) if _token_rx.match(value): dtype = "TOKEN" else: dtype = "CDATA" self.write("A%s %s %s\n" % (attrname, dtype, encode(value))) line = line[m.end():] if params and type(params[-1]) is type('') \ and (not empty) and not environ: # attempt to strip off next '{' m = _start_group_rx.match(line) if not m: raise LaTeXFormatError( "non-empty element '%s' has no content: %s" % (macroname, line[:12])) line = line[m.end():] if not opened: self.write("(%s\n" % macroname) pushing(macroname, "d", len(stack) + depth) if empty: line = "}" + line stack.append(macroname) self.pop_output() continue if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line[1:] return self.line if line[0] == "}": # end of macro or group macroname = stack[-1] conversion = self.table.get(macroname) if macroname \ and macroname not in self.discards \ and type(conversion) is not type(""): # otherwise, it was just a bare group self.write(")%s\n" % stack[-1]) popping(macroname, "d", len(stack) + depth - 1) del stack[-1] line = line[1:] continue if line[0] == "{": pushing("", "e", len(stack) + depth) stack.append("") line = line[1:] continue if line[0] == "\\" and line[1] in ESCAPED_CHARS: self.write("-%s\n" % encode(line[1])) line = line[2:] continue if line[:2] == r"\\": self.write("(BREAK\n)BREAK\n") line = line[2:] continue m = _text_rx.match(line) if m: text = encode(m.group()) self.write("-%s\n" % text) line = line[m.end():] continue # special case because of \item[] if line[0] == "]": self.write("-]\n") line = line[1:] continue # avoid infinite loops extra = "" if len(line) > 100: extra = "..." raise LaTeXFormatError("could not identify markup: %s%s" % (`line[:100]`, extra)) while stack and stack[-1] in self.autoclosing: self.write("-\\n\n") self.write(")%s\n" % stack[-1]) popping(stack.pop(), "e", len(stack) + depth - 1) if stack: raise LaTeXFormatError("elements remain on stack: " + string.join(stack, ", ")) # otherwise we just ran out of input here... | 95253f24a1ec2b5368a29fcf7b600da0559b9703 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/95253f24a1ec2b5368a29fcf7b600da0559b9703/latex2esis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
6283,
12,
2890,
16,
679,
3001,
33,
7036,
16,
3598,
33,
20,
4672,
2110,
273,
5378,
980,
273,
365,
18,
1369,
309,
6369,
471,
679,
3001,
30,
365,
18,
370,
67,
2626,
12,
315,
1717,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
6283,
12,
2890,
16,
679,
3001,
33,
7036,
16,
3598,
33,
20,
4672,
2110,
273,
5378,
980,
273,
365,
18,
1369,
309,
6369,
471,
679,
3001,
30,
365,
18,
370,
67,
2626,
12,
315,
1717,
... |
""" helps omit useless lines of object values | """ helps to omit useless lines of object values | def _check_object_value(param, value): """ helps omit useless lines of object values @param param: definition of object param @param value: value of param """ if value: return '%(param)s="%(value)s"' % {"param": param, "value": wikiutil.escape(value)} else: return "" | 8487a97aba188f2533010e4f3673881def398037 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/8487a97aba188f2533010e4f3673881def398037/EmbedObject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
1612,
67,
1132,
12,
891,
16,
460,
4672,
3536,
21814,
358,
14088,
26967,
2362,
434,
733,
924,
225,
632,
891,
579,
30,
2379,
434,
733,
579,
632,
891,
460,
30,
460,
434,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
1612,
67,
1132,
12,
891,
16,
460,
4672,
3536,
21814,
358,
14088,
26967,
2362,
434,
733,
924,
225,
632,
891,
579,
30,
2379,
434,
733,
579,
632,
891,
460,
30,
460,
434,
... |
if pidfile_pid.isdigit() and glue.utils.pid_exists(int(pidfile_pid)): raise RuntimeError, ("pidfile %s contains pid (%s) of a running " "process" % (lockfile, pidfile_pid)) else: print ("pidfile %s contains stale pid %s; writing new lock" % (lockfile, pidfile_pid)) | if pidfile_pid.isdigit(): if glue.utils.pid_exists(int(pidfile_pid)): raise RuntimeError, ("pidfile %s contains pid (%s) of a running " "process" % (lockfile, pidfile_pid)) else: print ("pidfile %s contains stale pid %s; writing new lock" % (lockfile, pidfile_pid)) | def get_lock(lockfile): """ Tries to write a lockfile containing the current pid. Excepts if the lockfile already contains the pid of a running process. Although this should prevent a lock from being granted twice, it can theoretically deny a lock unjustly in the unlikely event that the original process is gone but another unrelated process has been assigned the same pid by the OS. """ pidfile = open(lockfile, "a+") # here we do some meta-locking by getting an exclusive lock on the # pidfile before reading it, to prevent two daemons from seeing a # stale lock at the same time, and both trying to run try: fcntl.flock(pidfile.fileno(), fcntl.LOCK_EX|fcntl.LOCK_NB) except IOError,e: raise RuntimeError, "failed to lock %s: %s" % (lockfile, e) # we got the file lock, so check the pid therein pidfile.seek(0) pidfile_pid = pidfile.readline().strip() if pidfile_pid.isdigit() and glue.utils.pid_exists(int(pidfile_pid)): raise RuntimeError, ("pidfile %s contains pid (%s) of a running " "process" % (lockfile, pidfile_pid)) else: print ("pidfile %s contains stale pid %s; writing new lock" % (lockfile, pidfile_pid)) # the pidfile didn't exist or was stale, so grab a new lock pidfile.truncate(0) pidfile.write("%d\n" % os.getpid()) pidfile.close() # should be entirely unecessary, but paranoia always served me well confirm_lock(lockfile) return True | 92643f48d0ca124ff21dcb6607a2650036792d4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/92643f48d0ca124ff21dcb6607a2650036792d4e/pidfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
739,
12,
739,
768,
4672,
3536,
10000,
281,
358,
1045,
279,
2176,
768,
4191,
326,
783,
4231,
18,
225,
25209,
87,
309,
326,
2176,
768,
1818,
1914,
326,
4231,
434,
279,
3549,
120... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
739,
12,
739,
768,
4672,
3536,
10000,
281,
358,
1045,
279,
2176,
768,
4191,
326,
783,
4231,
18,
225,
25209,
87,
309,
326,
2176,
768,
1818,
1914,
326,
4231,
434,
279,
3549,
120... |
b = bytearray() self.assertEqual(type(b), bytearray) self.assertEqual(b.__class__, bytearray) | b = self.type2test() self.assertEqual(type(b), self.type2test) self.assertEqual(b.__class__, self.type2test) | def test_basics(self): b = bytearray() self.assertEqual(type(b), bytearray) self.assertEqual(b.__class__, bytearray) | 510711d598f1432afb021a01c2457b14334c6157 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/510711d598f1432afb021a01c2457b14334c6157/test_bytes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9157,
2102,
12,
2890,
4672,
324,
273,
14552,
1435,
365,
18,
11231,
5812,
12,
723,
12,
70,
3631,
14552,
13,
365,
18,
11231,
5812,
12,
70,
16186,
1106,
972,
16,
14552,
13,
2,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9157,
2102,
12,
2890,
4672,
324,
273,
14552,
1435,
365,
18,
11231,
5812,
12,
723,
12,
70,
3631,
14552,
13,
365,
18,
11231,
5812,
12,
70,
16186,
1106,
972,
16,
14552,
13,
2,
... |
help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Avaiable\'.\n When the picking it done the state is \'Done\'.\ | help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Available\'.\n When the picking is done the state is \'Done\'.\ | def _check_product_lot(self, cr, uid, ids): """ Checks whether move is done or not and production lot is assigned to that move. @return: True or False """ for move in self.browse(cr, uid, ids): if move.prodlot_id and move.state == 'done' and (move.prodlot_id.product_id.id != move.product_id.id): return False return True | 164e463c97d9110ef08efa5f1bf8319ad62188ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/164e463c97d9110ef08efa5f1bf8319ad62188ec/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
5896,
67,
23372,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
4672,
3536,
13074,
2856,
3635,
353,
2731,
578,
486,
471,
12449,
17417,
353,
6958,
358,
716,
3635,
18,
632,
2463,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1893,
67,
5896,
67,
23372,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
4672,
3536,
13074,
2856,
3635,
353,
2731,
578,
486,
471,
12449,
17417,
353,
6958,
358,
716,
3635,
18,
632,
2463,
... |
Return the intersection of self and X. | Return the xor of self and X. | def __xor__(self, X): """ Return the intersection of self and X. """ return self.intersection(X) | 192a1a6deaea5969b378dace0806336f1ff07a00 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/192a1a6deaea5969b378dace0806336f1ff07a00/set.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31346,
972,
12,
2890,
16,
1139,
4672,
3536,
2000,
326,
17586,
434,
365,
471,
1139,
18,
3536,
327,
365,
18,
30231,
12,
60,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31346,
972,
12,
2890,
16,
1139,
4672,
3536,
2000,
326,
17586,
434,
365,
471,
1139,
18,
3536,
327,
365,
18,
30231,
12,
60,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if (DEBUGLEVEL > 1): | if (cfg_webalert_debug_level > 1): | def send_email(fromaddr, toaddr, body, attempt=0): if attempt > 2: log('error sending email to %s: SMTP error; gave up after 3 attempts' % toaddr) return try: server = smtplib.SMTP('localhost') if DEBUGLEVEL > 2: server.set_debuglevel(1) else: server.set_debuglevel(0) server.sendmail(fromaddr, toaddr, body) server.quit() except: if (DEBUGLEVEL > 1): print 'Error connecting to SMTP server, attempt %s retrying in 5 minutes. Exception raised: %s' % (attempt, sys.exc_info()[0]) sleep(300) send_email(fromaddr, toaddr, body, attempt+1) return | 4fd01212b0b6dbfa56793eba65cfa032cbf36bc9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/4fd01212b0b6dbfa56793eba65cfa032cbf36bc9/alert_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
3652,
12,
2080,
4793,
16,
358,
4793,
16,
1417,
16,
4395,
33,
20,
4672,
225,
309,
4395,
405,
576,
30,
613,
2668,
1636,
5431,
2699,
358,
738,
87,
30,
18102,
555,
31,
314,
836... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
3652,
12,
2080,
4793,
16,
358,
4793,
16,
1417,
16,
4395,
33,
20,
4672,
225,
309,
4395,
405,
576,
30,
613,
2668,
1636,
5431,
2699,
358,
738,
87,
30,
18102,
555,
31,
314,
836... |
option_parser.add_option('', '--port', default='0', type='int', help='Port used by the server. If unspecified, the ' 'server will listen on an ephemeral port.') | option_parser.add_option('', '--port', default='8888', type='int', help='Port used by the server.') | def main(options, args): logfile = open('testserver.log', 'w') sys.stdout = FileMultiplexer(sys.stdout, logfile) sys.stderr = FileMultiplexer(sys.stderr, logfile) port = options.port if options.server_type == SERVER_HTTP: if options.cert: # let's make sure the cert file exists. if not os.path.isfile(options.cert): print 'specified server cert file not found: ' + options.cert + \ ' exiting...' return for ca_cert in options.ssl_client_ca: if not os.path.isfile(ca_cert): print 'specified trusted client CA file not found: ' + ca_cert + \ ' exiting...' return server = HTTPSServer(('127.0.0.1', port), TestPageHandler, options.cert, options.ssl_client_auth, options.ssl_client_ca, options.ssl_bulk_cipher) print 'HTTPS server started on port %d...' % server.server_port else: server = StoppableHTTPServer(('127.0.0.1', port), TestPageHandler) print 'HTTP server started on port %d...' % server.server_port server.data_dir = MakeDataDir() server.file_root_url = options.file_root_url server._sync_handler = None listen_port = server.server_port # means FTP Server else: my_data_dir = MakeDataDir() # Instantiate a dummy authorizer for managing 'virtual' users authorizer = pyftpdlib.ftpserver.DummyAuthorizer() # Define a new user having full r/w permissions and a read-only # anonymous user authorizer.add_user('chrome', 'chrome', my_data_dir, perm='elradfmw') authorizer.add_anonymous(my_data_dir) # Instantiate FTP handler class ftp_handler = pyftpdlib.ftpserver.FTPHandler ftp_handler.authorizer = authorizer # Define a customized banner (string returned when client connects) ftp_handler.banner = ("pyftpdlib %s based ftpd ready." % pyftpdlib.ftpserver.__ver__) # Instantiate FTP server class and listen to 127.0.0.1:port address = ('127.0.0.1', port) server = pyftpdlib.ftpserver.FTPServer(address, ftp_handler) listen_port = server.socket.getsockname()[1] print 'FTP server started on port %d...' % listen_port # Notify the parent that we've started. (BaseServer subclasses # bind their sockets on construction.) if options.startup_pipe is not None: if sys.platform == 'win32': fd = msvcrt.open_osfhandle(options.startup_pipe, 0) else: fd = options.startup_pipe startup_pipe = os.fdopen(fd, "w") # Write the listening port as a 2 byte value. This is _not_ using # network byte ordering since the other end of the pipe is on the same # machine. startup_pipe.write(struct.pack('@H', listen_port)) startup_pipe.close() try: server.serve_forever() except KeyboardInterrupt: print 'shutting down server' server.stop = True | 522629f43c7366bce97db14bb044e8884f1b048d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/522629f43c7366bce97db14bb044e8884f1b048d/testserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2116,
16,
833,
4672,
15204,
273,
1696,
2668,
3813,
3567,
18,
1330,
2187,
296,
91,
6134,
2589,
18,
10283,
273,
1387,
8438,
92,
264,
12,
9499,
18,
10283,
16,
15204,
13,
2589,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2116,
16,
833,
4672,
15204,
273,
1696,
2668,
3813,
3567,
18,
1330,
2187,
296,
91,
6134,
2589,
18,
10283,
273,
1387,
8438,
92,
264,
12,
9499,
18,
10283,
16,
15204,
13,
2589,
1... |
success, exitCode = self.parseFinalReport(reportfilename, job) | success = self.parseFinalReport(reportfilename, job) | def performOutputProcessing(self, job): """ __performOutputProcessing__ """ | 2b2f983d6d883cd12fd3a93706b5c39516482b44 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/2b2f983d6d883cd12fd3a93706b5c39516482b44/JobHandling.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
1447,
7798,
12,
2890,
16,
1719,
4672,
3536,
1001,
16092,
1447,
7798,
972,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
1447,
7798,
12,
2890,
16,
1719,
4672,
3536,
1001,
16092,
1447,
7798,
972,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
The request should be stored in self.raw_request; the results | The request should be stored in self.raw_requestline; the results | def parse_request(self): """Parse a request (internal). | 5d448ebac974d5bb884ea925238822330ec00ebe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/5d448ebac974d5bb884ea925238822330ec00ebe/BaseHTTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
2293,
12,
2890,
4672,
3536,
3201,
279,
590,
261,
7236,
2934,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
2293,
12,
2890,
4672,
3536,
3201,
279,
590,
261,
7236,
2934,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
poll_fun (timeout, map) | poll_fun(timeout, map) | def loop (timeout=30.0, use_poll=0, map=None): if map is None: map = socket_map if use_poll: if hasattr (select, 'poll'): poll_fun = poll3 else: poll_fun = poll2 else: poll_fun = poll while map: poll_fun (timeout, map) | 52c4de7c23c31563e4f0316b68865e17bb8c0f33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/52c4de7c23c31563e4f0316b68865e17bb8c0f33/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2798,
261,
4538,
33,
5082,
18,
20,
16,
999,
67,
13835,
33,
20,
16,
852,
33,
7036,
4672,
309,
852,
353,
599,
30,
852,
273,
2987,
67,
1458,
225,
309,
999,
67,
13835,
30,
309,
3859,
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,
2798,
261,
4538,
33,
5082,
18,
20,
16,
999,
67,
13835,
33,
20,
16,
852,
33,
7036,
4672,
309,
852,
353,
599,
30,
852,
273,
2987,
67,
1458,
225,
309,
999,
67,
13835,
30,
309,
3859,
2... |
raise TypeError('%r is a built-in module' % object) | raise TypeError('{!r} is a built-in module'.format(object)) | def getfile(object): """Work out which source or compiled file an object was defined in.""" if ismodule(object): if hasattr(object, '__file__'): return object.__file__ raise TypeError('%r is a built-in module' % object) if isclass(object): object = sys.modules.get(object.__module__) if hasattr(object, '__file__'): return object.__file__ raise TypeError('%r is a built-in class' % object) if ismethod(object): object = object.im_func if isfunction(object): object = object.func_code if istraceback(object): object = object.tb_frame if isframe(object): object = object.f_code if iscode(object): return object.co_filename raise TypeError('%r is not a module, class, method, ' 'function, traceback, frame, or code object' % object) | 17e7dd35cf6285fc4ab802d08c9c1791f6e24e06 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/17e7dd35cf6285fc4ab802d08c9c1791f6e24e06/inspect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
768,
12,
1612,
4672,
3536,
2421,
596,
1492,
1084,
578,
7743,
585,
392,
733,
1703,
2553,
316,
12123,
309,
353,
2978,
12,
1612,
4672,
309,
3859,
12,
1612,
16,
4940,
768,
7250,
4672,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
768,
12,
1612,
4672,
3536,
2421,
596,
1492,
1084,
578,
7743,
585,
392,
733,
1703,
2553,
316,
12123,
309,
353,
2978,
12,
1612,
4672,
309,
3859,
12,
1612,
16,
4940,
768,
7250,
4672,
... |
res[r] = None | res[r] = False | def _fnct_read(self2, self, cr, uid, ids, prop, val, context={}): property = self.pool.get('ir.property') definition_id = self2._field_get(self, cr, uid, prop) | c1c8fe64545c9fe903823a1daf2a411bf62ee8f9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/c1c8fe64545c9fe903823a1daf2a411bf62ee8f9/fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4293,
299,
67,
896,
12,
2890,
22,
16,
365,
16,
4422,
16,
4555,
16,
3258,
16,
2270,
16,
1244,
16,
819,
12938,
4672,
1272,
273,
365,
18,
6011,
18,
588,
2668,
481,
18,
4468,
6134,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4293,
299,
67,
896,
12,
2890,
22,
16,
365,
16,
4422,
16,
4555,
16,
3258,
16,
2270,
16,
1244,
16,
819,
12938,
4672,
1272,
273,
365,
18,
6011,
18,
588,
2668,
481,
18,
4468,
6134,
... |
sage: len(list(I.invertible_residues_mod_units([]))) == I.euler_phi() | sage: len(list(I.invertible_residues_mod([]))) == I.euler_phi() | def invertible_residues_mod_units(self, units=[], reduce=True): """ Returns a iterator through a list of invertible residues modulo this integral ideal and modulo the group generated by the given units. | 0eb4070e28a5423ec6b12fc4236fdfa03b4e3060 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/0eb4070e28a5423ec6b12fc4236fdfa03b4e3060/number_field_ideal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9848,
1523,
67,
15567,
3610,
67,
1711,
67,
7705,
12,
2890,
16,
4971,
22850,
6487,
5459,
33,
5510,
4672,
3536,
2860,
279,
2775,
3059,
279,
666,
434,
9848,
1523,
25435,
26109,
333,
21423,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9848,
1523,
67,
15567,
3610,
67,
1711,
67,
7705,
12,
2890,
16,
4971,
22850,
6487,
5459,
33,
5510,
4672,
3536,
2860,
279,
2775,
3059,
279,
666,
434,
9848,
1523,
25435,
26109,
333,
21423,
... |
print key.rjust(20),':',str(self.prefs[key]).ljust(40) def setAxes(self,axes): self.ax_contain = axes | print key.rjust( 20 ), ':', str( self.prefs[key] ).ljust( 40 ) def setAxes( self, axes ): self.ax_contain = axes | def dumpPrefs(self): for key in self.prefs: print key.rjust(20),':',str(self.prefs[key]).ljust(40) | 34ec1e9add6e7beaae414fa998b4771d25b40ccb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/34ec1e9add6e7beaae414fa998b4771d25b40ccb/PlotBase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
1386,
2556,
12,
2890,
4672,
225,
364,
498,
316,
365,
18,
1484,
2556,
30,
1172,
498,
18,
86,
3732,
12,
3462,
3631,
4278,
2187,
701,
12,
2890,
18,
1484,
2556,
63,
856,
65,
2934,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
1386,
2556,
12,
2890,
4672,
225,
364,
498,
316,
365,
18,
1484,
2556,
30,
1172,
498,
18,
86,
3732,
12,
3462,
3631,
4278,
2187,
701,
12,
2890,
18,
1484,
2556,
63,
856,
65,
2934,
... |
pmass.append(readu(f, precision, num)) | pmass.append(mass_block[offset:offset+num]) offset += num | def read_snapshot_file(filename, physical=False, ics=False, cooling=False): """ Reads a binary gadget file """ f = open(filename, mode='rb') res = {} # dictionary to hold data # read the header header = read_header(f) nparts = header['npart'] masses = header['mass'] print 'Particles', nparts print 'Masses', masses total = nparts.sum() print 'Total particles', total if header['flag_doubleprecision']: precision = float64 else: precision = float32 pos = readu(f, precision, total * 3).reshape((total, 3)) vel = readu(f, precision, total * 3).reshape((total, 3)) id = readIDs(f, total) pmass = [] for mass, num in zip(masses, nparts): if num > 0: if mass == 0: pmass.append(readu(f, precision, num)) else: pmass.append(mass) else: pmass.append(0) ngas = nparts[0] if ngas > 0: res['therm'] = readu(f, float32, ngas) if not ics: res['rho'] = readu(f, float32, ngas) if cooling: res['Ne'] = readu(f, float32, ngas) if cooling: res['NHI'] = readu(f, float32, ngas) res['NHeI'] = readu(f, float32, ngas) res['NHeIII'] = readu(f, float32, ngas) if not ics: res['sml'] = readu(f, float32, ngas) else: res['sml'] = 0.0 h = header['hubble0'] z = header['redshift'] lunit = 1.0 / h # Mpc munit = 1.e10 / h vunit = np.sqrt(1.0 / (1 + z)) * 1.e5 / km # km/s print ' units: I assume that lunit=Mpc/h, munit=10^10 modot0/h, v_unit=km/s ' if physical: print ' converting to physical Mpc, km/s, M_odot, g/cm^3' pos = pos * lunit / (1 + z) if ngas > 0: res['sml'] = res['sml'] * lunit / (1. + z) res['rho'] = res['rho'] * munit / (lunit * mpc / (1 + z)) ** 3.0 * msun res['therm'] = res['therm'] * vunit ** 2 * (1 + z) vel = vel * vunit / np.sqrt(1 + z) mass = mass * munit pmass = [p * munit for p in pmass] munit = msun lunit = mpc vunit = km f.close() res['pos'] = pos res['vel'] = vel res['mass'] = pmass res['id'] = id return header, res | 2d8df83fb02231fc57f56ae0a8d20d9d8977c14c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10299/2d8df83fb02231fc57f56ae0a8d20d9d8977c14c/binary_snapshot_io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
11171,
67,
768,
12,
3459,
16,
11640,
33,
8381,
16,
277,
2143,
33,
8381,
16,
27367,
310,
33,
8381,
4672,
3536,
29185,
279,
3112,
314,
361,
588,
585,
3536,
284,
273,
1696,
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,
855,
67,
11171,
67,
768,
12,
3459,
16,
11640,
33,
8381,
16,
277,
2143,
33,
8381,
16,
27367,
310,
33,
8381,
4672,
3536,
29185,
279,
3112,
314,
361,
588,
585,
3536,
284,
273,
1696,
12,
... |
if column == 'reduced_bank_chisq': | if column == 'reduced_bank_chisq': | def get_column(self,column): if column == 'reduced_bank_chisq': return self.get_reduced_bank_chisq() if column == 'reduced_cont_chisq': return self.get_reduced_cont_chisq() if column == 'effective_snr': return self.get_effective_snr() if column == 'snr_over_chi': return self.get_snr_over_chi() elif column == 'chirp_distance': return self.get_chirp_dist() else: return self.getColumnByName(column).asarray() | 844537a3df432e45a96028c15f89fb615f2ab421 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3589/844537a3df432e45a96028c15f89fb615f2ab421/lsctables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2827,
12,
2890,
16,
2827,
4672,
309,
1057,
422,
296,
1118,
26372,
67,
10546,
67,
343,
291,
85,
4278,
327,
365,
18,
588,
67,
1118,
26372,
67,
10546,
67,
343,
291,
85,
1435,
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,
336,
67,
2827,
12,
2890,
16,
2827,
4672,
309,
1057,
422,
296,
1118,
26372,
67,
10546,
67,
343,
291,
85,
4278,
327,
365,
18,
588,
67,
1118,
26372,
67,
10546,
67,
343,
291,
85,
1435,
3... |
this_dir = os.path.dirname(__file__) | this_dir = os.path.dirname(__file__) or os.curdir | def testOpenDir(self): this_dir = os.path.dirname(__file__) for mode in (None, "w"): try: if mode: f = open(this_dir, mode) else: f = open(this_dir) except IOError as e: self.assertEqual(e.filename, this_dir) else: self.fail("opening a directory didn't raise an IOError") | 0475bb4480174b6707ba1c533f835d9490a435a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/0475bb4480174b6707ba1c533f835d9490a435a8/test_file2k.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3678,
1621,
12,
2890,
4672,
333,
67,
1214,
273,
1140,
18,
803,
18,
12287,
12,
972,
768,
972,
13,
578,
1140,
18,
1397,
1214,
364,
1965,
316,
261,
7036,
16,
315,
91,
6,
4672,
775... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3678,
1621,
12,
2890,
4672,
333,
67,
1214,
273,
1140,
18,
803,
18,
12287,
12,
972,
768,
972,
13,
578,
1140,
18,
1397,
1214,
364,
1965,
316,
261,
7036,
16,
315,
91,
6,
4672,
775... |
x0 -= spacing x0 -= word_size | x0 -= spacing - word_size | def drawstringframedsoft(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top', layer=None, ellipses='...'): | f9be34fe6bf36d18d76b59cccedd089b5c4584eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/f9be34fe6bf36d18d76b59cccedd089b5c4584eb/osd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
1080,
74,
1940,
329,
9269,
12,
2890,
16,
533,
16,
619,
16,
677,
16,
1835,
16,
2072,
16,
10186,
3266,
33,
7036,
16,
31509,
33,
7036,
16,
3512,
33,
7036,
16,
5818,
1467,
33,
20,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
1080,
74,
1940,
329,
9269,
12,
2890,
16,
533,
16,
619,
16,
677,
16,
1835,
16,
2072,
16,
10186,
3266,
33,
7036,
16,
31509,
33,
7036,
16,
3512,
33,
7036,
16,
5818,
1467,
33,
20,
... |
and self.site.language() in botList[self.site.family.name]: botListPageTitle = wikipedia.translate(self.site.language(), botList) botListPage = wikipedia.Page(self.site, botListPageTitle) for linkedPage in botListPage.linkedPages(): if linkedPage.titleWithoutNamespace() == self.username: return True | and self.site.language() in botList[self.site.family.name]: botListPageTitle, botTemplate = botList[self.site.family.name][self.site.language()] botListPage = pywikibot.Page(self.site, botListPageTitle) if botTemplate: for template in botListPage.templatesWithParams(): if template[0] == botTemplate \ and template[1][0] == self.username: return True else: for linkedPage in botListPage.linkedPages(): if linkedPage.titleWithoutNamespace() == self.username: return True | def botAllowed(self): """ Checks whether the bot is listed on a specific page to comply with the policy on the respective wiki. """ if self.site.family.name in botList \ and self.site.language() in botList[self.site.family.name]: botListPageTitle = wikipedia.translate(self.site.language(), botList) botListPage = wikipedia.Page(self.site, botListPageTitle) for linkedPage in botListPage.linkedPages(): if linkedPage.titleWithoutNamespace() == self.username: return True return False else: # No bot policies on other return True | 608981a1811e769d811dd6211e35a67e7339add5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/608981a1811e769d811dd6211e35a67e7339add5/login.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2512,
5042,
12,
2890,
4672,
3536,
13074,
2856,
326,
2512,
353,
12889,
603,
279,
2923,
1363,
358,
532,
1283,
598,
326,
3329,
603,
326,
17613,
9050,
18,
3536,
309,
365,
18,
4256,
18,
9309,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2512,
5042,
12,
2890,
4672,
3536,
13074,
2856,
326,
2512,
353,
12889,
603,
279,
2923,
1363,
358,
532,
1283,
598,
326,
3329,
603,
326,
17613,
9050,
18,
3536,
309,
365,
18,
4256,
18,
9309,... |
warned_names.add(pkg.name) | warned_nas.add((pkg.name, pkg.arch)) | def downgrade(self, po=None, **kwargs): """ Try to downgrade a package. Works like: % yum shell <<EOL remove abcd install abcd-<old-version> run EOL """ | 9fbb21beef647848564f1801d07819cd7dc1ca5c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5445/9fbb21beef647848564f1801d07819cd7dc1ca5c/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2588,
3994,
12,
2890,
16,
8275,
33,
7036,
16,
2826,
4333,
4672,
3536,
6161,
358,
2588,
3994,
279,
2181,
18,
4147,
87,
3007,
30,
738,
677,
379,
5972,
2296,
5842,
1206,
225,
1223,
4315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2588,
3994,
12,
2890,
16,
8275,
33,
7036,
16,
2826,
4333,
4672,
3536,
6161,
358,
2588,
3994,
279,
2181,
18,
4147,
87,
3007,
30,
738,
677,
379,
5972,
2296,
5842,
1206,
225,
1223,
4315,
... |
for pofile in glob.glob ("*.po"): lang = pofile[:-3] mofile = os.path.join ("%s.mo" % lang) | files = get_files() for pofile in files: mofile = "%s.mo" % pofile[:-3] | def build_catalogs(): for pofile in glob.glob ("*.po"): lang = pofile[:-3] mofile = os.path.join ("%s.mo" % lang) os.system("msgfmt %s -o %s" % (pofile, mofile)) | 5b2e4c2347abd9b5c32ec3ef439b29dfd99a8538 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/5b2e4c2347abd9b5c32ec3ef439b29dfd99a8538/import-translations.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
2574,
287,
14072,
13332,
1390,
273,
336,
67,
2354,
1435,
364,
8275,
768,
316,
1390,
30,
7344,
768,
273,
2213,
87,
18,
8683,
6,
738,
8275,
768,
10531,
17,
23,
65,
1140,
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,
1361,
67,
2574,
287,
14072,
13332,
1390,
273,
336,
67,
2354,
1435,
364,
8275,
768,
316,
1390,
30,
7344,
768,
273,
2213,
87,
18,
8683,
6,
738,
8275,
768,
10531,
17,
23,
65,
1140,
18,
... |
if not msg.is_multipart() and msg.get_type('text/plain') == 'text/plain': | mcset = msg.get_param('charset', 'us-ascii') lcset = Utils.GetCharSet(mlist.preferred_language) msgtype = msg.get_type('text/plain') if not msg.is_multipart() and msgtype == 'text/plain' and mcset == lcset: | def process(mlist, msg, msgdata): if msgdata.get('isdigest'): # Digests already have their own header and footer return d = {} if msgdata.get('personalized'): # Calculate the extra personalization dictionary. Note that the # length of the recips list better be exactly 1. recips = msgdata.get('recips') assert type(recips) == ListType and len(recips) == 1 member = recips[0].lower() d['user_address'] = member try: d['user_delivered_to'] = mlist.getMemberCPAddress(member) # BAW: Hmm, should we allow this? d['user_password'] = mlist.getMemberPassword(member) d['user_language'] = mlist.getMemberLanguage(member) d['user_name'] = mlist.getMemberName(member) or _('not available') d['user_optionsurl'] = mlist.GetOptionsURL(member) except Errors.NotAMemberError: pass header = decorate(mlist, mlist.msg_header, _('non-digest header'), d) footer = decorate(mlist, mlist.msg_footer, _('non-digest footer'), d) # Be MIME smart here. We only attach the header and footer by # concatenation when the message is a non-multipart of type text/plain. # Otherwise, if it is not a multipart, we make it a multipart, and then we # add the header and footer as text/plain parts. if not msg.is_multipart() and msg.get_type('text/plain') == 'text/plain': payload = header + msg.get_payload() + footer msg.set_payload(payload) elif msg.get_type() == 'multipart/mixed': # The next easiest thing to do is just prepend the header and append # the footer as additional subparts mimehdr = MIMEText(header) mimeftr = MIMEText(footer) payload = msg.get_payload() if not isinstance(payload, ListType): payload = [payload] payload.append(mimeftr) payload.insert(0, mimehdr) msg.set_payload(payload) elif msg.get_main_type() <> 'multipart': # Okay, we've got some 'image/*' or 'audio/*' -like type. For now, we # simply refuse to add headers and footers to this message. BAW: # still trying to decide what the Right Thing To Do is. pass else: # Now we've got some multipart/* that's not a multipart/mixed. I'm # even less sure about what to do here, so once again, let's not add # headers or footers for now. pass | 70782d6fa746f089b80aebad4336dcddccd29d2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/70782d6fa746f089b80aebad4336dcddccd29d2d/Decorate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
781,
376,
16,
1234,
16,
1234,
892,
4672,
309,
1234,
892,
18,
588,
2668,
291,
10171,
11,
4672,
468,
15864,
87,
1818,
1240,
3675,
4953,
1446,
471,
9860,
327,
302,
273,
2618,
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,
1207,
12,
781,
376,
16,
1234,
16,
1234,
892,
4672,
309,
1234,
892,
18,
588,
2668,
291,
10171,
11,
4672,
468,
15864,
87,
1818,
1240,
3675,
4953,
1446,
471,
9860,
327,
302,
273,
2618,
30... |
if os.access("ssl_cert.pem", os.F_OK): cert_file = "ssl_cert.pem" elif os.access("./Lib/test/ssl_cert.pem", os.F_OK): cert_file = "./Lib/test/ssl_cert.pem" else: raise ValueError("No cert file found!") if os.access("ssl_key.pem", os.F_OK): key_file = "ssl_key.pem" elif os.access("./Lib/test/ssl_key.pem", os.F_OK): key_file = "./Lib/test/ssl_key.pem" else: raise ValueError("No cert file found!") | curdir = os.path.dirname(__file__) or os.curdir cert_file = os.path.join(curdir, "ssl_cert.pem") if not os.access(cert_file, os.F_OK): raise ValueError("No cert file found! (tried %r)" % cert_file) key_file = os.path.join(curdir, "ssl_key.pem") if not os.access(key_file, os.F_OK): raise ValueError("No key file found! (tried %r)" % key_file) | def _external(self): if os.access("ssl_cert.pem", os.F_OK): cert_file = "ssl_cert.pem" elif os.access("./Lib/test/ssl_cert.pem", os.F_OK): cert_file = "./Lib/test/ssl_cert.pem" else: raise ValueError("No cert file found!") if os.access("ssl_key.pem", os.F_OK): key_file = "ssl_key.pem" elif os.access("./Lib/test/ssl_key.pem", os.F_OK): key_file = "./Lib/test/ssl_key.pem" else: raise ValueError("No cert file found!") | 629de81291ef3389293e6f67f206300947bf1ac7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/629de81291ef3389293e6f67f206300947bf1ac7/test_socket_ssl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9375,
12,
2890,
4672,
309,
1140,
18,
3860,
2932,
8157,
67,
7593,
18,
20313,
3113,
1140,
18,
42,
67,
3141,
4672,
3320,
67,
768,
273,
315,
8157,
67,
7593,
18,
20313,
6,
1327,
1140,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9375,
12,
2890,
4672,
309,
1140,
18,
3860,
2932,
8157,
67,
7593,
18,
20313,
3113,
1140,
18,
42,
67,
3141,
4672,
3320,
67,
768,
273,
315,
8157,
67,
7593,
18,
20313,
6,
1327,
1140,
... |
if value.startswith("0"): | if value.startswith("0") or value.startswith("-0"): | def ParseEDSFile(filepath): eds_dict = {} # Read file text eds_file = open(filepath,'r').read() sections = ExtractSections(eds_file) # Parse assignments for each section for section_name, assignments in sections: # Reset values of entry values = {} # Search if the section name match an index or subindex expression index_result = index_model.match(section_name.upper()) subindex_result = subindex_model.match(section_name.upper()) # Compilation of the EDS information dictionary is_entry = False # First case, section name is in SECTION_KEYNAMES if section_name.upper() in SECTION_KEYNAMES: # Verify that entry is not already defined if section_name.upper() not in eds_dict: eds_dict[section_name.upper()] = values else: raise SyntaxError, "\"[%s]\" section is defined two times"%section_name # Second case, section name is a subindex name elif subindex_result: # Extract index and subindex number index, subindex = [int(value, 16) for value in subindex_result.groups()] # If index hasn't been referenced before, we add an entry into the dictionary # that will be updated later if index not in eds_dict: eds_dict[index] = {"subindexes" : {}} if subindex not in eds_dict[index]["subindexes"]: eds_dict[index]["subindexes"][subindex] = values else: raise SyntaxError, "\"[%s]\" section is defined two times"%section_name is_entry = True # Third case, section name is an index name elif index_result: # Extract index number index = int(index_result.groups()[0], 16) # If index hasn't been referenced before, we add an entry into the dictionary if index not in eds_dict: eds_dict[index] = values eds_dict[index]["subindexes"] = {} elif eds_dict[index].keys() == ["subindexes"]: values["subindexes"] = eds_dict[index]["subindexes"] eds_dict[index] = values else: raise SyntaxError, "\"[%s]\" section is defined two times"%section_name is_entry = True # In any other case, there is a syntax problem into EDS file else: raise SyntaxError, "Section \"[%s]\" is unrecognized"%section_name for assignment in assignments: # Escape any comment if assignment.startswith(";"): pass # Verify that line is a valid assignment elif assignment.find('=') > 0: # Split assignment into the two values keyname and value keyname, value = assignment.split("=", 1) # keyname must be immediately followed by the "=" sign, so we # verify that there is no whitespace into keyname if keyname.isalnum(): # value can be preceded and followed by whitespaces, so we escape them value = value.strip() # First case, value starts with "$NODEID", then it's a formula if value.startswith("$NODEID"): try: test = int(value.replace("$NODEID+", ""), 16) computed_value = "\"%s\""%value except: raise SyntaxError, "\"%s\" is not a valid formula for attribute \"%s\" of section \"[%s]\""%(value, keyname, section_name) # Second case, value starts with "0x", then it's an hexadecimal value elif value.startswith("0x"): try: computed_value = int(value, 16) except: raise SyntaxError, "\"%s\" is not a valid value for attribute \"%s\" of section \"[%s]\""%(value, keyname, section_name) elif value.isdigit(): # Third case, value is a number and starts with "0", then it's an octal value if value.startswith("0"): computed_value = int(value, 8) # Forth case, value is a number and don't start with "0", then it's a decimal value else: computed_value = int(value) # In any other case, we keep string value else: computed_value = value # Add value to values dictionary if computed_value != "": # If entry is an index or a subindex if is_entry: # Verify that keyname is a possible attribute if keyname.upper() not in ENTRY_ATTRIBUTES: raise SyntaxError, "Keyname \"%s\" not recognised for section \"[%s]\""%(keyname, section_name) # Verify that value is valid elif not ENTRY_ATTRIBUTES[keyname.upper()](computed_value): raise SyntaxError, "Invalid value \"%s\" for keyname \"%s\" of section \"[%s]\""%(value, keyname, section_name) else: values[keyname.upper()] = computed_value else: values[keyname.upper()] = computed_value # All lines that are not empty and are neither a comment neither not a valid assignment elif assignment.strip() != "": raise SyntaxError, "\"%s\" is not a valid EDS line"%assignment.strip() # If entry is an index or a subindex if is_entry: # Verify that entry has an ObjectType if "OBJECTTYPE" in values.keys(): # Extract entry ObjectType objecttype = values["OBJECTTYPE"] else: # Set ObjectType to VAR by default objecttype = 7 # Extract parameters defined keys = Set(values.keys()) keys.discard("subindexes") # Extract possible parameters and parameters required possible = Set(ENTRY_TYPES[objecttype]["require"] + ENTRY_TYPES[objecttype]["optional"]) required = Set(ENTRY_TYPES[objecttype]["require"]) # Verify that parameters defined contains all the parameters required if not keys.issuperset(required): missing = required.difference(keys)._data.keys() if len(missing) > 1: attributes = "Attributes %s are"%", ".join(["\"%s\""%attribute for attribute in missing]) else: attributes = "Attribute \"%s\" is"%missing[0] raise SyntaxError, "Error on section \"[%s]\":\n%s required for a%s entry"%(section_name, attributes, ENTRY_TYPES[objecttype]["name"]) # Verify that parameters defined are all in the possible parameters if not keys.issubset(possible): unsupported = keys.difference(possible)._data.keys() if len(unsupported) > 1: attributes = "Attributes %s are"%", ".join(["\"%s\""%attribute for attribute in unsupported]) else: attributes = "Attribute \"%s\" is"%unsupported[0] raise SyntaxError, "Error on section \"[%s]\":\n%s unsupported for a%s entry"%(section_name, attributes, ENTRY_TYPES[objecttype]["name"]) if "DEFAULTVALUE" in values: try: if values["DATATYPE"] in (0x09, 0x0A, 0x0B, 0x0F): values["DEFAULTVALUE"] = str(values["DEFAULTVALUE"]) elif values["DATATYPE"] in (0x08, 0x11): values["DEFAULTVALUE"] = float(values["DEFAULTVALUE"]) elif values["DATATYPE"] == 0x01: values["DEFAULTVALUE"] = {0 : True, 1 : False}[values["DEFAULTVALUE"]] else: if type(values["DEFAULTVALUE"]) != IntType and values["DEFAULTVALUE"].find("$NODEID") == -1: raise except: raise SyntaxError, "Error on section \"[%s]\":\nDefaultValue incompatible with DataType"%section_name return eds_dict | 377e3b02a272798306727eecf174777a489d3f3d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/116/377e3b02a272798306727eecf174777a489d3f3d/eds_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
2056,
55,
812,
12,
10561,
4672,
1675,
87,
67,
1576,
273,
2618,
468,
2720,
585,
977,
1675,
87,
67,
768,
273,
1696,
12,
10561,
11189,
86,
16063,
896,
1435,
7178,
273,
8152,
15965,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
2056,
55,
812,
12,
10561,
4672,
1675,
87,
67,
1576,
273,
2618,
468,
2720,
585,
977,
1675,
87,
67,
768,
273,
1696,
12,
10561,
11189,
86,
16063,
896,
1435,
7178,
273,
8152,
15965,
... |
self.ver_cmd = self.f77_compiler + ' -version' | def __init__(self, fc = None, f90c = None): fortran_compiler_base.__init__(self) if fc is None: fc = 'f77' if f90c is None: f90c = 'f90' | b539116e300999ded6f418730cce709d9cf1f028 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/b539116e300999ded6f418730cce709d9cf1f028/build_flib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8036,
273,
599,
16,
284,
9349,
71,
273,
599,
4672,
364,
13171,
67,
9576,
67,
1969,
16186,
2738,
972,
12,
2890,
13,
309,
8036,
353,
599,
30,
8036,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8036,
273,
599,
16,
284,
9349,
71,
273,
599,
4672,
364,
13171,
67,
9576,
67,
1969,
16186,
2738,
972,
12,
2890,
13,
309,
8036,
353,
599,
30,
8036,
273,
... | |
regex = arg[7:] | regex = arg[12:] | def handleArg(self, arg): """Parse one argument at a time. | 0c9e1bdb7d8378145394c5c96e8983fd1ce25ea7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/0c9e1bdb7d8378145394c5c96e8983fd1ce25ea7/pagegenerators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
4117,
12,
2890,
16,
1501,
4672,
3536,
3201,
1245,
1237,
622,
279,
813,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
4117,
12,
2890,
16,
1501,
4672,
3536,
3201,
1245,
1237,
622,
279,
813,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print 'yview', `itop` | def fixfocus(near, itop): n = scanbox.size() for i in range(n): line = scanbox.get(`i`) if scanparser.match(line) >= 0: num = string.atoi(scanparser.group(1)) if num >= near: break else: i = 'end' scanbox.select_from(i) print 'yview', `itop` scanbox.yview(itop) | 3e70d03d4a83a74d4f00b9ce303291a1a355939f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/3e70d03d4a83a74d4f00b9ce303291a1a355939f/mbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
13923,
12,
27862,
16,
518,
556,
4672,
290,
273,
4135,
2147,
18,
1467,
1435,
364,
277,
316,
1048,
12,
82,
4672,
980,
273,
4135,
2147,
18,
588,
12,
68,
77,
24065,
309,
4135,
4288,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
13923,
12,
27862,
16,
518,
556,
4672,
290,
273,
4135,
2147,
18,
1467,
1435,
364,
277,
316,
1048,
12,
82,
4672,
980,
273,
4135,
2147,
18,
588,
12,
68,
77,
24065,
309,
4135,
4288,
... | |
if height is not None: attrib['fo:min-height'] = '%.2fcm' % (height, ) el1 = SubElement(el1, 'draw:text-box', attrib=attrib) attrib = {'text:style-name': 'rststyle-caption', } el1 = SubElement(el1, 'text:p', attrib=attrib) el2 = self.generate_image(node, source, destination, el1) if caption: el2.tail = caption def generate_image(self, node, source, destination, current_element): | el4 = SubElement(el3, 'draw:text-box', attrib=attrib) attrib = { 'text:style-name': 'rststyle-caption', } el5 = SubElement(el4, 'text:p', attrib=attrib) return el3, el5, caption def generate_image(self, node, source, destination, current_element, | def generate_figure(self, node, source, destination): caption = None for node1 in node.parent.children: if node1.tagname == 'caption': caption = node1.astext() self.image_style_count += 1 style_name = 'rstframestyle%d' % self.image_style_count if 'scale' in node.attributes: try: scale = int(node.attributes['scale']) if scale < 1 or scale > 100: raise ValueError scale = scale * 0.01 except ValueError, e: print 'Error: Invalid scale for image: "%s"' % ( node.attributes['scale'], ) else: scale = 1.0 width = None if 'width' in node.attributes: try: width = int(node.attributes['width']) width = width * (35.278 / 1000.0) width *= scale #attrib['svg:width'] = '%.2fcm' % (width, ) except ValueError, e: print 'Error: Invalid width for image: "%s"' % ( node.attributes['width'], ) height = None if 'height' in node.attributes: try: height = int(node.attributes['height']) height = height * (35.278 / 1000.0) height *= scale #attrib['svg:height'] = '%.2fcm' % (height, ) except ValueError, e: print 'Error: Invalid height for image: "%s"' % ( node.attributes['height'], ) # Add the styles attrib = { 'style:name': style_name, 'style:family': 'graphic', 'style:parent-style-name': 'Frame', } el1 = SubElement(self.automatic_styles, 'style:style', attrib=attrib, nsdict=SNSD) halign = 'center' valign = 'top' if 'align' in node.attributes: align = node.attributes['align'].split() for val in align: if val in ('left', 'center', 'right'): halign = val elif val in ('top', 'middle', 'bottom'): valign = val attrib = { 'fo:margin-left': '0cm', 'fo:margin-right': '0cm', 'fo:margin-top': '0cm', 'fo:margin-bottom': '0cm', 'style:wrap': 'dynamic', 'style:number-wrapped-paragraphs': 'no-limit', 'style:vertical-pos': valign, 'style:vertical-rel': 'paragraph', 'style:horizontal-pos': halign, 'style:horizontal-rel': 'paragraph', 'fo:padding': '0cm', 'fo:border': 'none', } #ipshell('At generate_figure') el2 = SubElement(el1, 'style:graphic-properties', attrib=attrib, nsdict=SNSD) # Add the content attrib = {'text:style-name': 'rststyle-textbody'} el1 = SubElement(self.current_element, 'text:p', attrib=attrib) attrib = { 'draw:style-name': style_name, 'draw:name': 'Frame1', 'text:anchor-type': 'paragraph', 'draw:z-index': '1', } if width is not None: attrib['svg:width'] = '%.2fcm' % (width, ) el1 = SubElement(el1, 'draw:frame', attrib=attrib) attrib = {} if height is not None: attrib['fo:min-height'] = '%.2fcm' % (height, ) el1 = SubElement(el1, 'draw:text-box', attrib=attrib) attrib = {'text:style-name': 'rststyle-caption', } el1 = SubElement(el1, 'text:p', attrib=attrib) # Add the image (frame) inside the figure/caption frame. #ipshell('At visit_image #1') el2 = self.generate_image(node, source, destination, el1) if caption: el2.tail = caption | 8f9c74628116346d2f6e669c6a41a3e179d554cb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5620/8f9c74628116346d2f6e669c6a41a3e179d554cb/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
19675,
12,
2890,
16,
756,
16,
1084,
16,
2929,
4672,
11006,
273,
599,
364,
756,
21,
316,
756,
18,
2938,
18,
5906,
30,
309,
756,
21,
18,
2692,
529,
422,
296,
15386,
4278,
110... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
19675,
12,
2890,
16,
756,
16,
1084,
16,
2929,
4672,
11006,
273,
599,
364,
756,
21,
316,
756,
18,
2938,
18,
5906,
30,
309,
756,
21,
18,
2692,
529,
422,
296,
15386,
4278,
110... |
dependencies = [] if 'depends' in packages[pkg]: dependencies.extend(parse_depends(packages[pkg]['depends'])) if 'pre-depends' in packages[pkg]: dependencies.extend(parse_depends(packages[pkg]['pre-depends'])) for p in dependencies: | register_reverses(pkg, packages, provides, check_doubles=False) return (packages, provides) def register_reverses(self, pkg, packages, provides, check_doubles=True, parse_depends=apt_pkg.ParseDepends): """Register reverse dependencies and conflicts for the specified package This method register the reverse dependencies and conflicts for a give package using `packages` as list of packages and `provides` as list of virtual packages. The method has an optional parameter parse_depends which is there just for performance reasons and is not meant to be overwritten. """ dependencies = [] if 'depends' in packages[pkg]: dependencies.extend(parse_depends(packages[pkg]['depends'])) if 'pre-depends' in packages[pkg]: dependencies.extend(parse_depends(packages[pkg]['pre-depends'])) for p in dependencies: for a in p: if a[0] in packages and (not check_doubles or pkg not in packages[a[0]]['rdepends']): packages[a[0]]['rdepends'].append(pkg) elif a[0] in provides: for i in provides[a[0]]: if i not in packages: continue if not check_doubles or pkg not in packages[i]['rdepends']: packages[i]['rdepends'].append(pkg) if 'conflicts' in packages[pkg]: for p in parse_depends(packages[pkg]['conflicts']): | def read_binaries(self, basedir, distribution, arch): """Read the list of binary packages from the specified directory The binary packages are read from the `Packages_${arch}' files within the directory specified as `basedir' parameter, replacing ${arch} with the value of the arch parameter. Considering the large amount of memory needed, not all the fields are loaded in memory. The available fields are Version, Source, Pre-Depends, Depends, Conflicts, Provides and Architecture. After reading the packages, reverse dependencies are computed and saved in the `rdepends' keys, and the `Provides' field is used to populate the virtual packages list. | b57aefed68ccf3a45d249459e90c513a8a777948 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2784/b57aefed68ccf3a45d249459e90c513a8a777948/britney.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
4757,
5646,
12,
2890,
16,
15573,
16,
7006,
16,
6637,
4672,
3536,
1994,
326,
666,
434,
3112,
5907,
628,
326,
1269,
1867,
225,
1021,
3112,
5907,
854,
855,
628,
326,
1375,
11425,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
4757,
5646,
12,
2890,
16,
15573,
16,
7006,
16,
6637,
4672,
3536,
1994,
326,
666,
434,
3112,
5907,
628,
326,
1269,
1867,
225,
1021,
3112,
5907,
854,
855,
628,
326,
1375,
11425,
... |
yield pspecs[i] | yield ctypes.cast(pspecs[i], ctypes.POINTER(GParamSpec)).contents | def object_class_list_properties(type_id): klass = _gobj.g_type_class_ref(type_id) n = ctypes.c_uint() pspecs = _gobj.g_object_class_list_properties(klass, ctypes.byref(n)) for i in range(n.value): yield pspecs[i] | 8c6447d4b0bbaa908ca6aa283e0ac05010496730 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2770/8c6447d4b0bbaa908ca6aa283e0ac05010496730/cgobject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
733,
67,
1106,
67,
1098,
67,
4738,
12,
723,
67,
350,
4672,
7352,
273,
389,
75,
2603,
18,
75,
67,
723,
67,
1106,
67,
1734,
12,
723,
67,
350,
13,
290,
273,
6983,
18,
71,
67,
11890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
733,
67,
1106,
67,
1098,
67,
4738,
12,
723,
67,
350,
4672,
7352,
273,
389,
75,
2603,
18,
75,
67,
723,
67,
1106,
67,
1734,
12,
723,
67,
350,
13,
290,
273,
6983,
18,
71,
67,
11890,
... |
req = "%s %s" % (req,self.buildCondition(selectDict)) return self._update(req,connection) def __getConnection(self,connection): | req = "%s %s" % ( req, self.buildCondition( selectDict ) ) return self._update( req, connection ) def __getConnection( self, connection ): | def __checkUpdate(self,table,param,paramValue,selectDict = {},connection=False): """ Check whether the update will perform an update """ req = "UPDATE %s SET %s = '%s'" % (table,param,paramValue) if selectDict: req = "%s %s" % (req,self.buildCondition(selectDict)) return self._update(req,connection) | 9ad007ea503b29694fc081c1646b7c5ecd07b1f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9ad007ea503b29694fc081c1646b7c5ecd07b1f2/TransformationDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1893,
1891,
12,
2890,
16,
2121,
16,
891,
16,
891,
620,
16,
4025,
5014,
273,
10615,
4071,
33,
8381,
4672,
3536,
2073,
2856,
326,
1089,
903,
3073,
392,
1089,
3536,
1111,
273,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1893,
1891,
12,
2890,
16,
2121,
16,
891,
16,
891,
620,
16,
4025,
5014,
273,
10615,
4071,
33,
8381,
4672,
3536,
2073,
2856,
326,
1089,
903,
3073,
392,
1089,
3536,
1111,
273,
315,
... |
if load_path is None: msg = "%s expects to live within a Chromium checkout" % sys.argv[0] raise Exception, "Error locating simplejson load path (%s)" % msg | def OnTestsLoad(): old_path = sys.path script_path = os.path.dirname(sys.argv[0]) load_path = None global simplejson # This test script should be stored in src/tools/perf_expectations/. That # directory will most commonly live in 2 locations: # # - a regular Chromium checkout, in which case src/third_party # is where to look for simplejson # # - a buildbot checkout, in which case .../pylibs is where # to look for simplejson # # Locate and install the correct path based on what we can find. # for path in ('../../../third_party', '../../../../../pylibs'): path = os.path.join(script_path, path) if os.path.exists(path) and os.path.isdir(path): load_path = os.path.abspath(path) break if load_path is None: msg = "%s expects to live within a Chromium checkout" % sys.argv[0] raise Exception, "Error locating simplejson load path (%s)" % msg # Try importing simplejson once. If this succeeds, we found it and will # load it again later properly. Fail if we cannot load it. sys.path.append(load_path) try: import simplejson as Simplejson simplejson = Simplejson except ImportError, e: msg = "%s expects to live within a Chromium checkout" % sys.argv[0] raise Exception, "Error trying to import simplejson from %s (%s)" % \ (load_path, msg) finally: sys.path = old_path return True | 1ea27af393fbc64d260b34a36b418e5eb5ea69ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/1ea27af393fbc64d260b34a36b418e5eb5ea69ac/PRESUBMIT.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
14650,
2563,
13332,
1592,
67,
803,
273,
2589,
18,
803,
2728,
67,
803,
273,
1140,
18,
803,
18,
12287,
12,
9499,
18,
19485,
63,
20,
5717,
1262,
67,
803,
273,
599,
2552,
4143,
1977,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
14650,
2563,
13332,
1592,
67,
803,
273,
2589,
18,
803,
2728,
67,
803,
273,
1140,
18,
803,
18,
12287,
12,
9499,
18,
19485,
63,
20,
5717,
1262,
67,
803,
273,
599,
2552,
4143,
1977,... | |
w2, h2 = self.bold_dc.GetTextExtent(bold) | self.SetFont(self.bold_font) w2, h2 = self.GetTextExtent(bold) | def _calcWidth(self, index): """Calculate the widths of an individual entry. This is an internally used method that recalculates the widths of all the parts of a single entry -- the non-bold part before a match, the bold part of the match itself, and the non-bold part that hasn't been matched yet. @param index: index number of the item """ height = 0 width = 0 text1, bold, text2 = self.getTextParts(index) if text1: try: w1, h1 = self.text_cache[text1] except KeyError: w1, h1 = self.GetTextExtent(text1) self.text_cache[text1] = (w1, h1) else: w1, h1 = 0, 0 if bold: try: w2, h2 = self.bold_cache[bold] except KeyError: w2, h2 = self.bold_dc.GetTextExtent(bold) self.bold_cache[bold] = (w2, h2) else: w2, h2 = 0, 0 if text2: try: w3, h3 = self.text_cache[text2] except KeyError: w3, h3 = self.GetTextExtent(text2) self.text_cache[text2] = (w3, h3) else: w3, h3 = 0, 0 total = w1 + w2 + w3 self.heights[index] = (max(h1, h2), h1, h2, h3) self.widths[index] = (total, w1, w2, w3) #print("_calcWidth: index=%d widths=%s" % (index, str(self.widths[index]))) if self.largest_width is None: self.calc_scroll = (text1, bold, w1, w2) self.largest_width = total elif self.largest_width >= 0: if text1 == self.calc_scroll[0] and bold == self.calc_scroll[1]: if total > self.largest_width: self.largest_width = total else: # found an entry that doesn't have the same prefix, so we can't # scroll the whole list self.largest_width = -1 #print("%d: largest_width=%d text1=%s bold=%s" % (index, self.largest_width, text1, bold)) | 7eb2d17ddd44f138a2c0af0bc5b3e33742798d01 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11522/7eb2d17ddd44f138a2c0af0bc5b3e33742798d01/textctrl_autocomplete.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12448,
2384,
12,
2890,
16,
770,
4672,
3536,
8695,
326,
15801,
434,
392,
7327,
1241,
18,
225,
1220,
353,
392,
12963,
1399,
707,
716,
283,
12780,
815,
326,
15801,
434,
777,
326,
2140,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12448,
2384,
12,
2890,
16,
770,
4672,
3536,
8695,
326,
15801,
434,
392,
7327,
1241,
18,
225,
1220,
353,
392,
12963,
1399,
707,
716,
283,
12780,
815,
326,
15801,
434,
777,
326,
2140,... |
cls.idle() | def emulate_typing(cls, string, ctrlFlag = False, altFlag = False, shiftFlag = False): """ emulate_typing the string into the current focused widget """ cls.idle() #experiment to see if this helps with bug 5109 success = True def set_event_info(event): # setup event info for a keypress event event.m_keyCode = keyCode event.m_rawCode = keyCode event.m_shiftDown = char.isupper() or shiftFlag event.m_controlDown = event.m_metaDown = ctrlFlag event.m_altDown = altFlag event.SetEventObject(widget) # for each key, check for specials, then try several approaches app = wx.GetApp() for char in string: keyCode = ord(char) if keyCode == wx.WXK_RETURN: cls.emulate_return() elif keyCode == wx.WXK_TAB: cls.emulate_tab(shiftFlag=shiftFlag) else: # in case the focus has changed, get the new focused widget widget = wx.Window_FindFocus() if widget is None: success = False else: # try calling any bound key handler keyPress = wx.KeyEvent(wx.wxEVT_KEY_DOWN) set_event_info(keyPress) downWorked = widget.ProcessEvent(keyPress) keyUp = wx.KeyEvent(wx.wxEVT_KEY_UP) set_event_info(keyUp) upWorked = widget.ProcessEvent(keyUp) if not (downWorked or upWorked): # key handler worked? # try calling EmulateKeyPress emulateMethod = getattr(widget, 'EmulateKeyPress', lambda k: False) if '__WXMSW__' in wx.PlatformInfo: emulateMethod = lambda k: False if not emulateMethod(keyPress): # emulate worked? # try calling WriteText writeMethod = getattr(widget, 'WriteText', None) if writeMethod: writeMethod(char) else: success = False # remember we had a failure if success: app.Yield() return success | a53b3695dbbda1afd7a5d003a09fbaa5b1b11c81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/a53b3695dbbda1afd7a5d003a09fbaa5b1b11c81/scripting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
801,
6243,
67,
12846,
310,
12,
6429,
16,
533,
16,
6414,
4678,
273,
1083,
16,
3770,
4678,
273,
1083,
16,
4654,
4678,
273,
1083,
4672,
3536,
801,
6243,
67,
12846,
310,
326,
533,
1368,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
801,
6243,
67,
12846,
310,
12,
6429,
16,
533,
16,
6414,
4678,
273,
1083,
16,
3770,
4678,
273,
1083,
16,
4654,
4678,
273,
1083,
4672,
3536,
801,
6243,
67,
12846,
310,
326,
533,
1368,
32... | |
def fix_makefile(makefile, m32): """Fix makefile for 64bit | def create_makefile64(makefile, m32): """Create and fix makefile for 64bit | def fix_makefile(makefile, m32): """Fix makefile for 64bit Replace 32 with 64bit directories """ if not os.path.isfile(m32): return with open(m32) as fin: with open(makefile, 'w') as fout: for line in fin: line = line.replace("=tmp32", "=tmp64") line = line.replace("=out32", "=out64") line = line.replace("=inc32", "=inc64") # force 64 bit machine line = line.replace("MKLIB=lib", "MKLIB=lib /MACHINE:X64") line = line.replace("LFLAGS=", "LFLAGS=/MACHINE:X64 ") # don't link against the lib on 64bit systems line = line.replace("bufferoverflowu.lib", "") fout.write(line) os.unlink(m32) | 0140b75d5d75363ed22eb6fceff48824d4079007 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/0140b75d5d75363ed22eb6fceff48824d4079007/build_ssl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
6540,
768,
1105,
12,
6540,
768,
16,
312,
1578,
4672,
3536,
1684,
471,
2917,
1221,
768,
364,
5178,
3682,
225,
6910,
3847,
598,
5178,
3682,
6402,
3536,
309,
486,
1140,
18,
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,
752,
67,
6540,
768,
1105,
12,
6540,
768,
16,
312,
1578,
4672,
3536,
1684,
471,
2917,
1221,
768,
364,
5178,
3682,
225,
6910,
3847,
598,
5178,
3682,
6402,
3536,
309,
486,
1140,
18,
803,
... |
if context.options.debug: | if context.debug: | def parse(self, context, operands): if context.mode == OpcodeType.EXTENDED and self.mnemonic not in context.opcodes[OpcodeType.EXTENDED]: self.context.error("missing EXTEND before extended instruction") return if self.operandType == OperandType.NONE: if operands != None: context.error("instruction takes no operand") else: context.currentRecord.code = [ self.opcode ] context.currentRecord.complete = True else: if operands == None: context.error("missing operand") else: if operands: expr = AddressExpression(context, operands) if expr.complete: pa = expr.value if pa < 0: # Relative address. context.currentRecord.code = [ (self.opcode + pa) & 077777 ] else: if context.options.debug: context.currentRecord.target = expr.value address = context.memmap.pseudoToAddress(pa) context.currentRecord.code = [ (self.opcode + address) & 077777 ] context.currentRecord.complete = True else: context.error("missing operand") | 66ea0d265abe99681f89b243d317913dd9e44bc3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8152/66ea0d265abe99681f89b243d317913dd9e44bc3/instruction.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
819,
16,
14883,
4672,
309,
819,
18,
3188,
422,
16424,
559,
18,
4142,
22088,
471,
365,
18,
13607,
20918,
486,
316,
819,
18,
556,
7000,
63,
22808,
559,
18,
4142,
2208... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
819,
16,
14883,
4672,
309,
819,
18,
3188,
422,
16424,
559,
18,
4142,
22088,
471,
365,
18,
13607,
20918,
486,
316,
819,
18,
556,
7000,
63,
22808,
559,
18,
4142,
2208... |
result=custom_default_report(self.id, result) | r=custom_default_report(self.id, result) | def manage_test(self, REQUEST): | dca09b6d006685feda031b3c8cf0d6b07e6f5f4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/dca09b6d006685feda031b3c8cf0d6b07e6f5f4e/DA.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
3813,
12,
2890,
16,
12492,
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,
10680,
67,
3813,
12,
2890,
16,
12492,
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,
-10... |
name=parmre.group(2) value=parmre.group(3) l=len(parmre.group(1)) else: return result | mo_p = parmre.match(text) if mo_p: l = len(mo_p.group(1)) name = mo_p.group(2) value = mo_p.group(3) else: return result | def parse_cookie(text, result=None, qparmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)="\([^"]*\)\"' '\([\0- ]*[;,]\)?[\0- ]*\)' ), parmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)=\([^\0- ;,\"]*\)' '\([\0- ]*[;,]\)?[\0- ]*\)' ), acquire=parse_cookie_lock.acquire, release=parse_cookie_lock.release, ): if result is None: result={} already_have=result.has_key acquire() try: if qparmre.match(text) >= 0: # Match quoted correct cookies name=qparmre.group(2) value=qparmre.group(3) l=len(qparmre.group(1)) elif parmre.match(text) >= 0: # Match evil MSIE cookies ;) name=parmre.group(2) value=parmre.group(3) l=len(parmre.group(1)) else: # this may be an invalid cookie. # We'll simply bail without raising an error # if the cookie is invalid. return result finally: release() if not already_have(name): result[name]=value return apply(parse_cookie,(text[l:],result)) | 4720da81224eff2e9d087649a90c6dd0c50e39e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4720da81224eff2e9d087649a90c6dd0c50e39e4/HTTPRequest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
8417,
12,
955,
16,
563,
33,
7036,
16,
1043,
1065,
81,
266,
33,
7584,
18,
11100,
12,
2337,
14026,
20,
17,
308,
4035,
2337,
19042,
20,
17,
274,
16,
5189,
26446,
13,
1546,
64,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
8417,
12,
955,
16,
563,
33,
7036,
16,
1043,
1065,
81,
266,
33,
7584,
18,
11100,
12,
2337,
14026,
20,
17,
308,
4035,
2337,
19042,
20,
17,
274,
16,
5189,
26446,
13,
1546,
64,... |
None | pass | def FindRegexMatchesInHeader(regex, filename, env = None): f = None if env and env.has_key('CPPPATH'): for i in env['CPPPATH']: try: f = open(os.path.normpath(os.path.join(i, filename)), 'r') break except Exception: None if not f: for i in ['.', '/usr/include', '/usr/local/include']: try: f = open(os.path.normpath(os.path.join(i, filename)), 'r') break except Exception: None if f: return regex.findall(f.read()) else: return [] | 87c03e8f2db9ef9d58f96d539356334095c5207b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10802/87c03e8f2db9ef9d58f96d539356334095c5207b/build_support.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4163,
6628,
6869,
382,
1864,
12,
7584,
16,
1544,
16,
1550,
273,
599,
4672,
284,
273,
1342,
309,
1550,
471,
1550,
18,
5332,
67,
856,
2668,
4258,
52,
4211,
11,
4672,
364,
277,
316,
1550,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4163,
6628,
6869,
382,
1864,
12,
7584,
16,
1544,
16,
1550,
273,
599,
4672,
284,
273,
1342,
309,
1550,
471,
1550,
18,
5332,
67,
856,
2668,
4258,
52,
4211,
11,
4672,
364,
277,
316,
1550,... |
self._radiusy = (1.0 - self.perspective/100.0)*radiusy | self._radiusy = radiusy = (1.0 - self.perspective/100.0)*radiusy | def draw(self): slices = self.slices _3d_angle = self.angle_3d _3dva = self._3dva = _360(_3d_angle+90) a0 = _2rad(_3dva) self._xdepth_3d = cos(a0)*self.depth_3d self._ydepth_3d = sin(a0)*self.depth_3d self._cx = self.x+self.width/2.0 self._cy = self.y+(self.height - self._ydepth_3d)/2.0 radiusx = radiusy = self._cx-self.x if self.xradius: radiusx = self.xradius if self.yradius: radiusy = self.yradius self._radiusx = radiusx self._radiusy = (1.0 - self.perspective/100.0)*radiusy data = self.normalizeData() sum = self._sum | 89060dccba7a0305da47913bdb1e44935cbf96d7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7053/89060dccba7a0305da47913bdb1e44935cbf96d7/piecharts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
12390,
273,
365,
18,
21562,
389,
23,
72,
67,
4341,
273,
365,
18,
4341,
67,
23,
72,
389,
23,
72,
15304,
273,
365,
6315,
23,
72,
15304,
273,
389,
29751,
24899,
23... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
4672,
12390,
273,
365,
18,
21562,
389,
23,
72,
67,
4341,
273,
365,
18,
4341,
67,
23,
72,
389,
23,
72,
15304,
273,
365,
6315,
23,
72,
15304,
273,
389,
29751,
24899,
23... |
p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) multicall = xmlrpclib.MultiCall(p) multicall.add(2,3) multicall.pow(6,8) multicall.div(127,42) add_result, pow_result, div_result = multicall() self.assertEqual(add_result, 2+3) self.assertEqual(pow_result, 6**8) self.assertEqual(div_result, 127//42) | try: p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) multicall = xmlrpclib.MultiCall(p) multicall.add(2,3) multicall.pow(6,8) multicall.div(127,42) add_result, pow_result, div_result = multicall() self.assertEqual(add_result, 2+3) self.assertEqual(pow_result, 6**8) self.assertEqual(div_result, 127//42) except xmlrpclib.ProtocolError, e: self.fail("%s\n%s" % (e, e.headers)) | def test_multicall(self): p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT) multicall = xmlrpclib.MultiCall(p) multicall.add(2,3) multicall.pow(6,8) multicall.div(127,42) add_result, pow_result, div_result = multicall() self.assertEqual(add_result, 2+3) self.assertEqual(pow_result, 6**8) self.assertEqual(div_result, 127//42) | 2ef29f4a372d19eb40f0515fca203455bf8aac22 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/2ef29f4a372d19eb40f0515fca203455bf8aac22/test_xmlrpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5421,
335,
454,
12,
2890,
4672,
293,
273,
2025,
13832,
830,
495,
18,
2081,
3886,
2668,
2505,
2207,
13014,
5319,
72,
11,
738,
20987,
13,
1778,
335,
454,
273,
2025,
13832,
830,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5421,
335,
454,
12,
2890,
4672,
293,
273,
2025,
13832,
830,
495,
18,
2081,
3886,
2668,
2505,
2207,
13014,
5319,
72,
11,
738,
20987,
13,
1778,
335,
454,
273,
2025,
13832,
830,
... |
if not event.recurrenceID in rruleset: | recurrenceID = event.recurrenceID if isDayItem(event): recurrenceID = datetime.combine( recurrenceID.date(), time(0, tzinfo=recurrenceID.tzinfo)) if not recurrenceID in rruleset: | def _generateRule(self, after=None, before=None, inclusive=False): """Yield all occurrences in this rule.""" event = first = self.getFirstInRule() # check for modifications taking place before first, but only if # if we're actually interested in dates before first (i.e., the # after argument is None or less than first.startTime) prepDatetime = self.__getDatetimePrepFunction() if (first.modifications is not None and (after is None or prepDatetime(after) < prepDatetime(first.startTime))): for mod in first.modifications: if prepDatetime(mod.startTime) <= prepDatetime(event.startTime): event = mod if not event.isBetween(after, before): event = first.getNextOccurrence(after, before) else: # [Bug 5482] # We need to make sure event is actually # included in our recurrence rule. rruleset = self.createDateUtilFromRule() if not event.recurrenceID in rruleset: event = event.getNextOccurrence() while event is not None: if event.isBetween(after, before, inclusive): if event.occurrenceFor is not None: yield event # if event takes place after the before parameter, we're done. elif event.isBetween(after=before): break event = event.getNextOccurrence() | 94a9ccf53f63b1c8a5be787d7b4cc1dc52a8b655 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/94a9ccf53f63b1c8a5be787d7b4cc1dc52a8b655/Calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7163,
2175,
12,
2890,
16,
1839,
33,
7036,
16,
1865,
33,
7036,
16,
13562,
33,
8381,
4672,
3536,
16348,
777,
15698,
316,
333,
1720,
12123,
871,
273,
1122,
273,
365,
18,
588,
3759,
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,
389,
7163,
2175,
12,
2890,
16,
1839,
33,
7036,
16,
1865,
33,
7036,
16,
13562,
33,
8381,
4672,
3536,
16348,
777,
15698,
316,
333,
1720,
12123,
871,
273,
1122,
273,
365,
18,
588,
3759,
3... |
if self._draw_atom_style() in ('arrowhead-away1', 'arrowhead-to-bp'): | if self._draw_atom_style().startswith('arrowhead-'): | def max_pixel_radius(self): #bruce 070409 "Return an estimate (upper bound) of the maximum distance from self's center to any pixel drawn for self." res = self.selatom_radius() + 0.2 if self._draw_atom_style() in ('arrowhead-away1', 'arrowhead-to-bp'): res *= 3 return res | f173d4f674c49f0d7aca31b944ec94c5b3d48291 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/f173d4f674c49f0d7aca31b944ec94c5b3d48291/chem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
943,
67,
11743,
67,
11282,
12,
2890,
4672,
468,
2848,
3965,
10934,
3028,
5908,
315,
990,
392,
11108,
261,
5797,
2489,
13,
434,
326,
4207,
3888,
628,
365,
1807,
4617,
358,
1281,
4957,
193... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
943,
67,
11743,
67,
11282,
12,
2890,
4672,
468,
2848,
3965,
10934,
3028,
5908,
315,
990,
392,
11108,
261,
5797,
2489,
13,
434,
326,
4207,
3888,
628,
365,
1807,
4617,
358,
1281,
4957,
193... |
'date' : lambda *a: (parser.parse(datetime.date.today().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'), | 'date' : lambda *a: (parser.parse(datetime.now().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'), | def create(self, cr, uid, vals, context=None): if context is None: context = {} id = super(hr_employee, self).create(cr, uid, vals, context=context) if vals.get('evaluation_plan_id', False): self.pool.get('hr_evaluation.evaluation').create(cr, uid, {'employee_id' : id, 'plan_id': vals['evaluation_plan_id']}, context=context) return id | 7604859423abfdf9e74b502298d57ea590d77636 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/7604859423abfdf9e74b502298d57ea590d77636/hr_evaluation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
5773,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
612,
273,
2240,
12,
7256,
67,
351,
2817,
1340,
16,
365,
2934,
2640,
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,
5773,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
612,
273,
2240,
12,
7256,
67,
351,
2817,
1340,
16,
365,
2934,
2640,
12,
... |
from reportlab.lib.utils import haveImages, _RL_DIR, rl_isfile, open_for_read if haveImages: gif = os.path.join(_RL_DIR,'test','pythonpowered.gif') if rl_isfile(gif): data = [] t = data.append furl = gif.replace(os.sep,'/') if sys.platform=='win32' and furl[1]==':': furl = furl[0]+'|'+furl[2:] if furl[0]!='/': furl = '/'+furl furl = 'file://'+furl t([ Paragraph("Here is an Image flowable obtained from a string filename.",styleSheet['Italic']), platypus.Image(gif), Paragraph("Here is an Image flowable obtained from a string file url.",styleSheet['Italic']), platypus.Image(furl)]) t([ Paragraph("Here is an Image flowable obtained from a string http url.",styleSheet['Italic']), platypus.Image('http://www.reportlab.com/rsrc/encryption.gif'), Paragraph( "Here is an Image flowable obtained from a utf8 filename.", styleSheet['Italic']), platypus.Image(gif.encode('utf8'))]) t([Paragraph("Here is an Image flowable obtained from an open file.",styleSheet['Italic']), platypus.Image(open_for_read(gif,'b')), '','']) story.append(platypus.Table(data,[96,None,96,None], [None, None,None])) jpg = os.path.join(_RL_DIR,'docs','images','lj8100.jpg') if rl_isfile(jpg): story.append(Paragraph("Here is an JPEG Image flowable obtained from a filename.",styleSheet['Italic'])) img = platypus.Image(jpg) story.append(img) story.append(Paragraph("Here is an JPEG Image flowable obtained from an open file.",styleSheet['Italic'])) img = platypus.Image(open_for_read(jpg,'b')) story.append(img) | def wrap(self, availWidth, availHeight): """This will be called by the enclosing frame before objects are asked their size, drawn or whatever. It returns the size actually used.""" return (self.width, self.height) | 70b47bdfe92e0dc0682ee7991557e3fa42af8d8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/70b47bdfe92e0dc0682ee7991557e3fa42af8d8f/test_platypus_general.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
12,
2890,
16,
15783,
2384,
16,
15783,
2686,
4672,
3536,
2503,
903,
506,
2566,
635,
326,
16307,
2623,
1865,
2184,
854,
19279,
3675,
963,
16,
19377,
578,
15098,
18,
225,
2597,
1135,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2193,
12,
2890,
16,
15783,
2384,
16,
15783,
2686,
4672,
3536,
2503,
903,
506,
2566,
635,
326,
16307,
2623,
1865,
2184,
854,
19279,
3675,
963,
16,
19377,
578,
15098,
18,
225,
2597,
1135,
... | |
datalist.append('(void *)%s' % thisfunc) | datalist.append('(void *)%s' % t.func_data) | def make_arrays(funcdict): # functions array contains an entry for every type implemented # NULL should be placed where PyUfunc_ style function will be filled in later # code1list = [] code2list = [] for name, vals in funcdict.iteritems(): funclist = [] datalist = [] siglist = [] k=0; sub=0; numin, numout = vals[3] if numin > 1: thedict = chartotype2 # two inputs and one output else: thedict = chartotype1 # one input and one output instr = ''.join([x*numin for x in list(vals[0])]) if len(vals) > 6: if isinstance(vals[6],type('')): outstr = vals[6] else: # a tuple specifying input signature, output signature instr, outstr = vals[6] else: outstr = ''.join([x*numout for x in list(vals[0])]) _valslen = len(vals[0]) assert _valslen*numout == len(outstr), "input/output signature doesn't match" assert len(instr) == _valslen*numin, "input/output signature doesn't match" for char in vals[0]: if char in vals[1]: # use generic function-based interface funclist.append('NULL') astr = '%s_functions[%d] = PyUFunc_%s;' % \ (name, k, thedict[char]) code2list.append(astr) thisfunc = vals[2][sub] if len(thisfunc) > 8 and thisfunc[:8] == "PyNumber": astr = '%s_data[%d] = (void *) %s;' % \ (name, k, thisfunc) code2list.append(astr) datalist.append('(void *)NULL'); else: datalist.append('(void *)%s' % thisfunc) sub += 1 else: # individual wrapper interface datalist.append('(void *)NULL'); funclist.append('%s_%s' % (chartoname[char].upper(), name)) insubstr = instr[numin*k:numin*(k+1)] outsubstr = outstr[numout*k:numout*(k+1)] siglist.extend(['PyArray_%s' % chartoname[x].upper() for x in insubstr]) siglist.extend(['PyArray_%s' % chartoname[x].upper() for x in outsubstr]) k += 1 funcnames = ', '.join(funclist) signames = ', '.join(siglist) datanames = ', '.join(datalist) code1list.append("static PyUFuncGenericFunction %s_functions[] = { %s };" \ % (name, funcnames)) code1list.append("static void * %s_data[] = { %s };" \ % (name, datanames)) code1list.append("static char %s_signatures[] = { %s };" \ % (name, signames)) return "\n".join(code1list),"\n".join(code2list) | 912beccc011bf60d61b61fa24021f6235dba0225 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/912beccc011bf60d61b61fa24021f6235dba0225/generate_umath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
16223,
12,
644,
1576,
4672,
468,
4186,
526,
1914,
392,
1241,
364,
3614,
618,
8249,
468,
282,
3206,
1410,
506,
15235,
1625,
4707,
57,
644,
67,
2154,
445,
903,
506,
6300,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
16223,
12,
644,
1576,
4672,
468,
4186,
526,
1914,
392,
1241,
364,
3614,
618,
8249,
468,
282,
3206,
1410,
506,
15235,
1625,
4707,
57,
644,
67,
2154,
445,
903,
506,
6300,
316,
... |
stream = path if hasattr(path, 'read') else open(path, 'rb') stream.seek(0) matches = self.data.get_matches('title', title) if matches: tag_matches = self.data.get_matches('tags', _('Catalog')) matches = matches.intersection(tag_matches) db_id, existing = None, False if matches: db_id = list(matches)[0] if db_id is None: obj = self.conn.execute('INSERT INTO books(title, author_sort) VALUES (?, ?)', (title, 'calibre')) db_id = obj.lastrowid self.data.books_added([db_id], self) self.set_path(db_id, index_is_id=True) self.conn.commit() try: mi = get_metadata(stream, os.path.splitext(path)[1][1:].lower()) except: mi = MetaInformation(title, ['calibre']) mi.title, mi.authors = title, ['calibre'] mi.tags = [_('Catalog')] mi.pubdate = mi.timestamp = utcnow() self.set_metadata(db_id, mi) self.add_format(db_id, format, stream, index_is_id=True) if not hasattr(path, 'read'): stream.close() | with open(path, 'rb') as stream: matches = self.data.get_matches('title', '='+title) if matches: tag_matches = self.data.get_matches('tags', '='+_('Catalog')) matches = matches.intersection(tag_matches) db_id = None if matches: db_id = list(matches)[0] if db_id is None: obj = self.conn.execute('INSERT INTO books(title, author_sort) VALUES (?, ?)', (title, 'calibre')) db_id = obj.lastrowid self.data.books_added([db_id], self) self.set_path(db_id, index_is_id=True) self.conn.commit() try: mi = get_metadata(stream, format) except: import traceback traceback.print_exc() mi = MetaInformation(title, ['calibre']) stream.seek(0) mi.title, mi.authors = title, ['calibre'] mi.tags = [_('Catalog')] mi.pubdate = mi.timestamp = utcnow() self.set_metadata(db_id, mi) self.add_format(db_id, format, stream, index_is_id=True) | def add_catalog(self, path, title): format = os.path.splitext(path)[1][1:].lower() stream = path if hasattr(path, 'read') else open(path, 'rb') stream.seek(0) matches = self.data.get_matches('title', title) if matches: tag_matches = self.data.get_matches('tags', _('Catalog')) matches = matches.intersection(tag_matches) db_id, existing = None, False if matches: db_id = list(matches)[0] if db_id is None: obj = self.conn.execute('INSERT INTO books(title, author_sort) VALUES (?, ?)', (title, 'calibre')) db_id = obj.lastrowid self.data.books_added([db_id], self) self.set_path(db_id, index_is_id=True) self.conn.commit() try: mi = get_metadata(stream, os.path.splitext(path)[1][1:].lower()) except: mi = MetaInformation(title, ['calibre']) | 839c03372f5bc0548e65693f3873d0414dcd0fbc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/839c03372f5bc0548e65693f3873d0414dcd0fbc/database2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
7199,
12,
2890,
16,
589,
16,
2077,
4672,
740,
273,
1140,
18,
803,
18,
4939,
408,
12,
803,
25146,
21,
6362,
21,
30,
8009,
8167,
1435,
1407,
273,
589,
309,
3859,
12,
803,
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,
527,
67,
7199,
12,
2890,
16,
589,
16,
2077,
4672,
740,
273,
1140,
18,
803,
18,
4939,
408,
12,
803,
25146,
21,
6362,
21,
30,
8009,
8167,
1435,
1407,
273,
589,
309,
3859,
12,
803,
16,
... |
if step < 0: if self.shown != 0: self.lastMove = self.history.moves[self.shown-1] else: self.lastMove = None self.runAnimation(first = True) if step > 0: if self.shown != 0: self.lastMove = self.history.moves[self.shown-1] else: self.lastMove = None | if self.lastMove: paintBox = self.cord2Rect(self.lastMove.cord0) paintBox = join(paintBox, self.cord2Rect(self.lastMove.cord1)) self.lastMove = None self.redraw_canvas(rect(paintBox)) if self.shown != 0: self.lastMove = self.history.moves[self.shown-1] else: self.lastMove = None self.runAnimation(redrawMisc = True) | def do(): if step < 0: if self.shown != 0: self.lastMove = self.history.moves[self.shown-1] else: self.lastMove = None self.runAnimation(first = True) if step > 0: if self.shown != 0: self.lastMove = self.history.moves[self.shown-1] else: self.lastMove = None self.animationID = idle_add(self.runAnimation) | a20394473fe4ce0e4eeffe7094db0e19776a6398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5339/a20394473fe4ce0e4eeffe7094db0e19776a6398/BoardView.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
13332,
309,
365,
18,
2722,
7607,
30,
12574,
3514,
273,
365,
18,
901,
22,
6120,
12,
2890,
18,
2722,
7607,
18,
901,
20,
13,
12574,
3514,
273,
1233,
12,
84,
1598,
3514,
16,
365,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
13332,
309,
365,
18,
2722,
7607,
30,
12574,
3514,
273,
365,
18,
901,
22,
6120,
12,
2890,
18,
2722,
7607,
18,
901,
20,
13,
12574,
3514,
273,
1233,
12,
84,
1598,
3514,
16,
365,
18... |
output.write(" <usage>%s</usage>\n" % usage); tests.append(usage) | output.write(" <usage>%s</usage>\n" % escape(usage)); | def parse(filename, output): global symbols global sections parser = CParser(filename) parser.collect_references() idx = parser.parse() info = parse_top_comment(filename, parser.top_comment) output.write(" <example filename='%s'>\n" % filename) try: synopsis = info['synopsis'] output.write(" <synopsis>%s</synopsis>\n" % synopsis); except: print "Example %s lacks a synopsis description" % (filename) try: purpose = info['purpose'] output.write(" <purpose>%s</purpose>\n" % purpose); except: print "Example %s lacks a purpose description" % (filename) try: usage = info['usage'] output.write(" <usage>%s</usage>\n" % usage); tests.append(usage) except: print "Example %s lacks an usage description" % (filename) try: author = info['author'] output.write(" <author>%s</author>\n" % author); except: print "Example %s lacks an author description" % (filename) try: copy = info['copy'] output.write(" <copy>%s</copy>\n" % copy); except: print "Example %s lacks a copyright description" % (filename) try: section = info['section'] output.write(" <section>%s</section>\n" % section); if sections.has_key(section): sections[section].append(filename) else: sections[section] = [filename] except: print "Example %s lacks a section description" % (filename) for topic in info.keys(): if topic != "purpose" and topic != "usage" and \ topic != "author" and topic != "copy" and \ topic != "section" and topic != "synopsis": str = info[topic] output.write(" <extra topic='%s'>%s</extra>\n" % str) output.write(" <includes>\n") for include in idx.includes.keys(): if include.find("libxml") != -1: output.write(" <include>%s</include>\n" % (escape(include))) output.write(" </includes>\n") output.write(" <uses>\n") for ref in idx.references.keys(): id = idx.references[ref] name = id.get_name() line = id.get_lineno() if symbols.has_key(name): sinfo = symbols[name] refs = sinfo[0] # gather at most 5 references per symbols if refs > 5: continue sinfo[refs] = filename sinfo[0] = refs + 1 else: symbols[name] = [1, filename] info = find_symbol(name) if info != None: type = info[0] file = info[1] output.write(" <%s line='%d' file='%s' name='%s'/>\n" % (type, line, file, name)) else: type = id.get_type() output.write(" <%s line='%d' name='%s'/>\n" % (type, line, name)) output.write(" </uses>\n") output.write(" </example>\n") return idx | 241e19d4afea87d71e761803877ba9371d70d816 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12659/241e19d4afea87d71e761803877ba9371d70d816/index.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
3459,
16,
876,
4672,
2552,
7963,
2552,
7178,
225,
2082,
273,
385,
2678,
12,
3459,
13,
2082,
18,
14676,
67,
14353,
1435,
2067,
273,
2082,
18,
2670,
1435,
1123,
273,
1109,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
3459,
16,
876,
4672,
2552,
7963,
2552,
7178,
225,
2082,
273,
385,
2678,
12,
3459,
13,
2082,
18,
14676,
67,
14353,
1435,
2067,
273,
2082,
18,
2670,
1435,
1123,
273,
1109,
67,
... |
print " * Removing old @throw attribute in comment for %s" % name | print " * Removing old @throw attribute in comment for %s" % name | def fromFunction(func, assignType, name, alternative, old=[]): # # open comment ############################################################## s = "/**\n" # # description ############################################################## oldDesc = getAttrib(old, "description") if attribHas(oldDesc, "text"): newText = oldDesc["text"] else: newText = "TODOC" s += splitText(newText, False) s += " *\n" # # add @type ############################################################## if assignType != None: s += " * @type %s\n" % assignType else: s += " * @type unknown TODOC\n" # # add @abstract ############################################################## oldAbstract = getAttrib(old, "abstract") first = func.getChild("body").getChild("block").getFirstChild(False, True) abstract = first and first.type == "throw" if abstract: if attribHas(oldAbstract, "text"): newText = oldDesc["text"] else: newText = "" s += " * @abstract%s" % splitText(newText) if not s.endswith("\n"): s += "\n" elif oldAbstract: print " * Removing old @abstract for %s" % name # # add @param ############################################################## params = func.getChild("params") if params.hasChildren(): for child in params.children: if child.type == "variable": newName = child.getChild("identifier").get("name") newType = newTypeText = nameToType(newName) newDefault = "" newText = nameToDescription(newName) oldParam = getParam(old, newName) # Get type and text from old content if oldParam: if attribHas(oldParam, "type"): newTypeText = parseType(oldParam["type"]) if attribHas(oldParam, "defaultValue"): newDefault = oldParam["defaultValue"] if attribHas(oldParam, "text"): newText = oldParam["text"].strip() s += " * @param %s {%s%s}%s" % (newName, newTypeText, newDefault, splitText(newText)) if not s.endswith("\n"): s += "\n" # # add @return ############################################################## if name != "construct": oldReturn = getAttrib(old, "return") newType = "void" newText = "" # Get type and text from old content if oldReturn: if attribHas(oldReturn, "type"): newType = parseType(oldReturn["type"]) if attribHas(oldReturn, "text"): newText = oldReturn["text"].strip() # Try to autodetect the type if newType == "void": returns = getReturns(func.getChild("body"), []) if len(returns) > 0: newType = " | ".join(returns) elif name != None and name.startswith("is") and name[3].isupper(): newType = "boolean" # Add documentation hint in non void cases if newType != "void" and newText == "": newText = "TODOC" s += " * @return {%s}%s" % (newType, splitText(newText)) if not s.endswith("\n"): s += "\n" # # add @throws ############################################################## oldThrows = getAttrib(old, "throws") if hasThrows(func): if oldThrows and attribHas(oldThrows, "text"): newText = oldThrows["text"] elif abstract: newText = "the abstract function warning." else: newText = "TODOC" s += " * @throws%s" % splitText(newText) if not s.endswith("\n"): s += "\n" elif oldThrows: print " * Removing old @throw attribute in comment for %s" % name # # other @attributes ############################################################## for attrib in old: cat = attrib["category"] if cat in [ "see", "author", "deprecated", "exception", "since", "version", "abstract", "overridden" ]: s += " * @%s" % cat if attribHas(attrib, "text"): s += splitText(attrib["text"]) if not s.endswith("\n"): s += "\n" elif not cat in [ "description", "type", "abstract", "param", "return", "throws" ]: print " * Found unallowed attribute %s in comment for %s (function)" % (cat, name) # # close comment ############################################################## s += " */" return s | 553c409f6f9212caba65076dbf5512bad9c2d290 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/553c409f6f9212caba65076dbf5512bad9c2d290/comment.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
2083,
12,
644,
16,
2683,
559,
16,
508,
16,
10355,
16,
1592,
33,
8526,
4672,
468,
468,
1696,
2879,
19709,
5516,
26487,
7,
272,
273,
2206,
636,
64,
82,
6,
282,
468,
468,
2477,
197... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
2083,
12,
644,
16,
2683,
559,
16,
508,
16,
10355,
16,
1592,
33,
8526,
4672,
468,
468,
1696,
2879,
19709,
5516,
26487,
7,
272,
273,
2206,
636,
64,
82,
6,
282,
468,
468,
2477,
197... |
'Traceback (innermost last):\n', | tb_id+'\n', | def readlines(self): return self.data | 7ee3cac39bfb677751dc2f74cc73505ab26060f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/7ee3cac39bfb677751dc2f74cc73505ab26060f2/ErrorStack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17546,
12,
2890,
4672,
327,
365,
18,
892,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17546,
12,
2890,
4672,
327,
365,
18,
892,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
Game.next_level(self) self.max_time -= SECOND self._beat() | if not self.last_level(): Game.next_level(self) self.max_time -= SECOND self._beat() def last_level(self): return self.max_time == SECOND | def next_level(self): Game.next_level(self) self.max_time -= SECOND self._beat() | 976b1a8ad37a123cfe0f039787db57586addf114 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5891/976b1a8ad37a123cfe0f039787db57586addf114/stages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
67,
2815,
12,
2890,
4672,
309,
486,
365,
18,
2722,
67,
2815,
13332,
14121,
18,
4285,
67,
2815,
12,
2890,
13,
365,
18,
1896,
67,
957,
3947,
19379,
365,
6315,
2196,
270,
1435,
225,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
67,
2815,
12,
2890,
4672,
309,
486,
365,
18,
2722,
67,
2815,
13332,
14121,
18,
4285,
67,
2815,
12,
2890,
13,
365,
18,
1896,
67,
957,
3947,
19379,
365,
6315,
2196,
270,
1435,
225,... |
top_widgets = [ body, wrapped_sep, log ] top = ListBox(top_widgets) | footer = Pile([ ('flow', wrapped_sep), log ]) log.render = lambda size, focus=False: BoxAdapter.render(log, size[:1], focus) footer.render = lambda (maxcol,), focus=False: Pile.render(footer, (maxcol, sep.rows((maxcol,))+log.height), focus) top = Frame(body, None, footer) | def logger(level, prefix, text, ctxt): if ctxt is not None: c = [] if hasattr(ctxt, "_logger"): c[:0] = [ ctxt._logger() ] if issubclass(ctxt.__class__, Field): ctxt = ctxt["/"] name = logger.objects.get(ctxt) if name: c[:0] = [ name ] if c: text = "[%s] %s" % ('|'.join(c), text) if not isinstance(text, unicode): text = unicode(text, charset) msgs[0].append((level, prefix, text)) | 9d0fe6c8e939bacf85e4353fe8017a3af8da7803 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/9d0fe6c8e939bacf85e4353fe8017a3af8da7803/urwid_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1194,
12,
2815,
16,
1633,
16,
977,
16,
14286,
4672,
309,
14286,
353,
486,
599,
30,
276,
273,
5378,
309,
3859,
12,
20364,
16,
4192,
4901,
6,
4672,
276,
10531,
20,
65,
273,
306,
14286,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1194,
12,
2815,
16,
1633,
16,
977,
16,
14286,
4672,
309,
14286,
353,
486,
599,
30,
276,
273,
5378,
309,
3859,
12,
20364,
16,
4192,
4901,
6,
4672,
276,
10531,
20,
65,
273,
306,
14286,
... |
title = NearbyDetailView.get_metadata(request, ptypes, entity)['title'] | title = NearbyDetailView.get_metadata(self, request, ptypes, entity)['title'] | def breadcrumb(self, request, context, ptypes, entity=None): title = NearbyDetailView.get_metadata(request, ptypes, entity)['title'] return Breadcrumb('places', lazy_parent('nearby-list', entity=entity), title, lazy_reverse('nearby-detail', args=[ptypes])) | e352c46bd71960af63aaccd2bbe4ec6bb90b0a54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14173/e352c46bd71960af63aaccd2bbe4ec6bb90b0a54/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19538,
12,
2890,
16,
590,
16,
819,
16,
293,
2352,
16,
1522,
33,
7036,
4672,
2077,
273,
423,
2091,
1637,
6109,
1767,
18,
588,
67,
4165,
12,
2890,
16,
590,
16,
293,
2352,
16,
1522,
13,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19538,
12,
2890,
16,
590,
16,
819,
16,
293,
2352,
16,
1522,
33,
7036,
4672,
2077,
273,
423,
2091,
1637,
6109,
1767,
18,
588,
67,
4165,
12,
2890,
16,
590,
16,
293,
2352,
16,
1522,
13,... |
c.execute('select posts.rowid, text, date, username from posts join users on posts.user = users.rowid order by date desc limit 10') posts = [{'id': r[0], 'text': r[1], 'date': get_date(r[2]), 'username': r[3]} for r in c.fetchall()] | posts = db.fetchall('select posts.rowid, text, date, username from posts join users on posts.user = users.rowid order by date desc limit 10') posts = [{'id': r[0], 'text': r[1], 'date': pretty_date(get_date(r[2])), 'username': r[3]} for r in posts] | def index(self): logged_in = Session().get_logged_in() conn = cherrypy.thread_data.db c = conn.cursor() c.execute('select posts.rowid, text, date, username from posts join users on posts.user = users.rowid order by date desc limit 10') posts = [{'id': r[0], 'text': r[1], 'date': get_date(r[2]), 'username': r[3]} for r in c.fetchall()] return templates.get_template('dashboard.html').render(logged_in=logged_in, posts=posts) | 4b3b0887bbd7693b28f3887b7bce2d7daf7358e8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3078/4b3b0887bbd7693b28f3887b7bce2d7daf7358e8/minitwit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
12,
2890,
4672,
7545,
67,
267,
273,
3877,
7675,
588,
67,
19385,
67,
267,
1435,
1487,
273,
462,
370,
28398,
18,
5930,
67,
892,
18,
1966,
276,
273,
1487,
18,
9216,
1435,
10775,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
12,
2890,
4672,
7545,
67,
267,
273,
3877,
7675,
588,
67,
19385,
67,
267,
1435,
1487,
273,
462,
370,
28398,
18,
5930,
67,
892,
18,
1966,
276,
273,
1487,
18,
9216,
1435,
10775,
273,... |
if apply_rule(*rule_obj.domain_get(cr, uid, inherited_model, mode, context=context)): self._inherits_join_add(inherited_model, query) | apply_rule(*rule_obj.domain_get(cr, uid, inherited_model, mode, context=context), parent_model=inherited_model, child_object=self) | def apply_rule(added_clause, added_params, added_tables): if added_clause: query.where_clause += added_clause query.where_clause_params += added_params for table in added_tables: if table not in query.tables: query.tables.append(table) return True return False | 17412755b91a9fe74a02c1e25cf89d2ac1f23b52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/17412755b91a9fe74a02c1e25cf89d2ac1f23b52/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
67,
5345,
12,
9665,
67,
18128,
16,
3096,
67,
2010,
16,
3096,
67,
9373,
4672,
309,
3096,
67,
18128,
30,
843,
18,
6051,
67,
18128,
1011,
3096,
67,
18128,
843,
18,
6051,
67,
18128,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
67,
5345,
12,
9665,
67,
18128,
16,
3096,
67,
2010,
16,
3096,
67,
9373,
4672,
309,
3096,
67,
18128,
30,
843,
18,
6051,
67,
18128,
1011,
3096,
67,
18128,
843,
18,
6051,
67,
18128,
... |
results = self.r_values(table=True, rows=True) | results = self.r_values(table=True, rows=True, free_reflections_per_bin = free_reflections_per_bin, max_number_of_bins = max_number_of_bins) | def statistics_in_resolution_bins(self, free_reflections_per_bin = 200, max_number_of_bins = 30, out=None): results = self.r_values(table=True, rows=True) return results # first detemine number of bins please # self.twin_fraction_scan(n=15) # self.sigmaa_object().show(out=self.out) | 993233c08e80b963496300ffb6bffd66195ae28f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/696/993233c08e80b963496300ffb6bffd66195ae28f/twin_f_model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7691,
67,
267,
67,
19182,
67,
11862,
12,
2890,
16,
4843,
67,
26606,
87,
67,
457,
67,
4757,
273,
4044,
16,
943,
67,
2696,
67,
792,
67,
11862,
225,
273,
5196,
16,
596,
33,
7036,
4672,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7691,
67,
267,
67,
19182,
67,
11862,
12,
2890,
16,
4843,
67,
26606,
87,
67,
457,
67,
4757,
273,
4044,
16,
943,
67,
2696,
67,
792,
67,
11862,
225,
273,
5196,
16,
596,
33,
7036,
4672,
... |
if chunkMetadata.exists(stageSig): | if metadata.exists(stageSig): | def FlatCorrection(exposure, flat, policy, stageSig = ipIsr.ISR_FLAT, stageName = 'lsst.ip.isr.flatcorrection'): # common input test metadata = exposure.getMetadata() if chunkMetadata.exists(stageSig): pexLog.Trace(stageName, 4, '%s has already been run' % (stageSig)) return fmetadata = flat.getMetadata() filenameKeyword = policy.getString('filenameKeyword') filename = fmetadata(filenameKeyword) scalingKeyword = policy.getString('flatScaleKeyword') # e.g. MEAN flatscaling = dmetadata.getDouble(scalingKeyword) mi = exposure.getMaskedImage() #fmi = afwImage.MaskedImageF(flat.getMaskedImage(), True) #if flatscaling != 1.: # fmi /= flatscaling #mi /= fmi mi.scaledDivides(1./flatscaling, flat.getMaskedImage()) # common outputs stageSummary = 'using %s with scale=%.2f' % (filename, flatscaling) pexLog.Trace(stageName, 4, '%s %s' % (stageSig, stageSummary)) metadata.setString(stageSig, '%s; %s' % (stageSummary, time.asctime())) | 9178ba52aa57399136f285c8a065b1707c990801 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6526/9178ba52aa57399136f285c8a065b1707c990801/IsrStages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20396,
20884,
12,
22739,
16,
3569,
16,
3329,
16,
6009,
8267,
225,
273,
2359,
2520,
86,
18,
5127,
54,
67,
42,
12190,
16,
6009,
461,
273,
296,
3251,
334,
18,
625,
18,
291,
86,
18,
1540... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20396,
20884,
12,
22739,
16,
3569,
16,
3329,
16,
6009,
8267,
225,
273,
2359,
2520,
86,
18,
5127,
54,
67,
42,
12190,
16,
6009,
461,
273,
296,
3251,
334,
18,
625,
18,
291,
86,
18,
1540... |
location = Point((float(list_record['geo_long']), float(list_record['geo_lat']))) | kwargs = get_unique_fields(list_record) location = self.get_location(list_record) | def save(self, old_record, list_record, detail_record): kwargs = self.unique_fields(list_record) | 7fa37ba874d94c12b5efdfb819de1a05f663c91f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10327/7fa37ba874d94c12b5efdfb819de1a05f663c91f/seeclickfix_retrieval.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
1592,
67,
3366,
16,
666,
67,
3366,
16,
7664,
67,
3366,
4672,
1205,
273,
365,
18,
6270,
67,
2821,
12,
1098,
67,
3366,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1923,
12,
2890,
16,
1592,
67,
3366,
16,
666,
67,
3366,
16,
7664,
67,
3366,
4672,
1205,
273,
365,
18,
6270,
67,
2821,
12,
1098,
67,
3366,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
o = %(name)s(id) self._setObject(id, o) o = getattr(self, id) o.initializeArchetype(**kwargs) | obj = %(name)s(id) self._setObject(id, obj) obj = self._getOb(id) obj.initializeArchetype(**kwargs) | def add%(name)s(self, id, **kwargs): o = %(name)s(id) self._setObject(id, o) o = getattr(self, id) o.initializeArchetype(**kwargs) return id | 7a3dca2570a4f9cc92adce327a6cf0eb24162332 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/7a3dca2570a4f9cc92adce327a6cf0eb24162332/ClassGen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
17105,
529,
13,
87,
12,
2890,
16,
612,
16,
2826,
4333,
4672,
1081,
273,
8975,
529,
13,
87,
12,
350,
13,
365,
6315,
542,
921,
12,
350,
16,
1081,
13,
1081,
273,
365,
6315,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
17105,
529,
13,
87,
12,
2890,
16,
612,
16,
2826,
4333,
4672,
1081,
273,
8975,
529,
13,
87,
12,
350,
13,
365,
6315,
542,
921,
12,
350,
16,
1081,
13,
1081,
273,
365,
6315,
588,
... |
sef.fx0=x0 self.fx2=x2 | def __init__(self, f1, f2, x0, x2, auto_center=False, y1=0.0): """ connect f1(x0) to f2(x2) with a very smooth polynomial. If auto_center is False, function(midpoint)=y1 at midpoint of the join and poly is 6th order. If auto_center is True, poly is 5th order, and y(midpoint) is whatever it has to be.""" fdx=self.fdx=(x2-x0)/2.0 self.fhinv=1.0/fdx self.fx1=(x0+x2)/2.0 sef.fx0=x0 self.fx2=x2 y0, yp0, ypp0=f1.value_with_derivatives(x0) # get left wall values from conventional computation y2, yp2, ypp2=f2.value_with_derivatives(x2) # get right wall values from conventional computation | 00aa60938617c1688f2e30fb16e7d4291654061b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6028/00aa60938617c1688f2e30fb16e7d4291654061b/C2Functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
284,
21,
16,
284,
22,
16,
619,
20,
16,
619,
22,
16,
3656,
67,
5693,
33,
8381,
16,
677,
21,
33,
20,
18,
20,
4672,
3536,
3077,
284,
21,
12,
92,
20,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
284,
21,
16,
284,
22,
16,
619,
20,
16,
619,
22,
16,
3656,
67,
5693,
33,
8381,
16,
677,
21,
33,
20,
18,
20,
4672,
3536,
3077,
284,
21,
12,
92,
20,
... | |
self._verify_tout(tout, str='10s', secs=10, msg=' '.join(msgcols)) | self._verify_tout(tout, str='10 seconds', secs=10, msg=' '.join(msgcols)) | def test_message(self): for msgcols in [ ['mymessage'], ['This is my message!'], ['Message in','two colums'], ['My','message','in','quite','many','columns','.'] ]: tout = TestTimeout('10sec', *msgcols) self._verify_tout(tout, str='10s', secs=10, msg=' '.join(msgcols)) | 62023eb1a3ffca8bc1d94d7a732da33a5e9fc587 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6988/62023eb1a3ffca8bc1d94d7a732da33a5e9fc587/test_timeouts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2150,
12,
2890,
4672,
364,
1234,
6842,
316,
306,
10228,
4811,
2150,
17337,
10228,
2503,
353,
3399,
883,
5,
17337,
10228,
1079,
316,
17023,
15415,
645,
379,
87,
17337,
10228,
1206... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2150,
12,
2890,
4672,
364,
1234,
6842,
316,
306,
10228,
4811,
2150,
17337,
10228,
2503,
353,
3399,
883,
5,
17337,
10228,
1079,
316,
17023,
15415,
645,
379,
87,
17337,
10228,
1206... |
while hook.location.parent.id == bait.id: old_rate = self.rate | while hook.location.parent.id == bait.id: old_rate = self.rate | def tick_operation(self, op): """ Op handler for regular tick op """ hook = 0 for item in bait.contains: if item.type[0] == "hook": hook = item | 19ff3f12f72868db392cdf2694e8f086a8a1a599 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12932/19ff3f12f72868db392cdf2694e8f086a8a1a599/Fishing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4024,
67,
7624,
12,
2890,
16,
1061,
4672,
3536,
6066,
1838,
364,
6736,
4024,
1061,
3536,
3953,
273,
374,
364,
761,
316,
324,
1540,
18,
12298,
30,
309,
761,
18,
723,
63,
20,
65,
422,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4024,
67,
7624,
12,
2890,
16,
1061,
4672,
3536,
6066,
1838,
364,
6736,
4024,
1061,
3536,
3953,
273,
374,
364,
761,
316,
324,
1540,
18,
12298,
30,
309,
761,
18,
723,
63,
20,
65,
422,
... |
registration = portal.portal_registration | def validate_registration(self, action, data): """ specific business logic for this join form note: all this logic was taken directly from the old validate_registration.py script """ | 5e2448fc7580eaa43d1bfcc5e2a88dd61b0204bb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12186/5e2448fc7580eaa43d1bfcc5e2a88dd61b0204bb/joinform.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
14170,
12,
2890,
16,
1301,
16,
501,
4672,
3536,
2923,
13160,
4058,
364,
333,
1233,
646,
4721,
30,
777,
333,
4058,
1703,
9830,
5122,
628,
326,
1592,
1954,
67,
14170,
18,
2074,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1954,
67,
14170,
12,
2890,
16,
1301,
16,
501,
4672,
3536,
2923,
13160,
4058,
364,
333,
1233,
646,
4721,
30,
777,
333,
4058,
1703,
9830,
5122,
628,
326,
1592,
1954,
67,
14170,
18,
2074,
... | |
def new_exists(self, *args): exists = orig_exists(self, *args) | def new_exists(self, **kw): exists = orig_exists(self, **kw) | def new_exists(self, *args): exists = orig_exists(self, *args) | 22ac8fcb5b149d6c9c64fe7f98a8e8c63354c880 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/888/22ac8fcb5b149d6c9c64fe7f98a8e8c63354c880/Include.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
1808,
12,
2890,
16,
380,
1968,
4672,
1704,
273,
1647,
67,
1808,
12,
2890,
16,
380,
1968,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
1808,
12,
2890,
16,
380,
1968,
4672,
1704,
273,
1647,
67,
1808,
12,
2890,
16,
380,
1968,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.annotation = Annotation() | self.annotation = Annotation(self) | def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) self.content = [] self.attr_content = [] | 6d624a54ef4e80f277c247ef300c646e01f4568e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13054/6d624a54ef4e80f277c247ef300c646e01f4568e/XMLSchema.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
8832,
12,
2890,
16,
756,
4672,
365,
18,
542,
2498,
12,
2159,
13,
2939,
273,
365,
18,
588,
6323,
12,
2159,
13,
365,
18,
1745,
273,
5378,
365,
18,
1747,
67,
1745,
273,
5378,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
8832,
12,
2890,
16,
756,
4672,
365,
18,
542,
2498,
12,
2159,
13,
2939,
273,
365,
18,
588,
6323,
12,
2159,
13,
365,
18,
1745,
273,
5378,
365,
18,
1747,
67,
1745,
273,
5378,
2,
... |
def _do_query_directory(directory, category): sql = 'SELECT host.id, host.country, host_category_url.url, site.private, host.private ' sql += 'FROM host_category_dir, host_category, host_category_url, host, site ' | def _do_query_directories(): sql = 'SELECT directory.name, host.id, host.country, host_category_url.url, site.private, host.private ' sql += 'FROM directory, host_category_dir, host_category, host_category_url, host, site ' | def _do_query_directory(directory, category): sql = 'SELECT host.id, host.country, host_category_url.url, site.private, host.private ' sql += 'FROM host_category_dir, host_category, host_category_url, host, site ' sql += 'WHERE host_category_dir.host_category_id = host_category.id ' # join criteria sql += 'AND host_category_url.host_category_id = host_category.id ' # join criteria sql += 'AND host_category.host_id = host.id ' # join criteria sql += 'AND host.site_id = site.id ' # join criteria sql += 'AND host_category.category_id = %d ' % category.id # but select only the target category sql += "AND host_category_dir.directory_id = %s " % directory.id # and target directory sql += 'AND (host_category_dir.up2date OR host_category.always_up2date) ' sql += 'AND NOT host_category_url.private ' sql += 'AND host.user_active AND site.user_active ' sql += 'AND host.admin_active AND site.admin_active ' result = directory._connection.queryAll(sql) result = trim(result) return result | e15a52dbde749000bdad35402b0bc452c40a3f3f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13031/e15a52dbde749000bdad35402b0bc452c40a3f3f/mirrorlist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1652,
389,
2896,
67,
2271,
67,
15121,
13332,
1847,
225,
273,
296,
4803,
1867,
18,
529,
16,
1479,
18,
350,
16,
1479,
18,
9082,
16,
1479,
67,
4743,
67,
718,
18,
718,
16,
2834,
18,
1152,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
282,
1652,
389,
2896,
67,
2271,
67,
15121,
13332,
1847,
225,
273,
296,
4803,
1867,
18,
529,
16,
1479,
18,
350,
16,
1479,
18,
9082,
16,
1479,
67,
4743,
67,
718,
18,
718,
16,
2834,
18,
1152,... |
Hack1() | DoPackage(argv_RealClean, PackageSets["all"]) or sys.exit(1) | def Hack1(): # appropriate pylib.GCC_BACKEND = True pylib.OMIT_GCC = False # hack os.environ["GCC_BACKEND"] = "yes" os.environ.pop("OMIT_GCC", None) reload(pylib) | f79eddf7420d7ecca90b9ab0d9d7d03ff433e039 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9328/f79eddf7420d7ecca90b9ab0d9d7d03ff433e039/bootntgnu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
670,
484,
21,
13332,
225,
468,
5505,
2395,
2941,
18,
43,
6743,
67,
8720,
4415,
273,
1053,
2395,
2941,
18,
1872,
1285,
67,
43,
6743,
273,
1083,
225,
468,
11769,
1140,
18,
28684,
9614,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
670,
484,
21,
13332,
225,
468,
5505,
2395,
2941,
18,
43,
6743,
67,
8720,
4415,
273,
1053,
2395,
2941,
18,
1872,
1285,
67,
43,
6743,
273,
1083,
225,
468,
11769,
1140,
18,
28684,
9614,
4... |
r'Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|' r'window)\b', Name.Builtin), | r'eval|isFinite|isNaN|parseFloat|parseInt|document|window)\b', Name.Builtin), | def callback(lexer, match, ctx): yield match.start(), token, match.group(0) | 6876985eb522fc1a3c6c3376e930d5b7243b42a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6148/6876985eb522fc1a3c6c3376e930d5b7243b42a8/web.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1348,
12,
31731,
16,
845,
16,
1103,
4672,
2824,
845,
18,
1937,
9334,
1147,
16,
845,
18,
1655,
12,
20,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1348,
12,
31731,
16,
845,
16,
1103,
4672,
2824,
845,
18,
1937,
9334,
1147,
16,
845,
18,
1655,
12,
20,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
assert s.c == [] | def test_close_local_of_local_start(): up = DummyTransfer() down = DummyTransfer() s = DummyScheduler() c = Connecter(up, down, s, 5, 6) e = DummyEncrypter() c.set_encrypter(e) c.start_connecting(['testcode.com']) assert s.c == [] assert e.c == ['testcode.com'] del e.c[:] dc = DummyConnection('a' * 20, 'testcode.com') c.locally_initiated_connection_completed(dc) assert len(down.cs_made) == 1 and down.cs_made[0].get_id() == 'a' * 20 assert len(up.cs_made) == 0 assert s.c == [] assert dc.m == ['download'] del dc.m[:] down.cs_made[0].send_message('a') assert dc.m == ['a'] c.got_message(dc, 'b') assert down.m == [(down.cs_made[0], 'b')] assert not dc.closed down.cs_made[0].close() assert dc.closed assert s.c == [] | e515f2d77bfcdfdf465f07113b3fb94b00f492ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/e515f2d77bfcdfdf465f07113b3fb94b00f492ad/Connecter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4412,
67,
3729,
67,
792,
67,
3729,
67,
1937,
13332,
731,
273,
28622,
5912,
1435,
2588,
273,
28622,
5912,
1435,
272,
273,
28622,
11870,
1435,
276,
273,
8289,
264,
12,
416,
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,
4412,
67,
3729,
67,
792,
67,
3729,
67,
1937,
13332,
731,
273,
28622,
5912,
1435,
2588,
273,
28622,
5912,
1435,
272,
273,
28622,
11870,
1435,
276,
273,
8289,
264,
12,
416,
16,
... | |
nodes = [] nodes.extend(flatten_nodes(self.defaults)) nodes.append(self.code) return tuple(nodes) | nodelist = [] nodelist.extend(flatten_nodes(self.defaults)) nodelist.append(self.code) return tuple(nodelist) | def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.defaults)) nodes.append(self.code) return tuple(nodes) | 7dce7618a9a2ec21fadacd49967dbf4d460b4941 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/7dce7618a9a2ec21fadacd49967dbf4d460b4941/ast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23895,
12,
2890,
4672,
2199,
273,
5378,
2199,
18,
14313,
12,
16940,
67,
4690,
12,
2890,
18,
7606,
3719,
2199,
18,
6923,
12,
2890,
18,
710,
13,
327,
3193,
12,
4690,
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,
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,
23895,
12,
2890,
4672,
2199,
273,
5378,
2199,
18,
14313,
12,
16940,
67,
4690,
12,
2890,
18,
7606,
3719,
2199,
18,
6923,
12,
2890,
18,
710,
13,
327,
3193,
12,
4690,
13,
2,
-100,
-100,
... |
def __str__(self): return '__str__ overridden' | def __str__(self): return '__str__ overridden' | c7790ed1637ad688ea61decf45703f996f29584d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/c7790ed1637ad688ea61decf45703f996f29584d/test_unicode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
4940,
701,
972,
11000,
11,
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,
... | [
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,
1001,
701,
972,
12,
2890,
4672,
327,
4940,
701,
972,
11000,
11,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
run( "svn add '%s'" % nodefile ) | run( "svn add --no-auto-props '%s'" % nodefile ) | def svn_create_dump_file( filename, fileid, data, reposdir, wcdir ): """Creates a svn dump file using the svn commandline.""" print "" print "=" * 80 print "=== Initialize" print "" # cleanup first kill_dir( reposdir ) kill_dir( wcdir ) # create repos run( "svnadmin create '%s'" % reposdir ) # create wc run( "svn co 'file://%s' '%s'" % ( reposdir, wcdir ) ) # now do the work nrev = len(data) irev = 1 revnr = 0 while irev < nrev: rev = data[irev] irev = irev + 1 revnr = revnr + 1 print "" print "=" * 80 print "=== Revision %d" % revnr print "" if rev.has_key( "author" ): author = rev["author"] else: author = "t%d" % revnr if rev.has_key( "log" ): log = rev["log"] else: log = "log for file '%s' rev %d" % ( fileid, revnr ) nodes = rev["nodes"] nnode = len(nodes) inode = 0 while inode < nnode: nodedata = nodes[inode] inode = inode + 1 action = nodedata["action"] kind = nodedata["kind"] path = nodedata["path"] nodefile = "%s/%s" % ( wcdir, path ) if action == "delete": run( "svn rm '%s'" % nodefile ) elif kind == "dir" and action == "replace": # replace = rm and add run( "svn rm '%s'" % nodefile ) run( "svn add '%s'" % nodefile ) elif kind == "dir" and action == "add": if isdir( nodefile ): # allready there, probably copied with parent dir pass elif nodedata.has_key( "copyfrom" ): # copy from repos copyfrom = nodedata["copyfrom"] fromurl = "file://%s/%s" % ( reposdir, copyfrom[0] ) fromrev = copyfrom[1] run( "svn cp -r %d '%s' '%s'" % ( fromrev, fromurl, nodefile ) ) else: run( "svn mkdir '%s/%s'" % ( wcdir, path ) ) elif kind == "file": add = False if action == "replace": # replace = delete & add add = True run( "svn rm '%s'" % nodefile ) if action == "add" and not isfile( nodefile ): # action 'add' and file doesn't exist if nodedata.has_key( "copyfrom" ): # copy from repos copyfrom = nodedata["copyfrom"] fromurl = "file://%s/%s" % ( reposdir, copyfrom[0] ) fromrev = copyfrom[1] run( "svn cp -r %d '%s' '%s'" % ( fromrev, fromurl, nodefile ) ) # bug in my svn client ?!? #run( "svn up '%s'" % nodefile ) # Philip Martin suggested sleep(1), thanks :) time.sleep(1) else: # it's a normal add add = True if nodedata.has_key( "text" ): # set/modify text print "write text to '%s'" % path text = create_text( nodedata["text"], fileid, revnr ) fileobj = open( nodefile, "wb" ) fileobj.write( text ) fileobj.close() if add: run( "svn add '%s'" % nodefile ) if nodedata.has_key( "props" ): # for each property do a propset or propdel props = nodedata["props"] for name, value in props.items(): if value == None: run( "svn pd '%s' '%s'" % ( name, nodefile ) ) else: run( "svn ps '%s' '%s' '%s'" % \ ( name, value, nodefile ) ) # commit revision run( "svn ci --username '%s' -m '%s' '%s'" % ( author, log, wcdir ) ) # update wc run( "svn up '%s'" % wcdir ) print "" print "=" * 80 print "=== Dump" print "" # dump the repos run( "svnadmin dump '%s' > '%s'" % ( reposdir, filename ) ) print "" print "=== Done" print "=" * 80 print "" | ea426dfb93d645bcd795a74b9f5557fd11fb9429 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13212/ea426dfb93d645bcd795a74b9f5557fd11fb9429/svndumptest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5893,
82,
67,
2640,
67,
8481,
67,
768,
12,
1544,
16,
585,
350,
16,
501,
16,
13686,
1214,
16,
14310,
1214,
262,
30,
3536,
2729,
279,
5893,
82,
4657,
585,
1450,
326,
5893,
82,
28305,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5893,
82,
67,
2640,
67,
8481,
67,
768,
12,
1544,
16,
585,
350,
16,
501,
16,
13686,
1214,
16,
14310,
1214,
262,
30,
3536,
2729,
279,
5893,
82,
4657,
585,
1450,
326,
5893,
82,
28305,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.