rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
sep() | cls.sep() | def opening(self, node): s = u'' # for loop if node.parent.type == "loop" and node.parent.get("loopType") == "FOR": if not node.parent.hasChild("first"): s += write("(;") | 01a99d0db0499777506f7fbf9ecf7a7e70c7a9e2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/01a99d0db0499777506f7fbf9ecf7a7e70c7a9e2/Packer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10890,
12,
2890,
16,
756,
4672,
272,
273,
582,
6309,
468,
364,
2798,
309,
756,
18,
2938,
18,
723,
422,
315,
6498,
6,
471,
756,
18,
2938,
18,
588,
2932,
6498,
559,
7923,
422,
315,
747... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10890,
12,
2890,
16,
756,
4672,
272,
273,
582,
6309,
468,
364,
2798,
309,
756,
18,
2938,
18,
723,
422,
315,
6498,
6,
471,
756,
18,
2938,
18,
588,
2932,
6498,
559,
7923,
422,
315,
747... |
u = self.random() | u = 1.0 - self.random() | def weibullvariate(self, alpha, beta): """Weibull distribution. | 72354f9f4eb9ba40dba8bc67a76cfaec33d057ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/72354f9f4eb9ba40dba8bc67a76cfaec33d057ed/random.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
732,
495,
420,
1401,
3840,
12,
2890,
16,
4190,
16,
6796,
4672,
3536,
3218,
495,
420,
7006,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
732,
495,
420,
1401,
3840,
12,
2890,
16,
4190,
16,
6796,
4672,
3536,
3218,
495,
420,
7006,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.assertRaises(Exception, test_view('ldap_authentication')) | test_view('ldap_authentication') | def test0005views(self): ''' Test views. ''' self.assertRaises(Exception, test_view('ldap_authentication')) | 48e1b3a3b8075484686d97bc8de2f7244f1a0e85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9279/48e1b3a3b8075484686d97bc8de2f7244f1a0e85/test_ldap_authentication.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3784,
25,
7061,
12,
2890,
4672,
9163,
7766,
7361,
18,
9163,
365,
18,
11231,
12649,
6141,
12,
503,
16,
1842,
67,
1945,
2668,
14394,
67,
12293,
26112,
2,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3784,
25,
7061,
12,
2890,
4672,
9163,
7766,
7361,
18,
9163,
365,
18,
11231,
12649,
6141,
12,
503,
16,
1842,
67,
1945,
2668,
14394,
67,
12293,
26112,
2,
-100,
-100,
-100,
-100,
-100... |
streer__urlencode_records = 0; | want_urlencode_records = 0; | def __sendUsageXML(meterId, recordXml, messageType = "URLEncodedUpdate"): global __connection global __connectionError global __certificateRejected global __connectionRetries global streer__urlencode_records global __resending # Backward compatibility with old collectors if (streer__urlencode_records == 0): messageType = "update" try: # Connect to the web service, in case we aren't already # connected. If we are already connected, this call will do # nothing if not __connect(): # Failed to connect raise IOError # Kick out to except: clause # Generate a unique Id for this transaction transactionId = meterId + TimeToString().replace(":","") DebugPrint(3, 'TransactionId: ' + transactionId) if Config.get_UseSSL() == 0 and Config.get_UseSoapProtocol() == 1: # Use the following template to call the interface that has # the 'Event' object as a parameter soapServiceTemplate = """<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <soap:Body> <collectUsageXml> <event xmlns:ns2="http://gratia.sf.net" xsi:type="ns2:event"> <_id >%s</_id> <_xml>%s</_xml> </event> </collectUsageXml> </soap:Body> </soap:Envelope> """ # Insert the actual xml data into the soap template, being sure to clean out any illegal characters soapMessage = soapServiceTemplate%(transactionId, escapeXML(recordXml)) DebugPrint(4, 'Soap message: ' + soapMessage) # Configure the requestor to request a Post to the GratiaCollector web service __connection.putrequest('POST', Config.get_CollectorService()) # Include user and data information __connection.putheader('Host', Config.get_SOAPHost()) __connection.putheader('User-Agent', 'Python post') __connection.putheader('Content-type', 'text/xml; charset=\'UTF-8\'') __connection.putheader('Content-length', '%d' % len(soapMessage)) __connection.putheader('SOAPAction', '') __connection.endheaders() # Send the soap message to the web service __connection.send(soapMessage) # Get the web service response to the request (status_code, message, reply_headers) = __connection.getreply() # Read the response attachment to get the actual soap response responseString = __connection.getfile().read() # Parse the response string into a response object try: doc = safeParseXML(responseString) codeNode = doc.getElementsByTagName('ns1:_code') messageNode = doc.getElementsByTagName('ns1:_message') if codeNode.length == 1 and messageNode.length == 1: response = Response(int(codeNode[0].childNodes[0].data), messageNode[0].childNodes[0].data) else: response = Response(Response.AutoSet, responseString) except: response = Response(Response.Failed, responseString) elif Config.get_UseSSL() == 0 and Config.get_UseSoapProtocol() == 0: queryString = __encodeData(messageType, recordXml) # Attempt to make sure Collector can actually read the post. headers = {"Content-type": "application/x-www-form-urlencoded"} __connection.request("POST", Config.get_CollectorService(), queryString, headers) responseString = __connection.getresponse().read() response = Response(Response.AutoSet, responseString) if response.get_code() == Response.UnknownCommand: # We're talking to an old collector DebugPrint(0, "Unable to send new record to old collector -- engaging backwards-compatible mode for remainder of connection") streer__urlencode_records = 0; # Try again with the same record before returning to the # caller. There will be no infinite recursion because # __url_records has been reset response = __sendUsageXML(meterId, recordXml, messageType) else: # SSL DebugPrint(4, "DEBUG: Encoding data for SSL transmission") queryString = __encodeData(messageType, recordXml) DebugPrint(4, "DEBUG: Encoding data for SSL transmission: OK") # Attempt to make sure Collector can actually read the post. headers = {"Content-type": "application/x-www-form-urlencoded"} DebugPrint(4, "DEBUG: POST") __connection.request("POST",Config.get_SSLCollectorService(), queryString, headers) DebugPrint(4, "DEBUG: POST: OK") DebugPrint(4, "DEBUG: Read response") responseString = __connection.getresponse().read() DebugPrint(4, "DEBUG: Read response: OK") response = Response(Response.AutoSet, responseString) if response.get_code() == Response.UnknownCommand: # We're talking to an old collector DebugPrint(0, "Unable to send new record to old collector -- engaging backwards-compatible mode for remainder of connection") streer__urlencode_records = 0; # Try again with the same record before returning to the # caller. There will be no infinite recursion because # __url_records has been reset response = __sendUsageXML(meterId, recordXml, messageType) elif response.get_code() == Response.BadCertificate: __connectionError = True __certificateRejected = True response = Response(Response.AutoSet, responseString) if response.get_code == Response.ConnectionError or response.get_code == Response.CollectorError: # Server threw an error - 503, maybe? __connectionError = True response = Response(Response.Failed, r'Server unable to receive data: save for reprocessing'); except SystemExit: raise except httplib.BadStatusLine, e: DebugPrint(0, 'Received BadStatusLine exception:', e.args) __connectionError = True if e.args[0] == '' and not __resending: DebugPrint(0, 'Possible connection timeout: resend this record') __resending = 1 response = __sendUsageXML(meterId, recordXml, messageType) else: DebugPrintTraceback(1) response = Response(Response.Failed,"Failed to send xml to web service") except: DebugPrint(0,'Failed to send xml to web service due to an error of type "', sys.exc_info()[0], '": ', sys.exc_info()[1]) DebugPrintTraceback(1) # Upon a connection error, we will stop to try to reprocess but will continue to # try sending __connectionError = True response = Response(Response.Failed,"Failed to send xml to web service") __resending = 0 DebugPrint(2, 'Response: ' + str(response)) return response | febe01b27142a70e6115797a58b054b34a42f67b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/637/febe01b27142a70e6115797a58b054b34a42f67b/Gratia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4661,
5357,
4201,
12,
81,
847,
548,
16,
1409,
4432,
16,
22402,
273,
315,
1785,
10397,
1891,
6,
4672,
2552,
1001,
4071,
2552,
1001,
4071,
668,
2552,
1001,
14108,
19902,
2552,
1001,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4661,
5357,
4201,
12,
81,
847,
548,
16,
1409,
4432,
16,
22402,
273,
315,
1785,
10397,
1891,
6,
4672,
2552,
1001,
4071,
2552,
1001,
4071,
668,
2552,
1001,
14108,
19902,
2552,
1001,
... |
support.run_unittest(FnmatchTestCase) | support.run_unittest(FnmatchTestCase, TranslateTestCase, FilterTestCase) | def test_main(): support.run_unittest(FnmatchTestCase) | 7eb477c67461f60984caea308287724d9a6429c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/7eb477c67461f60984caea308287724d9a6429c5/test_fnmatch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
13332,
2865,
18,
2681,
67,
4873,
3813,
12,
5372,
1916,
4709,
2449,
16,
16820,
4709,
2449,
16,
4008,
4709,
2449,
13,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
13332,
2865,
18,
2681,
67,
4873,
3813,
12,
5372,
1916,
4709,
2449,
16,
16820,
4709,
2449,
16,
4008,
4709,
2449,
13,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
print "self.bdist_dir = %s" % self.bdist_dir print "self.format = %s" % self.format | def run (self): | 8fd7ba2c6a333993480a0a9f52332463de79b95f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8fd7ba2c6a333993480a0a9f52332463de79b95f/bdist_dumb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
if 'Data Encipherment' not in r: r.append('Data Encipherment') | def _fix_key_usage(self, values): """ invalid values are 'Non Repudiation' and 'keyCertSign' digitalSignature is required """ r = [] for v in values.split(', '): if v in ['Non Repudiation', 'keyCertSign']: continue r.append(v) if 'Digital Signature' not in r: r.append('Digital Signature') if 'Data Encipherment' not in r: r.append('Data Encipherment') return ', '.join(r) | 76ddcfe32abe08ffa3b0718c67c62dae2fb763be /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13183/76ddcfe32abe08ffa3b0718c67c62dae2fb763be/proxy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
904,
67,
856,
67,
9167,
12,
2890,
16,
924,
4672,
3536,
2057,
924,
854,
296,
3989,
868,
84,
1100,
7072,
11,
471,
296,
856,
5461,
2766,
11,
25615,
5374,
353,
1931,
3536,
436,
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,
389,
904,
67,
856,
67,
9167,
12,
2890,
16,
924,
4672,
3536,
2057,
924,
854,
296,
3989,
868,
84,
1100,
7072,
11,
471,
296,
856,
5461,
2766,
11,
25615,
5374,
353,
1931,
3536,
436,
273,
... | |
_udp_socks = {socket.AF_INET: [], socket.AF_UNIX: []} | if is_win32: _udp_socks = {socket.AF_INET: []} else: _udp_socks = {socket.AF_INET: [], socket.AF_UNIX: []} | def close(self): self.del_channel(_map) self.socket.close() | dab10d21d1351712487ac4d13554a3be0bb6eed0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9502/dab10d21d1351712487ac4d13554a3be0bb6eed0/async.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
365,
18,
3771,
67,
4327,
24899,
1458,
13,
365,
18,
7814,
18,
4412,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
365,
18,
3771,
67,
4327,
24899,
1458,
13,
365,
18,
7814,
18,
4412,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
P ( contents = [ | P ( contents = [ | def makePage( _T, _N, _M, MIRRORS_DATA, lang, charset ): navigation = Tree \ ( [ P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['home'], href=makeURL( '.', lang ))] ), Tree \ ( [ P ( contents = [ Img( src = '%(ROOT)simages/englishlogo.png', width = 16, height = 10), A( 'English', href='%(BASE)s.' )]), P ( contents = [ Img( src = '%(ROOT)simages/germanylogo.png', width = 16, height = 10), A( 'Deutsch', href='%(BASE)sde/' )]), P ( contents = [ Img( src = '%(ROOT)simages/greecelogo.png', width = 16, height = 10), A( 'Ελληυικά', href='%(BASE)sel/' )]), P ( contents = [ Img( src = '%(ROOT)simages/francelogo.png', width = 16, height = 10), A( 'Français', href='%(BASE)sfr/' )]), P ( contents = [ Img( src = '%(ROOT)simages/italylogo.png', width = 16, height = 10), A( 'Italiano', href='%(BASE)sit/' )]), P ( contents = [ Img( src = '%(ROOT)simages/netherlandslogo.png', width = 16, height = 10), A( 'Nederlands', href='%(BASE)snl/' )]), P ( contents = [ Img( src = '%(ROOT)simages/polandlogo.png', width = 16, height = 10), A( 'Polski', href='%(BASE)spl/' )]), P ( contents = [ Img( src = '%(ROOT)simages/portugallogo.png', width = 16, height = 10), A( 'Português', href='%(BASE)spt/' )]), P ( contents = [ Img( src = '%(ROOT)simages/russialogo.png', width = 16, height = 10), A( 'Русский', href='%(BASE)sru/' )]), P ( contents = [ Img( src = '%(ROOT)simages/spanishlogo.png', width = 16, height = 10), A( 'Español', href='%(BASE)ses/' )]), P ( contents = [ Img( src = '%(ROOT)simages/finlandlogo.png', width = 16, height = 10), A( 'Suomi', href='%(BASE)sfi/' )]), P ( contents = [ Img( src = '%(ROOT)simages/swedenlogo.png', width = 16, height = 10), A( 'Svenska', href='%(BASE)ssv/' )]), P ( contents = [ Img( src = '%(ROOT)simages/czechlogo.png', width = 16, height = 10), A( 'Česky', href='%(BASE)scs/' )]) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['news'], href=makeURL( 'news/', lang ) )]), Tree ( A( _N['archive'], href=makeURL( 'news/archive/', lang ) ) ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['introduction'], href=makeURL( 'introduction/', lang ) ) ]), Tree \ ( [ #A( _N['status'], href=makeURL('introduction/status/everything.html' ), A( _N['screenshots'], href=makeURL( 'pictures/screenshots/', lang) ), A( _N['ports'], href=makeURL( 'introduction/ports', lang ) ), A( _N['license'], href='%(BASE)slicense.html' ) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['download'], href=makeURL( 'download', lang ) )]), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), _N['documentation'] ]), Tree \ ( [ A( _N['users'], href=makeURL( 'documentation/users/', lang ) ), Tree \ ( [ A( _N['installation'], href=makeURL( 'documentation/users/installation', lang ) ), A( _N['using'], href=makeURL( 'documentation/users/using', lang ) ), A( _N['shell'], href=makeURL( 'documentation/users/shell/index', lang ) ), A( _N['applications'], href=makeURL( 'documentation/users/applications/index', lang ) ), A( _N['faq'], href=makeURL( 'documentation/users/faq', lang ) ), #_N['ports'], #A( _N['links'], href=makeURL( 'documentation/users/links', lang ) ) ] ), A( _N['developers'], href=makeURL( 'documentation/developers/index', lang ) ), Tree \ ( [ A( _N['contribute'], href=makeURL( 'documentation/developers/contribute', lang ) ), A( 'Roadmap', href=makeURL( 'documentation/developers/roadmap', lang ) ), A( _N['bug-tracker'], href='http://sourceforge.net/tracker/?atid=439463&group_id=43586&func=browse' ), A( _N['working-with-subversion'], href=makeURL( 'documentation/developers/svn', lang ) ), A( _N['compiling'], href=makeURL( 'documentation/developers/compiling', lang ) ), A( _N['application-development-manual'], href=makeURL( 'documentation/developers/app-dev/index', lang ) ), A( _N['zune-application-development-manual'], href=makeURL( 'documentation/developers/zune-application-development', lang ) ), A( _N['system-development-manual'], href=makeURL( 'documentation/developers/system-development', lang ) ), A( _N['debugging-manual'], href=makeURL( 'documentation/developers/debugging', lang ) ), A( _N['reference'], href=makeURL( 'documentation/developers/autodocs/index', lang ) ), A( _N['specifications'], href=makeURL( 'documentation/developers/specifications/', lang ) ), A( _N['ui-style-guide'], href=makeURL( 'documentation/developers/ui', lang ) ), A( _N['documenting'], href=makeURL( 'documentation/developers/documenting', lang ) ), A( _N['porting'], href=makeURL( 'documentation/developers/porting', lang ) ), A( _N['translating'], href=makeURL( 'documentation/developers/translating', lang ) ), A( _N['summaries'], href=makeURL( 'documentation/developers/summaries/', lang ) ), A( _N['links'], href=makeURL( 'documentation/developers/links', lang ) ) ] ) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['contact'], href=makeURL( 'contact', lang ) )]), Tree \ ( [ A( _N['mailing-lists'], href=makeURL( 'contact', lang, 'mailing-lists' ) ), #A( _N['forums'], href=makeURL( 'contact', lang, 'forums' ) ), A( _N['irc-channels'], href=makeURL( 'contact', lang, 'irc-channels' ) ) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['credits'], href=makeURL( 'credits', lang ) )]), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( 'Acknowledgements', href=makeURL( 'acknowledgements', lang ) )]), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), _N['pictures']]), Tree \ ( [ A( _N['developers'], href=makeURL( 'pictures/developers/', lang ) ), A( _N['developers-together'], href=makeURL( 'pictures/developers-together/', lang ) ) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['sponsors'], href=makeURL( 'sponsors', lang ) )]), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['linking'], href=makeURL( 'linking', lang ) )]), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['links'], href=makeURL( 'links', lang ) )]) ] ) counter = Img( src = 'http://www.hepe.com/cgi-bin/wwwcount.cgi?df=aros.dat&dd=E&ft=0' ) sponsors = Table\ ( cellspacing = 5, cellpadding = 0, contents = [ TR ( TD ( A ( Img( src = '%(ROOT)simages/trustec-small.png', border = 0 ), href = 'http://www.trustsec.de/' ) ) ), TR ( TD ( A ( Img( src = '%(ROOT)simages/genesi-small.gif', border = 0 ), href = 'http://www.pegasosppc.com/' ) ) ), TR ( TD ( A \ ( Img \ ( src = 'http://sflogo.sourceforge.net/sflogo.php?group_id=43586&type=1', width = 88, height = 31, border = 0, alt = 'SourceForge Logo' ), href = 'http://sourceforge.net/' ) ) ) ] ) bar = Table( border = 0, cellpadding = 2, cellspacing = 2, width = 171, valign = 'top', contents = [ TR( valign = 'top', contents = [ TD( rowspan = 8, width=15 ), TD() ] ), TR( valign = 'top', contents = TD( navigation ) ), TR( TD(), height=15 ), TR( valign = 'top', contents = TD( align = 'center', contents = counter ) ), TR( TD(), height=15 ), TR( valign = 'top', contents = TD( align = 'center', contents = sponsors ) ), TR( TD(), height=30 ), TR \ ( valign = 'top', contents = TD \ ( align = 'center', contents = A \ ( Img \ ( src = '%(ROOT)simages/noeupatents-small.png', border = 0 ), href = 'http://petition.eurolinux.org/' ) ) ) ] ) statsPHP = ''' <?php //define("_BBC_PAGE_NAME", "my page title"); define("_BBCLONE_DIR", "%(ROOT)smybbclone/"); define("COUNTER", _BBCLONE_DIR."index.php"); if (file_exists(COUNTER)) include_once(COUNTER); ?> ''' statsPHP2 = ''' <?php echo date("m.d.y"); ?> ''' statsPHP3 = ''' <?php echo "<map name=\\"map\\">"; echo "<area shape=\\"rect\\" coords=\\"11,80,82,95\\" alt=\\"http://www.aros.org\\" href=\\"http://www.aros.org\\">"; echo "<area shape=\\"rect\\" coords=\\"87,78,165,95\\" alt=\\"AROS-Exec\\" href=\\"http://www.aros-exec.org\\">"; echo "<area shape=\\"rect\\" coords=\\"244,77,323,95166,77,240,95\\" alt=\\"Team AROS\\" href=\\"http://www.teamaros.org\\">"; echo "<area shape=\\"rect\\" coords=\\"166,77,240,95\\" alt=\\"AROS-Exec Archives\\" href=\\"http://archives.aros-exec.org\\">"; echo "</map>"; ?> ''' statsPHP4 = ''' <?php echo "<table width=\\"100%%\\"><tr><td>"; echo "<div style=\\"text-align: right;\\">"; echo "<font color=\\"#aaaaaa\\">"; ?> ''' statsPHP6 = ''' <?php echo "</font></div>"; echo "</p></tr></td></table>"; ?> ''' statsPHP5= ''' <?php include( '/home/groups/a/ar/aros/htdocs/rsfeed/browserdetect.php'); $win_ie56 = (browser_detection('browser') == 'ie' ) && (browser_detection('number') >= 5 ) && (browser_detection('number') < 7 ); if ($win_ie56) { echo \"<img src=\\"/images/kittymascot.gif\\" style=\\"float:right\\" border=\\"0\\"></img><img src=\\"/images/toplogomenu.gif\\" border=\\"0\\" usemap=\\"#map\\"></img>"; } else { echo \"<img src=\\"/images/kittymascot.png\\" style=\\"float:right\\" border=\\"0\\"></img><img src=\\"/images/toplogomenu.png\\" border=\\"0\\" usemap=\\"#map\\"></img>"; } ?> ''' page = HTML( [ Head( [ Charset( charset ), Title( 'AROS Research Operating System' ), Link( href = '%(ROOT)saros.css', type = 'text/css', rel = 'stylesheet' ), Meta( name = 'keywords', content = 'AROS, OS, operating system, research, open source, portage' ) ] ), Body( style = 'margin: 0px;', bgcolor = '#ffffff', contents = [ statsPHP3, Table( border = 0, cellspacing = 0, cellpadding = 0, width = '100%%', contents = [ TR( [ TD( halign = 'top', width = '100%%', height = 109, background='%(ROOT)simages/backgroundtop.png' ,rowspan = 4, contents = statsPHP5) | 6f57d571cb5a191a538d1b271f46a3e100233a4d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4747/6f57d571cb5a191a538d1b271f46a3e100233a4d/page.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
1964,
12,
389,
56,
16,
389,
50,
16,
389,
49,
16,
490,
7937,
2784,
55,
67,
4883,
16,
3303,
16,
4856,
262,
30,
10394,
273,
4902,
521,
261,
306,
453,
261,
2939,
273,
306,
2221,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1964,
12,
389,
56,
16,
389,
50,
16,
389,
49,
16,
490,
7937,
2784,
55,
67,
4883,
16,
3303,
16,
4856,
262,
30,
10394,
273,
4902,
521,
261,
306,
453,
261,
2939,
273,
306,
2221,
... |
P = self._check_valid() return P.get(self._name) | return self.str() | def __str__(self): P = self._check_valid() return P.get(self._name) | 590fbc72da02767df12740376902552b2b6577f3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/590fbc72da02767df12740376902552b2b6577f3/axiom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
453,
273,
365,
6315,
1893,
67,
877,
1435,
327,
453,
18,
588,
12,
2890,
6315,
529,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
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,
453,
273,
365,
6315,
1893,
67,
877,
1435,
327,
453,
18,
588,
12,
2890,
6315,
529,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
connection.requestHeaders['PATH_INFO']=info connection.uri= path | connection.requestHeaders['PATH-INFO']=info connection.uri= path[len(Configuration.documentRoot):] | def rewrite(self, match, connection, sessionDict, key): fs=Configuration.documentRootFS (path, info)=fs.split_extra(connection.uri) if not path: raise PreemptiveResponse, self.notFoundHandler(connection, sessionDict) else: if self.add_info_to_args: connection.args[self.path_info_var_name]=info connection.requestHeaders['PATH_INFO']=info connection.uri= path | 4b4173bf9fcfcb4f9d8cfb79af60b388349f63d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2304/4b4173bf9fcfcb4f9d8cfb79af60b388349f63d9/rewrite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10738,
12,
2890,
16,
845,
16,
1459,
16,
1339,
5014,
16,
498,
4672,
2662,
33,
1750,
18,
5457,
2375,
4931,
261,
803,
16,
1123,
13,
33,
2556,
18,
4939,
67,
7763,
12,
4071,
18,
1650,
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,
10738,
12,
2890,
16,
845,
16,
1459,
16,
1339,
5014,
16,
498,
4672,
2662,
33,
1750,
18,
5457,
2375,
4931,
261,
803,
16,
1123,
13,
33,
2556,
18,
4939,
67,
7763,
12,
4071,
18,
1650,
13,... |
sage: T = CrystalOfTableaux(['C',2], shape = [2,1]) sage: T.check() True | sage: T = CrystalOfTableaux(['A',2], shape = []) sage: T.list() [[]] sage: T = CrystalOfTableaux(['C',2], shape = [1]) sage: T.check() True sage: T.list() [[[1]], [[2]], [[-2]], [[-1]]] | def positionsOfUnmatchedPlus(self, i): | c27699b8bb22b7b3e572ffbdc158cfe8fb39e194 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/c27699b8bb22b7b3e572ffbdc158cfe8fb39e194/tensor_product.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6865,
951,
984,
11073,
13207,
12,
2890,
16,
277,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6865,
951,
984,
11073,
13207,
12,
2890,
16,
277,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
PREFIX_REGEXP = re.compile(r"^(?P<prefix>(%s)(%s)?)\s?\b(?P<name>.*)" % | PREFIX_REGEXP = re.compile(r"^(?P<prefix>(%s)(%s)?)\s?\b(?P<name>.+)" % | def first_letter_equal(self, a, b): """returns True if the letters a and b are equal in the map index, e.g. É and E are equals in French map index""" return a == b | a3954ae3823ae93bb76bf369182672beb3ba37b2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9326/a3954ae3823ae93bb76bf369182672beb3ba37b2/i18n.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1122,
67,
13449,
67,
9729,
12,
2890,
16,
279,
16,
324,
4672,
3536,
6154,
1053,
309,
326,
13768,
279,
471,
324,
854,
3959,
316,
326,
852,
770,
16,
425,
18,
75,
18,
225,
132,
236,
471,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1122,
67,
13449,
67,
9729,
12,
2890,
16,
279,
16,
324,
4672,
3536,
6154,
1053,
309,
326,
13768,
279,
471,
324,
854,
3959,
316,
326,
852,
770,
16,
425,
18,
75,
18,
225,
132,
236,
471,... |
timer.sleep(0.033) | visionSystem.unbackground(True) | def testRedLightDetector(self): # Create a vision system with two mock cameras and an EventHub cfg = { 'name' : 'Test', 'type' : 'TestSubsystem' } cfg = core.ConfigNode.fromString(str(cfg)) forwardCamera = vision.Camera(640,480) backwardCamera = vision.Camera(640,480) | 0ecefb998dc72110f3fdf1303502deae88148fae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10608/0ecefb998dc72110f3fdf1303502deae88148fae/TestVisionSystem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3715,
12128,
12594,
12,
2890,
4672,
468,
1788,
279,
331,
1951,
2619,
598,
2795,
5416,
5861,
12067,
471,
392,
2587,
8182,
2776,
273,
288,
296,
529,
11,
294,
296,
4709,
2187,
296,
72... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3715,
12128,
12594,
12,
2890,
4672,
468,
1788,
279,
331,
1951,
2619,
598,
2795,
5416,
5861,
12067,
471,
392,
2587,
8182,
2776,
273,
288,
296,
529,
11,
294,
296,
4709,
2187,
296,
72... |
if resp[:3] != '281': | if not resp.startswith(b'281'): | def __init__(self, host, port=NNTP_PORT, user=None, password=None, readermode=None, usenetrc=True): """Initialize an instance. Arguments: - host: hostname to connect to - port: port to connect to (default the standard NNTP port) - user: username to authenticate with - password: password to use with username - readermode: if true, send 'mode reader' command after connecting. | 17de0ac39e028b8777529030dfc984cdf592a543 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/17de0ac39e028b8777529030dfc984cdf592a543/nntplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
16,
1756,
33,
50,
1784,
52,
67,
6354,
16,
729,
33,
7036,
16,
2201,
33,
7036,
16,
855,
1035,
390,
33,
7036,
16,
584,
31034,
1310,
33,
5510,
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,
1001,
2738,
972,
12,
2890,
16,
1479,
16,
1756,
33,
50,
1784,
52,
67,
6354,
16,
729,
33,
7036,
16,
2201,
33,
7036,
16,
855,
1035,
390,
33,
7036,
16,
584,
31034,
1310,
33,
5510,
4672,
... |
tui.Item('main_results', show_label=False), | tui.UItem('main_results'), | def getstats(cls, obj=None): self = cls(obj) return pstats.Stats(self) | 1abb1fd080526092ab77808de73a8c00f92915ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13166/1abb1fd080526092ab77808de73a8c00f92915ef/sike.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
5296,
12,
6429,
16,
1081,
33,
7036,
4672,
365,
273,
2028,
12,
2603,
13,
327,
293,
5296,
18,
4195,
12,
2890,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
5296,
12,
6429,
16,
1081,
33,
7036,
4672,
365,
273,
2028,
12,
2603,
13,
327,
293,
5296,
18,
4195,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
finished.update(unfinished) requests = finished.values() | finished.extend(unfinished.values()) requests = finished | def analyze(f, top, sortf, start=None, end=None, mode='cumulative'): beginrequests = {} cumulative = {} finished = {} unfinished = {} while 1: line = f.readline() if not line: break line = string.strip(line) tup = parsebigmlogline(line) if tup is None: print "Could not interpret line: %s" % line continue code, id, timestr, desc = tup timestr = string.strip(timestr) fromepoch = getdate(timestr) if start is not None and fromepoch < start: continue if end is not None and fromepoch > end: break request = unfinished.get(id) if request is None: if code != "B": continue # garbage at beginning of file request = Request() unfinished[id] = request request.put(code, int(fromepoch), desc) if request.isfinished(): del unfinished[id] finished[id] = request request.active = len(unfinished) finished.update(unfinished) requests = finished.values() if mode == 'cumulative': for request in requests: url = request.url stats = cumulative.get(url) if stats is None: stats = Cumulative(url) cumulative[url] = stats stats.put(request) cumulative = cumulative.values() if mode == 'cumulative': dict = cumulative elif mode == 'detailed': dict = requests else: raise "Invalid mode." dict.sort(sortf) write(dict, top) | c648c5bbce99b81bc4eb3d9d537b410d346db716 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c648c5bbce99b81bc4eb3d9d537b410d346db716/requestprofiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12375,
12,
74,
16,
1760,
16,
1524,
74,
16,
787,
33,
7036,
16,
679,
33,
7036,
16,
1965,
2218,
71,
11276,
11,
4672,
2376,
11420,
273,
2618,
15582,
273,
2618,
6708,
273,
2618,
640,
13527,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12375,
12,
74,
16,
1760,
16,
1524,
74,
16,
787,
33,
7036,
16,
679,
33,
7036,
16,
1965,
2218,
71,
11276,
11,
4672,
2376,
11420,
273,
2618,
15582,
273,
2618,
6708,
273,
2618,
640,
13527,... |
"-p", "9000", "-H", "rmcpp_integ_sik", "localhost"]) | "-p", "9000", "localhost"]) | def main(): gtk.main() return 0 | 0e58b67b299efd7c965f3791912fb42b900a8540 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3867/0e58b67b299efd7c965f3791912fb42b900a8540/ipmigui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
22718,
18,
5254,
1435,
327,
374,
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,
... | [
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,
2774,
13332,
22718,
18,
5254,
1435,
327,
374,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
], 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,... |
email = comment['email'] | email = escape_SMTP_commands(clean_author(comment['email'])) | def send_email(config, entry, comment, comment_dir, comment_filename): """Send an email to the blog owner on a new comment @param config: configuration as parsed by Pyblosxom @type config: dictionary @param entry: a file entry @type config: dictionary @param comment: comment as generated by readComment @type comment: dictionary @param comment_dir: the comment directory @type comment_dir: string @param comment_filename: file name of current comment @type comment_filename: string """ import smtplib # import the formatdate function which is in a different # place in Python 2.3 and up. try: from email.Utils import formatdate except ImportError: from rfc822 import formatdate author = escape_SMTP_commands(clean_author(comment['author'])) description = escape_SMTP_commands(comment['description']) ipaddress = escape_SMTP_commands(comment.get('ipaddress', '?')) if comment.has_key('email'): email = comment['email'] else: email = config['comment_smtp_from'] try: server = smtplib.SMTP(config['comment_smtp_server']) curl = config['base_url']+'/'+entry['file_path'] comment_dir = os.path.join(config['comment_dir'], entry['absolute_path']) message = [] message.append("From: %s" % email) message.append("To: %s" % config["comment_smtp_to"]) message.append("Date: %s" % formatdate(float(comment['pubDate']))) message.append("Subject: write back by %s" % author) message.append("") message.append("%s\n%s\n%s\n%s\n" % (description, ipaddress, comment_filename, curl)) server.sendmail(from_addr=email, to_addrs=config['comment_smtp_to'], msg="\n".join(message)) server.quit() except Exception, e: logger = tools.getLogger() logger.error("error sending email: %s" % e) | 229d7e57a59cd251c44642b2134e58fd4968adcb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11836/229d7e57a59cd251c44642b2134e58fd4968adcb/comments.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
3652,
12,
1425,
16,
1241,
16,
2879,
16,
2879,
67,
1214,
16,
2879,
67,
3459,
4672,
3536,
3826,
392,
2699,
358,
326,
10700,
3410,
603,
279,
394,
2879,
225,
632,
891,
642,
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,
1366,
67,
3652,
12,
1425,
16,
1241,
16,
2879,
16,
2879,
67,
1214,
16,
2879,
67,
3459,
4672,
3536,
3826,
392,
2699,
358,
326,
10700,
3410,
603,
279,
394,
2879,
225,
632,
891,
642,
30,
... |
'AND ( planned_date <= %s or planned_date IS NULL)) '\ | 'AND ( planned_date <= %s )) '\ | def products_by_location(self, cursor, user, location_ids, product_ids=None, with_childs=False, skip_zero=True, context=None): """ Compute for each location and product the stock quantity in the default uom of the product. | 4ec9e17a1a2764f8ea2f273f6195da4f595db87c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9298/4ec9e17a1a2764f8ea2f273f6195da4f595db87c/product.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10406,
67,
1637,
67,
3562,
12,
2890,
16,
3347,
16,
729,
16,
2117,
67,
2232,
16,
3017,
67,
2232,
33,
7036,
16,
598,
67,
3624,
87,
33,
8381,
16,
2488,
67,
7124,
33,
5510,
16,
819,
33... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10406,
67,
1637,
67,
3562,
12,
2890,
16,
3347,
16,
729,
16,
2117,
67,
2232,
16,
3017,
67,
2232,
33,
7036,
16,
598,
67,
3624,
87,
33,
8381,
16,
2488,
67,
7124,
33,
5510,
16,
819,
33... |
"as gen_%d:" % context.lookup_data('clause_num'), "for dummy in gen_%d:" % context.lookup_data('clause_num'), | "as gen_%d:" % context.lookup_data('decl_num'), "for dummy in gen_%d:" % context.lookup_data('decl_num'), | def gen_fc_for_false(rule, arg_patterns, arg_context): engine = rule.rule_base.engine patterns = rule.goal_arg_patterns() if len(arg_patterns) == len(patterns): context = contexts.bc_context(rule) try: if all(itertools.imap(lambda pat, arg: pat.match_pattern(context, context, arg, arg_context), patterns, arg_patterns)): rule.rule_base.num_bc_rules_matched += 1 mark1 = context.mark(True) if rule.pattern(0).match_data(context, context, (('STARTING_LINENO', context.lookup_data('start_lineno')), "with knowledge_base.Gen_once if index == %d \\" % \ context.lookup_data('clause_num'), ('INDENT', 9), "else engine.lookup(%r, %r, context," % \ (context.lookup_data('kb_name'), context.lookup_data('entity_name')), ('INDENT', 19), "rule.foreach_patterns(%d)) \\" % context.lookup_data('clause_num'), 'POPINDENT', 'POPINDENT', ('INDENT', 2), "as gen_%d:" % context.lookup_data('clause_num'), "for dummy in gen_%d:" % context.lookup_data('clause_num'), ('ENDING_LINENO', context.lookup_data('end_lineno')), ('INDENT', 2), )): context.end_save_all_undo() rule.rule_base.num_bc_rule_successes += 1 yield else: context.end_save_all_undo() context.undo_to_mark(mark1) rule.rule_base.num_bc_rule_failures += 1 finally: context.done() | bd4e660a9ed69b909bf026a87883b9b1a9562934 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14714/bd4e660a9ed69b909bf026a87883b9b1a9562934/compiler_bc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
67,
7142,
67,
1884,
67,
5743,
12,
5345,
16,
1501,
67,
13317,
16,
1501,
67,
2472,
4672,
4073,
273,
1720,
18,
5345,
67,
1969,
18,
8944,
6884,
273,
1720,
18,
27354,
67,
3175,
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,
3157,
67,
7142,
67,
1884,
67,
5743,
12,
5345,
16,
1501,
67,
13317,
16,
1501,
67,
2472,
4672,
4073,
273,
1720,
18,
5345,
67,
1969,
18,
8944,
6884,
273,
1720,
18,
27354,
67,
3175,
67,
... |
if K is None: | if K is None or K is self.ground_ring(): | def inertia_degree(self, K = None): if K is None: return 1 else: raise NotImplementedError | 7bf6dee61c60ab6092c1af87c4a29df3ba127fbc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/7bf6dee61c60ab6092c1af87c4a29df3ba127fbc/eisenstein_extension_generic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
316,
31449,
67,
21361,
12,
2890,
16,
1475,
273,
599,
4672,
309,
1475,
353,
599,
578,
1475,
353,
365,
18,
2915,
67,
8022,
13332,
327,
404,
469,
30,
1002,
11206,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
316,
31449,
67,
21361,
12,
2890,
16,
1475,
273,
599,
4672,
309,
1475,
353,
599,
578,
1475,
353,
365,
18,
2915,
67,
8022,
13332,
327,
404,
469,
30,
1002,
11206,
2,
-100,
-100,
-100,
-10... |
request.shutdown(socket.SHUT_WR) | try: request.shutdown(socket.SHUT_WR) except socket.error: pass | def close_request(self, request): """Called to clean up an individual request.""" request.shutdown(socket.SHUT_WR) request.close() | b362bf8c79861d09c855c8a21039454d43c6c7d2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/b362bf8c79861d09c855c8a21039454d43c6c7d2/SocketServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
2293,
12,
2890,
16,
590,
4672,
3536,
8185,
358,
2721,
731,
392,
7327,
590,
12123,
775,
30,
282,
590,
18,
15132,
12,
7814,
18,
2664,
1693,
67,
7181,
13,
1335,
2987,
18,
1636,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1746,
67,
2293,
12,
2890,
16,
590,
4672,
3536,
8185,
358,
2721,
731,
392,
7327,
590,
12123,
775,
30,
282,
590,
18,
15132,
12,
7814,
18,
2664,
1693,
67,
7181,
13,
1335,
2987,
18,
1636,
... |
sleep(sleept) | sleep(slept) | def makeMagic(targets,sleept = 0): """ function where the targes are looped though and packets are sent to them """ packetQue = [] packetCount = 1 #hard coded number of how many copys of each packet is sent for bssid in targets: for client in targets[bssid][1]: engine = packetGenerator( targets[bssid][0]["allow"], client,bssid,bssid, targets[bssid][0]["channel"] ) packetQue.extend(engine.packetEngine()) numPackets = len(packetQue) message.printMessage( "\nAttempting to TX "+str(numPackets)+" packets "+str(packetCount)+" times each") while len(packetQue) != 0: lorconTX( packetCount, #number of packets to send packetQue[0][0], #packet in hex int(packetQue[0][1]) #channel to tx the packet on ) sleep(sleept) del packetQue[0] #remove the sent packet from the que message.printMessage( "\nSent "+str(numPackets)+" packets "+str(packetCount)+" times each") return numPackets * packetCount | da7bda7dccd56366bc8623135bcc9cf4c4818fc6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3861/da7bda7dccd56366bc8623135bcc9cf4c4818fc6/airdrop-ng.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
19289,
12,
11358,
16,
87,
11182,
337,
273,
374,
4672,
3536,
445,
1625,
326,
8232,
2852,
854,
2798,
329,
11376,
471,
12640,
854,
3271,
358,
2182,
3536,
4414,
12253,
273,
5378,
4414,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19289,
12,
11358,
16,
87,
11182,
337,
273,
374,
4672,
3536,
445,
1625,
326,
8232,
2852,
854,
2798,
329,
11376,
471,
12640,
854,
3271,
358,
2182,
3536,
4414,
12253,
273,
5378,
4414,
... |
Util.transform("xsl/static.xsl", f, outfile,validate=False,xinclude=True) | Util.transform(__scriptdir__+"/xsl/static.xsl", f, outfile,validate=False,xinclude=True) | def _static_indexpages(self): # make the front page and other static pages log.info("Generating site global static pages") | 293b444b2afb23d2674b73ef2e7536716a603550 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4027/293b444b2afb23d2674b73ef2e7536716a603550/Manager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3845,
67,
1615,
7267,
12,
2890,
4672,
468,
1221,
326,
6641,
1363,
471,
1308,
760,
4689,
613,
18,
1376,
2932,
21755,
2834,
2552,
760,
4689,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3845,
67,
1615,
7267,
12,
2890,
4672,
468,
1221,
326,
6641,
1363,
471,
1308,
760,
4689,
613,
18,
1376,
2932,
21755,
2834,
2552,
760,
4689,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-10... |
ofs.tpc_vote(transaction) ofs.tpc_finish(transaction) | ofs.tpc_vote(txn) ofs.tpc_finish(txn) | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs = ZODB.FileStorage.FileStorage(outp, create=1) _ts = None ok = 1 prog1 = 0 preindex = {} undone = 0 pos = 4 while pos: try: npos, transaction = read_transaction_header(file, pos, file_size) except EOFError: break except: print "\n%s: %s\n" % sys.exc_info()[:2] if not verbose: progress(prog1) pos = scan(file, pos) continue if transaction is None: undone = undone + npos - pos pos = npos continue else: pos = npos tid = transaction.tid if _ts is None: _ts = TimeStamp(tid) else: t = TimeStamp(tid) if t <= _ts: if ok: print ('Time stamps out of order %s, %s' % (_ts, t)) ok = 0 _ts = t.laterThan(_ts) tid = `_ts` else: _ts = t if not ok: print ('Time stamps back in order %s' % (t)) ok = 1 if verbose: print 'begin', if verbose > 1: print sys.stdout.flush() ofs.tpc_begin(transaction, tid, transaction.status) if verbose: print 'begin', pos, _ts, if verbose > 1: print sys.stdout.flush() nrec = 0 try: for r in transaction: oid = r.oid if verbose > 1: print u64(oid), r.version, len(r.data) pre = preindex.get(oid) s = ofs.store(oid, pre, r.data, r.version, transaction) preindex[oid] = s nrec += 1 except: if partial and nrec: ofs._status = 'p' ofs.tpc_vote(transaction) ofs.tpc_finish(transaction) if verbose: print 'partial' else: ofs.tpc_abort(transaction) print "\n%s: %s\n" % sys.exc_info()[:2] if not verbose: progress(prog1) pos = scan(file, pos) else: ofs.tpc_vote(transaction) ofs.tpc_finish(transaction) if verbose: print 'finish' sys.stdout.flush() if not verbose: prog = pos * 20l / file_size while prog > prog1: prog1 = prog1 + 1 iprogress(prog1) bad = file_size - undone - ofs._pos print "\n%s bytes removed during recovery" % bad if undone: print "%s bytes of undone transaction data were skipped" % undone if pack is not None: print "Packing ..." from ZODB.referencesf import referencesf ofs.pack(pack, referencesf) ofs.close() | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5910,
12,
31647,
16,
596,
84,
16,
3988,
33,
20,
16,
4702,
33,
20,
16,
2944,
33,
20,
16,
2298,
33,
20,
4672,
1172,
296,
27622,
310,
2187,
12789,
16,
296,
18591,
2187,
596,
84,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5910,
12,
31647,
16,
596,
84,
16,
3988,
33,
20,
16,
4702,
33,
20,
16,
2944,
33,
20,
16,
2298,
33,
20,
4672,
1172,
296,
27622,
310,
2187,
12789,
16,
296,
18591,
2187,
596,
84,
225,
... |
r, a, b, k = C[i] F = NumberField(R(r), name + str(i)) into_F1 = self.hom ([F(a)], check=True) into_F2 = other.hom([F(b)], check=True) | r, a_in_F, b_in_F, k = C[i] r = R(r) | def composite_fields(self, other, names=None, both_maps=False): """ List of all possible composite number fields formed from self and other. | bdc7705a321063158034f3feabccb1a83d8c742c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/bdc7705a321063158034f3feabccb1a83d8c742c/number_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9635,
67,
2821,
12,
2890,
16,
1308,
16,
1257,
33,
7036,
16,
3937,
67,
10711,
33,
8381,
4672,
3536,
987,
434,
777,
3323,
9635,
1300,
1466,
20010,
628,
365,
471,
1308,
18,
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,
9635,
67,
2821,
12,
2890,
16,
1308,
16,
1257,
33,
7036,
16,
3937,
67,
10711,
33,
8381,
4672,
3536,
987,
434,
777,
3323,
9635,
1300,
1466,
20010,
628,
365,
471,
1308,
18,
2,
-100,
-100,... |
if _RERUN_LATEX_RE.match(out): | if _RERUN_LATEX_RE.search(out): | def write_latex(docindex, options): # If latex is an intermediate target, then use a temporary # directory for its files. if 'latex' in options.actions: latex_target = options.target['latex'] else: latex_target = tempfile.mkdtemp() log.start_progress('Writing LaTeX docs') # Choose a pdfdriver if we're generating pdf output. if options.pdfdriver=='auto' and ('latex' in options.actions or 'dvi' in options.actions or 'ps' in options.actions or 'pdf' in options.actions): if 'dvi' in options.actions or 'ps' in options.actions: options.pdfdriver = 'latex' else: try: run_subprocess('pdflatex --version') options.pdfdriver = 'pdflatex' except RunSubprocessError, e: options.pdfdriver = 'latex' log.info('%r pdfdriver selected' % options.pdfdriver) from epydoc.docwriter.latex import LatexWriter latex_writer = LatexWriter(docindex, **options.__dict__) latex_writer.write(latex_target) log.end_progress() # Decide how many steps we need to go through. if 'pdf' in options.actions: if options.pdfdriver == 'latex': steps = 6 elif 'ps' in options.actions: steps = 8 elif 'dvi' in options.actions: steps = 7 else: steps = 4 elif 'ps' in options.actions: steps = 5 elif 'dvi' in options.actions: steps = 4 else: # If we're just generating the latex, and not any derived # output format, then we're done. assert 'latex' in options.actions return # Decide whether we need to run latex, pdflatex, or both. if options.pdfdriver == 'latex': latex_commands = ['latex'] elif 'dvi' in options.actions or 'ps' in options.actions: latex_commands = ['latex', 'pdflatex'] else: latex_commands = ['pdflatex'] log.start_progress('Processing LaTeX docs') oldpath = os.path.abspath(os.curdir) running = None # keep track of what we're doing. step = 0. try: try: os.chdir(latex_target) # Clear any old files out of the way. for ext in 'aux log out idx ilg toc ind'.split(): if os.path.exists('api.%s' % ext): os.remove('api.%s' % ext) for latex_command in latex_commands: LaTeX = latex_command.replace('latex', 'LaTeX') # The first pass generates index files. running = latex_command log.progress(step/steps, '%s (First pass)' % LaTeX) step += 1 run_subprocess('%s api.tex' % latex_command) # Build the index. running = 'makeindex' log.progress(step/steps, '%s (Build index)' % LaTeX) step += 1 run_subprocess('makeindex api.idx') # The second pass generates our output. running = latex_command log.progress(step/steps, '%s (Second pass)' % LaTeX) step += 1 out, err = run_subprocess('%s api.tex' % latex_command) # The third pass is only necessary if the second pass # changed what page some things are on. running = latex_command if _RERUN_LATEX_RE.match(out): log.progress(step/steps, '%s (Third pass)' % LaTeX) out, err = run_subprocess('%s api.tex' % latex_command) # A fourth path should (almost?) never be necessary. running = latex_command if _RERUN_LATEX_RE.match(out): log.progress(step/steps, '%s (Fourth pass)' % LaTeX) run_subprocess('%s api.tex' % latex_command) step += 1 # If requested, convert to postscript. if ('ps' in options.actions or ('pdf' in options.actions and options.pdfdriver=='latex')): running = 'dvips' log.progress(step/steps, 'dvips') step += 1 run_subprocess('dvips api.dvi -o api.ps -G0 -Ppdf') # If requested, convert to pdf. if 'pdf' in options.actions and options.pdfdriver=='latex': running = 'ps2pdf' log.progress(step/steps, 'ps2pdf') step += 1 run_subprocess( 'ps2pdf -sPAPERSIZE#letter -dMaxSubsetPct#100 ' '-dSubsetFonts#true -dCompatibilityLevel#1.2 ' '-dEmbedAllFonts#true api.ps api.pdf') # Copy files to their respective targets. if 'dvi' in options.actions: dst = os.path.join(oldpath, options.target['dvi']) shutil.copy2('api.dvi', dst) if 'ps' in options.actions: dst = os.path.join(oldpath, options.target['ps']) shutil.copy2('api.ps', dst) if 'pdf' in options.actions: dst = os.path.join(oldpath, options.target['pdf']) shutil.copy2('api.pdf', dst) except RunSubprocessError, e: if running in ('latex', 'pdflatex'): e.out = re.sub(r'(?sm)\A.*?!( LaTeX Error:)?', r'', e.out) e.out = re.sub(r'(?sm)\s*Type X to quit.*', '', e.out) e.out = re.sub(r'(?sm)^! Emergency stop.*', '', e.out) log.error("%s failed: %s" % (running, (e.out+e.err).lstrip())) except OSError, e: log.error("%s failed: %s" % (running, e)) finally: os.chdir(oldpath) if 'latex' not in options.actions: # The latex output went to a tempdir; clean it up. log.info('Cleaning up %s' % latex_target) try: for filename in os.listdir(latex_target): os.remove(os.path.join(latex_target, filename)) os.rmdir(latex_target) except Exception, e: log.error("Error cleaning up tempdir %s: %s" % (latex_target, e)) log.end_progress() | e7993c1263226ecaf6eee3c8bab6e8900367fcda /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11420/e7993c1263226ecaf6eee3c8bab6e8900367fcda/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
26264,
12,
2434,
1615,
16,
702,
4672,
468,
971,
25079,
353,
392,
12110,
1018,
16,
1508,
999,
279,
6269,
468,
1867,
364,
2097,
1390,
18,
309,
296,
26264,
11,
316,
702,
18,
490... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
26264,
12,
2434,
1615,
16,
702,
4672,
468,
971,
25079,
353,
392,
12110,
1018,
16,
1508,
999,
279,
6269,
468,
1867,
364,
2097,
1390,
18,
309,
296,
26264,
11,
316,
702,
18,
490... |
def readable(self): return self.accepting and \ len(asyncore.socket_map) < CONNECTION_LIMIT | try: ssl_conn=SSL.Connection(self.ssl_ctx, conn) ssl_conn._setup_ssl(addr) ssl_conn.accept_ssl() self.channel_class(self, ssl_conn, addr) except SSL.SSLError: pass | def readable(self): return self.accepting and \ len(asyncore.socket_map) < CONNECTION_LIMIT | 22b19a91863374e228d1dd56aa6fa1606ecfa764 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10522/22b19a91863374e228d1dd56aa6fa1606ecfa764/https_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7471,
12,
2890,
4672,
327,
365,
18,
9436,
310,
471,
521,
562,
12,
3810,
479,
18,
7814,
67,
1458,
13,
411,
20695,
67,
8283,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7471,
12,
2890,
4672,
327,
365,
18,
9436,
310,
471,
521,
562,
12,
3810,
479,
18,
7814,
67,
1458,
13,
411,
20695,
67,
8283,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
query['portal_type'] = self.portal_type | if self.portal_type==FRAGMENT_TYPE: query['portal_type'] = 'Navigation Page' else: query['portal_type'] = self.portal_type | def mkQuery(self): query = {} if self.portal_type: query['portal_type'] = self.portal_type if self.paths: query['path'] = self.paths query['Language'] = 'all' return query | 877e6dc1e1a56805e9f55bed9cf08b4b829b9a9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10193/877e6dc1e1a56805e9f55bed9cf08b4b829b9a9a/html2captioned.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5028,
1138,
12,
2890,
4672,
843,
273,
2618,
309,
365,
18,
24386,
67,
723,
30,
309,
365,
18,
24386,
67,
723,
631,
9981,
26903,
67,
2399,
30,
843,
3292,
24386,
67,
723,
3546,
273,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5028,
1138,
12,
2890,
4672,
843,
273,
2618,
309,
365,
18,
24386,
67,
723,
30,
309,
365,
18,
24386,
67,
723,
631,
9981,
26903,
67,
2399,
30,
843,
3292,
24386,
67,
723,
3546,
273,
296,
... |
self.gateway = util.get_attr(dom, "gateway", default=None) | self.gateway = util.get_attr(dom, "gateway", default="10.1.1.254/24") if not len(self.gateway.split("/")) == 2: self.gateway = self.gateway + "/24" | def decode_xml(self, dom): dummynet.EmulatedConnection.decode_xml(self, dom) self.gateway = util.get_attr(dom, "gateway", default=None) | 12b0d00f684876f6805000e644c3ef937af90dff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3860/12b0d00f684876f6805000e644c3ef937af90dff/tinc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
67,
2902,
12,
2890,
16,
4092,
4672,
4569,
81,
878,
278,
18,
1514,
11799,
1952,
18,
3922,
67,
2902,
12,
2890,
16,
4092,
13,
365,
18,
11127,
273,
1709,
18,
588,
67,
1747,
12,
985... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
67,
2902,
12,
2890,
16,
4092,
4672,
4569,
81,
878,
278,
18,
1514,
11799,
1952,
18,
3922,
67,
2902,
12,
2890,
16,
4092,
13,
365,
18,
11127,
273,
1709,
18,
588,
67,
1747,
12,
985... |
print err | s = str(err) if s: s = ": " + s print err.__class__.__name__ + s | def main(): host = None port = None unix = None write = 1 storage = '1' try: opts, args = getopt.getopt(sys.argv[1:], 'p:h:U:S:1', ['nowrite']) for o, a in opts: if o == '-p': port = int(a) elif o == '-h': host = a elif o == '-U': unix = a elif o == '-S': storage = a elif o == '--nowrite': write = 0 elif o == '-1': ZEO_VERSION = 1 except Exception, err: print err usage() if unix is not None: addr = unix else: if host is None: host = socket.gethostname() if port is None: usage() addr = host, port check_server(addr, storage, write) | 6a1571aa798fc23c238b897615505076340ac2b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/6a1571aa798fc23c238b897615505076340ac2b8/zeoup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1479,
273,
599,
1756,
273,
599,
9753,
273,
599,
1045,
273,
404,
2502,
273,
296,
21,
11,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
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,
2774,
13332,
1479,
273,
599,
1756,
273,
599,
9753,
273,
599,
1045,
273,
404,
2502,
273,
296,
21,
11,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
2... |
image_shape=(batch_size,6,12,12), filter_shape=(32,6,5,5), poolsize=(2,2)) | image_shape=(batch_size,20,12,12), filter_shape=(50,20,5,5), poolsize=(2,2)) | def evaluate_lenet5(learning_rate=0.0001, n_iter=1000, dataset='mnist.pkl.gz'): print 'learning_rate = ', learning_rate rng = numpy.random.RandomState(23455) train_batches, valid_batches, test_batches = load_dataset(dataset) ishape = (28,28) # this is the size of MNIST images batch_size = 20 # sized of the minibatch # allocate symbolic variables for the data x = theano.floatX.xmatrix(theano.config.floatX) # rasterized images y = T.lvector() # the labels are presented as 1D vector of [long int] labels ###################### # BUILD ACTUAL MODEL # ###################### # Reshape matrix of rasterized images of shape (batch_size,28*28) # to a 4D tensor, compatible with our LeNetConvPoolLayer layer0_input = x.reshape((batch_size,1,28,28)) # Construct the first convolutional pooling layer: # filtering reduces the image size to (28-5+1,28-5+1)=(24,24) # maxpooling reduces this further to (24/2,24/2) = (12,12) # 4D output tensor is thus of shape (20,6,12,12) layer0 = LeNetConvPoolLayer(rng, input=layer0_input, image_shape=(batch_size,1,28,28), filter_shape=(6,1,5,5), poolsize=(2,2)) # Construct the second convolutional pooling layer # filtering reduces the image size to (12-5+1,12-5+1)=(8,8) # maxpooling reduces this further to (8/2,8/2) = (4,4) # 4D output tensor is thus of shape (20,32,4,4) layer1 = LeNetConvPoolLayer(rng, input=layer0.output, image_shape=(batch_size,6,12,12), filter_shape=(32,6,5,5), poolsize=(2,2)) # the SigmoidalLayer being fully-connected, it operates on 2D matrices of # shape (batch_size,num_pixels) (i.e matrix of rasterized images). # This will generate a matrix of shape (20,32*4*4) = (20,512) layer2_input = layer1.output.flatten(2) # construct a fully-connected sigmoidal layer layer2 = SigmoidalLayer(rng, input=layer2_input, n_in=32*4*4, n_out=500) # classify the values of the fully-connected sigmoidal layer layer3 = LogisticRegression(input=layer2.output, n_in=500, n_out=10) # the cost we minimize during training is the NLL of the model cost = layer3.negative_log_likelihood(y) # create a function to compute the mistakes that are made by the model test_model = theano.function([x,y], layer3.errors(y)) # create a list of all model parameters to be fit by gradient descent params = layer3.params+ layer2.params+ layer1.params + layer0.params learning_rate = numpy.asarray(learning_rate, dtype=theano.config.floatX) # train_model is a function that updates the model parameters by SGD train_model = theano.function([x, y], cost, updates=[(p, p - learning_rate*gp) for p,gp in zip(params, T.grad(cost, params))]) ############### # TRAIN MODEL # ############### n_minibatches = len(train_batches) # early-stopping parameters patience = 10000 # look as this many examples regardless patience_increase = 2 # wait this much longer when a new best is # found improvement_threshold = 0.995 # a relative improvement of this much is # considered significant validation_frequency = n_minibatches # go through this many # minibatche before checking the network # on the validation set; in this case we # check every epoch best_params = None best_validation_loss = float('inf') best_iter = 0 test_score = 0. start_time = time.clock() # have a maximum of `n_iter` iterations through the entire dataset for iter in xrange(n_iter * n_minibatches): #for iter in xrange(2 * n_minibatches): # get epoch and minibatch index epoch = iter / n_minibatches minibatch_index = iter % n_minibatches # get the minibatches corresponding to `iter` modulo # `len(train_batches)` x,y = train_batches[ minibatch_index ] print 'training @ iter = ', iter cost_ij = train_model(x,y) if (iter+1) % validation_frequency == 0: # compute zero-one loss on validation set this_validation_loss = 0. for x,y in valid_batches: # sum up the errors for each minibatch this_validation_loss += test_model(x,y) # get the average by dividing with the number of minibatches this_validation_loss /= len(valid_batches) print('epoch %i, minibatch %i/%i, validation error %f %%' % \ (epoch, minibatch_index+1, n_minibatches, \ this_validation_loss*100.)) # if we got the best validation score until now if this_validation_loss < best_validation_loss: #improve patience if loss improvement is good enough if this_validation_loss < best_validation_loss * \ improvement_threshold : patience = max(patience, iter * patience_increase) # save best validation score and iteration number best_validation_loss = this_validation_loss best_iter = iter # test it on the test set test_score = 0. for x,y in test_batches: test_score += test_model(x,y) test_score /= len(test_batches) print((' epoch %i, minibatch %i/%i, test error of best ' 'model %f %%') % (epoch, minibatch_index+1, n_minibatches, test_score*100.)) if patience <= iter : break end_time = time.clock() print('Optimization complete.') print('Best validation score of %f %% obtained at iteration %i,'\ 'with test performance %f %%' % (best_validation_loss * 100., best_iter, test_score*100.)) print('The code ran for %f minutes' % ((end_time-start_time)/60.)) | 865ed2ce1ebc93572eeaf6cd553710102fe1bfc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/242/865ed2ce1ebc93572eeaf6cd553710102fe1bfc8/convolutional_mlp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5956,
67,
1897,
278,
25,
12,
21455,
67,
5141,
33,
20,
18,
13304,
16,
290,
67,
2165,
33,
18088,
16,
3709,
2218,
13607,
376,
18,
5465,
80,
18,
9764,
11,
4672,
1172,
296,
21455,
67,
514... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5956,
67,
1897,
278,
25,
12,
21455,
67,
5141,
33,
20,
18,
13304,
16,
290,
67,
2165,
33,
18088,
16,
3709,
2218,
13607,
376,
18,
5465,
80,
18,
9764,
11,
4672,
1172,
296,
21455,
67,
514... |
dists.append("src\\basic.dist") | dists.append("src/basic.dist") | def get_dists(*args): """ Find all dists refered in args """ ds = parse(*args)['dist'] dists = get_dists_helper(ds,[]) dists.append("src\\basic.dist") #print dists return dists | 25c454a8bdca0d656ffbcdf3ec88b411dcab7247 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/331/25c454a8bdca0d656ffbcdf3ec88b411dcab7247/dist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
30467,
30857,
1968,
4672,
3536,
4163,
777,
16871,
8884,
329,
316,
833,
3536,
3780,
273,
1109,
30857,
1968,
13,
3292,
4413,
3546,
16871,
273,
336,
67,
30467,
67,
4759,
12,
2377,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
30467,
30857,
1968,
4672,
3536,
4163,
777,
16871,
8884,
329,
316,
833,
3536,
3780,
273,
1109,
30857,
1968,
13,
3292,
4413,
3546,
16871,
273,
336,
67,
30467,
67,
4759,
12,
2377,
... |
def onchange_user_id(self, cr, uid, ids,res,zip_id): | def onchange_user_id(self, cr, uid, ids,zip_id): if not ids: return {} data_add=self.pool.get('res.partner.address').browse(cr, uid,ids) | def onchange_user_id(self, cr, uid, ids,res,zip_id): if zip_id: data_zip=self.pool.get('res.partner.zip').browse(cr, uid,[zip_id]) for data in data_zip: if data.user_id: self.pool.get('res.partner').write(cr, uid,res,{'user_id':data.user_id.id}) return {} | dd6392c6f1ee8119e494f32085c2f953b5961b75 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7339/dd6392c6f1ee8119e494f32085c2f953b5961b75/cci_partner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
1652,
603,
3427,
67,
1355,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
4450,
67,
350,
4672,
309,
486,
3258,
30,
327,
2618,
501,
67,
1289,
33,
2890,
18,
6011,
18,
588,
2668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
1652,
603,
3427,
67,
1355,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
4450,
67,
350,
4672,
309,
486,
3258,
30,
327,
2618,
501,
67,
1289,
33,
2890,
18,
6011,
18,
588,
2668,
... |
self.worksheet.sage() | def render(self, ctx): s = notebook.html(worksheet_filename = self.name, username=self.username) self.worksheet.sage() return http.Response(stream=s) | e22fbb6f0d4deb21ddf84b2a70fbc5301d689d06 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/e22fbb6f0d4deb21ddf84b2a70fbc5301d689d06/twist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
272,
273,
14718,
18,
2620,
12,
1252,
8118,
67,
3459,
273,
365,
18,
529,
16,
225,
2718,
33,
2890,
18,
5053,
13,
327,
1062,
18,
1064,
12,
3256,
33,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
272,
273,
14718,
18,
2620,
12,
1252,
8118,
67,
3459,
273,
365,
18,
529,
16,
225,
2718,
33,
2890,
18,
5053,
13,
327,
1062,
18,
1064,
12,
3256,
33,
87,
... | |
header, snps_name_ls, category_list, data_matrix = FilterStrainSNPMatrix.read_data(self.input_dir, double_header=1) | header, snps_name_ls, category_list, data_matrix = read_data(self.input_dir, double_header=1) | def run(self): """ 2008-04-25 return None if QC_method_id==0 2008-04-20 for plone to call it just to get row_id2NA_mismatch_rate """ #database connection and etc db = Stock_250kDB.Stock_250kDB(drivername=self.drivername, username=self.user, password=self.passwd, hostname=self.hostname, database=self.dbname) db.setup() session = db.session session.begin() #transaction = session.create_transaction() self.cmp_data_filename = self.findOutCmpDataFilename(self.cmp_data_filename, self.QC_method_id, Stock_250kDB.QCMethod) import MySQLdb conn = MySQLdb.connect(db=self.dbname, host=self.hostname, user = self.user, passwd = self.passwd) curs = conn.cursor() self.curs = curs if self.debug: import pdb pdb.set_trace() readme = formReadmeObj(sys.argv, self.ad, Stock_250kDB.README) session.save(readme) QC_method_id2snps_table = self.QC_method_id2snps_table if self.QC_method_id==0: self.cal_independent_NA_rate(db, self.min_probability, readme) row_id2NA_mismatch_rate = None else: #from variation.src.FilterStrainSNPMatrix import FilterStrainSNPMatrix header, strain_acc_list, category_list, data_matrix = read_data(self.cmp_data_filename) strain_acc_list = map(int, strain_acc_list) #it's ecotypeid, cast it to integer to be compatible to the later ecotype_id_ls from db snpData2 = SNPData(header=header, strain_acc_list=strain_acc_list, \ data_matrix=data_matrix, snps_table=QC_method_id2snps_table.get(self.QC_method_id)) #category_list is not used. """ if self.input_dir and os.path.isdir(self.input_dir): #04/22/08 Watch: call_info_id2fname here is fake, it's actually keyed by (array_id, ecotypeid) #no submission to db call_info_id2fname = self.get_array_id2fname(curs, self.input_dir) """ if self.input_dir and os.path.isfile(self.input_dir): #it's file call_info_id2fname = None else: if self.run_type==2: #no filtering on call_info entries that have been QCed. filter_calls_QCed=0 elif self.run_type==1: filter_calls_QCed = 1 self.max_call_info_mismatch_rate = 1 #don't use this when doing accession-wise QC else: sys.stderr.write("run_type=%s is not supported.\n"%self.run_type) sys.exit(5) call_data = self.get_call_info_id2fname(db, self.QC_method_id, self.call_method_id, \ filter_calls_QCed, self.max_call_info_mismatch_rate, self.debug,\ min_no_of_non_NA_pairs=self.min_no_of_non_NA_pairs, input_dir=self.input_dir) call_info_id2fname = call_data.call_info_id2fname call_info_ls_to_return = call_data.call_info_ls_to_return if self.run_type==2: snps_name2snps_id = self.get_snps_name2snps_id(db) else: snps_name2snps_id = None if call_info_id2fname: if self.one_by_one and self.run_type==1: #one_by_one only for QC by accession row_id2NA_mismatch_rate = {} row_id12row_id2 = {} counter = 0 for call_info_id, value in call_info_id2fname.iteritems(): counter += 1 print "No", counter tmp_dict = {} tmp_dict[call_info_id] = value pdata = self.read_call_matrix(tmp_dict, self.min_probability) passingdata = self.qcDataMatrixVSsnpData(pdata, snps_name2snps_id, snpData2, curs, session, readme) row_id2NA_mismatch_rate.update(passingdata.row_id2NA_mismatch_rate) row_id12row_id2.update(passingdata.row_id12row_id2) del pdata if self.debug and counter==10: break else: pdata = self.read_call_matrix(call_info_id2fname, self.min_probability) passingdata = self.qcDataMatrixVSsnpData(pdata, snps_name2snps_id, snpData2, curs, session, readme) row_id2NA_mismatch_rate = passingdata.row_id2NA_mismatch_rate row_id12row_id2 = passingdata.row_id12row_id2 del pdata else: #input file is SNP by strain format. double header (1st two lines) header, snps_name_ls, category_list, data_matrix = FilterStrainSNPMatrix.read_data(self.input_dir, double_header=1) pdata = PassingData() pdata.ecotype_id_ls = header[0][2:] pdata.call_info_id_ls = header[1][2:] data_matrix = numpy.array(data_matrix) pdata.data_matrix = data_matrix.transpose() pdata.header = ['', ''] + snps_name_ls #fake a header for SNPData passingdata = self.qcDataMatrixVSsnpData(pdata, snps_name2snps_id, snpData2, curs, session, readme) row_id2NA_mismatch_rate = passingdata.row_id2NA_mismatch_rate row_id12row_id2 = passingdata.row_id12row_id2 del pdata if self.output_fname and self.run_type==1 and row_id2NA_mismatch_rate: self.output_row_id2NA_mismatch_rate(row_id2NA_mismatch_rate, self.output_fname) if self.run_type==1 and self.commit and not self.input_dir and row_id2NA_mismatch_rate: #if self.input_dir is given, no db submission. call_info_id2fname here is fake, it's actually keyed by (array_id, ecotypeid) #row_id2NA_mismatch_rate might be None if it's method 0. self.submit_to_call_QC(session, row_id2NA_mismatch_rate, self.QC_method_id, self.user, self.min_probability, \ row_id12row_id2, self.call_method_id, readme) if self.commit: curs.execute("commit") session.commit() else: session.rollback() self.row_id2NA_mismatch_rate = row_id2NA_mismatch_rate #for plone to get the data structure | 456fd04dd75bf791eb821b70d71a680df56dc6f9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9645/456fd04dd75bf791eb821b70d71a680df56dc6f9/QC_250k.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
3536,
4044,
28,
17,
3028,
17,
2947,
327,
599,
309,
2238,
39,
67,
2039,
67,
350,
631,
20,
4044,
28,
17,
3028,
17,
3462,
364,
886,
476,
358,
745,
518,
2537,
358,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
3536,
4044,
28,
17,
3028,
17,
2947,
327,
599,
309,
2238,
39,
67,
2039,
67,
350,
631,
20,
4044,
28,
17,
3028,
17,
3462,
364,
886,
476,
358,
745,
518,
2537,
358,
... |
""" Cache a list of files available in stock Slackware """ | """ Creates a cache of files available in stock Slackware """ | def save_cache_stock_slackfiles(self): """ Cache a list of files available in stock Slackware """ | f9b5bccd6b4fd4355a72b9b495908af2da52cae3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2163/f9b5bccd6b4fd4355a72b9b495908af2da52cae3/pyfind_revdep.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
2493,
67,
15381,
67,
2069,
484,
2354,
12,
2890,
4672,
3536,
4379,
279,
666,
434,
1390,
2319,
316,
12480,
26807,
2726,
225,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
2493,
67,
15381,
67,
2069,
484,
2354,
12,
2890,
4672,
3536,
4379,
279,
666,
434,
1390,
2319,
316,
12480,
26807,
2726,
225,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
utils.system('/sbin/rmmod ' + module_name) | """ Removes a module. Handles dependencies. If even then it's not possible to remove one of the modules, it will trhow an error.CmdError exception. @param module_name: Name of the module we want to remove. """ l_raw = utils.system_output("/sbin/lsmod").splitlines() lsmod = [x for x in l_raw if x.split()[0] == module_name] if len(lsmod) > 0: line_parts = lsmod[0].split() if len(line_parts) == 4: submodules = line_parts[3].split(",") for submodule in submodules: unload_module(submodule) utils.system("/sbin/modprobe -r %s" % module_name) logging.info("Module %s unloaded" % module_name) else: logging.info("Module %s is already unloaded" % module_name) | def unload_module(module_name): utils.system('/sbin/rmmod ' + module_name) | b4dfe01d0eed0d679f84c2ff7adaa10260168875 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/b4dfe01d0eed0d679f84c2ff7adaa10260168875/base_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27060,
67,
2978,
12,
2978,
67,
529,
4672,
3536,
20284,
279,
1605,
18,
27020,
5030,
18,
971,
5456,
1508,
518,
1807,
486,
3323,
358,
1206,
1245,
434,
326,
4381,
16,
518,
903,
433,
13606,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27060,
67,
2978,
12,
2978,
67,
529,
4672,
3536,
20284,
279,
1605,
18,
27020,
5030,
18,
971,
5456,
1508,
518,
1807,
486,
3323,
358,
1206,
1245,
434,
326,
4381,
16,
518,
903,
433,
13606,
... |
re_field = re.compile(r'^([A-Za-z][A-Za-z0-9-]+):(?:\s+(.*?))?\s*$') | re_field = re.compile(r'^([A-Za-z][A-Za-z0-9-]+):(?:\s*(.*?))?\s*$') | def version_compare(a,b): return cmp(Version(a), Version(b)) | 2f0c3285ca89feb82fe4740c5640234b95782401 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12282/2f0c3285ca89feb82fe4740c5640234b95782401/debian_support.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1177,
67,
9877,
12,
69,
16,
70,
4672,
327,
9411,
12,
1444,
12,
69,
3631,
4049,
12,
70,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1177,
67,
9877,
12,
69,
16,
70,
4672,
327,
9411,
12,
1444,
12,
69,
3631,
4049,
12,
70,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
] + commands.walkopts + commands.commitopts + headeropts, | ('U', 'currentuser', None, _('add "From: <current user>" to patch')), ('u', 'user', '', _('add "From: <given user>" to patch')), ('D', 'currentdate', None, _('add "Date: <current date>" to patch')), ('d', 'date', '', _('add "Date: <given date>" to patch')) ] + commands.walkopts + commands.commitopts, | def _branchtags(self, partial, lrev): q = self.mq if not q.applied: return super(mqrepo, self)._branchtags(partial, lrev) | 0805755fbe835a31db35f3349890027e1ff699ab /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/0805755fbe835a31db35f3349890027e1ff699ab/mq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7500,
4156,
12,
2890,
16,
4702,
16,
328,
9083,
4672,
1043,
273,
365,
18,
11636,
309,
486,
1043,
18,
438,
3110,
30,
327,
2240,
12,
11636,
7422,
16,
365,
2934,
67,
7500,
4156,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7500,
4156,
12,
2890,
16,
4702,
16,
328,
9083,
4672,
1043,
273,
365,
18,
11636,
309,
486,
1043,
18,
438,
3110,
30,
327,
2240,
12,
11636,
7422,
16,
365,
2934,
67,
7500,
4156,
12,
... |
msg = HandshakeMessage(self.factory.peer_id) | msg = specs.HandshakeMessage.create(self.factory.peer_id) | def send_hanshake(self): """Sends a handshake message""" | b1428616912b4e6ec013d7b4010ed73273b0804e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10501/b1428616912b4e6ec013d7b4010ed73273b0804e/protocol.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
76,
634,
76,
911,
12,
2890,
4672,
3536,
10501,
279,
11942,
883,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1366,
67,
76,
634,
76,
911,
12,
2890,
4672,
3536,
10501,
279,
11942,
883,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
[0, 3, 4] | [2, 3, 0] | def __init__(self, ambient, gens, names="f"): """ EXAMPLES: sage: F = AbelianGroup(5,[30,64,729],names = list("abcde")) sage: a,b,c,d,e = F.gens() sage: F.subgroup([a^3,b]) Multiplicative Abelian Group isomorphic to Z x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a^3, b] sage: F.subgroup([c]) Multiplicative Abelian Group isomorphic to C2 x C3 x C5, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [c] sage: F.subgroup([a,c]) Multiplicative Abelian Group isomorphic to Z x C2 x C3 x C5, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a, c] sage: F.subgroup([a,b*c]) Multiplicative Abelian Group isomorphic to Z x Z, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a, b*c] sage: F.subgroup([b*c,d]) Multiplicative Abelian Group isomorphic to Z x C64, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [b*c, d] sage: F.subgroup([a*b,c^6,d],names = list("xyz")) Multiplicative Abelian Group isomorphic to Z x C5 x C64, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a*b, c^6, d] sage: H.<x,y,z> = F.subgroup([a*b, c^6, d]); H Multiplicative Abelian Group isomorphic to Z x C5 x C64, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a*b, c^6, d] sage: G = F.subgroup([a*b,c^6,d],names = list("xyz")) sage: G Multiplicative Abelian Group isomorphic to Z x C5 x C64, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x Z x C2 x C3 x C5 x C64 x C729 generated by [a*b, c^6, d] sage: x,y,z = G.gens() sage: x.order() +Infinity sage: y.order() 5 sage: z.order() 64 sage: A = AbelianGroup(5,[3, 5, 5, 7, 8], names = "abcde") sage: a,b,c,d,e = A.gens() sage: A.subgroup([a,b]) Multiplicative Abelian Group isomorphic to C3 x C5, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [a, b] sage: A.subgroup([a,b,c,d^2,e]) Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [a, b, c, d^2, e] sage: A.subgroup([a,b,c,d^2,e^2]) Multiplicative Abelian Group isomorphic to C3 x C4 x C5 x C5 x C7, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [a, b, c, d^2, e^2] sage: B = A.subgroup([a^3,b,c,d,e^2]); B Multiplicative Abelian Group isomorphic to C4 x C5 x C5 x C7, which is the subgroup of Multiplicative Abelian Group isomorphic to C3 x C5 x C5 x C7 x C8 generated by [b, c, d, e^2] sage: B.invariants() [4, 5, 5, 7] sage: A = AbelianGroup(4,[1009, 2003, 3001, 4001], names = "abcd") sage: a,b,c,d = A.gens() sage: B = A.subgroup([a^3,b,c,d]) sage: B.invariants() [1009, 2003, 3001, 4001] sage: A.order() 24266473210027 sage: B.order() 24266473210027 sage: A = AbelianGroup(4,[1008, 2003, 3001, 4001], names = "abcd") sage: a,b,c,d = A.gens() sage: B = A.subgroup([a^3,b,c,d]) sage: B Multiplicative Abelian Group isomorphic to C3 x C7 x C16 x C2003 x C3001 x C4001, which is the subgroup of Multiplicative Abelian Group isomorphic to C7 x C9 x C16 x C2003 x C3001 x C4001 generated by [a^3, b, c, d] Infinite groups can also be handled: sage: G = AbelianGroup([3,4,0], names = "abc") sage: a,b,c = G.gens() sage: F = G.subgroup([a,b^2,c]); F Multiplicative Abelian Group isomorphic to Z x C3 x C4, which is the subgroup of Multiplicative Abelian Group isomorphic to Z x C3 x C4 generated by [a, b^2, c] sage: F.invariants() [0, 3, 4] sage: F.gens() [a, b^2, c] sage: F.order() +Infinity | 4b76758ecf69f92f14b50ef31dd04f2252c5a26c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/4b76758ecf69f92f14b50ef31dd04f2252c5a26c/abelian_group.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13232,
1979,
16,
314,
773,
16,
1257,
1546,
74,
6,
4672,
3536,
225,
5675,
8900,
11386,
30,
272,
410,
30,
478,
273,
9771,
292,
2779,
1114,
12,
25,
16,
63... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13232,
1979,
16,
314,
773,
16,
1257,
1546,
74,
6,
4672,
3536,
225,
5675,
8900,
11386,
30,
272,
410,
30,
478,
273,
9771,
292,
2779,
1114,
12,
25,
16,
63... |
thread = LinkCheckThread(title, url) | thread = LinkCheckThread(title, url, self.history) thread.setDaemon(True) | def checkLinksIn(self, title, text): #wikipedia.output(title) linkR = re.compile(r'http://[^ \]\r\n]+') urls = linkR.findall(text) for url in urls: # Don't start more than 10 threads at once. Each thread will check # one page, then die. # TODO: Make number of threads a config variable. while threading.activeCount() >= 10: # wait 100 ms time.sleep(0.1) thread = LinkCheckThread(title, url) thread.start() | de6d8c9e49a0166325dfd011a09b33b2e6501d52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/de6d8c9e49a0166325dfd011a09b33b2e6501d52/weblinkchecker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
7100,
382,
12,
2890,
16,
2077,
16,
977,
4672,
468,
11999,
13744,
18,
2844,
12,
2649,
13,
1692,
54,
273,
283,
18,
11100,
12,
86,
11,
2505,
2207,
5969,
521,
13944,
86,
64,
82,
373... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
7100,
382,
12,
2890,
16,
2077,
16,
977,
4672,
468,
11999,
13744,
18,
2844,
12,
2649,
13,
1692,
54,
273,
283,
18,
11100,
12,
86,
11,
2505,
2207,
5969,
521,
13944,
86,
64,
82,
373... |
def GetOptions(self, test): return self._test_to_options[test] | def GetTestsWithTimeline(self, timeline): return self._timeline_to_tests[timeline] | 8eb26144f32b9dc19ff34c5291f421ac2bf50daa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/8eb26144f32b9dc19ff34c5291f421ac2bf50daa/test_expectations.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
14650,
1190,
31914,
12,
2890,
16,
18316,
4672,
327,
365,
6315,
26237,
67,
869,
67,
16341,
63,
26237,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
14650,
1190,
31914,
12,
2890,
16,
18316,
4672,
327,
365,
6315,
26237,
67,
869,
67,
16341,
63,
26237,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
graphic.drawOn(canv) | name = str(hash(graphic)) internalname = canv._doc.hasForm(name) if not internalname: canv.beginForm(name) canv.saveState() graphic.drawOn(canv) canv.restoreState() canv.endForm() canv.doForm(name) else: canv.doForm(name) | def drawOn(self, canv): for graphic in self.graphics: graphic.drawOn(canv) | c23c3ba4f6106b1783082b8b71e1ddbf16a6ddf3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/c23c3ba4f6106b1783082b8b71e1ddbf16a6ddf3/pythonpoint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
1398,
12,
2890,
16,
848,
90,
4672,
364,
19548,
316,
365,
18,
31586,
30,
508,
273,
609,
12,
2816,
12,
4660,
335,
3719,
2713,
529,
273,
848,
90,
6315,
2434,
18,
5332,
1204,
12,
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,
3724,
1398,
12,
2890,
16,
848,
90,
4672,
364,
19548,
316,
365,
18,
31586,
30,
508,
273,
609,
12,
2816,
12,
4660,
335,
3719,
2713,
529,
273,
848,
90,
6315,
2434,
18,
5332,
1204,
12,
5... |
print 'ext', extended_type, extended_data | def _parseAttributes(self, data): flags = struct.unpack('!L', data[:4])[0] attrs = {} data = data[4:] if flags & FILEXFER_ATTR_SIZE == FILEXFER_ATTR_SIZE: size = struct.unpack('!Q', data[:8])[0] attrs['size'] = size data = data[8:] if flags & FILEXFER_ATTR_OWNERGROUP == FILEXFER_ATTR_OWNERGROUP: uid, gid = struct.unpack('!2L', data[:8]) attrs['uid'] = uid attrs['gid'] = gid data = data[8:] if flags & FILEXFER_ATTR_PERMISSIONS == FILEXFER_ATTR_PERMISSIONS: perms = struct.unpack('!L', data[:4])[0] attrs['permissions'] = perms data = data[4:] if flags & FILEXFER_ATTR_ACMODTIME == FILEXFER_ATTR_ACMODTIME: atime, mtime = struct.unpack('!2L', data[:8]) attrs['atime'] = atime attrs['mtime'] = mtime data = data[8:] if flags & FILEXFER_ATTR_EXTENDED == FILEXFER_ATTR_EXTENDED: extended_count = struct.unpack('!L', data[4:])[0] data = data[4:] for i in xrange(extended_count): extended_type, data = common.getNS(data) extended_data, data = common.getNS(data) print 'ext', extended_type, extended_data attrs['ext_%s' % extended_type] = extended_data return attrs, data | af5a90dcce0ea343ce97b4a7b07843f8d4cfc1d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/af5a90dcce0ea343ce97b4a7b07843f8d4cfc1d0/filetransfer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
2498,
12,
2890,
16,
501,
4672,
2943,
273,
1958,
18,
17309,
2668,
5,
48,
2187,
501,
10531,
24,
5717,
63,
20,
65,
3422,
273,
2618,
501,
273,
501,
63,
24,
26894,
309,
2943,
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,
389,
2670,
2498,
12,
2890,
16,
501,
4672,
2943,
273,
1958,
18,
17309,
2668,
5,
48,
2187,
501,
10531,
24,
5717,
63,
20,
65,
3422,
273,
2618,
501,
273,
501,
63,
24,
26894,
309,
2943,
4... | |
self.incomplete_injection_coinc_ids = filter(lambda id: self.coinc_table[id].is_zero_lag(), self.incomplete_injection_coinc_ids) | self.incomplete_injection_coinc_ids = filter(lambda id: self.coinc_table[id].is_zero_lag(), map(lambda id: str(lsctables.ILWD("coinc_event", "coinc_event_id", id)), self.incomplete_injection_coinc_ids)) | def summarize(self, xmldoc, live_time_program, verbose = False): """ Compute and record some summary information about the database. Call this after all the data has been inserted, and before you want any of this information. """ self.connection.commit() self.connection.execute("CREATE INDEX time_slide_id_index ON time_slide (time_slide_id)") self.connection.execute("CREATE INDEX coinc_event_id_index ON coinc_event_map (table_name, coinc_event_id)") | c885fe584f38bc7dc722ca6981bb825cfd72aeea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/c885fe584f38bc7dc722ca6981bb825cfd72aeea/SnglBurstUtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28712,
12,
2890,
16,
2025,
2434,
16,
8429,
67,
957,
67,
12890,
16,
3988,
273,
1083,
4672,
3536,
8155,
471,
1409,
2690,
4916,
1779,
2973,
326,
2063,
18,
225,
3049,
333,
1839,
777,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28712,
12,
2890,
16,
2025,
2434,
16,
8429,
67,
957,
67,
12890,
16,
3988,
273,
1083,
4672,
3536,
8155,
471,
1409,
2690,
4916,
1779,
2973,
326,
2063,
18,
225,
3049,
333,
1839,
777,
326,
... |
doc = self.markup(value.__doc__, self.preformat) | doc = self.markup(getdoc(value), self.preformat) | def _docdescriptor(self, name, value, mod): results = [] push = results.append | a0a45a13b55b431298de7ad5675dd8fe1107622f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a0a45a13b55b431298de7ad5675dd8fe1107622f/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2434,
12628,
12,
2890,
16,
508,
16,
460,
16,
681,
4672,
1686,
273,
5378,
1817,
273,
1686,
18,
6923,
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,
389,
2434,
12628,
12,
2890,
16,
508,
16,
460,
16,
681,
4672,
1686,
273,
5378,
1817,
273,
1686,
18,
6923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
elif isintance(expanded_name, (str, unicode)): | elif isinstance(expanded_name, (str, unicode)): | def createChildElement (self, expanded_name, parent=None): """Create a new element node in the tree. | b4b9d39ce027f22907f1d8ad8836c33826e0e6ba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7171/b4b9d39ce027f22907f1d8ad8836c33826e0e6ba/domutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
1763,
1046,
261,
2890,
16,
8406,
67,
529,
16,
982,
33,
7036,
4672,
3536,
1684,
279,
394,
930,
756,
316,
326,
2151,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
1763,
1046,
261,
2890,
16,
8406,
67,
529,
16,
982,
33,
7036,
4672,
3536,
1684,
279,
394,
930,
756,
316,
326,
2151,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
- ``g, s, t`` - such that g = s\*a + t\*b | - ``g, s, t`` - such that `g = s\*a + t\*b` | def xgcd(a, b): """ Returns triple (g,s,t) such that `g = s*a+t*b = gcd(a,b)`. INPUT: - ``a, b`` - integers or univariate polynomials (or any type with an xgcd method). OUTPUT: - ``g, s, t`` - such that g = s\*a + t\*b .. note:: There is no guarantee that the returned cofactors (s and t) are minimal. In the integer case, see Integer._xgcd() for minimal cofactors. EXAMPLES:: sage: xgcd(56, 44) (4, 4, -5) sage: 4*56 + (-5)*44 4 sage: g, a, b = xgcd(5/1, 7/1); g, a, b (1, 3, -2) sage: a*(5/1) + b*(7/1) == g True sage: x = polygen(QQ) sage: xgcd(x^3 - 1, x^2 - 1) (x - 1, 1, -x) sage: K.<g> = NumberField(x^2-3) sage: R.<a,b> = K[] sage: S.<y> = R.fraction_field()[] sage: xgcd(y^2, a*y+b) (b^2/a^2, 1, ((-1)/a)*y + b/a^2) sage: xgcd((b+g)*y^2, (a+g)*y+b) ((b^3 + (g)*b^2)/(a^2 + (2*g)*a + 3), 1, ((-b + (-g))/(a + (g)))*y + (b^2 + (g)*b)/(a^2 + (2*g)*a + 3)) """ try: return a.xgcd(b) except AttributeError: pass if not isinstance(a, sage.rings.integer.Integer): a = ZZ(a) return a.xgcd(ZZ(b)) | f2370aee3f6f590b914899ff20666b42b979fc93 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f2370aee3f6f590b914899ff20666b42b979fc93/arith.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
75,
4315,
12,
69,
16,
324,
4672,
3536,
2860,
14543,
261,
75,
16,
87,
16,
88,
13,
4123,
716,
1375,
75,
273,
272,
14,
69,
15,
88,
14,
70,
273,
14876,
12,
69,
16,
70,
13,
8338,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
75,
4315,
12,
69,
16,
324,
4672,
3536,
2860,
14543,
261,
75,
16,
87,
16,
88,
13,
4123,
716,
1375,
75,
273,
272,
14,
69,
15,
88,
14,
70,
273,
14876,
12,
69,
16,
70,
13,
8338,... |
del self.response.headers['Cache-Control'] self.response.headers['Expires'] = (datetime.datetime.utcnow() + datetime.timedelta(1)) | self.response.headers['Cache-Control'] = 'public, max-age=86400' | def get(self): del self.response.headers['Cache-Control'] self.response.headers['Expires'] = (datetime.datetime.utcnow() + datetime.timedelta(1)) self.response.headers['Content-Type'] = 'image/png' c = pngcanvas.PNGCanvas(16, 16) id = self.request.path[6:-4] try: w = Word.get(id) except: w = None if w: w.accessed = datetime.datetime.now() w.put() data = w.icon for y in range(0, 16): for x in range(0, 16): z = x + y * 16 if z < len(data) and int(data[z]): c.color = [0x00, 0x00, 0x00, 0xff] else: c.color = [0xff, 0xff, 0xff, 0xff] c.rectangle(x, y, x+1, y+1) else: c.verticalGradient(0, 0, c.width-1, c.height-1, [0xff,0,0,0xff], [0x20,0,0xff,0x80]) self.response.out.write(c.dump()) | d46b500d794812373f442ba75a92f913968998bb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3507/d46b500d794812373f442ba75a92f913968998bb/iconforth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
365,
18,
2740,
18,
2485,
3292,
1649,
17,
3367,
3546,
273,
296,
482,
16,
943,
17,
410,
33,
28,
1105,
713,
11,
365,
18,
2740,
18,
2485,
3292,
1350,
17,
559,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
365,
18,
2740,
18,
2485,
3292,
1649,
17,
3367,
3546,
273,
296,
482,
16,
943,
17,
410,
33,
28,
1105,
713,
11,
365,
18,
2740,
18,
2485,
3292,
1350,
17,
559,
3546,
... |
self.netMag /= count | self.netMag /= self.staMagCount self.netMagVar = np.var(self.staMags) | def updateNetworkMag(self): count = 0 self.netMag = 0 for i in range(len(self.streams)): if self.dicts[i]['MagUse'] and self.dicts[i].has_key('Mag'): count += 1 self.netMag += self.dicts[i]['Mag'] if count == 0: self.netMag = np.NaN else: self.netMag /= count self.netMagLabel = '\n\n\n\n %.2f' % self.netMag try: self.netMagText.set_text(self.netMagLabel) except: pass | 58ecfe19bef44aacd9e7b0124f02593f5139b455 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/58ecfe19bef44aacd9e7b0124f02593f5139b455/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
3906,
11372,
12,
2890,
4672,
1056,
273,
374,
365,
18,
2758,
11372,
273,
374,
364,
277,
316,
1048,
12,
1897,
12,
2890,
18,
16320,
3719,
30,
309,
365,
18,
16287,
63,
77,
23962,
113... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
3906,
11372,
12,
2890,
4672,
1056,
273,
374,
365,
18,
2758,
11372,
273,
374,
364,
277,
316,
1048,
12,
1897,
12,
2890,
18,
16320,
3719,
30,
309,
365,
18,
16287,
63,
77,
23962,
113... |
return 2 | return "OK, python was compiled with GCC" | def check_config_h(): """Checks if the GCC compiler is mentioned in config.h. If it is not, compiling probably doesn't work. """ # return values # 2: OK, python was compiled with GCC # 1: OK, python's config.h mentions __GCC__ # 0: uncertain, because we couldn't check it # -1: probably not OK, because we didn't found it in config.h # You could check check_config_h()>0 => OK from distutils import sysconfig import string,sys # if sys.version contains GCC then python was compiled with # GCC, and the config.h file should be OK if -1 == string.find(sys.version,"GCC"): pass # go to the next test else: return 2 try: # It would probably better to read single lines to search. # But we do this only once, and it is fast enough f=open(sysconfig.get_config_h_filename()) s=f.read() f.close() # is somewhere a #ifdef __GNUC__ or something similar if -1 == string.find(s,"__GNUC__"): return -1 else: return 1 except IOError: # if we can't read this file, we cannot say it is wrong # the compiler will complain later about this file as missing pass return 0 | b1dceae3df683a4ca673e45f25581048f31095c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b1dceae3df683a4ca673e45f25581048f31095c8/cygwinccompiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1425,
67,
76,
13332,
3536,
4081,
309,
326,
611,
6743,
5274,
353,
27635,
316,
642,
18,
76,
18,
225,
971,
518,
353,
486,
16,
1161,
4973,
8656,
3302,
1404,
1440,
18,
3536,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1425,
67,
76,
13332,
3536,
4081,
309,
326,
611,
6743,
5274,
353,
27635,
316,
642,
18,
76,
18,
225,
971,
518,
353,
486,
16,
1161,
4973,
8656,
3302,
1404,
1440,
18,
3536,
468,
... |
hints.append("The owner will change") | hints.append(_("The owner will change")) | def render_ticket_action_control(self, req, ticket, action): from trac.ticket import model | 090fd7fafec0ef4708e2b8b11b5429e8c09a3be6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2831/090fd7fafec0ef4708e2b8b11b5429e8c09a3be6/default_workflow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
16282,
67,
1128,
67,
7098,
12,
2890,
16,
1111,
16,
9322,
16,
1301,
4672,
628,
1284,
71,
18,
16282,
1930,
938,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
16282,
67,
1128,
67,
7098,
12,
2890,
16,
1111,
16,
9322,
16,
1301,
4672,
628,
1284,
71,
18,
16282,
1930,
938,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
s = [row_signs[i]*col_signs[j]*data[i][j] for j in range(cols)] solver.Add(row_sums[i] == solver.Sum(s)) | row_sums[i].SetMin(0) | def main(): # Create the solver. solver = pywrapcp.Solver('Einav puzzle') # # data # # small problem rows = 3; cols = 3; data = [ [ 33, 30, -10], [-16, 19, 9], [-17, -12, -14] ] # # variables # x = {} for i in range(rows): for j in range(cols): x[i,j] = solver.IntVar(-100, 100, "x[%i,%i]" % (i,j)) x_flat = [x[i,j] for i in range(rows) for j in range(cols)] row_sums = [solver.IntVar(0, 300, "row_sums(%i)" % i) for i in range(rows)] col_sums = [solver.IntVar(0, 300, "col_sums(%i)" % j) for j in range(cols)] row_signs = [solver.IntVar(-1, 1, "row_signs(%i)" % i) for i in range(rows)] col_signs = [solver.IntVar(-1, 1, "col_signs(%i)" % j) for j in range(cols)] # total sum: to be minimized total_sum = solver.IntVar(0, 1000, "total_sum") # # constraints # for i in range(rows): for j in range(cols): solver.Add(x[i,j] == data[i][j]*row_signs[i]*col_signs[j]) total_sum_a = [data[i][j]*row_signs[i]*col_signs[j] for i in range(rows) for j in range(cols) ] solver.Add(total_sum == solver.Sum(total_sum_a)) # row sums for i in range(rows): s = [row_signs[i]*col_signs[j]*data[i][j] for j in range(cols)] solver.Add(row_sums[i] == solver.Sum(s)) # column sums for j in range(cols): s = [row_signs[i]*col_signs[j]*data[i][j] for i in range(rows)] solver.Add(col_sums[j] == solver.Sum(s)) # objective objective = solver.Minimize(total_sum, 1) # # search and result # db = solver.Phase(x_flat + row_sums + col_sums, solver.INT_VAR_SIMPLE, solver.INT_VALUE_SIMPLE) solver.NewSearch(db, [objective]) num_solutions = 0 while solver.NextSolution(): num_solutions += 1 print "row_sums:", [row_sums[i].Value() for i in range(rows)] print "col_sums:", [col_sums[j].Value() for j in range(cols)] for i in range(rows): for j in range(cols): print x[i,j].Value(), print print solver.EndSearch() print print "num_solutions:", num_solutions print "failures:", solver.failures() print "branches:", solver.branches() print "wall_time:", solver.wall_time() | d55b553ab319a285a09242c7fd29e2caaaf2cc87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4695/d55b553ab319a285a09242c7fd29e2caaaf2cc87/issue5.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
225,
468,
1788,
326,
12776,
18,
12776,
273,
2395,
4113,
4057,
18,
27721,
2668,
41,
267,
842,
293,
31550,
6134,
225,
468,
468,
501,
468,
282,
468,
5264,
6199,
2595,
273,
890,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
225,
468,
1788,
326,
12776,
18,
12776,
273,
2395,
4113,
4057,
18,
27721,
2668,
41,
267,
842,
293,
31550,
6134,
225,
468,
468,
501,
468,
282,
468,
5264,
6199,
2595,
273,
890,... |
assert 'Edit this page' in response | assert 'Edit TEST' in response | def test_sidebar_dynamic_page(self): response = self.app.get('/wiki/TEST/').follow() assert 'Edit this page' in response assert 'Related Pages' not in response self.app.get('/wiki/aaa/') self.app.get('/wiki/bbb/') # Fake out updating the pages since reactor doesn't work with tests app = search_main.SearchApp cmd = reactor.ReactorCommand('reactor') cmd.args = [ os.environ.get('SANDBOX') and 'sandbox-test.ini' or 'test.ini' ] cmd.options = mock.Mock() cmd.options.dry_run = True cmd.options.proc = 1 configs = cmd.command() add_artifacts = cmd.route_audit('search', app.add_artifacts) del_artifacts = cmd.route_audit('search', app.del_artifacts) msg = mock.Mock() msg.ack = lambda:None msg.delivery_info = dict(routing_key='search.add_artifacts') h.set_context('test', 'wiki') a = model.Page.query.find(dict(title='aaa')).first() a.text = '\n[TEST]\n' msg.data = dict(project_id=a.project_id, mount_point=a.app_config.options.mount_point, artifacts=[a.dump_ref()]) add_artifacts(msg.data, msg) b = model.Page.query.find(dict(title='TEST')).first() b.text = '\n[bbb]\n' msg.data = dict(project_id=b.project_id, mount_point=b.app_config.options.mount_point, artifacts=[b.dump_ref()]) add_artifacts(msg.data, msg) ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() response = self.app.get('/wiki/TEST/') assert 'Related Pages' in response assert 'aaa' in response assert 'bbb' in response | 3e831b98587a9d237a62481486722e0ef943d9b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1036/3e831b98587a9d237a62481486722e0ef943d9b8/test_root.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
26417,
67,
14507,
67,
2433,
12,
2890,
4672,
766,
273,
365,
18,
2910,
18,
588,
2668,
19,
13044,
19,
16961,
2473,
2934,
14641,
1435,
1815,
296,
4666,
22130,
11,
316,
766,
1815,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
26417,
67,
14507,
67,
2433,
12,
2890,
4672,
766,
273,
365,
18,
2910,
18,
588,
2668,
19,
13044,
19,
16961,
2473,
2934,
14641,
1435,
1815,
296,
4666,
22130,
11,
316,
766,
1815,
... |
'iterationinfo Retrieve a iteration\n' | 'iterationinfo Retrieve a iteration\n\n' | def _PrintUsage(): print ('\nClient for talking to a Flies Server\n' 'basic commands:\n' 'list List all available projects\n' 'projectinfo Retrieve a project\n' 'iterationinfo Retrieve a iteration\n' "Use 'flies help' for the full list of commands\n") | ca4a6dfc32c2361a1a060d4347bf18740a0ce1c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12929/ca4a6dfc32c2361a1a060d4347bf18740a0ce1c5/flies.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5108,
5357,
13332,
1172,
7707,
64,
82,
1227,
364,
26591,
310,
358,
279,
478,
549,
281,
3224,
64,
82,
11,
296,
13240,
4364,
5581,
82,
11,
296,
1098,
2398,
987,
777,
2319,
10137,
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,
389,
5108,
5357,
13332,
1172,
7707,
64,
82,
1227,
364,
26591,
310,
358,
279,
478,
549,
281,
3224,
64,
82,
11,
296,
13240,
4364,
5581,
82,
11,
296,
1098,
2398,
987,
777,
2319,
10137,
64... |
""" fl_add_box(type, x, y, w, h, label) -> object ref. | """ fl_add_box(type, x, y, w, h, label) -> object | def fl_add_box(type, x, y, w, h, label): """ fl_add_box(type, x, y, w, h, label) -> object ref. """ retval = _fl_add_box(type, x, y, w, h, label) return retval | 8765c710f695de392f6fc7c664c746ec98668b1d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/8765c710f695de392f6fc7c664c746ec98668b1d/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
1289,
67,
2147,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
16,
1433,
4672,
3536,
1183,
67,
1289,
67,
2147,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
16,
1433,
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,
1183,
67,
1289,
67,
2147,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
16,
1433,
4672,
3536,
1183,
67,
1289,
67,
2147,
12,
723,
16,
619,
16,
677,
16,
341,
16,
366,
16,
1433,
13,
... |
raise hg.RepoError(_("no suitable response from remote hg")) | self.repoerror(_("no suitable response from remote hg")) | def validate_repo(self, ui, sshcmd, args, remotecmd): # cleanup up previous run self.cleanup() | d749d14b9a64f994adbac33fdac7100d51bc15f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/d749d14b9a64f994adbac33fdac7100d51bc15f4/sshrepo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
7422,
12,
2890,
16,
5915,
16,
7056,
4172,
16,
833,
16,
26693,
557,
1264,
4672,
468,
6686,
731,
2416,
1086,
365,
18,
16732,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
7422,
12,
2890,
16,
5915,
16,
7056,
4172,
16,
833,
16,
26693,
557,
1264,
4672,
468,
6686,
731,
2416,
1086,
365,
18,
16732,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def _sockfam(ip): """Returns the family argument of socket.socket""" if ip.version == 4: return socket.AF_INET elif ip.version == 6: return socket.AF_INET6 else: raise ValueError('IPv' + ip.version + ' is not supported') | def _sockfam(ip): """Returns the family argument of socket.socket""" if ip.version == 4: return socket.AF_INET elif ip.version == 6: return socket.AF_INET6 else: raise ValueError('IPv' + ip.version + ' is not supported') | 388637d373807b82cdd4fc04cf46f0b81f162768 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/388637d373807b82cdd4fc04cf46f0b81f162768/mcast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
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,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
tmpstack = [] for line_index, text in self.interesting_lines(firstline): while self.info[-1][0] > line_index: del self.info[-1] if self.info[-1][0] == line_index: break tmpstack.append((line_index, text)) while tmpstack: self.info.append(tmpstack.pop()) | def update_label(self): firstline = int(self.text.index("@0,0").split('.')[0]) if self.lastfirstline == firstline: return self.lastfirstline = firstline tmpstack = [] for line_index, text in self.interesting_lines(firstline): # Remove irrelevant self.info items, and when we reach a relevant # item (which must happen because of the dummy element), break. while self.info[-1][0] > line_index: del self.info[-1] if self.info[-1][0] == line_index: break tmpstack.append((line_index, text)) while tmpstack: self.info.append(tmpstack.pop()) lines = [""] * max(0, self.numlines - len(self.info)) + \ [x[1] for x in self.info[-self.numlines:]] self.label["text"] = '\n'.join(lines) | 98f9ff7223406f0c344f530e77fc866a67894c35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/98f9ff7223406f0c344f530e77fc866a67894c35/CodeContext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1925,
12,
2890,
4672,
1122,
1369,
273,
509,
12,
2890,
18,
955,
18,
1615,
2932,
36,
20,
16,
20,
20387,
4939,
2668,
1093,
25146,
20,
5717,
309,
365,
18,
2722,
3645,
1369,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1925,
12,
2890,
4672,
1122,
1369,
273,
509,
12,
2890,
18,
955,
18,
1615,
2932,
36,
20,
16,
20,
20387,
4939,
2668,
1093,
25146,
20,
5717,
309,
365,
18,
2722,
3645,
1369,
422,
... | |
def loop(timeout=30.0, use_poll=False, map=None): | def loop(timeout=30.0, use_poll=False, map=None, count=None): | def loop(timeout=30.0, use_poll=False, map=None): if map is None: map = socket_map if use_poll and hasattr(select, 'poll'): poll_fun = poll2 else: poll_fun = poll while map: poll_fun(timeout, map) | d5cf14348269f1faf06322a8c159cc50e98e736b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d5cf14348269f1faf06322a8c159cc50e98e736b/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2798,
12,
4538,
33,
5082,
18,
20,
16,
999,
67,
13835,
33,
8381,
16,
852,
33,
7036,
16,
1056,
33,
7036,
4672,
309,
852,
353,
599,
30,
852,
273,
2987,
67,
1458,
225,
309,
999,
67,
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,
2798,
12,
4538,
33,
5082,
18,
20,
16,
999,
67,
13835,
33,
8381,
16,
852,
33,
7036,
16,
1056,
33,
7036,
4672,
309,
852,
353,
599,
30,
852,
273,
2987,
67,
1458,
225,
309,
999,
67,
13... |
class c2(c): | class c2(waflib.Tools.c.c): | def start(cwd, version, wafdir): # no script file here Logs.init_log() Context.waf_dir = wafdir Context.out_dir = Context.top_dir = Context.run_dir = cwd Context.g_module = imp.new_module('wscript') Context.g_module.root_path = cwd Context.Context.recurse = recurse_rep Context.g_module.configure = configure Context.g_module.build = build Context.g_module.options = options Options.OptionsContext().execute() do_config = 'configure' in sys.argv try: os.stat(cwd + '/c4che') except: do_config = True if do_config: Context.create_context('configure').execute() if 'clean' in sys.argv: Context.create_context('clean').execute() if 'build' in sys.argv: Context.create_context('build').execute() | 5a9ad7f368224b4e27ee715a0a46ef76a46aff74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2886/5a9ad7f368224b4e27ee715a0a46ef76a46aff74/dbdlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
11089,
16,
1177,
16,
24103,
1214,
4672,
468,
1158,
2728,
585,
2674,
20238,
18,
2738,
67,
1330,
1435,
1772,
18,
91,
1727,
67,
1214,
273,
24103,
1214,
1772,
18,
659,
67,
1214,
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,
787,
12,
11089,
16,
1177,
16,
24103,
1214,
4672,
468,
1158,
2728,
585,
2674,
20238,
18,
2738,
67,
1330,
1435,
1772,
18,
91,
1727,
67,
1214,
273,
24103,
1214,
1772,
18,
659,
67,
1214,
2... |
def __checkAndPrepareJob(self, jobID, classAdJob, classAdReq, owner, ownerDN, ownerGroup, diracSetup, jobAttrNames, jobAttrValues): | def __checkAndPrepareJob( self, jobID, classAdJob, classAdReq, owner, ownerDN, ownerGroup, diracSetup, jobAttrNames, jobAttrValues ): | def __checkAndPrepareJob(self, jobID, classAdJob, classAdReq, owner, ownerDN, ownerGroup, diracSetup, jobAttrNames, jobAttrValues): """ Check Consistence of Submitted JDL and set some defaults Prepare subJDL with Job Requirements """ error = '' | 99c1bc850ba087890925b3180df206f65bb1d4b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/99c1bc850ba087890925b3180df206f65bb1d4b3/JobDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1893,
1876,
7543,
2278,
12,
365,
16,
28913,
16,
667,
1871,
2278,
16,
667,
1871,
6113,
16,
3410,
16,
3410,
8609,
16,
3410,
1114,
16,
4314,
8836,
7365,
16,
1719,
3843,
1557,
16,
17... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1893,
1876,
7543,
2278,
12,
365,
16,
28913,
16,
667,
1871,
2278,
16,
667,
1871,
6113,
16,
3410,
16,
3410,
8609,
16,
3410,
1114,
16,
4314,
8836,
7365,
16,
1719,
3843,
1557,
16,
17... |
self._brokers.append(self.test.broker(self.args, name, expect, wait)) | self._brokers.append(self.test.broker(self.args+args, name, expect, wait)) | def start(self, name=None, expect=EXPECT_RUNNING, wait=True): """Add a broker to the cluster. Returns the index of the new broker.""" if not name: name="%s-%d" % (self.name, len(self._brokers)) log.debug("Cluster %s starting member %s" % (self.name, name)) self._brokers.append(self.test.broker(self.args, name, expect, wait)) return self._brokers[-1] | 44699298a7d94febb9c42683b0093c0bae1ec9fb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/197/44699298a7d94febb9c42683b0093c0bae1ec9fb/brokertest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
16,
508,
33,
7036,
16,
4489,
33,
2294,
1423,
1268,
67,
29358,
16,
2529,
33,
5510,
4672,
3536,
986,
279,
8625,
358,
326,
2855,
18,
2860,
326,
770,
434,
326,
394,
8625,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
16,
508,
33,
7036,
16,
4489,
33,
2294,
1423,
1268,
67,
29358,
16,
2529,
33,
5510,
4672,
3536,
986,
279,
8625,
358,
326,
2855,
18,
2860,
326,
770,
434,
326,
394,
8625,
... |
TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11', 'XRANDR', 'XF86DGA']) | TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11', 'XRANDR', 'XF86DGA', 'XCURSOR']) | pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n" | 40b487d3fade2f3d085bdf4caae1e0b5fa6cc1ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8543/40b487d3fade2f3d085bdf4caae1e0b5fa6cc1ea/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
293,
464,
842,
722,
67,
76,
1011,
1548,
82,
7,
318,
536,
225,
453,
4307,
37,
67,
3932,
1653,
39,
6365,
67,
5757,
64,
82,
6,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
293,
464,
842,
722,
67,
76,
1011,
1548,
82,
7,
318,
536,
225,
453,
4307,
37,
67,
3932,
1653,
39,
6365,
67,
5757,
64,
82,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
EXAMPLE: | EXAMPLE:: | def maximal_linear_bias_relative(self): """ Return maximal bias of all linear approximations of this S-box. | 722300ff09b8199db5acea36fda4b2778a4c12e9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/722300ff09b8199db5acea36fda4b2778a4c12e9/sbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
943,
2840,
67,
12379,
67,
13931,
67,
11626,
12,
2890,
4672,
3536,
2000,
943,
2840,
12005,
434,
777,
9103,
26962,
1012,
434,
333,
348,
17,
2147,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
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,
943,
2840,
67,
12379,
67,
13931,
67,
11626,
12,
2890,
4672,
3536,
2000,
943,
2840,
12005,
434,
777,
9103,
26962,
1012,
434,
333,
348,
17,
2147,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,... |
if first in site.family.langs or first in site.family.known_families: | if first in site.family.langs or (first in site.family.known_families and site.family.known_families[first] != site.family.name): | def isInterwikiLink(s, site = None): """ Try to check whether s is in the form "foo:bar" where foo is a known language code or family. In such a case we are dealing with an interwiki link. """ if not ':' in s: return False site = site or getSite() first, rest = s.split(':',1) # interwiki codes are case-insensitive first = first.lower() if first in site.family.langs or first in site.family.known_families: return True return False | dc4f9d947cd3f42e62966ae54218433e2415bbc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/dc4f9d947cd3f42e62966ae54218433e2415bbc1/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
2465,
13044,
2098,
12,
87,
16,
2834,
273,
599,
4672,
3536,
6161,
358,
866,
2856,
272,
353,
316,
326,
646,
315,
11351,
30,
3215,
6,
1625,
8431,
353,
279,
4846,
2653,
981,
578,
6755... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
2465,
13044,
2098,
12,
87,
16,
2834,
273,
599,
4672,
3536,
6161,
358,
866,
2856,
272,
353,
316,
326,
646,
315,
11351,
30,
3215,
6,
1625,
8431,
353,
279,
4846,
2653,
981,
578,
6755... |
result['product_uom_qty'] = qty | result['product_uom_qty'] = qty | def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False): product_uom_obj = self.pool.get('product.uom') partner_obj = self.pool.get('res.partner') product_obj = self.pool.get('product.product') | 6c58c27ae54d6d246eaf3ccd86d55dcf0ec0d3bd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/6c58c27ae54d6d246eaf3ccd86d55dcf0ec0d3bd/sale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
350,
67,
3427,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
846,
335,
5449,
16,
3017,
16,
26667,
33,
20,
16,
582,
362,
33,
8381,
16,
26667,
67,
89,
538,
33,
20,
16,
582,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
350,
67,
3427,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
846,
335,
5449,
16,
3017,
16,
26667,
33,
20,
16,
582,
362,
33,
8381,
16,
26667,
67,
89,
538,
33,
20,
16,
582,
... |
"responsible" for the contents""" | "responsible" for the contents.""" | def compareFlavors(self, left, right): """Compare two flavor strings. This is part of your preferences because whether the user prefers installing from source or binary is.""" if left in self.flavorOrder: if right in self.flavorOrder: return cmp(self.flavorOrder.index(left), self.flavorOrder.index(right)) return -1 if right in self.flavorOrder: return 1 return cmp(left, right) | 2e4f38c4e47f37da0cfc2fae88001ca6999e16e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2e4f38c4e47f37da0cfc2fae88001ca6999e16e0/pimp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
2340,
842,
1383,
12,
2890,
16,
2002,
16,
2145,
4672,
3536,
8583,
2795,
19496,
2064,
18,
1220,
353,
1087,
434,
3433,
12750,
2724,
2856,
326,
729,
11307,
414,
3799,
310,
628,
1084,
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,
3400,
2340,
842,
1383,
12,
2890,
16,
2002,
16,
2145,
4672,
3536,
8583,
2795,
19496,
2064,
18,
1220,
353,
1087,
434,
3433,
12750,
2724,
2856,
326,
729,
11307,
414,
3799,
310,
628,
1084,
5... |
def __init__(self,backend,parameters,refresh_cllbck) : | def __init__(self,backend,parameters,locks,refresh_cllbck) : | def __init__(self,backend,parameters,refresh_cllbck) : self.backend = backend self.dic = parameters self.tasks = {} self.time = time.time() self.refresh = refresh_cllbck self.locks = {} self.tosleep = 0 | fb7f0d508074137043da484113a61a40849d87c0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/fb7f0d508074137043da484113a61a40849d87c0/datastore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
9993,
16,
3977,
16,
23581,
16,
9144,
67,
830,
20404,
363,
13,
294,
365,
18,
9993,
273,
4221,
365,
18,
15859,
273,
1472,
365,
18,
9416,
273,
2618,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
9993,
16,
3977,
16,
23581,
16,
9144,
67,
830,
20404,
363,
13,
294,
365,
18,
9993,
273,
4221,
365,
18,
15859,
273,
1472,
365,
18,
9416,
273,
2618,
365,
... |
raise ValueError, 'Headers recieved are not in the correct form' def getHeaders(self): """ Returns the headers of this response. @returns: the HTTP response headers @rtype: dict """ | self.headers.update({key: str(value)}) addHeader = add_header def get_headers(self): | def addHeader(self, *args): """ Populates the HTTP header with lines of text. Sets the status code on this response object if the given argument list containes a 'Status' header. | 2d889182f07a1e20247eba2168cf4d18f81fcdab /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11836/2d889182f07a1e20247eba2168cf4d18f81fcdab/pyblosxom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13906,
12,
2890,
16,
380,
1968,
4672,
3536,
10264,
17099,
326,
2239,
1446,
598,
2362,
434,
977,
18,
11511,
326,
1267,
981,
603,
333,
766,
733,
309,
326,
864,
1237,
666,
912,
281,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13906,
12,
2890,
16,
380,
1968,
4672,
3536,
10264,
17099,
326,
2239,
1446,
598,
2362,
434,
977,
18,
11511,
326,
1267,
981,
603,
333,
766,
733,
309,
326,
864,
1237,
666,
912,
281,
279,
... |
clause.append("%s LIKE '%%%s%%'" % (col, util.sql_escape(v))) else: clause.append("%s = '%s'" % (col, util.sql_escape(v))) | clause.append("%s LIKE '%%%s%%'" % (col, util.sql_escape(v[0]))) else: clause.append("%s = '%s'" % (col, util.sql_escape(v[0]))) | def _render_results(self, constraints, order, desc): self.req.hdf.setValue('title', 'Advanced Ticket Query') self.req.hdf.setValue('query.edit_href', self.env.href.query(constraints, order, desc, action='edit')) | f45b2a906cc619cd9797382551d6dad656345e82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/f45b2a906cc619cd9797382551d6dad656345e82/Query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
4717,
12,
2890,
16,
6237,
16,
1353,
16,
3044,
4672,
365,
18,
3658,
18,
26428,
18,
542,
620,
2668,
2649,
2187,
296,
23618,
22023,
2770,
6134,
365,
18,
3658,
18,
26428,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
4717,
12,
2890,
16,
6237,
16,
1353,
16,
3044,
4672,
365,
18,
3658,
18,
26428,
18,
542,
620,
2668,
2649,
2187,
296,
23618,
22023,
2770,
6134,
365,
18,
3658,
18,
26428,
18... |
sequence = sequence.data.upper() | sequence = sequence.tostring().upper() | def translate(sequence, table = "Standard", stop_symbol = "*"): try: id = int(table) except: id = None if isinstance(sequence, Seq): if sequence.alphabet==IUPAC.unambiguous_dna: if id==None: table = CodonTable.unambiguous_dna_by_name[table] else: table = CodonTable.unambiguous_dna_by_id[id] elif sequence.alphabet==IUPAC.ambiguous_dna: if id==None: table = CodonTable.ambiguous_dna_by_name[table] else: table = CodonTable.ambiguous_dna_by_id[id] elif sequence.alphabet==IUPAC.unambiguous_rna: if id==None: table = CodonTable.unambiguous_rna_by_name[table] else: table = CodonTable.unambiguous_rna_by_id[id] elif sequence.alphabet==IUPAC.ambiguous_rna: if id==None: table = CodonTable.ambiguous_rna_by_name[table] else: table = CodonTable.ambiguous_rna_by_id[id] else: if id==None: table = CodonTable.generic_by_name[table] else: table = CodonTable.generic_by_id[id] sequence = sequence.data.upper() n = len(sequence) get = table.forward_table.get protein = [get(sequence[i:i+3], stop_symbol) for i in xrange(0,n-n%3,3)] protein = "".join(protein) alphabet = Alphabet.HasStopCodon(table.protein_alphabet) return Seq(protein, alphabet) else: if id==None: table = CodonTable.generic_by_name[table] else: table = CodonTable.generic_by_id[id] get = table.forward_table.get sequence = sequence.upper() n = len(sequence) protein = [get(sequence[i:i+3], stop_symbol) for i in xrange(0,n-n%3,3)] protein = "".join(protein) return protein | e1423f1266992cd51167fbf4155526e2856f21fe /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7167/e1423f1266992cd51167fbf4155526e2856f21fe/Seq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
12,
6178,
16,
1014,
273,
315,
8336,
3113,
2132,
67,
7175,
273,
10971,
4672,
775,
30,
612,
273,
509,
12,
2121,
13,
1335,
30,
612,
273,
599,
309,
1549,
12,
6178,
16,
14367,
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,
4204,
12,
6178,
16,
1014,
273,
315,
8336,
3113,
2132,
67,
7175,
273,
10971,
4672,
775,
30,
612,
273,
509,
12,
2121,
13,
1335,
30,
612,
273,
599,
309,
1549,
12,
6178,
16,
14367,
4672,
... |
self.options['show-lines'], | self.options['debug-ocr'], | def detect_id(self): if self.id_corners is None: self.id = None corners_up, corners_down = self.id_corners digits = [] self.id_scores = [] for i in range(0, len(corners_up) - 1): corners = (corners_up[i], corners_up[i + 1], corners_down[i], corners_down[i + 1]) digit, scores = (ocr.digit_ocr(self.image_proc, corners, self.options['show-lines'], self.image_drawn)) digits.append(digit) self.id_scores.append(scores) | 52c52f535e3e31b45b3da08b0838cd90cb5f94d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12267/52c52f535e3e31b45b3da08b0838cd90cb5f94d8/imageproc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
350,
12,
2890,
4672,
309,
365,
18,
350,
67,
3850,
9646,
353,
599,
30,
365,
18,
350,
273,
599,
18398,
67,
416,
16,
18398,
67,
2378,
273,
365,
18,
350,
67,
3850,
9646,
6815,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
350,
12,
2890,
4672,
309,
365,
18,
350,
67,
3850,
9646,
353,
599,
30,
365,
18,
350,
273,
599,
18398,
67,
416,
16,
18398,
67,
2378,
273,
365,
18,
350,
67,
3850,
9646,
6815,
... |
>>> o2 = [] >>> o3 = [] | If the adapter does not provide ILocation, we location proxy it and set the parent. If the adapter does provide ILocation and it's __parent__ is None, we set the __parent__ to the adapter's context only: | ... def __init__(self, *context): | c4df19b7123c032c70b5860013f9a3c864759b7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9520/c4df19b7123c032c70b5860013f9a3c864759b7f/adapter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1372,
377,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
2472,
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... | [
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,
1372,
377,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
2472,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return int(Backquote(cmd, cwd)) except ValueError: | return int(input) except TypeError, ValueError: | def BackquoteAsInteger(cmd, cwd=None): """Like Backquote, but returns either an int or None.""" try: return int(Backquote(cmd, cwd)) except ValueError: return None | 4328fa54cb2779b9e7774e9e5cc7152353218c3d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/4328fa54cb2779b9e7774e9e5cc7152353218c3d/git_cl_hooks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4297,
6889,
1463,
4522,
12,
4172,
16,
7239,
33,
7036,
4672,
3536,
8804,
4297,
6889,
16,
1496,
1135,
3344,
392,
509,
578,
599,
12123,
775,
30,
327,
509,
12,
2630,
13,
1335,
3580,
16,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4297,
6889,
1463,
4522,
12,
4172,
16,
7239,
33,
7036,
4672,
3536,
8804,
4297,
6889,
16,
1496,
1135,
3344,
392,
509,
578,
599,
12123,
775,
30,
327,
509,
12,
2630,
13,
1335,
3580,
16,
20... |
if atts.has_key('align'): self.body.append('<p align="%s">' % (self.attval(atts['align'],))) else: self.body.append('<p>') self.context.append('</p>\n') | div_atts = self.image_div_atts(node) self.body.append(self.starttag({}, 'div', '', **div_atts)) self.context.append('</div>\n') | def visit_image(self, node): atts = node.attributes.copy() if atts.has_key('class'): del atts['class'] # prevent duplication with node attrs atts['src'] = atts['uri'] del atts['uri'] if atts.has_key('scale'): if Image and not (atts.has_key('width') and atts.has_key('height')): try: im = Image.open(str(atts['src'])) except (IOError, # Source image can't be found or opened UnicodeError): # PIL doesn't like Unicode paths. pass else: if not atts.has_key('width'): atts['width'] = im.size[0] if not atts.has_key('height'): atts['height'] = im.size[1] del im if atts.has_key('width'): atts['width'] = int(round(atts['width'] * (float(atts['scale']) / 100))) if atts.has_key('height'): atts['height'] = int(round(atts['height'] * (float(atts['scale']) / 100))) del atts['scale'] if not atts.has_key('alt'): atts['alt'] = atts['src'] if isinstance(node.parent, nodes.TextElement): self.context.append('') else: if atts.has_key('align'): self.body.append('<p align="%s">' % (self.attval(atts['align'],))) else: self.body.append('<p>') self.context.append('</p>\n') self.body.append(self.emptytag(node, 'img', '', **atts)) | 4f7dcf6c0e8e9b3a0aa2be6406e89c1b05be4e2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/4f7dcf6c0e8e9b3a0aa2be6406e89c1b05be4e2c/html4css1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2730,
12,
2890,
16,
756,
4672,
15687,
273,
756,
18,
4350,
18,
3530,
1435,
309,
15687,
18,
5332,
67,
856,
2668,
1106,
11,
4672,
1464,
15687,
3292,
1106,
3546,
6647,
468,
5309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2730,
12,
2890,
16,
756,
4672,
15687,
273,
756,
18,
4350,
18,
3530,
1435,
309,
15687,
18,
5332,
67,
856,
2668,
1106,
11,
4672,
1464,
15687,
3292,
1106,
3546,
6647,
468,
5309,
... |
node = Player.createNode("words", {"text":"Bold"}) | node = Player.createNode("words", {"text":"Bold", "font":"Bitstream Vera Sans"}) | def posAlmostEqual(pos1, pos2): return math.fabs(pos1[0]-pos2[0]) <= 2 and math.fabs(pos1[1]-pos2[1]) <= 2 | 048d7fe74d2555f9dcd5ec903e1f63343e228e6e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7300/048d7fe74d2555f9dcd5ec903e1f63343e228e6e/WordsTest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
949,
1067,
10329,
5812,
12,
917,
21,
16,
949,
22,
4672,
327,
4233,
18,
74,
5113,
12,
917,
21,
63,
20,
65,
17,
917,
22,
63,
20,
5717,
1648,
576,
471,
4233,
18,
74,
5113,
12,
917,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
949,
1067,
10329,
5812,
12,
917,
21,
16,
949,
22,
4672,
327,
4233,
18,
74,
5113,
12,
917,
21,
63,
20,
65,
17,
917,
22,
63,
20,
5717,
1648,
576,
471,
4233,
18,
74,
5113,
12,
917,
... |
self.__pari_prime = P[0] return self.__pari_prime is not None | self._pari_prime = P[0] return self._pari_prime is not None | def is_prime(self): """ Return True if this ideal is prime. | 7188bde5dd23ba549d366751fa805d8005f39b9b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/7188bde5dd23ba549d366751fa805d8005f39b9b/number_field_ideal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
16382,
12,
2890,
4672,
3536,
2000,
1053,
309,
333,
23349,
353,
17014,
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,
... | [
1,
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,
353,
67,
16382,
12,
2890,
4672,
3536,
2000,
1053,
309,
333,
23349,
353,
17014,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
exceptions.RuntimeWarning.__name__) | RuntimeWarning.__name__) | def has_warned(self): self.assertEqual(test.test_warnings.msg.category, exceptions.RuntimeWarning.__name__) | a8d4b02e89c53d205ab895f9c594aff08b2b5292 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/a8d4b02e89c53d205ab895f9c594aff08b2b5292/test_structmembers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
8935,
329,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
3813,
18,
3813,
67,
12103,
18,
3576,
18,
4743,
16,
4798,
18,
5576,
6210,
16186,
529,
972,
13,
2,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
8935,
329,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
3813,
18,
3813,
67,
12103,
18,
3576,
18,
4743,
16,
4798,
18,
5576,
6210,
16186,
529,
972,
13,
2,
-100,
-100,
-100,
-100,
... |
age = max(now - when, 0) | age = max(int(now - when), 0) | def handlePacket_IQ(self, ad, data): # Initialization Request; someone else is trying to get online (kind, myip, port ) = self.decodePacket('!2s4sH', data) | 53cca108b3673acc984d0fc42f5dfb88038a50af /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8524/53cca108b3673acc984d0fc42f5dfb88038a50af/dtella.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
6667,
67,
45,
53,
12,
2890,
16,
1261,
16,
501,
4672,
468,
26586,
1567,
31,
18626,
469,
353,
8374,
358,
336,
12365,
261,
9224,
16,
3399,
625,
16,
1756,
262,
273,
365,
18,
3922,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1640,
6667,
67,
45,
53,
12,
2890,
16,
1261,
16,
501,
4672,
468,
26586,
1567,
31,
18626,
469,
353,
8374,
358,
336,
12365,
261,
9224,
16,
3399,
625,
16,
1756,
262,
273,
365,
18,
3922,
... |
nrjob = int(math.ceil(len(guids)/float(self.numfiles))) | nrfiles = self.numfiles nrjob = int(math.ceil(len(guids)/float(nrfiles))) | def split(self,job): | 30af3ed580bfb24efde9f1b112a6ae6ecc72bfd1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1488/30af3ed580bfb24efde9f1b112a6ae6ecc72bfd1/DQ2JobSplitter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
12,
2890,
16,
4688,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
12,
2890,
16,
4688,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
def itervalues(cls): return cls.iter("values") def iteritems(cls): return cls.iter("items") copy = cow | def itervalues(cls, readonly=False): if not cls.__warn__ is False and cls.__hasmutable__ and readonly is False: print >> cls.__warn__, "Warning: If you arn't going to change any of the values call with True." return cls.iter("values", readonly) def iteritems(cls, readonly=False): if not cls.__warn__ is False and cls.__hasmutable__ and readonly is False: print >> cls.__warn__, "Warning: If you arn't going to change any of the values call with True." return cls.iter("items", readonly) | def itervalues(cls): return cls.iter("values") | b1769260cbbb28f284a3741b353552319b559c2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2672/b1769260cbbb28f284a3741b353552319b559c2c/COW.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24607,
12,
6429,
4672,
327,
2028,
18,
2165,
2932,
2372,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
24607,
12,
6429,
4672,
327,
2028,
18,
2165,
2932,
2372,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
return self.__addBestPkg(pkglist) | return self.__handleBestPkg("remove", pkglist) | def removeByDep(self, dname, dflags, dversion, all=True): pkglist = self.pydb.searchDependency(dname, dflags, dversion) return self.__addBestPkg(pkglist) | 63c08f3d9e04ccf32583372dd5311f84d2b5343f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/63c08f3d9e04ccf32583372dd5311f84d2b5343f/yum.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31858,
16316,
12,
2890,
16,
302,
529,
16,
302,
7133,
16,
302,
1589,
16,
777,
33,
5510,
4672,
3475,
1098,
273,
365,
18,
2074,
1966,
18,
3072,
7787,
12,
72,
529,
16,
302,
7133,
16,
302... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31858,
16316,
12,
2890,
16,
302,
529,
16,
302,
7133,
16,
302,
1589,
16,
777,
33,
5510,
4672,
3475,
1098,
273,
365,
18,
2074,
1966,
18,
3072,
7787,
12,
72,
529,
16,
302,
7133,
16,
302... |
sage: sage.symbolic.units.unitdocs('meter') 'SI base unit of length.\nDefined to be the distance light travels in vacuum in 1/299792458 of a second.' sage: sage.symbolic.units.unitdocs('amu') 'Abbreviation for atomic mass unit.\nApproximately equal to 1.660538782*10^-27 kilograms.' | sage: sage.symbolic.units.unitdocs('meter') 'SI base unit of length.\nDefined to be the distance light travels in vacuum in 1/299792458 of a second.' sage: sage.symbolic.units.unitdocs('amu') 'Abbreviation for atomic mass unit.\nApproximately equal to 1.660538782*10^-27 kilograms.' | def unitdocs(unit): """ Returns docstring for the given unit. INPUT: - ``unit`` OUTPUT: - ``string`` EXAMPLES:: sage: sage.symbolic.units.unitdocs('meter') 'SI base unit of length.\nDefined to be the distance light travels in vacuum in 1/299792458 of a second.' sage: sage.symbolic.units.unitdocs('amu') 'Abbreviation for atomic mass unit.\nApproximately equal to 1.660538782*10^-27 kilograms.' Units not in the list unit_docs will raise a ValueError:: sage: sage.symbolic.units.unitdocs('earth') Traceback (most recent call last): ... ValueError: No documentation exists for the unit earth. """ if is_unit(unit): return unit_docs[unit_to_type[str(unit)]+"_docs"][str(unit)] else: raise ValueError, "No documentation exists for the unit %s."%unit | ed891e5784edd8a5e4d544f1ef837edc82b93924 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ed891e5784edd8a5e4d544f1ef837edc82b93924/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2836,
8532,
12,
4873,
4672,
3536,
2860,
14525,
364,
326,
864,
2836,
18,
225,
12943,
30,
225,
300,
12176,
4873,
10335,
225,
11550,
30,
225,
300,
12176,
1080,
10335,
225,
5675,
8900,
11386,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2836,
8532,
12,
4873,
4672,
3536,
2860,
14525,
364,
326,
864,
2836,
18,
225,
12943,
30,
225,
300,
12176,
4873,
10335,
225,
11550,
30,
225,
300,
12176,
1080,
10335,
225,
5675,
8900,
11386,
... |
if not self.started_playing == PLAYING: | if not self.play_state == PLAYING: | def set_current_time(self, seconds): if not self.started_playing == PLAYING: self.play_from_time = seconds return t = int(seconds * 1000) libvlc.libvlc_media_player_set_time(self.media_player, ctypes.c_longlong(t), self.exc.ref()) try: self.exc.check() except VLCError, e: logging.warn("exception setting current time %s" % e) | 1e46e35fceec45c9bfd30e3fdb32385e7ab2b765 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/1e46e35fceec45c9bfd30e3fdb32385e7ab2b765/vlc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2972,
67,
957,
12,
2890,
16,
3974,
4672,
309,
486,
365,
18,
1601,
67,
2019,
422,
453,
7868,
1360,
30,
365,
18,
1601,
67,
2080,
67,
957,
273,
3974,
327,
268,
273,
509,
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,
444,
67,
2972,
67,
957,
12,
2890,
16,
3974,
4672,
309,
486,
365,
18,
1601,
67,
2019,
422,
453,
7868,
1360,
30,
365,
18,
1601,
67,
2080,
67,
957,
273,
3974,
327,
268,
273,
509,
12,
... |
if xid <> self.lastxid: | if xid != self.lastxid: | def do_call(self): call = self.packer.get_buf() self.sock.send(call) try: from select import select except ImportError: print 'WARNING: select not found, RPC may hang' select = None BUFSIZE = 8192 # Max UDP buffer size timeout = 1 count = 5 while 1: r, w, x = [self.sock], [], [] if select: r, w, x = select(r, w, x, timeout) if self.sock not in r: count = count - 1 if count < 0: raise RuntimeError, 'timeout' if timeout < 25: timeout = timeout *2 | e6b5917a3f1232d3676928a6fb5ae07cc948f164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6b5917a3f1232d3676928a6fb5ae07cc948f164/rpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1991,
12,
2890,
4672,
745,
273,
365,
18,
2920,
264,
18,
588,
67,
4385,
1435,
365,
18,
15031,
18,
4661,
12,
1991,
13,
775,
30,
628,
2027,
1930,
2027,
1335,
11308,
30,
1172,
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,
741,
67,
1991,
12,
2890,
4672,
745,
273,
365,
18,
2920,
264,
18,
588,
67,
4385,
1435,
365,
18,
15031,
18,
4661,
12,
1991,
13,
775,
30,
628,
2027,
1930,
2027,
1335,
11308,
30,
1172,
2... |
ref4 = DateTime('2006/01/01') | ref4 = DateTime('2006/01/01 GMT') | def testISO8601(self): # ISO8601 reference dates ref0 = DateTime('2002/5/2 8:00am GMT') ref1 = DateTime('2002/5/2 8:00am US/Eastern') ref2 = DateTime('2006/11/6 10:30') ref3 = DateTime('2004/06/14 14:30:15 GMT-3') ref4 = DateTime('2006/01/01') | 81cca4b73a2847124fd8ec06de65680cb78faa68 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9658/81cca4b73a2847124fd8ec06de65680cb78faa68/testDateTime.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
12609,
14181,
12,
2890,
4672,
468,
9351,
14181,
2114,
7811,
1278,
20,
273,
3716,
2668,
6976,
22,
19,
25,
19,
22,
1725,
30,
713,
301,
21706,
6134,
1278,
21,
273,
3716,
2668,
6976,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12609,
14181,
12,
2890,
4672,
468,
9351,
14181,
2114,
7811,
1278,
20,
273,
3716,
2668,
6976,
22,
19,
25,
19,
22,
1725,
30,
713,
301,
21706,
6134,
1278,
21,
273,
3716,
2668,
6976,
... |
request.user = self.auth_func(username, password) or AnonymousUser() return not request.user in (False, AnonymousUser()) | request.user = authenticate(username=username, password=password) or AnonymousUser() return not request.user in (False, None, AnonymousUser()) | def is_authenticated(self, request): auth_string = request.META.get('HTTP_AUTHORIZATION', None) | 32222a612d303481faad6d4c9c2a2a625cd4b4c8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11777/32222a612d303481faad6d4c9c2a2a625cd4b4c8/authentication.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
14454,
12,
2890,
16,
590,
4672,
1357,
67,
1080,
273,
590,
18,
19294,
18,
588,
2668,
3693,
67,
17866,
2689,
2187,
599,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
14454,
12,
2890,
16,
590,
4672,
1357,
67,
1080,
273,
590,
18,
19294,
18,
588,
2668,
3693,
67,
17866,
2689,
2187,
599,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
print "ending" | def endCall(self, callcookie, reason=''): rtp = self._rtp.get(callcookie) self._currentCall = None if rtp: rtp = self._rtp[callcookie] rtp.stopSendingAndReceiving() del self._rtp[callcookie] if self._calls.get(callcookie): del self._calls[callcookie] self.closeAudioDevice() print "ending" self.ui.callDisconnected(callcookie, reason) | a5bcaca6f4acbd54ebd7fe241f31271ad71e5c43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1265/a5bcaca6f4acbd54ebd7fe241f31271ad71e5c43/phone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
1477,
12,
2890,
16,
745,
8417,
16,
3971,
2218,
11,
4672,
436,
6834,
273,
365,
6315,
3797,
84,
18,
588,
12,
1991,
8417,
13,
365,
6315,
2972,
1477,
273,
599,
309,
436,
6834,
30,
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,
679,
1477,
12,
2890,
16,
745,
8417,
16,
3971,
2218,
11,
4672,
436,
6834,
273,
365,
6315,
3797,
84,
18,
588,
12,
1991,
8417,
13,
365,
6315,
2972,
1477,
273,
599,
309,
436,
6834,
30,
4... | |
'recv', 'recvfrom', 'send', 'sendall', 'sendto', 'setblocking', | 'sendall', 'setblocking', | def getfqdn(name=''): """Get fully qualified domain name from name. An empty argument is interpreted as meaning the local host. First the hostname returned by gethostbyaddr() is checked, then possibly existing aliases. In case no FQDN is available, hostname is returned. """ name = name.strip() if not name or name == '0.0.0.0': name = gethostname() try: hostname, aliases, ipaddrs = gethostbyaddr(name) except error: pass else: aliases.insert(0, hostname) for name in aliases: if '.' in name: break else: name = hostname return name | 3c14469ffa6f8d0efe1a5ac4c33b3d0fd5b1fe1a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/3c14469ffa6f8d0efe1a5ac4c33b3d0fd5b1fe1a/socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
19206,
5176,
12,
529,
2218,
11,
4672,
3536,
967,
7418,
9348,
2461,
508,
628,
508,
18,
225,
1922,
1008,
1237,
353,
19898,
487,
12256,
326,
1191,
1479,
18,
225,
5783,
326,
5199,
2106,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19206,
5176,
12,
529,
2218,
11,
4672,
3536,
967,
7418,
9348,
2461,
508,
628,
508,
18,
225,
1922,
1008,
1237,
353,
19898,
487,
12256,
326,
1191,
1479,
18,
225,
5783,
326,
5199,
2106,... |
if error.errno != errno.ENOENT: | if error.errno not in (errno.ENOENT, errno.ENOTDIR): | def unlink(filename): try: os.unlink(filename) except OSError as error: # The filename need not exist. if error.errno != errno.ENOENT: raise | a410571dc5814e0014243e9842510012882da5cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/a410571dc5814e0014243e9842510012882da5cd/support.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8255,
12,
3459,
4672,
775,
30,
1140,
18,
318,
1232,
12,
3459,
13,
1335,
10002,
487,
555,
30,
468,
1021,
1544,
1608,
486,
1005,
18,
309,
555,
18,
19088,
486,
316,
261,
19088,
18,
1157,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8255,
12,
3459,
4672,
775,
30,
1140,
18,
318,
1232,
12,
3459,
13,
1335,
10002,
487,
555,
30,
468,
1021,
1544,
1608,
486,
1005,
18,
309,
555,
18,
19088,
486,
316,
261,
19088,
18,
1157,
... |
@param id: structure type ID | @param sid: structure type ID | def SetMemberComment(id, member_offset, comment, repeatable): """ Change structure member comment @param id: structure type ID @param member_offset: offset of the member @param comment: new comment of the structure member @param repeatable: 1: change repeatable comment 0: change regular comment @return: != 0 - ok """ s = idaapi.get_struc(id) if not s: return 0 m = idaapi.get_member(s, member_offset) if not m: return 0 return idaapi.set_member_cmt(m, comment, repeatable) | 244a3cd02a580c0095170004ec30e922f0d1a8a6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6984/244a3cd02a580c0095170004ec30e922f0d1a8a6/idc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
4419,
4469,
12,
350,
16,
3140,
67,
3348,
16,
2879,
16,
7666,
429,
4672,
3536,
7576,
3695,
3140,
2879,
225,
632,
891,
7348,
30,
3695,
618,
1599,
632,
891,
3140,
67,
3348,
30,
1384... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
4419,
4469,
12,
350,
16,
3140,
67,
3348,
16,
2879,
16,
7666,
429,
4672,
3536,
7576,
3695,
3140,
2879,
225,
632,
891,
7348,
30,
3695,
618,
1599,
632,
891,
3140,
67,
3348,
30,
1384... |
result += "\n<p>" + real_paragraph + "</p>\n" | indent_text = '' m_start_and_end = re.match( '^\s*(")(.*)"(.?—\[[^\]]*\])?\s*$', real_paragraph ) m_start = re.match( '^\s*(")(.*)', real_paragraph ) m_end = re.match( '^\s*(.*)"(.?—\[[^\]]*\])?\s*$', real_paragraph ) indent = False if m_start_and_end: self.opened_and_closed_quote = True if not re.search('"',m_start_and_end.group(2)): indent = True elif m_start: self.open_quote = True if not re.search('"',m_start.group(2)): indent = True elif m_end: self.close_quote = True if not re.search('"',m_end.group(1)): indent = True elif self.after_open_quote: indent = True if indent: indent_text = ' class="indent"' result += "\n<p%s>%s</p>\n" % ( indent_text, real_paragraph ) | def to_xml(self): | 392be97a0f9928862e73ceca51d21a10fb9a1fec /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8428/392be97a0f9928862e73ceca51d21a10fb9a1fec/parse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
2902,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
2902,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if krawlx != m.i and m.j != 0: look.i = next.i + krawlx krawlx = -krawlx elif krawly != m.j and m.i != 0: look.j = next.j + krawly krawly = -krawly | if krawli != m.i and m.j != 0: look.i = next.i + krawli krawli = -krawli elif krawlj != m.j and m.i != 0: look.j = next.j + krawlj krawlj = -krawlj | def movebaddy(enemy): "Tactical movement for the bad guys." next = coord(); look = coord() irun = False # This should probably be just (game.quadrant in game.state.kcmdr) + (game.state.kscmdr==game.quadrant) if game.skill >= SKILL_EXPERT: nbaddys = (((game.quadrant in game.state.kcmdr)*2 + (game.state.kscmdr==game.quadrant)*2+game.klhere*1.23+game.irhere*1.5)/2.0) else: nbaddys = (game.quadrant in game.state.kcmdr) + (game.state.kscmdr==game.quadrant) dist1 = enemy.kdist mdist = int(dist1 + 0.5); # Nearest integer distance # If SC, check with spy to see if should hi-tail it if enemy.type==IHS and \ (enemy.kpower <= 500.0 or (game.condition=="docked" and not damaged(DPHOTON))): irun = True motion = -QUADSIZE else: # decide whether to advance, retreat, or hold position forces = enemy.kpower+100.0*len(game.enemies)+400*(nbaddys-1) if not game.shldup: forces += 1000; # Good for enemy if shield is down! if not damaged(DPHASER) or not damaged(DPHOTON): if damaged(DPHASER): # phasers damaged forces += 300.0 else: forces -= 0.2*(game.energy - 2500.0) if damaged(DPHOTON): # photon torpedoes damaged forces += 300.0 else: forces -= 50.0*game.torps else: # phasers and photon tubes both out! forces += 1000.0 motion = 0 if forces <= 1000.0 and game.condition != "docked": # Typical situation motion = ((forces + randreal(200))/150.0) - 5.0 else: if forces > 1000.0: # Very strong -- move in for kill motion = (1.0 - randreal())**2 * dist1 + 1.0 if game.condition=="docked" and (game.options & OPTION_BASE): # protected by base -- back off ! motion -= game.skill*(2.0-randreal()**2) if idebug: proutn("=== MOTION = %d, FORCES = %1.2f, " % (motion, forces)) # don't move if no motion if motion==0: return # Limit motion according to skill if abs(motion) > game.skill: if motion < 0: motion = -game.skill else: motion = game.skill # calculate preferred number of steps if motion < 0: nsteps = -motion else: nsteps = motion if motion > 0 and nsteps > mdist: nsteps = mdist; # don't overshoot if nsteps > QUADSIZE: nsteps = QUADSIZE; # This shouldn't be necessary if nsteps < 1: nsteps = 1; # This shouldn't be necessary if idebug: proutn("NSTEPS = %d:" % nsteps) # Compute preferred values of delta X and Y m = game.sector - enemy.kloc if 2.0 * abs(m.i) < abs(m.j): m.i = 0 if 2.0 * abs(m.j) < abs(game.sector.i-enemy.kloc.i): m.j = 0 if m.i != 0: if m.i*motion < 0: m.i = -1 else: m.i = 1 if m.j != 0: if m.j*motion < 0: m.j = -1 else: m.j = 1 next = enemy.kloc # main move loop for ll in range(nsteps): if idebug: proutn(" %d" % (ll+1)) # Check if preferred position available look = next + m if m.i < 0: krawlx = 1 else: krawlx = -1 if m.j < 0: krawly = 1 else: krawly = -1 success = False attempts = 0; # Settle mysterious hang problem while attempts < 20 and not success: attempts += 1 if look.i < 0 or look.i >= QUADSIZE: if motion < 0 and tryexit(enemy, look, irun): return if krawlx == m.i or m.j == 0: break look.i = next.i + krawlx krawlx = -krawlx elif look.j < 0 or look.j >= QUADSIZE: if motion < 0 and tryexit(enemy, look, irun): return if krawly == m.j or m.i == 0: break look.j = next.j + krawly krawly = -krawly elif (game.options & OPTION_RAMMING) and game.quad[look.i][look.j] != IHDOT: # See if enemy should ram ship if game.quad[look.i][look.j] == game.ship and \ (enemy.type == IHC or enemy.type == IHS): collision(rammed=True, enemy=enemy) return if krawlx != m.i and m.j != 0: look.i = next.i + krawlx krawlx = -krawlx elif krawly != m.j and m.i != 0: look.j = next.j + krawly krawly = -krawly else: break; # we have failed else: success = True if success: next = look if idebug: proutn(`next`) else: break; # done early if idebug: skip(1) if enemy.move(next): if not damaged(DSRSENS) or game.condition == "docked": proutn(_("*** %s from Sector %s") % (cramen(enemy.type), enemy.kloc)) if enemy.kdist < dist1: proutn(_(" advances to ")) else: proutn(_(" retreats to ")) prout("Sector %s." % next) | 9166a6df132fa18c32881b2019e1fcc41716a3ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/9166a6df132fa18c32881b2019e1fcc41716a3ab/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
70,
31934,
12,
275,
351,
93,
4672,
315,
56,
621,
1706,
26017,
364,
326,
5570,
3058,
1900,
1199,
1024,
273,
2745,
5621,
2324,
273,
2745,
1435,
277,
2681,
273,
1083,
468,
1220,
1410,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
70,
31934,
12,
275,
351,
93,
4672,
315,
56,
621,
1706,
26017,
364,
326,
5570,
3058,
1900,
1199,
1024,
273,
2745,
5621,
2324,
273,
2745,
1435,
277,
2681,
273,
1083,
468,
1220,
1410,... |
py_files.append(os.path.join(target_dir,name+'.py')) | py_files.append(os.path.join(py_target_dir, name+'.py')) | def swig_sources(self, sources, extension): new_sources = [] swig_sources = [] swig_targets = {} target_dirs = [] py_files = [] # swig generated .py files target_ext = '.c' typ = None is_cpp = 0 skip_swig = 0 ext_name = extension.name.split('.')[-1] | 58618b0bb463a22a8938dad2a47ce9dda31f7c13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/58618b0bb463a22a8938dad2a47ce9dda31f7c13/build_src.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1352,
360,
67,
10141,
12,
2890,
16,
5550,
16,
2710,
4672,
394,
67,
10141,
273,
5378,
1352,
360,
67,
10141,
273,
5378,
1352,
360,
67,
11358,
273,
2618,
1018,
67,
8291,
273,
5378,
2395,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1352,
360,
67,
10141,
12,
2890,
16,
5550,
16,
2710,
4672,
394,
67,
10141,
273,
5378,
1352,
360,
67,
10141,
273,
5378,
1352,
360,
67,
11358,
273,
2618,
1018,
67,
8291,
273,
5378,
2395,
... |
self.isDirty = 1 | def setSubLanguageDefaultBackgroundColor(self, language, mozcolor): if not language: return style = 'compound_document_defaults' self._set(language, style, mozcolor2scincolor(mozcolor), 'back') def getSubLanguageDefaultBackgroundColor(self, language, useFixed=1): try: backgroundColor = self._languageStyles[language]\ ['compound_document_defaults']['back'] if backgroundColor is not None: return scincolor2mozcolor(backgroundColor) except KeyError: pass return self.getBack(language, 'default') def setGlobalSubLanguageBackgroundEnabled(self, language, val): if not language: return self._miscLanguageSettings.setdefault(language, {})['globalSubLanguageBackgroundEnabled'] = val def getGlobalSubLanguageBackgroundEnabled(self, language): try: return self._miscLanguageSettings[language]['globalSubLanguageBackgroundEnabled'] except KeyError: return False | def setBack(self, language, style, mozcolor): self._set(language, style, mozcolor2scincolor(mozcolor), 'back') self.isDirty = 1 | a1c32b306c8f7ea4af0df20d18a05ff1066d9748 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9914/a1c32b306c8f7ea4af0df20d18a05ff1066d9748/koScintillaSchemeService.p.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2711,
12,
2890,
16,
2653,
16,
2154,
16,
7344,
94,
3266,
4672,
365,
6315,
542,
12,
4923,
16,
2154,
16,
7344,
94,
3266,
22,
1017,
267,
3266,
12,
8683,
94,
3266,
3631,
296,
823,
61... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2711,
12,
2890,
16,
2653,
16,
2154,
16,
7344,
94,
3266,
4672,
365,
6315,
542,
12,
4923,
16,
2154,
16,
7344,
94,
3266,
22,
1017,
267,
3266,
12,
8683,
94,
3266,
3631,
296,
823,
61... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.