rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
self.label.set_text(self.text[:mid-6] + '…' + self.text[len(self.text)-6:]) | if mid-6 < 0: self.label.set_text(self.text) return self.label.set_text('%s…%s' %(self.text[:mid-6], self.text[len(self.text)-6:])) | def _wrap_label(self, min, max, width): mid = (min + max) / 2 self.label.set_text(self.text[:mid-6] + '…' + self.text[len(self.text)-6:]) if mid == min or self.label.get_preferred_size()[2] == width: return if self.label.get_preferred_size()[2] > width: self._wrap_label(min, mid, width) else: self._wrap_label(mid, max, width) | 3c8db11d56df9ebc1e145d842f23f2d01d89ab90 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5279/3c8db11d56df9ebc1e145d842f23f2d01d89ab90/buttons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4113,
67,
1925,
12,
2890,
16,
1131,
16,
943,
16,
1835,
4672,
7501,
273,
261,
1154,
397,
943,
13,
342,
576,
309,
7501,
17,
26,
411,
374,
30,
365,
18,
1925,
18,
542,
67,
955,
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,
389,
4113,
67,
1925,
12,
2890,
16,
1131,
16,
943,
16,
1835,
4672,
7501,
273,
261,
1154,
397,
943,
13,
342,
576,
309,
7501,
17,
26,
411,
374,
30,
365,
18,
1925,
18,
542,
67,
955,
12... |
if item['author'].find('@') == -1: item['author'] = '' | if item['author'].find('@') != -1: item['author.email'] = item['author'] | def render(self, req): self.perm.assert_permission(perm.TIMELINE_VIEW) | 2d78bb21cd18b160bab6832f2097bd4a8271821c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/2d78bb21cd18b160bab6832f2097bd4a8271821c/Timeline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1111,
4672,
365,
18,
12160,
18,
11231,
67,
9827,
12,
12160,
18,
4684,
5997,
67,
12145,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1111,
4672,
365,
18,
12160,
18,
11231,
67,
9827,
12,
12160,
18,
4684,
5997,
67,
12145,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return apipool.try_api_urls() | return apipool.try_api_urls(urls) | def try_api_urls(urls, apipool=None): """return mwapi instance for the first url which looks like it's working api.php or None""" if apipool is None: apipool=pool() return apipool.try_api_urls() | a08e3d414c5e08bec06cfd07e1f125978a74564e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/a08e3d414c5e08bec06cfd07e1f125978a74564e/mwapi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
775,
67,
2425,
67,
10518,
12,
10518,
16,
513,
625,
1371,
33,
7036,
4672,
3536,
2463,
14721,
2425,
791,
364,
326,
1122,
880,
1492,
10192,
3007,
518,
1807,
5960,
1536,
18,
2684,
578,
599,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
775,
67,
2425,
67,
10518,
12,
10518,
16,
513,
625,
1371,
33,
7036,
4672,
3536,
2463,
14721,
2425,
791,
364,
326,
1122,
880,
1492,
10192,
3007,
518,
1807,
5960,
1536,
18,
2684,
578,
599,
... |
if profilers.present(): profilers.stop(self) profilers.report(self) | def execute(self, testdir = None, iterations = 1, filesize='100M', type='write', pattern='random'): cmd = os.path.join(self.srcdir, 'src/spew') if not testdir: testdir = self.tmpdir tmpfile = os.path.join(testdir, 'spew-test.%d' % os.getpid()) results = os.path.join(self.resultsdir, 'stdout') args = '--%s -i %d -p %s -b 2k -B 2M %s %s' % \ (type, iterations, pattern, filesize, tmpfile) cmd += ' ' + args | c0cd30bbdbbd299c4c385961fca222705f40db21 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/c0cd30bbdbbd299c4c385961fca222705f40db21/spew.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
1842,
1214,
273,
599,
16,
11316,
273,
404,
16,
14104,
2218,
6625,
49,
2187,
618,
2218,
2626,
2187,
1936,
2218,
9188,
11,
4672,
1797,
273,
1140,
18,
803,
18,
5701,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
1842,
1214,
273,
599,
16,
11316,
273,
404,
16,
14104,
2218,
6625,
49,
2187,
618,
2218,
2626,
2187,
1936,
2218,
9188,
11,
4672,
1797,
273,
1140,
18,
803,
18,
5701,
1... | |
print "Elvin connection succeeded." | if verbose: log( "Elvin connection succeeded to %s" % (connect_string) ) | def __init__(self, elvinurl=ELVIN_URL, elvinscope=ELVIN_SCOPE): | dbd18abb3b7486c00964cbd1506a90b2bd96974e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3643/dbd18abb3b7486c00964cbd1506a90b2bd96974e/elvinrrd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
415,
21529,
718,
33,
2247,
58,
706,
67,
1785,
16,
415,
21529,
4887,
33,
2247,
58,
706,
67,
19444,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
415,
21529,
718,
33,
2247,
58,
706,
67,
1785,
16,
415,
21529,
4887,
33,
2247,
58,
706,
67,
19444,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
xml = '''<?xml version="1.0" encoding="utf-8"?>''' | xml = '''<?xml version="1.0" encoding="utf-8"?>''' \ | def _inherit_apply_rec(result, inherit_id): # get all views which inherit from (ie modify) this view cr.execute('select arch,id from ir_ui_view where inherit_id=%d and model=%s order by priority', (inherit_id, self._name)) sql_inherit = cr.fetchall() for (inherit,id) in sql_inherit: result = _inherit_apply(result, inherit) result = _inherit_apply_rec(result,id) return result | a72dac1e6849b3b11b8a0f2353971452785f14bb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12853/a72dac1e6849b3b11b8a0f2353971452785f14bb/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6018,
67,
9010,
67,
3927,
12,
2088,
16,
6811,
67,
350,
4672,
468,
336,
777,
7361,
1492,
6811,
628,
261,
1385,
5612,
13,
333,
1476,
4422,
18,
8837,
2668,
4025,
6637,
16,
350,
628,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6018,
67,
9010,
67,
3927,
12,
2088,
16,
6811,
67,
350,
4672,
468,
336,
777,
7361,
1492,
6811,
628,
261,
1385,
5612,
13,
333,
1476,
4422,
18,
8837,
2668,
4025,
6637,
16,
350,
628,
... |
logger.info("ldap network timeout:" + str(self.l.get_option(ldap.OPT_NETWORK_TIMEOUT))) | logger.debug("ldap network timeout:" + str(self.l.get_option(ldap.OPT_NETWORK_TIMEOUT))) | def deleteGroupDiskQuotas(self, cn, device): logger = logging.getLogger() devicepath = device.split(':')[0] logger.info("Delete quotas for members of:" + cn) logger.info("ldap timeout:" + str(self.l.timeout)) self.l.set_option(ldap.OPT_NETWORK_TIMEOUT, 100) logger.info("ldap network timeout:" + str(self.l.get_option(ldap.OPT_NETWORK_TIMEOUT))) | c1b148277eaa33380684c03817015cbdb8ea5c22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5988/c1b148277eaa33380684c03817015cbdb8ea5c22/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
1114,
6247,
7678,
345,
12,
2890,
16,
6227,
16,
2346,
4672,
1194,
273,
2907,
18,
588,
3328,
1435,
2346,
803,
273,
2346,
18,
4939,
2668,
2497,
25146,
20,
65,
1194,
18,
1376,
2932,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
1114,
6247,
7678,
345,
12,
2890,
16,
6227,
16,
2346,
4672,
1194,
273,
2907,
18,
588,
3328,
1435,
2346,
803,
273,
2346,
18,
4939,
2668,
2497,
25146,
20,
65,
1194,
18,
1376,
2932,
... |
tweight -- weighting for time average options: 'none' 'var' = 1/var(spec) weighted 'tsys' = 1/Tsys**2 weighted 'tint' = integration time weighted 'tintsys' = Tint/Tsys**2 'median' = median averaging default: 'none' | tweight -- weighting for time average options: 'var' = 1/var(spec) weighted 'tsys' = 1/Tsys**2 weighted 'tint' = integration time weighted 'tintsys' = Tint/Tsys**2 'median' = median averaging default: 'tintsys' | def tweight(): """ tweight -- weighting for time average options: 'none' 'var' = 1/var(spec) weighted 'tsys' = 1/Tsys**2 weighted 'tint' = integration time weighted 'tintsys' = Tint/Tsys**2 'median' = median averaging default: 'none' """ | 688277b727789bdee43fec6be00ebb3c397b5959 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/688277b727789bdee43fec6be00ebb3c397b5959/parameter_dictionary.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2339,
1274,
13332,
3536,
2339,
1274,
1493,
3119,
310,
364,
813,
8164,
702,
30,
296,
1401,
11,
1377,
273,
404,
19,
1401,
12,
2793,
13,
13747,
296,
3428,
1900,
11,
377,
273,
404,
19,
56,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2339,
1274,
13332,
3536,
2339,
1274,
1493,
3119,
310,
364,
813,
8164,
702,
30,
296,
1401,
11,
1377,
273,
404,
19,
1401,
12,
2793,
13,
13747,
296,
3428,
1900,
11,
377,
273,
404,
19,
56,... |
select.select(recv_sockets, send_sockets, [], 10) | select.select(recv_sockets, send_sockets, [], 20) | def exit_test(self, router): """ Perform port and IP tests on router. Will block until all port tests are finished. Can raise the following errors: socket.error - errno == errno.ECONNREFUSED: Tor refused our SOCKS connected. """ test_data = {} test_ports = [] recv_sockets = [] listen_sockets = [] self.test_exit = router | 4c865d62c51c3e1a9d19c722ba2e4c12fc91c4eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9986/4c865d62c51c3e1a9d19c722ba2e4c12fc91c4eb/torbel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2427,
67,
3813,
12,
2890,
16,
4633,
4672,
3536,
11217,
1756,
471,
2971,
7434,
603,
4633,
18,
9980,
1203,
3180,
777,
1756,
7434,
854,
6708,
18,
4480,
1002,
326,
3751,
1334,
30,
2987,
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,
2427,
67,
3813,
12,
2890,
16,
4633,
4672,
3536,
11217,
1756,
471,
2971,
7434,
603,
4633,
18,
9980,
1203,
3180,
777,
1756,
7434,
854,
6708,
18,
4480,
1002,
326,
3751,
1334,
30,
2987,
18,
... |
context = context) | context = context, store = store) | def _instance(cls, subject, vals, context = None): """ Create an instance from the `subject` and it's associated `concept` (`vals`) URIs. | 489ba9c91e782e611a803bd537972eeb7d85b203 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13812/489ba9c91e782e611a803bd537972eeb7d85b203/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1336,
12,
6429,
16,
3221,
16,
5773,
16,
819,
273,
599,
4672,
3536,
1788,
392,
791,
628,
326,
1375,
7857,
68,
471,
518,
1807,
3627,
1375,
25770,
68,
21863,
4524,
24065,
24565,
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,
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,
1336,
12,
6429,
16,
3221,
16,
5773,
16,
819,
273,
599,
4672,
3536,
1788,
392,
791,
628,
326,
1375,
7857,
68,
471,
518,
1807,
3627,
1375,
25770,
68,
21863,
4524,
24065,
24565,
18,
... |
if not dnMatch: | if dnMatch == 0: | def __checkProxyness( self ): self.__firstProxyStep = len( self.__certList )-2 # -1 is user cert by default, -2 is first proxy step self.__isProxy = True checkProxyPart = True #If less than 2 steps in the chain is no proxy if len( self.__certList ) < 2: self.__isProxy = False return #Check proxyness in steps for step in range( len( self.__certList ) - 1 ): issuerMatch = self.__checkIssuer( step, step + 1 ) if not issuerMatch: self.__isProxy = False return if checkProxyPart: dnMatch = self.__checkProxyDN( step, step + 1 ) if not dnMatch: if step > 0: self.__firstProxyStep = step-1 checkProxyPart = False else: self.__isProxy = False return | 305602de5e0c340ed06b7c08603efd49c207738d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/305602de5e0c340ed06b7c08603efd49c207738d/X509Chain.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1893,
16155,
878,
403,
12,
365,
262,
30,
365,
16186,
3645,
3886,
4160,
273,
562,
12,
365,
16186,
7593,
682,
262,
17,
22,
468,
300,
21,
353,
729,
3320,
635,
805,
16,
300,
22,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1893,
16155,
878,
403,
12,
365,
262,
30,
365,
16186,
3645,
3886,
4160,
273,
562,
12,
365,
16186,
7593,
682,
262,
17,
22,
468,
300,
21,
353,
729,
3320,
635,
805,
16,
300,
22,
35... |
if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) elif BUILD_ARCHIVE_TYPE in ('mac'): os.system("open %s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) | if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64', 'mac'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, pipes.quote(flags))) | def TryRevision(rev): """Downloads revision |rev|, unzips it, and opens it for the user to test.""" # Do this in a temp dir so we don't collide with user files. cwd = os.getcwd() tempdir = tempfile.mkdtemp(prefix='bisect_tmp') os.chdir(tempdir) # Download the file. download_url = BUILD_BASE_URL + (BUILD_ARCHIVE_URL % rev) + BUILD_ZIP_NAME try: print 'Fetching ' + download_url urllib.urlretrieve(download_url, BUILD_ZIP_NAME) except Exception, e: print("Could not retrieve the download. Sorry.") sys.exit(-1) # Unzip the file. print 'Unzipping ...' os.system("unzip -q %s" % BUILD_ZIP_NAME) # Tell the system to open the app. flags = '--user-data-dir=profile' print 'Running %s/%s/%s %s' % (os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME, flags) if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64'): os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) elif BUILD_ARCHIVE_TYPE in ('mac'): os.system("open %s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) elif BUILD_ARCHIVE_TYPE in ('xp'): # TODO(mmoss) Does Windows need 'start' or something? os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags)) os.chdir(cwd) print 'Cleaning temp dir ...' try: shutil.rmtree(tempdir, True) except Exception, e: pass | d4bf358741a855e6e3642acc7646f2ab3b2aed36 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/d4bf358741a855e6e3642acc7646f2ab3b2aed36/build-bisect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6161,
7939,
12,
9083,
4672,
3536,
22141,
6350,
571,
9083,
96,
16,
20259,
87,
518,
16,
471,
10400,
518,
364,
326,
729,
358,
1842,
12123,
468,
2256,
333,
316,
279,
1906,
1577,
1427,
732,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6161,
7939,
12,
9083,
4672,
3536,
22141,
6350,
571,
9083,
96,
16,
20259,
87,
518,
16,
471,
10400,
518,
364,
326,
729,
358,
1842,
12123,
468,
2256,
333,
316,
279,
1906,
1577,
1427,
732,
... |
return self.__setattr__(attrib, value) | return self.__setattr__(attrib, value) | def setitem(self, attrib, value): return self.__setattr__(attrib, value) | bc3c1f7a22dbca3c418f700cf48883617e53933e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/bc3c1f7a22dbca3c418f700cf48883617e53933e/tiny_xmlrpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
1726,
12,
2890,
16,
5885,
16,
460,
4672,
327,
365,
16186,
542,
1747,
972,
12,
14588,
16,
460,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
1726,
12,
2890,
16,
5885,
16,
460,
4672,
327,
365,
16186,
542,
1747,
972,
12,
14588,
16,
460,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if field.type.c_type in _cardinal_types: | if field.type.member.is_simple: | def _c_iterator_get_end(field, accum): ''' Figures out what C code is needed to find the end of a variable-length structure field. For nested structures, recurses into its last variable-sized field. For lists, calls the end function ''' if field.type.is_container: accum = field.c_accessor_name + '(' + accum + ')' # XXX there could be fixed-length fields at the end return _c_iterator_get_end(field.type.last_varsized_field, accum) if field.type.is_list: # XXX we can always use the first way if field.type.c_type in _cardinal_types: return field.c_end_name + '(' + accum + ')' else: return field.type.member.c_end_name + '(' + field.c_iterator_name + '(' + accum + '))' | 43b612a5e99ccdfb787a11b2b7c3179fc242edf3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1416/43b612a5e99ccdfb787a11b2b7c3179fc242edf3/c_client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
71,
67,
9838,
67,
588,
67,
409,
12,
1518,
16,
22778,
4672,
9163,
478,
360,
1823,
596,
4121,
385,
981,
353,
3577,
358,
1104,
326,
679,
434,
279,
2190,
17,
2469,
3695,
652,
18,
24... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
71,
67,
9838,
67,
588,
67,
409,
12,
1518,
16,
22778,
4672,
9163,
478,
360,
1823,
596,
4121,
385,
981,
353,
3577,
358,
1104,
326,
679,
434,
279,
2190,
17,
2469,
3695,
652,
18,
24... |
for i in range(0, len(result),row_width): result = result[:i] + [zip(*result[i:i+row_width])] + result[i+row_width:] | big_result = [] for i in range(0, row_width * int(len(result)/row_width),row_width): big_result.append([]) for j in range(row_width): big_result[-1].append(result[i+j]) return big_result | def get(self, header, subcase, constraints, column_names, row_width=1): # find the grid we're talking about my matching # the header myindex = None maybeindex = None # for partial matches for index, grid in enumerate(self.grids): if self.headers[index]["actual"].strip() == header or \ self.headers[index]["clean"] == header: if not subcase or \ (subcase and self.subcases[index] == subcase): myindex = index break else: print "subcase mismatch!" print "should be subcase", subcase print "but the header's subcase is", self.subcases[index] if header in self.headers[index]["actual"].strip() or \ header in self.headers[index]["clean"]: if not subcase or \ (subcase and self.subcases[index] == subcase): maybeindex = index | 188f0944c602702655c15ec3ed200693a005fb2a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12610/188f0944c602702655c15ec3ed200693a005fb2a/nastran_parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
1446,
16,
720,
3593,
16,
6237,
16,
1057,
67,
1973,
16,
1027,
67,
2819,
33,
21,
4672,
468,
1104,
326,
3068,
732,
4565,
26591,
310,
2973,
3399,
3607,
468,
326,
1446,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16,
1446,
16,
720,
3593,
16,
6237,
16,
1057,
67,
1973,
16,
1027,
67,
2819,
33,
21,
4672,
468,
1104,
326,
3068,
732,
4565,
26591,
310,
2973,
3399,
3607,
468,
326,
1446,
... |
logging.debug('called set text.') | def set_text(self, font, text): """ """ logging.debug('called set text.') self.remove(self.text) self.text = Text(font, text) self.text.set_size(self.get_width(), self.get_height()) scale_x, scale_y = self.get_scale() print scale_x self.text.set_scale(scale_x, scale_y) self.add(self.text) | 78d35b6eabb456ab59c6c32414df879edc75e4c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/78d35b6eabb456ab59c6c32414df879edc75e4c8/game_board.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
955,
12,
2890,
16,
3512,
16,
977,
4672,
3536,
3536,
365,
18,
4479,
12,
2890,
18,
955,
13,
365,
18,
955,
273,
3867,
12,
5776,
16,
977,
13,
365,
18,
955,
18,
542,
67,
1467,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
955,
12,
2890,
16,
3512,
16,
977,
4672,
3536,
3536,
365,
18,
4479,
12,
2890,
18,
955,
13,
365,
18,
955,
273,
3867,
12,
5776,
16,
977,
13,
365,
18,
955,
18,
542,
67,
1467,
... | |
if fromaddress is None: fromaddress = message['From'] if recipientlist is None: recipientlist = [message['To']] | if fromaddress is not None: messagefrom = fromaddress else: messagefrom = message['From'] if recipientlist is not None: messageto = recipientlist else: messageto = [message['To']] | def sendmails(messages, fromaddress=None, recipientlist=None, app=None): if app is None: app = cherrypy.request.app smtpserver = app.config['weeklyupdates']['smtp.server'] smtpuser = app.config['weeklyupdates'].get('smtp.username', None) smtppass = app.config['weeklyupdates'].get('smtp.password', None) session = smtplib.SMTP(smtpserver) if smtpuser is not None: session.login(smtpuser, smtppass) for message in messages: if fromaddress is None: fromaddress = message['From'] if recipientlist is None: recipientlist = [message['To']] try: session.sendmail(fromaddress, recipientlist, message.as_string()) except AttributeError, e: print e try: print "Exception sending mail from %r to %r" % (fromaddress, recipientlist) except: pass session.quit() | 65f1dbadc45e46d0a1681a0ea5b38f54f251de6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8838/65f1dbadc45e46d0a1681a0ea5b38f54f251de6a/mail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
4408,
87,
12,
6833,
16,
628,
2867,
33,
7036,
16,
8027,
1098,
33,
7036,
16,
595,
33,
7036,
4672,
309,
595,
353,
599,
30,
595,
273,
462,
370,
28398,
18,
2293,
18,
2910,
17660,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
4408,
87,
12,
6833,
16,
628,
2867,
33,
7036,
16,
8027,
1098,
33,
7036,
16,
595,
33,
7036,
4672,
309,
595,
353,
599,
30,
595,
273,
462,
370,
28398,
18,
2293,
18,
2910,
17660,
35... |
The vertices of the (n,k)-star graph are the set of all arangements of | The vertices of the (n,k)-star graph are the set of all arrangements of | def NKStarGraph(self,n,k): r''' Returns the (n,k)-star graph. The vertices of the (n,k)-star graph are the set of all arangements of n symbols into labels of length k. There are two adjacency rules for the (n,k)-star graph. Frist, two vertices are adjacent if one can be obtained from the other by swapping the first symbol with another symbol. Second, two vertices are adjacent if one can be obtained from the other by swapping the first symbol with an external symbol (a symbol not used in the original label). INPUT:: - ``n`` - ``k`` EXAMPLES:: sage: g = graphs.NKStarGraph(4,2) sage: g.plot() # long time REFERENCES: - Wei-Kuo, Chiang, and Chen Rong-Jaye. "The (n, k)-star graph: A generalized star graph." Information Processing Letters 56, no. 5 (December 8, 1995): 259-264. AUTHORS: - Michael Yurko (2009-09-01) | aa71796c41743b21cf5dd66d16cf6af9c8e363ee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/aa71796c41743b21cf5dd66d16cf6af9c8e363ee/graph_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
47,
18379,
4137,
12,
2890,
16,
82,
16,
79,
4672,
436,
26418,
2860,
326,
261,
82,
16,
79,
24950,
10983,
2667,
18,
225,
1021,
6928,
434,
326,
261,
82,
16,
79,
24950,
10983,
2667,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
47,
18379,
4137,
12,
2890,
16,
82,
16,
79,
4672,
436,
26418,
2860,
326,
261,
82,
16,
79,
24950,
10983,
2667,
18,
225,
1021,
6928,
434,
326,
261,
82,
16,
79,
24950,
10983,
2667,
... |
if Numeric.alltrue(Numeric.fabs(test-ref) <= threshold_byte): | ary = Numeric.fabs(test - ref) if Numeric.alltrue(ary <= threshold_byte): | def warp_4(): gdaltest.tiff_drv = gdal.GetDriverByName( 'GTiff' ) if gdaltest.tiff_drv is None: return 'skip' test = gdalnumeric.LoadFile( 'data/utmsmall_cubicspline.vrt' ) ref = gdalnumeric.LoadFile( 'data/utmsmall_cubicspline.tiff' ) if Numeric.alltrue(Numeric.fabs(test-ref) <= threshold_byte): return 'success' else: return 'fail' | 4c0073afea2225038152a60120f0d752dfa313dc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10290/4c0073afea2225038152a60120f0d752dfa313dc/warp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
11441,
67,
24,
13332,
225,
15551,
2390,
395,
18,
88,
3048,
67,
3069,
90,
273,
15551,
287,
18,
967,
4668,
5911,
12,
296,
16506,
3048,
11,
262,
309,
15551,
2390,
395,
18,
88,
3048,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
11441,
67,
24,
13332,
225,
15551,
2390,
395,
18,
88,
3048,
67,
3069,
90,
273,
15551,
287,
18,
967,
4668,
5911,
12,
296,
16506,
3048,
11,
262,
309,
15551,
2390,
395,
18,
88,
3048,
... |
cty.c_int, cty.c_long], | cty.c_int, cty.c_long], | def flps_apply_gamma(p1): """ flps_apply_gamma(p1) """ _flps_apply_gamma(p1) | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
1121,
67,
9010,
67,
20589,
12,
84,
21,
4672,
3536,
1183,
1121,
67,
9010,
67,
20589,
12,
84,
21,
13,
3536,
225,
389,
2242,
1121,
67,
9010,
67,
20589,
12,
84,
21,
13,
282,
2,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
1121,
67,
9010,
67,
20589,
12,
84,
21,
4672,
3536,
1183,
1121,
67,
9010,
67,
20589,
12,
84,
21,
13,
3536,
225,
389,
2242,
1121,
67,
9010,
67,
20589,
12,
84,
21,
13,
282,
2,
-... |
sage: magma.function_call('IsSquare', 100) | sage: magma.function_call('IsSquare', 100) | def function_call(self, function, args=[], params={}, nvals=1): """ Return result of evaluating a Magma function with given input, parameters, and asking for nvals as output. | 04917fdfb19c54d3ca3aa421b8fa4cc30257acef /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/04917fdfb19c54d3ca3aa421b8fa4cc30257acef/magma.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
445,
67,
1991,
12,
2890,
16,
445,
16,
833,
22850,
6487,
859,
28793,
290,
4524,
33,
21,
4672,
3536,
2000,
563,
434,
26704,
279,
490,
9454,
445,
598,
864,
810,
16,
1472,
16,
471,
29288,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
445,
67,
1991,
12,
2890,
16,
445,
16,
833,
22850,
6487,
859,
28793,
290,
4524,
33,
21,
4672,
3536,
2000,
563,
434,
26704,
279,
490,
9454,
445,
598,
864,
810,
16,
1472,
16,
471,
29288,
... |
subdir = os.path.join('target', subdir) | subdir = os.path.join("target", subdir) | def set_pkgproviders(self_db_get_runq_depend_packages, PKGPROVIDER_, RECDEPENDS): recdepends = [] | dbcb30f25831d2467cf8c4dbff48103403d8793a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5897/dbcb30f25831d2467cf8c4dbff48103403d8793a/recipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
10657,
17520,
12,
2890,
67,
1966,
67,
588,
67,
2681,
85,
67,
5817,
67,
10308,
16,
11327,
43,
26413,
67,
16,
2438,
39,
1639,
52,
1157,
3948,
4672,
1950,
27360,
273,
5378,
2,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
10657,
17520,
12,
2890,
67,
1966,
67,
588,
67,
2681,
85,
67,
5817,
67,
10308,
16,
11327,
43,
26413,
67,
16,
2438,
39,
1639,
52,
1157,
3948,
4672,
1950,
27360,
273,
5378,
2,
... |
if optional and ("${argPtr}" in template): warn("Optional parameters of type %s are not supported." % type.name) | def writeArgumentUnboxing(f, i, name, type, haveCcx, optional, rvdeclared): # f - file to write to # i - int or None - Indicates the source jsval. If i is an int, the source # jsval is argv[i]; otherwise it is *vp. But if Python i >= C++ argc, # which can only happen if optional is True, the argument is missing; # use JSVAL_NULL as the source jsval instead. # name - str - name of the native C++ variable to create. # type - xpidl.{Interface,Native,Builtin} - IDL type of argument # optional - bool - True if the parameter is optional. # rvdeclared - bool - False if no |nsresult rv| has been declared earlier. isSetter = (i is None) if isSetter: argPtr = "vp" argVal = "*vp" elif optional: argPtr = '! /* TODO - optional parameter of this type not supported */' argVal = "(%d < argc ? argv[%d] : JSVAL_NULL)" % (i, i) else: argVal = "argv[%d]" % i argPtr = "&" + argVal params = { 'name': name, 'argVal': argVal, 'argPtr': argPtr } typeName = getBuiltinOrNativeTypeName(type) if typeName is not None: template = argumentUnboxingTemplates.get(typeName) if template is not None: if optional and ("${argPtr}" in template): warn("Optional parameters of type %s are not supported." % type.name) f.write(substitute(template, params)) return rvdeclared # else fall through; the type isn't supported yet. elif isInterfaceType(type): if type.name == 'nsIVariant': # Totally custom. assert haveCcx template = ( " nsCOMPtr<nsIVariant> ${name}(already_AddRefed<nsIVariant>(" "XPCVariant::newVariant(ccx, ${argVal})));\n" " if (!${name})\n" " return JS_FALSE;\n") f.write(substitute(template, params)) return rvdeclared elif type.name == 'nsIAtom': # Should have special atomizing behavior. Fall through. pass else: if not rvdeclared: f.write(" nsresult rv;\n"); f.write(" %s *%s;\n" % (type.name, name)) f.write(" xpc_qsSelfRef %sref;\n" % name) f.write(" rv = xpc_qsUnwrapArg<%s>(" "cx, %s, &%s, &%sref.ptr, %s);\n" % (type.name, argVal, name, name, argPtr)) f.write(" if (NS_FAILED(rv)) {\n") if isSetter: f.write(" xpc_qsThrowBadSetterValue(" "cx, rv, JSVAL_TO_OBJECT(*tvr.addr()), id);\n") elif haveCcx: f.write(" xpc_qsThrowBadArgWithCcx(ccx, rv, %d);\n" % i) else: f.write(" xpc_qsThrowBadArg(cx, rv, vp, %d);\n" % i) f.write(" return JS_FALSE;\n" " }\n") return True warn("Unable to unbox argument of type %s" % type.name) if i is None: src = '*vp' else: src = 'argv[%d]' % i f.write(" !; // TODO - Unbox argument %s = %s\n" % (name, src)) return rvdeclared | 547c9137fe7f5061409005e05ec145bbf18f5ab6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/547c9137fe7f5061409005e05ec145bbf18f5ab6/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
1379,
984,
2147,
310,
12,
74,
16,
277,
16,
508,
16,
618,
16,
1240,
39,
71,
92,
16,
3129,
16,
5633,
16571,
4672,
468,
284,
300,
585,
358,
1045,
358,
468,
277,
300,
509,
578,
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,
1045,
1379,
984,
2147,
310,
12,
74,
16,
277,
16,
508,
16,
618,
16,
1240,
39,
71,
92,
16,
3129,
16,
5633,
16571,
4672,
468,
284,
300,
585,
358,
1045,
358,
468,
277,
300,
509,
578,
5... | |
print "limite", window.axis.xaxis.xlim | window.axis.autoscale_view () limite_sup += 2 limite_inf -= 2 print limite_sup, limite_inf print window.axis.set_ylim (limite_inf, limite_sup) | def plot (self, values): window = gtk.Window () window.set_title (_("PyAcqua - Grafico")) window.set_size_request (800, 600) window.figure = Figure ()#figsize=(6,4), dpi=72) window.axis = window.figure.add_subplot (111) window.canvas = FigureCanvasGTK(window.figure) sw = gtk.ScrolledWindow () sw.set_policy (gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) sw.set_shadow_type (gtk.SHADOW_ETCHED_IN) sw.add_with_viewport (window.canvas) window.axis.clear () window.axis.grid(True) # [0, [[u'23/04/2006', u'Vasca Sala', 0.40000000000000002], [u'17/06/2006', u'Vasca Sala', 3.3999999999999999], [u'26/06/2006', u'Vasca Sala', 0.0]], 0, [[u'26/06/2006', u'Mia', 1.5000000000000002]], 1, [[u'23/04/2006', u'Vasca Sala', 1.6000000000000001], [u'17/06/2006', u'Vasca Sala', 1.6000000000000001], [u'26/06/2006', u'Vasca Sala', 1.6000000000000001]], 1, [[u'26/06/2006', u'Mia', 2.1000000000000005]]] labels = (_('pH'), _('KH'), _('GH'), _('NO2'), _('NO3'), _('Conducibilita'), _('Ammoniaca'), _('Ferro'), _('Rame'), _('Fosfati'), _('Calcio'), _('Magnesio'), _('Densita')) colors = ('r', 'g', 'y', 'b', 'c', 'm', 'k', 'w') color = 0 label = values[0] dates = [] valori = [] for i in values: if type (i) == int: label = labels [i] else: for x in i: dt = x[0].split ('/') dates.append (datetime.date (int (dt[2]), int (dt[1]), int (dt[0]))) valori.append (x[2]) if color == 8: color = 0 # Sort su dates self.parallel_sort (dates, valori) window.axis.plot_date (date2num (dates), valori, colors[color] + 'o--', label="%s %s" % (x[1], label)) valori = []; dates = [] color += 1 # In caso si usi l'inglese meglio %m-%d window.axis.xaxis.set_major_formatter (DateFormatter(_('%d/%m'))) print "limite", window.axis.xaxis.xlim window.axis.legend () window.canvas.draw () bb = gtk.HButtonBox () bb.set_layout (gtk.BUTTONBOX_END) btn = gtk.Button (stock=gtk.STOCK_SAVE) btn.connect ('clicked', self.on_save, window) btn.set_relief (gtk.RELIEF_NONE) bb.pack_start (btn) btn = gtk.Button (stock=gtk.STOCK_CLOSE) btn.connect ('clicked', self.exit, window) btn.set_relief (gtk.RELIEF_NONE) bb.pack_start (btn) vbox = gtk.VBox (False, 2) vbox.pack_start (sw, True, True, 0) vbox.pack_start (bb, False, False, 0) window.add (vbox) window.connect ('delete_event', self.exit, window) window.show_all() | 18bf3a611d71f0983a8d59b9411e8993843c349a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2406/18bf3a611d71f0983a8d59b9411e8993843c349a/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
261,
2890,
16,
924,
4672,
225,
2742,
273,
22718,
18,
3829,
1832,
2742,
18,
542,
67,
2649,
261,
67,
2932,
9413,
9988,
372,
69,
300,
10812,
74,
10764,
6,
3719,
2742,
18,
542,
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,
3207,
261,
2890,
16,
924,
4672,
225,
2742,
273,
22718,
18,
3829,
1832,
2742,
18,
542,
67,
2649,
261,
67,
2932,
9413,
9988,
372,
69,
300,
10812,
74,
10764,
6,
3719,
2742,
18,
542,
67,
... |
print "Deleting %i vesselmaps linked to this donation: %s"%(vmaps.count(), vmaps) | print time.ctime(), "Deleting %i vesselmaps linked to this donation: %s"%(vmaps.count(), vmaps) | def handle_inactive_donation(donation): if donation.active == 0: print "Donation [%s] already inactive"%(donation) return try: if donation.epoch == 0: print "Donation [%s] epoch count is 0, making inactive"%(donation) vmaps = VesselMap.objects.filter(vessel_port__vessel__donation__exact = donation) print "Deleting %i vesselmaps linked to this donation: %s"%(vmaps.count(), vmaps) for vmap in vmaps: vmap.delete() # TODO: need to update people's flow records here!!! donation.active = 0 else: donation.epoch -= 1 print "Donation [%s] inactive, epoch count is now %i"%(donation , donation.epoch) donation.save() except: traceback.print_exc() transaction.rollback() raise else: # success transaction.commit() return True | 1db1a15bc2d7456e1aafa032c74fc2cbbdf3ff67 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/1db1a15bc2d7456e1aafa032c74fc2cbbdf3ff67/genidb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
27366,
67,
19752,
367,
12,
19752,
367,
4672,
309,
2727,
367,
18,
3535,
422,
374,
30,
1172,
315,
22293,
367,
9799,
87,
65,
1818,
16838,
6,
17105,
19752,
367,
13,
327,
225,
775... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
27366,
67,
19752,
367,
12,
19752,
367,
4672,
309,
2727,
367,
18,
3535,
422,
374,
30,
1172,
315,
22293,
367,
9799,
87,
65,
1818,
16838,
6,
17105,
19752,
367,
13,
327,
225,
775... |
ans = [x.decode(preferred_encoding, 'replace') if isinstance(x, 'str') else x for x in ans] | ans = [x.decode(preferred_encoding, 'replace') if isinstance(x, str) else x for x in ans] | def gui_text(self): ans = [u'Job: '] if self.description: if not isinstance(self.description, unicode): self.description = self.description.decode('utf-8', 'replace') ans[0] += u'**%s**'%self.description if self.exception is not None: header = unicode(self.exception.__class__.__name__) if \ hasattr(self.exception, '__class__') else u'Error' header = u'**%s**'%header header += u': ' try: header += unicode(self.exception) except: header += unicode(repr(self.exception)) ans.append(header) if self.traceback: ans.append(u'**Traceback**:') ans.extend(self.traceback.split('\n')) if self.log: ans.append(u'**Log**:') if isinstance(self.log, str): self.log = unicode(self.log, 'utf-8', 'replace') ans.extend(self.log.split('\n')) ans = [x.decode(preferred_encoding, 'replace') if isinstance(x, 'str') else x for x in ans] return u'<br>'.join(ans) | 1621e0141d368809b405b126fbda73287bfe9eae /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/1621e0141d368809b405b126fbda73287bfe9eae/parallel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13238,
67,
955,
12,
2890,
4672,
4152,
273,
306,
89,
11,
2278,
30,
12671,
309,
365,
18,
3384,
30,
309,
486,
1549,
12,
2890,
18,
3384,
16,
5252,
4672,
365,
18,
3384,
273,
365,
18,
3384... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13238,
67,
955,
12,
2890,
4672,
4152,
273,
306,
89,
11,
2278,
30,
12671,
309,
365,
18,
3384,
30,
309,
486,
1549,
12,
2890,
18,
3384,
16,
5252,
4672,
365,
18,
3384,
273,
365,
18,
3384... |
sites = [site for site in incomplete_sites[cloud] if site in allowed_sites[backend]] | if backend == "Panda": sites = [site for site in incomplete_sites[cloud] if Client.convertDQ2toPandaID(site) in allowed_sites["Panda"]] else: sites = [site for site in incomplete_sites[cloud] if site in allowed_sites[backend]] | def findIncompleteCloudBackend(self,db_sites,allowed_sites,replicas): # If no cloud/backend combination is found for complete replicas, # find cloud/backend with maximal number of replicas # returns list of tuples sorted by number of sites with replicas: (cloud, backend) clouds = config["cloudPreference"] + TiersOfATLAS.ToACache.dbcloud.keys() incomplete_sites = {} for c in clouds: incomplete_sites[c] = [] for s in replicas[0]: try: cloud = whichCloudExt(s) except: continue if db_sites and not stripSite(s) in db_sites: continue incomplete_sites[cloud].append(s) using_backend = None using_cloud = None max_sites = 0 result = [] backends = [be for be in config["backendPreference"] if be in GPI.__dict__] for cloud in clouds: for backend in backends: sites = [site for site in incomplete_sites[cloud] if site in allowed_sites[backend]] if len(sites) > 0: result.append((len(sites),cloud,backend)) result.sort() return [(r[1],r[2]) for r in result] | 3865b22693b9fc4fc569b65e316611e7091ab973 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/3865b22693b9fc4fc569b65e316611e7091ab973/AnaTransform.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
27531,
6230,
7172,
12,
2890,
16,
1966,
67,
12180,
16,
8151,
67,
12180,
16,
266,
10528,
4672,
468,
971,
1158,
5051,
19,
9993,
10702,
353,
1392,
364,
3912,
21545,
16,
468,
1104,
5051... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
27531,
6230,
7172,
12,
2890,
16,
1966,
67,
12180,
16,
8151,
67,
12180,
16,
266,
10528,
4672,
468,
971,
1158,
5051,
19,
9993,
10702,
353,
1392,
364,
3912,
21545,
16,
468,
1104,
5051... |
return standard_normal(args) | if len(args) == 1: return standard_normal() else: return standard_normal(args) | def randn(*args): """u = randn(d0,d1,...,dn) returns zero-mean, unit-variance Gaussian random numbers in an array of size (d0,d1,...,dn). """ return standard_normal(args) | 9bb983356b5dc2f19a389befc72da89fafe4fef8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/9bb983356b5dc2f19a389befc72da89fafe4fef8/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5605,
82,
30857,
1968,
4672,
3536,
89,
273,
5605,
82,
12,
72,
20,
16,
72,
21,
16,
2777,
16,
5176,
13,
1135,
3634,
17,
7079,
16,
2836,
17,
11721,
23079,
2744,
5600,
316,
392,
526,
434... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5605,
82,
30857,
1968,
4672,
3536,
89,
273,
5605,
82,
12,
72,
20,
16,
72,
21,
16,
2777,
16,
5176,
13,
1135,
3634,
17,
7079,
16,
2836,
17,
11721,
23079,
2744,
5600,
316,
392,
526,
434... |
if req.find("/suggest?") != 0 and req.find("/cluster?") !=0: self.res.good_result_times.append(exec_time) | if req.find("/suggest?") == 0: self.res.good_suggest_result_times.append(exec_time) if req.find("/cluster?") == 0: self.res.good_cluster_result_times.append(exec_time) else: self.res.good_search_result_times.append(exec_time) | def FetchContent(self, host, port, q, parameters): start_time = time.ctime(time.time()) test_requests = [] #For each queries we get from the queue, making one suggest query and one clustering req: if q.find("/search?") == 0 and q.find("coutput=json") != 0: test_requests.append(q) else: test_requests.append("/search?q=%s&output=xml_no_dtd&client=default_frontend&roxystylesheet=default_frontend&site=default_collection" % (q)) if enable_cluster == True: token = parameters.get('q') frontend = parameters.get('client', "default_frontend") collection = parameters.get('site', "default_collection") test_requests.append("/cluster?coutput=json&q=%s&site=%s&client=%s" %(token, collection, frontend)) if enable_suggest == True: token = parameters.get('q') frontend = parameters.get('client', "default_frontend") collection = parameters.get('site', "default_collection") test_requests.append("/suggest?q=%s&max_matches=10&use_similar&access=p&format=rich" %(token[0:2])) for req in test_requests: try: timer_start = time.time() conn = httplib.HTTPConnection(host, port) if req.find("/suggest?") == 0 or req.find("/cluster?") == 0: conn.request("POST", req) else: conn.request("GET", req) res = conn.getresponse() content = res.read() conn.close() if res.status != 200: content_lines = content.splitlines() exc_value = str(res.status) exc_value += " " exc_value += content_lines[-1] raise httplib.HTTPException(exc_value) timer_end = time.time() exec_time = timer_end - timer_start logging.info(("%s: %s: success: %.1f secs query: " "%s") % (start_time, self.getName(), exec_time, req)) if req.find("/suggest?") != 0 and req.find("/cluster?") !=0: self.res.good_result_times.append(exec_time) except httplib.HTTPException, value: logging.info(("%s: %s: error: %s query: " "%s") % (start_time, self.getName(), value, req)) self.res.error_result_count += 1 except socket.error, msg: logging.info("%s: %s: %s query: %s" % (start_time, self.getName(), msg, req)) self.res.error_result_count += 1 except: the_type, value, tb = sys.exc_info() logging.info("%s: %s: exception: %s %s query: %s" % (start_time, self.getName(), the_type, value, req)) self.res.error_result_count += 1 | 786420d3e794bd6ec1356ae7b9b796ca05e967d6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6393/786420d3e794bd6ec1356ae7b9b796ca05e967d6/load.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8065,
1350,
12,
2890,
16,
1479,
16,
1756,
16,
1043,
16,
1472,
4672,
787,
67,
957,
273,
813,
18,
21261,
12,
957,
18,
957,
10756,
1842,
67,
11420,
273,
5378,
468,
1290,
1517,
6218,
732,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8065,
1350,
12,
2890,
16,
1479,
16,
1756,
16,
1043,
16,
1472,
4672,
787,
67,
957,
273,
813,
18,
21261,
12,
957,
18,
957,
10756,
1842,
67,
11420,
273,
5378,
468,
1290,
1517,
6218,
732,
... |
if opener == "else" or "elif": | if opener in ("else", "elif"): | def interesting_lines(self, firstline): """Generator which yields context lines, starting at firstline.""" # The indentation level we are currently in: lastindent = INFINITY # For a line to be interesting, it must begin with a block opening # keyword, and have less indentation than lastindent. for line_index in xrange(firstline, -1, -1): indent, text, opener = self.get_line_info(line_index) if indent < lastindent: lastindent = indent if opener == "else" or "elif": # We also show the if statement lastindent += 1 if opener and line_index < firstline: yield line_index, text | 951b9c764cf430cc30991851488e98c6b032b390 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/951b9c764cf430cc30991851488e98c6b032b390/CodeContext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26122,
67,
3548,
12,
2890,
16,
1122,
1369,
4672,
3536,
3908,
1492,
16932,
819,
2362,
16,
5023,
622,
1122,
1369,
12123,
468,
1021,
12018,
1801,
732,
854,
4551,
316,
30,
1142,
9355,
273,
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,
26122,
67,
3548,
12,
2890,
16,
1122,
1369,
4672,
3536,
3908,
1492,
16932,
819,
2362,
16,
5023,
622,
1122,
1369,
12123,
468,
1021,
12018,
1801,
732,
854,
4551,
316,
30,
1142,
9355,
273,
2... |
print "an_int", self.__dict__['an_int'] print "ALL VALUES:", self.__dict__ | def __init__(self, **kwargs): object.__init__(self) # We need to iterate over all descriptor instances and # (a) set their key attribute to their name, # (b) init the descriptor # To support inheritance, we need to take all base classes # into account as well. To give meaningful error messages, we # reverse the order and define the base class descriptors # first. klasslist = list(self.__class__.__mro__[:-1]) klasslist.reverse() | 4ff8ddb5194b9cda2f4dfbdda82626ae6bfb58e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2510/4ff8ddb5194b9cda2f4dfbdda82626ae6bfb58e6/typecheck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2826,
4333,
4672,
733,
16186,
2738,
972,
12,
2890,
13,
225,
468,
1660,
1608,
358,
7401,
1879,
777,
4950,
3884,
471,
468,
261,
69,
13,
444,
3675,
498,
156... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2826,
4333,
4672,
733,
16186,
2738,
972,
12,
2890,
13,
225,
468,
1660,
1608,
358,
7401,
1879,
777,
4950,
3884,
471,
468,
261,
69,
13,
444,
3675,
498,
156... | |
>>> from schoolbell.app.browser.app import PersonPhotoView | def test_personPhotoView(): r"""Test for PersonPhotoView Let's create a new person: >>> from schoolbell.app.app import Person >>> person = Person() >>> person.__name__ = "Jonas" >>> person.title = "Jonas Petraitis" >>> person.photo = "I am a photo!" Let's create a person photo view >>> request = TestRequest() >>> from schoolbell.app.browser.app import PersonPhotoView >>> view = PersonPhotoView(person, request) We should see the photo >>> view.__call__() 'I am a photo!' The photo should be jpeg >>> request.response.getHeader("Content-Type") 'image/jpeg' But if a person has no photo >>> person.photo = None We should get an exception >>> view.__call__() # doctest: +ELLIPSIS Traceback (most recent call last): ... NotFound: Object: <...Person object at ...>, name: u'photo' >>> setup.placelessTearDown() """ | 5d1e5d9e4f62357cff332e9f67f2986d9f474f5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/5d1e5d9e4f62357cff332e9f67f2986d9f474f5f/test_app.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
12479,
19934,
1767,
13332,
436,
8395,
4709,
364,
11573,
19934,
1767,
225,
10559,
1807,
752,
279,
394,
6175,
30,
225,
4080,
628,
18551,
1371,
70,
1165,
18,
2910,
18,
2910,
1930,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12479,
19934,
1767,
13332,
436,
8395,
4709,
364,
11573,
19934,
1767,
225,
10559,
1807,
752,
279,
394,
6175,
30,
225,
4080,
628,
18551,
1371,
70,
1165,
18,
2910,
18,
2910,
1930,
... | |
p1 = Popen(tar_cmd, stdout=PIPE) p2 = Popen(['gzip'], stdin=p1.stdout, stdout=outfile) p2.communicate() outfile.close if os.path.getsize(tar_file) <= 0: print 'Could not tar image' | tarproc = subprocess.Popen(tar_cmd, stdout=subprocess.PIPE) zipproc = subprocess.Popen(['gzip'], stdin=subprocess.PIPE, stdout=targzfile) sha_image = sha() buf=os.read(tarproc.stdout.fileno(), 8196) while buf: zipproc.stdin.write(buf) sha_image.update(buf) buf=os.read(tarproc.stdout.fileno(), 8196) zipproc.stdin.close(); targzfile.close() if os.path.getsize(targz) <= 0: print 'Could not tar/compress image' | def tarzip_image( self, prefix, file, path, ): Util().check_prerequisite_command('tar') | ae7d9b2ec3a9eb66d32cee0ec2b18d182167148c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12707/ae7d9b2ec3a9eb66d32cee0ec2b18d182167148c/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8232,
4450,
67,
2730,
12,
365,
16,
1633,
16,
585,
16,
589,
16,
262,
30,
3564,
7675,
1893,
67,
683,
822,
16608,
1137,
67,
3076,
2668,
11718,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8232,
4450,
67,
2730,
12,
365,
16,
1633,
16,
585,
16,
589,
16,
262,
30,
3564,
7675,
1893,
67,
683,
822,
16608,
1137,
67,
3076,
2668,
11718,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,... |
return False | return False | def prompt_open(self, bettor): if not bettor.active: return False elif bettor == self.last_bettor: self.state = Rotator.BettingFinished return False elif bettor.stack == 0: return False | c3a7dd039f85f59330adfc1527fe216448cfcc10 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14397/c3a7dd039f85f59330adfc1527fe216448cfcc10/rotator2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6866,
67,
3190,
12,
2890,
16,
2701,
13039,
4672,
309,
486,
2701,
13039,
18,
3535,
30,
327,
1083,
1327,
2701,
13039,
422,
365,
18,
2722,
67,
70,
278,
13039,
30,
365,
18,
2019,
273,
1569... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6866,
67,
3190,
12,
2890,
16,
2701,
13039,
4672,
309,
486,
2701,
13039,
18,
3535,
30,
327,
1083,
1327,
2701,
13039,
422,
365,
18,
2722,
67,
70,
278,
13039,
30,
365,
18,
2019,
273,
1569... |
view_box = elem.get('viewBox', elem.get('viewbox', None)) if size.width() == 100 and size.height() == 100 \ and view_box is not None: box = [float(x) for x in view_box.split()] size.setWidth(box[2] - box[0]) size.setHeight(box[3] - box[1]) | if size.width() == 100 and size.height() == 100 and sizes: size.setWidth(sizes[0]) size.setHeight(sizes[1]) | def rasterize_svg(self, elem, width=0, height=0, format='PNG'): data = QByteArray(xml2str(elem, with_tail=False)) svg = QSvgRenderer(data) size = svg.defaultSize() view_box = elem.get('viewBox', elem.get('viewbox', None)) if size.width() == 100 and size.height() == 100 \ and view_box is not None: box = [float(x) for x in view_box.split()] size.setWidth(box[2] - box[0]) size.setHeight(box[3] - box[1]) if width or height: size.scale(width, height, Qt.KeepAspectRatio) logger = self.oeb.logger logger.info('Rasterizing %r to %dx%d' % (elem, size.width(), size.height())) image = QImage(size, QImage.Format_ARGB32_Premultiplied) image.fill(QColor("white").rgb()) painter = QPainter(image) svg.render(painter) painter.end() array = QByteArray() buffer = QBuffer(array) buffer.open(QIODevice.WriteOnly) image.save(buffer, format) return str(array) | 31e8fa91b3e7767d2f17d2b8bd87e6dce3b0756c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/31e8fa91b3e7767d2f17d2b8bd87e6dce3b0756c/rasterize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12553,
554,
67,
11451,
12,
2890,
16,
3659,
16,
1835,
33,
20,
16,
2072,
33,
20,
16,
740,
2218,
23092,
11,
4672,
501,
273,
2238,
8826,
12,
2902,
22,
701,
12,
10037,
16,
598,
67,
13101,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12553,
554,
67,
11451,
12,
2890,
16,
3659,
16,
1835,
33,
20,
16,
2072,
33,
20,
16,
740,
2218,
23092,
11,
4672,
501,
273,
2238,
8826,
12,
2902,
22,
701,
12,
10037,
16,
598,
67,
13101,... |
owner0 = ClusterUser(id=1, name='owner0') owner1 = ClusterUser(id=2, name='owner1') | owner0 = ClusterUser(id=74, name='owner0') owner1 = ClusterUser(id=21, name='owner1') | def test_update_owner_tag(self): """ Test changing owner """ vm, cluster = self.create_virtual_machine() owner0 = ClusterUser(id=1, name='owner0') owner1 = ClusterUser(id=2, name='owner1') owner0.save() owner1.save() # no owner vm.refresh() self.assertEqual([], vm.info['tags']) # setting owner vm.owner = owner0 vm.save() self.assertEqual(['%s%s' % (constants.OWNER_TAG, owner0.id)], vm.info['tags']) # changing owner vm.owner = owner1 vm.save() self.assertEqual(['%s%s' % (constants.OWNER_TAG, owner1.id)], vm.info['tags']) # setting owner to none vm.owner = None vm.save() self.assertEqual([], vm.info['tags']) | c24ff4471dfca799ba7ddabc41abb048929bc8fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10509/c24ff4471dfca799ba7ddabc41abb048929bc8fd/virtual_machine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2725,
67,
8443,
67,
2692,
12,
2890,
4672,
3536,
7766,
12770,
3410,
3536,
4268,
16,
2855,
273,
365,
18,
2640,
67,
12384,
67,
9149,
1435,
225,
3410,
20,
273,
5584,
1299,
12,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2725,
67,
8443,
67,
2692,
12,
2890,
4672,
3536,
7766,
12770,
3410,
3536,
4268,
16,
2855,
273,
365,
18,
2640,
67,
12384,
67,
9149,
1435,
225,
3410,
20,
273,
5584,
1299,
12,
35... |
self.set_trig_start( int(trig.gpsTime[ifo]) - 1) self.set_trig_end( int(trig.gpsTime[ifo]) + 1 ) | hLengthAnalyzed = 1 self.set_trig_start( int(trig.gpsTime[ifo]) - int(hLengthAnalyzed) ) self.set_trig_end( int(trig.gpsTime[ifo]) + int(hLengthAnalyzed) ) | def __init__(self, inspJob, procParams, ifo, trig, cp,opts,dag, datafindCache, d_node, datafindCommand, type='plot',sngl_table = None): | 0e8f6b7cd053a463158947b05c188cee7a4dd02d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5758/0e8f6b7cd053a463158947b05c188cee7a4dd02d/fu_Condor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
316,
1752,
2278,
16,
5418,
1370,
16,
21479,
16,
23142,
16,
3283,
16,
4952,
16,
30204,
16,
501,
4720,
1649,
16,
302,
67,
2159,
16,
501,
4720,
2189,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
316,
1752,
2278,
16,
5418,
1370,
16,
21479,
16,
23142,
16,
3283,
16,
4952,
16,
30204,
16,
501,
4720,
1649,
16,
302,
67,
2159,
16,
501,
4720,
2189,
16,
... |
if h1: h1 = h1[0] parent = h1.parentNode i = parent.childNodes.index(h1) parent.childNodes[i+1:i+1] = [toc] | empty = microdom.Element('span') for node in h1: node.parentNode.replaceChild(empty, node) | def putInToC(document, toc): h1 = domhelpers.findNodesNamed(document, 'h1') if h1: h1 = h1[0] parent = h1.parentNode i = parent.childNodes.index(h1) parent.childNodes[i+1:i+1] = [toc] | d611d100a5009c14bf7f3fce9295797785519ceb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d611d100a5009c14bf7f3fce9295797785519ceb/tree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
382,
774,
39,
12,
5457,
16,
17919,
4672,
366,
21,
273,
4092,
11397,
18,
4720,
3205,
7604,
12,
5457,
16,
296,
76,
21,
6134,
1008,
273,
6481,
9859,
18,
1046,
2668,
3969,
6134,
364,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
382,
774,
39,
12,
5457,
16,
17919,
4672,
366,
21,
273,
4092,
11397,
18,
4720,
3205,
7604,
12,
5457,
16,
296,
76,
21,
6134,
1008,
273,
6481,
9859,
18,
1046,
2668,
3969,
6134,
364,... |
self.debuglog("while expecting '%s', got unexpected response '%s'" % (text, line)) | self.debuglog("while expecting '%s', got unexpected response '%s'" % (text, line)) | def expect(self, text): line = self.readline() if line != text: self.debuglog("while expecting '%s', got unexpected response '%s'" % (text, line)) return line | aa973f034fdfe4801db987afda8191177edefc04 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11935/aa973f034fdfe4801db987afda8191177edefc04/memcache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4489,
12,
2890,
16,
977,
4672,
980,
273,
365,
18,
896,
1369,
1435,
309,
980,
480,
977,
30,
365,
18,
4148,
1330,
2932,
17523,
17012,
1995,
87,
2187,
2363,
9733,
766,
1995,
87,
4970,
738... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4489,
12,
2890,
16,
977,
4672,
980,
273,
365,
18,
896,
1369,
1435,
309,
980,
480,
977,
30,
365,
18,
4148,
1330,
2932,
17523,
17012,
1995,
87,
2187,
2363,
9733,
766,
1995,
87,
4970,
738... |
self.window.connect_after("key-press-event", self.OnKeyPress) | self.window.connect("key-press-event", self.OnKeyPress) | def __init__(self, openproject=None, loadExtensions=True, startuptype=None): """ Creates a new instance of MainApp. Parameters: openproject -- filename of the project to open at startup. loadExtensions -- whether the extensions should be loaded. startuptype -- determines the startup state of Jokosher: 0 = Open the project referred by the openproject parameter. 1 = Do not display the welcome dialog or open a the previous project. 2 = Display the welcome dialog. """ # create tooltip messages for buttons self.recTipEnabled = _("Stop recording") self.recTipDisabled = _("Arm an instrument, then click here to begin recording") self.recStopTipEnabled = _("Stop recording") self.recStopTipDisabled = _("Stop playback") self.recordingViewEnabledTip = _("Currently working in the Recording workspace") self.recordingViewDisabledTip = _("Switch to the Recording workspace") self.mixingViewEnabledTip = _("Currently working in the Mixing workspace") self.mixingViewDisabledTip = _("Switch to the Mixing workspace") gtk.glade.bindtextdomain(Globals.LOCALE_APP, Globals.LOCALE_PATH) gtk.glade.textdomain(Globals.LOCALE_APP) | bdaaef04ce43a2ce5f14c46c0404834d145716bc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10033/bdaaef04ce43a2ce5f14c46c0404834d145716bc/JokosherApp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1696,
4406,
33,
7036,
16,
1262,
7513,
33,
5510,
16,
787,
3648,
388,
33,
7036,
4672,
3536,
10210,
279,
394,
791,
434,
12740,
3371,
18,
225,
7012,
30,
1696... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1696,
4406,
33,
7036,
16,
1262,
7513,
33,
5510,
16,
787,
3648,
388,
33,
7036,
4672,
3536,
10210,
279,
394,
791,
434,
12740,
3371,
18,
225,
7012,
30,
1696... |
actionDict = {'vti' : ('modules.Readers.vtiRDR', 'filename'), 'vtp' : ('modules.Readers.vtpRDR', 'filename'), 'mha' : ('modules.Readers.metaImageRDR', 'filename'), 'mhd' : ('modules.Readers.metaImageRDR', 'filename'), 'stl' : ('modules.Readers.stlRDR', 'filename')} | actionDict = {'vti' : ('modules.readers.vtiRDR', 'filename'), 'vtp' : ('modules.readers.vtpRDR', 'filename'), 'mha' : ('modules.readers.metaImageRDR', 'filename'), 'mhd' : ('modules.readers.metaImageRDR', 'filename'), 'stl' : ('modules.readers.stlRDR', 'filename')} | def createModuleOneVar(moduleName, configVarName, configVarValue, newModuleName=None): """This method creates a moduleName (e.g. modules.Readers.vtiRDR) at position x,y. It then sets the 'configVarName' attribute to value configVarValue. """ (mod, glyph) = self.createModuleAndGlyph(x, y, moduleName) if mod: cfg = mod.getConfig() setattr(cfg, configVarName, filename) mod.setConfig(cfg) | 55004d482ec7e6d527f6c8ca818d94b5b9018251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4494/55004d482ec7e6d527f6c8ca818d94b5b9018251/graphEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
3120,
3335,
1537,
12,
2978,
461,
16,
642,
18129,
16,
642,
1537,
620,
16,
394,
22542,
33,
7036,
4672,
3536,
2503,
707,
3414,
279,
9780,
261,
73,
18,
75,
18,
4381,
18,
30301,
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,
752,
3120,
3335,
1537,
12,
2978,
461,
16,
642,
18129,
16,
642,
1537,
620,
16,
394,
22542,
33,
7036,
4672,
3536,
2503,
707,
3414,
279,
9780,
261,
73,
18,
75,
18,
4381,
18,
30301,
18,
... |
testsFolder = None | if name=='__main__': scriptDir=os.path.dirname(sys.argv[0]) if not scriptDir: scriptDir=os.getcwd() testsFolder = os.path.abspath(scriptDir) else: testsFolder = None | def setOutDir(name): """Is it a writable file system distro being invoked within test directory? If so, can write test output here. If not, it had better go in a temp directory. Only do this once per process""" global _OUTDIR, RL_HOME, testsFolder if _OUTDIR: return _OUTDIR D = [d[9:] for d in sys.argv if d.startswith('--outdir=')] if D: _OUTDIR = D[-1] try: os.makedirs(_OUTDIR) except: pass map(sys.argv.remove,D) else: assert name=='__main__',"setOutDir should only be called in the main script" scriptDir=os.path.dirname(sys.argv[0]) if not scriptDir: scriptDir=os.getcwd() _OUTDIR = scriptDir if not isWritable(_OUTDIR): _OUTDIR = get_rl_tempdir('reportlab_test') import reportlab RL_HOME=reportlab.__path__[0] if not os.path.isabs(RL_HOME): RL_HOME=os.path.normpath(os.path.abspath(RL_HOME)) topDir = os.path.dirname(RL_HOME) testsFolder = os.path.join(topDir,'tests') if not os.path.isdir(testsFolder): testsFolder = os.path.join(os.path.dirname(topDir),'tests') if not os.path.isdir(testsFolder): testsFolder = None return _OUTDIR | cc4eca9f4404b7c469b8414de7f52c407120c844 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7053/cc4eca9f4404b7c469b8414de7f52c407120c844/testutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
1182,
1621,
12,
529,
4672,
3536,
2520,
518,
279,
9691,
585,
2619,
27450,
3832,
8187,
3470,
1842,
1867,
35,
225,
971,
1427,
16,
848,
1045,
1842,
876,
2674,
18,
225,
971,
486,
16,
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,
444,
1182,
1621,
12,
529,
4672,
3536,
2520,
518,
279,
9691,
585,
2619,
27450,
3832,
8187,
3470,
1842,
1867,
35,
225,
971,
1427,
16,
848,
1045,
1842,
876,
2674,
18,
225,
971,
486,
16,
5... |
print "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] | msg = "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] appendTextview(self.textviewStdOut, msg) | def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need the position of the cursor location # in the seismogram array: xpos = pickSample * samp_rate # Set new P Pick if self.flagPhase==0 and event.key==self.dictKeybindings['setPick']: self.delPLine() self.delPLabel() self.delPsynthLine() self.dicts[self.stPt]['P'] = pickSample self.drawPLine() self.drawPLabel() self.drawPsynthLine() self.drawPsynthLabel() #check if the new P pick lies outside of the Error Picks try: if self.dicts[self.stPt]['P']<self.dicts[self.stPt]['PErr1']: self.delPErr1Line() self.delPErr1() except: pass try: if self.dicts[self.stPt]['P']>self.dicts[self.stPt]['PErr2']: self.delPErr2Line() self.delPErr2() except: pass # Update all subplots self.redraw() # Console output print "P Pick set at %.3f" % self.dicts[self.stPt]['P'] # Set P Pick weight if self.dicts[self.stPt].has_key('P'): if self.flagPhase==0 and event.key==self.dictKeybindings['setPWeight0']: self.delPLabel() self.dicts[self.stPt]['PWeight']=0 self.drawPLabel() self.redraw() print "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] if self.flagPhase==0 and event.key==self.dictKeybindings['setPWeight1']: self.delPLabel() self.dicts[self.stPt]['PWeight']=1 print "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] self.drawPLabel() self.redraw() if self.flagPhase==0 and event.key==self.dictKeybindings['setPWeight2']: self.delPLabel() self.dicts[self.stPt]['PWeight']=2 print "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] self.drawPLabel() self.redraw() if self.flagPhase==0 and event.key==self.dictKeybindings['setPWeight3']: self.delPLabel() self.dicts[self.stPt]['PWeight']=3 print "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] self.drawPLabel() self.redraw() # Set P Pick polarity if self.dicts[self.stPt].has_key('P'): if self.flagPhase==0 and event.key==self.dictKeybindings['setPPolUp']: self.delPLabel() self.dicts[self.stPt]['PPol']='up' self.drawPLabel() self.redraw() print "P Pick polarity set to %s"%self.dicts[self.stPt]['PPol'] if self.flagPhase==0 and event.key==self.dictKeybindings['setPPolPoorUp']: self.delPLabel() self.dicts[self.stPt]['PPol']='poorup' self.drawPLabel() self.redraw() print "P Pick polarity set to %s"%self.dicts[self.stPt]['PPol'] if self.flagPhase==0 and event.key==self.dictKeybindings['setPPolDown']: self.delPLabel() self.dicts[self.stPt]['PPol']='down' self.drawPLabel() self.redraw() print "P Pick polarity set to %s"%self.dicts[self.stPt]['PPol'] if self.flagPhase==0 and event.key==self.dictKeybindings['setPPolPoorDown']: self.delPLabel() self.dicts[self.stPt]['PPol']='poordown' self.drawPLabel() self.redraw() print "P Pick polarity set to %s"%self.dicts[self.stPt]['PPol'] # Set P Pick onset if self.dicts[self.stPt].has_key('P'): if self.flagPhase == 0 and event.key == self.dictKeybindings['setPOnsetImpulsive']: self.delPLabel() self.dicts[self.stPt]['POnset'] = 'impulsive' self.drawPLabel() self.redraw() print "P pick onset set to %s" % self.dicts[self.stPt]['POnset'] elif self.flagPhase == 0 and event.key == self.dictKeybindings['setPOnsetEmergent']: self.delPLabel() self.dicts[self.stPt]['POnset'] = 'emergent' self.drawPLabel() self.redraw() print "P pick onset set to %s" % self.dicts[self.stPt]['POnset'] # Set new S Pick if self.flagPhase==1 and event.key==self.dictKeybindings['setPick']: self.delSLine() self.delSLabel() self.delSsynthLine() self.dicts[self.stPt]['S'] = pickSample self.dicts[self.stPt]['Saxind'] = self.axs.index(event.inaxes) self.drawSLine() self.drawSLabel() self.drawSsynthLine() self.drawSsynthLabel() #check if the new S pick lies outside of the Error Picks try: if self.dicts[self.stPt]['S']<self.dicts[self.stPt]['SErr1']: self.delSErr1Line() self.delSErr1() except: pass try: if self.dicts[self.stPt]['S']>self.dicts[self.stPt]['SErr2']: self.delSErr2Line() self.delSErr2() except: pass # Update all subplots self.redraw() # Console output print "S Pick set at %.3f" % self.dicts[self.stPt]['S'] # Set S Pick weight if self.dicts[self.stPt].has_key('S'): if self.flagPhase==1 and event.key==self.dictKeybindings['setSWeight0']: self.delSLabel() self.dicts[self.stPt]['SWeight']=0 self.drawSLabel() self.redraw() print "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSWeight1']: self.delSLabel() self.dicts[self.stPt]['SWeight']=1 self.drawSLabel() self.redraw() print "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSWeight2']: self.delSLabel() self.dicts[self.stPt]['SWeight']=2 self.drawSLabel() self.redraw() print "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSWeight3']: self.delSLabel() self.dicts[self.stPt]['SWeight']=3 self.drawSLabel() self.redraw() print "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] # Set S Pick polarity if self.dicts[self.stPt].has_key('S'): if self.flagPhase==1 and event.key==self.dictKeybindings['setSPolUp']: self.delSLabel() self.dicts[self.stPt]['SPol']='up' self.drawSLabel() self.redraw() print "S Pick polarity set to %s"%self.dicts[self.stPt]['SPol'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSPolPoorUp']: self.delSLabel() self.dicts[self.stPt]['SPol']='poorup' self.drawSLabel() self.redraw() print "S Pick polarity set to %s"%self.dicts[self.stPt]['SPol'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSPolDown']: self.delSLabel() self.dicts[self.stPt]['SPol']='down' self.drawSLabel() self.redraw() print "S Pick polarity set to %s"%self.dicts[self.stPt]['SPol'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSPolPoorDown']: self.delSLabel() self.dicts[self.stPt]['SPol']='poordown' self.drawSLabel() self.redraw() print "S Pick polarity set to %s"%self.dicts[self.stPt]['SPol'] # Set S Pick onset if self.dicts[self.stPt].has_key('S'): if self.flagPhase == 1 and event.key == self.dictKeybindings['setSOnsetImpulsive']: self.delSLabel() self.dicts[self.stPt]['SOnset'] = 'impulsive' self.drawSLabel() self.redraw() print "S pick onset set to %s" % self.dicts[self.stPt]['SOnset'] elif self.flagPhase == 1 and event.key == self.dictKeybindings['setSOnsetEmergent']: self.delSLabel() self.dicts[self.stPt]['SOnset'] = 'emergent' self.drawSLabel() self.redraw() print "S pick onset set to %s" % self.dicts[self.stPt]['SOnset'] # Remove P Pick if self.flagPhase==0 and event.key==self.dictKeybindings['delPick']: # Try to remove all existing Pick lines and P Pick variable self.delPLine() self.delP() self.delPWeight() self.delPPol() self.delPOnset() self.delPLabel() # Try to remove existing Pick Error 1 lines and variable self.delPErr1Line() self.delPErr1() # Try to remove existing Pick Error 2 lines and variable self.delPErr2Line() self.delPErr2() # Update all subplots self.redraw() # Remove S Pick if self.flagPhase==1 and event.key==self.dictKeybindings['delPick']: # Try to remove all existing Pick lines and P Pick variable self.delSLine() self.delS() self.delSWeight() self.delSPol() self.delSOnset() self.delSLabel() # Try to remove existing Pick Error 1 lines and variable self.delSErr1Line() self.delSErr1() # Try to remove existing Pick Error 2 lines and variable self.delSErr2Line() self.delSErr2() # Update all subplots self.redraw() # Set new P Pick uncertainties if self.flagPhase==0 and event.key==self.dictKeybindings['setPickError']: # Set Flag to determine scenario try: # Set left Error Pick if pickSample < self.dicts[self.stPt]['P']: errFlag=1 # Set right Error Pick else: errFlag=2 # Set no Error Pick (no P Pick yet) except: return # Case 1 if errFlag==1: # Define global variables seen outside # Remove old lines from the plot before plotting the new ones self.delPErr1Line() # Save time value of sample nearest to error pick self.dicts[self.stPt]['PErr1'] = pickSample # Plot the lines for the P Error pick in all three traces self.drawPErr1Line() # Update all subplots self.redraw() # Console output print "P Error Pick 1 set at %.3f" % \ self.dicts[self.stPt]['PErr1'] # Case 2 if errFlag==2: # Define global variables seen outside # Remove old lines from the plot before plotting the new ones self.delPErr2Line() # Save time value of sample nearest to error pick self.dicts[self.stPt]['PErr2'] = pickSample # Plot the lines for the P Error pick in all three traces self.drawPErr2Line() # Update all subplots self.redraw() # Console output print "P Error Pick 2 set at %.3f" % \ self.dicts[self.stPt]['PErr2'] # Set new S Pick uncertainties if self.flagPhase==1 and event.key==self.dictKeybindings['setPickError']: # Set Flag to determine scenario try: # Set left Error Pick if pickSample < self.dicts[self.stPt]['S']: errFlag=1 # Set right Error Pick else: errFlag=2 # Set no Error Pick (no S Pick yet) except: return # Case 1 if errFlag==1: # Define global variables seen outside # Remove old lines from the plot before plotting the new ones self.delSErr1Line() # Save sample value of error pick (round to integer sample value) self.dicts[self.stPt]['SErr1'] = pickSample # Plot the lines for the S Error pick in all three traces self.drawSErr1Line() # Update all subplots self.redraw() # Console output print "S Error Pick 1 set at %.3f" % \ self.dicts[self.stPt]['SErr1'] # Case 2 if errFlag==2: # Define global variables seen outside # Remove old lines from the plot before plotting the new ones self.delSErr2Line() # Save sample value of error pick (round to integer sample value) self.dicts[self.stPt]['SErr2'] = pickSample # Plot the lines for the S Error pick in all three traces self.drawSErr2Line() # Update all subplots self.redraw() # Console output print "S Error Pick 2 set at %.3f" % \ self.dicts[self.stPt]['SErr2'] # Magnitude estimation picking: if self.flagPhase==2 and event.key==self.dictKeybindings['setMagMin'] and len(self.axs) > 2: if event.inaxes == self.axs[1]: self.delMagMinCross1() ydata=event.inaxes.lines[0].get_ydata() #get the first line hoping that it is the seismogram! cutoffSamples=xpos-self.magPickWindow #remember, how much samples there are before our small window! We have to add this number for our MagMinT estimation! self.dicts[self.stPt]['MagMin1']=np.min(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) # save time of magnitude minimum in seconds tmp_magtime = cutoffSamples + np.argmin(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) tmp_magtime = tmp_magtime / samp_rate self.dicts[self.stPt]['MagMin1T'] = tmp_magtime #delete old MagMax Pick, if new MagMin Pick is higher try: if self.dicts[self.stPt]['MagMin1'] > self.dicts[self.stPt]['MagMax1']: self.delMagMaxCross1() self.delMagMax1() except: pass self.drawMagMinCross1() self.redraw() print "Minimum for magnitude estimation set: %s at %.3f" % \ (self.dicts[self.stPt]['MagMin1'], self.dicts[self.stPt]['MagMin1T']) elif event.inaxes == self.axs[2]: self.delMagMinCross2() ydata=event.inaxes.lines[0].get_ydata() #get the first line hoping that it is the seismogram! cutoffSamples=xpos-self.magPickWindow #remember, how much samples there are before our small window! We have to add this number for our MagMinT estimation! self.dicts[self.stPt]['MagMin2']=np.min(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) # save time of magnitude minimum in seconds tmp_magtime = cutoffSamples + np.argmin(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) tmp_magtime = tmp_magtime / samp_rate self.dicts[self.stPt]['MagMin2T'] = tmp_magtime #delete old MagMax Pick, if new MagMin Pick is higher try: if self.dicts[self.stPt]['MagMin2'] > self.dicts[self.stPt]['MagMax2']: self.delMagMaxCross2() self.delMagMax2() except: pass self.drawMagMinCross2() self.redraw() print "Minimum for magnitude estimation set: %s at %.3f" % \ (self.dicts[self.stPt]['MagMin2'], self.dicts[self.stPt]['MagMin2T']) if self.flagPhase==2 and event.key==self.dictKeybindings['setMagMax'] and len(self.axs) > 2: if event.inaxes == self.axs[1]: self.delMagMaxCross1() ydata=event.inaxes.lines[0].get_ydata() #get the first line hoping that it is the seismogram! cutoffSamples=xpos-self.magPickWindow #remember, how much samples there are before our small window! We have to add this number for our MagMinT estimation! self.dicts[self.stPt]['MagMax1']=np.max(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) # save time of magnitude maximum in seconds tmp_magtime = cutoffSamples + np.argmax(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) tmp_magtime = tmp_magtime / samp_rate self.dicts[self.stPt]['MagMax1T'] = tmp_magtime #delete old MagMax Pick, if new MagMax Pick is higher try: if self.dicts[self.stPt]['MagMin1'] > self.dicts[self.stPt]['MagMax1']: self.delMagMinCross1() self.delMagMin1() except: pass self.drawMagMaxCross1() self.redraw() print "Maximum for magnitude estimation set: %s at %.3f" % \ (self.dicts[self.stPt]['MagMax1'], self.dicts[self.stPt]['MagMax1T']) elif event.inaxes == self.axs[2]: self.delMagMaxCross2() ydata=event.inaxes.lines[0].get_ydata() #get the first line hoping that it is the seismogram! cutoffSamples=xpos-self.magPickWindow #remember, how much samples there are before our small window! We have to add this number for our MagMinT estimation! self.dicts[self.stPt]['MagMax2']=np.max(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) # save time of magnitude maximum in seconds tmp_magtime = cutoffSamples + np.argmax(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) tmp_magtime = tmp_magtime / samp_rate self.dicts[self.stPt]['MagMax2T'] = tmp_magtime #delete old MagMax Pick, if new MagMax Pick is higher try: if self.dicts[self.stPt]['MagMin2'] > self.dicts[self.stPt]['MagMax2']: self.delMagMinCross2() self.delMagMin2() except: pass self.drawMagMaxCross2() self.redraw() print "Maximum for magnitude estimation set: %s at %.3f" % \ (self.dicts[self.stPt]['MagMax2'],self.dicts[self.stPt]['MagMax2T']) if self.flagPhase == 2 and event.key == self.dictKeybindings['delMagMinMax']: if event.inaxes == self.axs[1]: self.delMagMaxCross1() self.delMagMinCross1() self.delMagMin1() self.delMagMax1() elif event.inaxes == self.axs[2]: self.delMagMaxCross2() self.delMagMinCross2() self.delMagMin2() self.delMagMax2() else: return self.redraw() | b822b77814749ba0fa0b0a638d2c2e8ccf514f6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/b822b77814749ba0fa0b0a638d2c2e8ccf514f6c/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6002,
12,
2890,
16,
871,
4672,
468,
5666,
2359,
1966,
31,
2359,
1966,
18,
542,
67,
5129,
1435,
468,
3218,
2545,
358,
3643,
628,
326,
6002,
310,
2117,
358,
468,
5787,
813,
460,
434,
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,
6002,
12,
2890,
16,
871,
4672,
468,
5666,
2359,
1966,
31,
2359,
1966,
18,
542,
67,
5129,
1435,
468,
3218,
2545,
358,
3643,
628,
326,
6002,
310,
2117,
358,
468,
5787,
813,
460,
434,
326... |
self.sort() if self.box.elm_obj.is_deleted() == False: self.box.elm_obj.delete() self.box = elm_box(self.Elm_win.elm_obj) self.items = [] testcounter = 0 for item in self.model: if self.Elm_win.elm_obj.is_deleted() == True: logger.info(str(self.model)) logger.info("window deleted") ly = elementary.Layout(self.Elm_win.elm_obj) ly.file_set(self.EdjeFile, self.EdjeGroup) edje_obj = ly.edje_get() for part, attribute in self.label_list: if hasattr(item, attribute): value = getattr(item, attribute) if isinstance(value, tichy.Item): value = unicode(value.get_text()) txt = unicode(value).encode('utf-8') edje_obj.part_text_set(part,txt) | if self.Elm_win.elm_obj.is_deleted() == True: self._remove_cb() else: self.sort() if self.box.elm_obj.is_deleted() == False: self.box.elm_obj.delete() self.box = elm_box(self.Elm_win.elm_obj) self.items = [] testcounter = 0 for item in self.model: if self.Elm_win.elm_obj.is_deleted() == True: logger.info(str(self.model)) logger.info("window deleted") ly = elementary.Layout(self.Elm_win.elm_obj) ly.file_set(self.EdjeFile, self.EdjeGroup) edje_obj = ly.edje_get() for part, attribute in self.label_list: if hasattr(item, attribute): value = getattr(item, attribute) if isinstance(value, tichy.Item): value = unicode(value.get_text()) txt = unicode(value).encode('utf-8') edje_obj.part_text_set(part,txt) if edje_obj.data_get('attribute1') != None: attribute = edje_obj.data_get('attribute1') if edje_obj.data_get('attribute2') != None: item_cp = getattr(item,attribute) attribute = edje_obj.data_get('attribute2') else: item_cp = item if edje_obj.data_get('value') == 'None': value = None else: value = edje_obj.data_get('value') signal = edje_obj.data_get('signal') if attribute[-2] == "(": test = getattr(item_cp,attribute[:-2])() else: test = getattr(item_cp,attribute) if test == value: edje_obj.signal_emit(signal,'*') ly.size_hint_min_set(470,60) self.box.elm_obj.pack_end(ly) ly.show() self.items.append([item,edje_obj,ly]) | def _redraw_view(self, *args, **kargs): logger.info("list redrawing") self.sort() if self.box.elm_obj.is_deleted() == False: self.box.elm_obj.delete() self.box = elm_box(self.Elm_win.elm_obj) self.items = [] testcounter = 0 for item in self.model: if self.Elm_win.elm_obj.is_deleted() == True: logger.info(str(self.model)) logger.info("window deleted") ly = elementary.Layout(self.Elm_win.elm_obj) ly.file_set(self.EdjeFile, self.EdjeGroup) edje_obj = ly.edje_get() for part, attribute in self.label_list: if hasattr(item, attribute): value = getattr(item, attribute) if isinstance(value, tichy.Item): value = unicode(value.get_text()) txt = unicode(value).encode('utf-8') edje_obj.part_text_set(part,txt) ##check for optional display elements if edje_obj.data_get('attribute1') != None: attribute = edje_obj.data_get('attribute1') if edje_obj.data_get('attribute2') != None: item_cp = getattr(item,attribute) attribute = edje_obj.data_get('attribute2') else: item_cp = item if edje_obj.data_get('value') == 'None': value = None else: value = edje_obj.data_get('value') signal = edje_obj.data_get('signal') if attribute[-2] == "(": test = getattr(item_cp,attribute[:-2])() else: test = getattr(item_cp,attribute) if test == value: edje_obj.signal_emit(signal,'*') | b80366a7b244b4b25dba95ffadaf9a56ded684d1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4712/b80366a7b244b4b25dba95ffadaf9a56ded684d1/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1118,
1899,
67,
1945,
12,
2890,
16,
380,
1968,
16,
2826,
79,
1968,
4672,
1194,
18,
1376,
2932,
1098,
16540,
310,
7923,
309,
365,
18,
28439,
67,
8082,
18,
19597,
67,
2603,
18,
291,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1118,
1899,
67,
1945,
12,
2890,
16,
380,
1968,
16,
2826,
79,
1968,
4672,
1194,
18,
1376,
2932,
1098,
16540,
310,
7923,
309,
365,
18,
28439,
67,
8082,
18,
19597,
67,
2603,
18,
291,... |
elif optname in ('output', 'target'): | elif optname == 'output': if optname not in ACTIONS: raise ValueError('"%s" expected one of: %s' % (optname, ', '.join(ACTIONS))) options.action = action elif optname == 'target': | def parse_configfiles(configfiles, options, names): configparser = ConfigParser.ConfigParser() # ConfigParser.read() silently ignores errors, so open the files # manually (since we want to notify the user of any errors). for configfile in configfiles: fp = open(configfile, 'r') # may raise IOError. configparser.readfp(fp, configfile) fp.close() for optname in configparser.options('epydoc'): val = configparser.get('epydoc', optname).strip() optname = optname.lower().strip() if optname in ('modules', 'objects', 'values', 'module', 'object', 'value'): names.extend(val.replace(',', ' ').split()) elif optname in ('output', 'target'): options.target = val elif optname == 'inheritance': if val.lower() not in INHERITANCE_STYLES: raise ValueError('"inheritance" expected one of: %s.' % ', '.join(INHERITANCE_STYLES)) options.inerhitance = val.lower() elif optname == 'docformat': options.docformat = val elif optname == 'css': options.css = val elif optname == 'name': options.prj_name = val elif optname == 'url': options.prj_url = val elif optname == 'link': options.prj_link = val elif optname == 'top': options.top_page = val elif optname == 'help': options.help_file = val elif optname =='frames': options.frames = _str_to_bool(val, optname) elif optname =='private': options.private = _str_to_bool(val, optname) elif optname =='imports': options.imports = _str_to_bool(val, optname) elif optname == 'verbosity': try: options.verbosity = int(val) except ValueError: raise ValueError('"verbosity" expected an int') elif optname == 'parse': options.parse = _str_to_bool(val, optname) elif optname == 'introspect': options.introspect = _str_to_bool(val, optname) elif optname == 'dotpath': options.dotpath = val elif optname == 'graph': graphtypes = val.replace(',', '').split() for graphtype in graphtypes: if graphtype not in GRAPH_TYPES: raise ValueError('"graph" expected one of: %s.' % ', '.join(GRAPH_TYPES)) options.graphs.extend(graphtypes) elif optname in ('separate-classes', 'separate_classes'): options.list_classes_separately = _str_to_bool(val, optname) elif optname == 'sourcecode': options.include_source_code = _str_to_bool(val, optname) elif optname == 'pstat': options.pstat_files.extend(val.replace(',', ' ').split()) else: raise ValueError('Unknown option %s' % optname) | b62a459bfe884778954b251644ae46a630c52d23 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/b62a459bfe884778954b251644ae46a630c52d23/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1425,
2354,
12,
1425,
2354,
16,
702,
16,
1257,
4672,
642,
4288,
273,
25076,
18,
809,
2678,
1435,
468,
25076,
18,
896,
1435,
22274,
17868,
1334,
16,
1427,
1696,
326,
1390,
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,
1109,
67,
1425,
2354,
12,
1425,
2354,
16,
702,
16,
1257,
4672,
642,
4288,
273,
25076,
18,
809,
2678,
1435,
468,
25076,
18,
896,
1435,
22274,
17868,
1334,
16,
1427,
1696,
326,
1390,
468,
... |
self.colormapper.set_norm(matplotlib.colors.LogNorm(1.,2.)) | self.colormapper.set_norm(LogNorm(1.,2.)) | def __init__(self, parent, id = -1, dpi = None, color=None, **kwargs): # TODO: inherit directly from Canvas --- it is after all a panel. | 636880d26039268a45f2f72b4fdda12c46f0b191 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13135/636880d26039268a45f2f72b4fdda12c46f0b191/polplot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
612,
273,
300,
21,
16,
16361,
273,
599,
16,
2036,
33,
7036,
16,
2826,
4333,
4672,
468,
2660,
30,
6811,
5122,
628,
20966,
9948,
518,
353,
1839,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
982,
16,
612,
273,
300,
21,
16,
16361,
273,
599,
16,
2036,
33,
7036,
16,
2826,
4333,
4672,
468,
2660,
30,
6811,
5122,
628,
20966,
9948,
518,
353,
1839,
... |
a.setDisplay(diDEFAULT) | if a.display == diINVISIBLE: a.setDisplay(diDEFAULT) | def makeAtomsVisible(self): for a in self.mol.atoms.itervalues(): a.setDisplay(diDEFAULT) self.mol.glpane.gl_update() | f9ca784f9d5ef54605c5be003462db7b15e25d54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/f9ca784f9d5ef54605c5be003462db7b15e25d54/MoleculeProp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
14280,
6207,
12,
2890,
4672,
364,
279,
316,
365,
18,
21260,
18,
14937,
18,
2165,
2372,
13332,
309,
279,
18,
5417,
422,
4314,
706,
29588,
30,
279,
18,
542,
4236,
12,
3211,
5280,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
14280,
6207,
12,
2890,
4672,
364,
279,
316,
365,
18,
21260,
18,
14937,
18,
2165,
2372,
13332,
309,
279,
18,
5417,
422,
4314,
706,
29588,
30,
279,
18,
542,
4236,
12,
3211,
5280,
1... |
self._index = args[0] self._size = args[1] self._name = Registers[self._index] | self.index = args[0] self.size = args[1] self.name = Registers[self.index] | def __init__(self, type, *args): self._type = type self._index = None self._name = "" self._size = 0 self._value = 0 self._disp = 0 self._dispSize = 0 self._base = 0 if type == OPERAND_IMMEDIATE: self._value = int(args[0]) self._size = args[1] elif type == OPERAND_REGISTER: self._index = args[0] self._size = args[1] self._name = Registers[self._index] elif type == OPERAND_MEMORY: self._base = args[0] if args[0] != R_NONE else None self._index = args[1] self._size = args[2] self._scale = args[3] if args[3] > 1 else 1 self._disp = int(args[4]) self._dispSize = args[5] elif type == OPERAND_ABSOLUTE_ADDRESS: self._size = args[0] self._disp = int(args[1]) self._dispSize = args[2] elif type == OPERAND_FAR_MEMORY: self._seg = args[0] self._off = args[1] | 005c58df4b3c5cf2af8b9028cc40a540461beeb1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4918/005c58df4b3c5cf2af8b9028cc40a540461beeb1/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
618,
16,
380,
1968,
4672,
365,
6315,
723,
273,
618,
365,
6315,
1615,
273,
599,
365,
6315,
529,
273,
1408,
365,
6315,
1467,
273,
374,
365,
6315,
1132,
273... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
618,
16,
380,
1968,
4672,
365,
6315,
723,
273,
618,
365,
6315,
1615,
273,
599,
365,
6315,
529,
273,
1408,
365,
6315,
1467,
273,
374,
365,
6315,
1132,
273... |
if bool1 != None: (bool2, expr2) = self.parse_expression() | if bool1 == None: Msg.add(_["Warning: %s: PATCH rule invalid first expression"] % (self.where())) self.parse_dbg_indent = self.parse_dbg_indent[:-2] return (bool2, expr2) = self.parse_expression() | def parse_statement(self, rule, msg, expr): self.parse_dbg_indent += " " self.pdbg("parse_statement(%s, %s, %s)" % (rule, msg, expr)) expr = expr.strip() if msg == "": if expr == "": self.parse_message_block() expr = self.buffer else: self.message = [msg] if expr == "": if not self.readline(): self.parse_dbg_indent = self.parse_dbg_indent[:-2] return else: self.buffer = expr msg = "" if self.message == [] else " |" + "\n |".join(self.message) # no ending LF if rule == "CONFLICT": # takes any number of exprs exprs = [] self.pdbg("before conflict parse_expr() expr=%s line=%s" % (expr, self.buffer)) (bool, expr) = self.parse_expression() self.pdbg("conflict parse_expr()1 bool=%s bool=%s" % (bool, expr)) while bool != None: if bool: exprs.append(expr) (bool, expr) = self.parse_expression() self.pdbg("conflict parse_expr()N bool=%s bool=%s" % ("True" if bool else "False", expr)) if len(exprs) > 1: Msg.add("[CONFLICT]") for e in exprs: Msg.add(self.pprint(e, " > ")) if msg != "": Msg.add(msg) elif rule == "NOTE": # takes any number of exprs self.pdbg("function NOTE: %s" % msg) exprs = [] (bool, expr) = self.parse_expression(prune=True) while bool != None: if bool: exprs.append(expr) (bool, expr) = self.parse_expression(prune=True) if not Opt.Quiet and len(exprs) > 0: Msg.add("[NOTE]") for e in exprs: Msg.add(self.pprint(e, " > ")) if msg != "": Msg.add(msg) elif rule == "PATCH": # takes 2 exprs (bool1, expr1) = self.parse_expression() if bool1 != None: (bool2, expr2) = self.parse_expression() if bool2 == None: Msg.add(_["Warning: %s: PATCH rule must have 2 conditions"] % (self.where())) self.parse_dbg_indent = self.parse_dbg_indent[:-2] return if bool1 and not bool2: # case where the patch is present but the thing to be patched is missing Msg.add(_["[PATCH]\n%s is missing some pre-requisites:\n%s"] % (self.pprint(expr1, " !!"), self.pprint(expr2, " "))) if msg != "": Msg.add(msg) if bool2 and not bool1: # case where the patch is missing for the thing to be patched Msg.add(_["[PATCH]\n%s for:\n%s"] % (self.pprint(expr1, " !!"), self.pprint(expr2, " "))) if msg != "": Msg.add(msg) elif rule == "REQUIRES": # takes 2 exprs (bool1, expr1) = self.parse_expression(prune=True) if bool1 != None: (bool2, expr2) = self.parse_expression() self.pdbg("REQ expr2 == %s" % expr2) if bool2 == None: self.parse_error("REQUIRES rule must have 2 conditions") return if bool1 and not bool2: expr2_str = self.pprint(expr2, " > ") Msg.add(_["[REQUIRES]\n%s Requires:\n%s"] % (self.pprint(expr1, " !!!"), expr2_str)) if msg != "": Msg.add(msg) match = re_filename_version.search(expr2_str) if match: Msg.add(_[" | [Note that you may see this message if you have an older version of one\n | of the pre-requisites. In that case, it is suggested that you upgrade\n | to the newer version]."]) self.parse_dbg_indent = self.parse_dbg_indent[:-2] self.pdbg("parse_statement RETURNING") | 3da534b9bf37dbde04239e14e13a579e2b0fe147 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2827/3da534b9bf37dbde04239e14e13a579e2b0fe147/mlox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
11516,
12,
2890,
16,
1720,
16,
1234,
16,
3065,
4672,
365,
18,
2670,
67,
1966,
75,
67,
9355,
1011,
315,
225,
315,
365,
18,
17414,
75,
2932,
2670,
67,
11516,
9275,
87,
16,
73... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
11516,
12,
2890,
16,
1720,
16,
1234,
16,
3065,
4672,
365,
18,
2670,
67,
1966,
75,
67,
9355,
1011,
315,
225,
315,
365,
18,
17414,
75,
2932,
2670,
67,
11516,
9275,
87,
16,
73... |
WHERE treepath_id=pid; | WHERE treepath_id = pid; | def ddl_prog(db): safe_query(db, "CREATE LANGUAGE 'plpgsql'") cursor = db.cursor() cursor.execute(""" CREATE OR REPLACE FUNCTION share_update() RETURNS trigger AS $$BEGIN IF NEW.tree_id != OLD.tree_id AND OLD.tree_id IS NOT NULL THEN RAISE EXCEPTION 'tree_id cannot be changed (share_id=%)', NEW.share_id; END IF; IF NEW.state != OLD.state THEN NEW.last_state_change = 'now'; END IF; RETURN NEW; END;$$ LANGUAGE 'plpgsql' VOLATILE COST 100; CREATE TRIGGER share_update_trigger BEFORE UPDATE ON shares FOR EACH ROW EXECUTE PROCEDURE share_update(); CREATE OR REPLACE FUNCTION share_insert() RETURNS trigger AS $$BEGIN INSERT INTO trees (share_id) VALUES (NEW.share_id) RETURNING tree_id INTO STRICT NEW.tree_id; UPDATE shares SET tree_id=NEW.tree_id WHERE share_id=NEW.share_id; RETURN NEW; END;$$ LANGUAGE 'plpgsql' VOLATILE COST 100; CREATE TRIGGER share_insert_trigger AFTER INSERT ON shares FOR EACH ROW EXECUTE PROCEDURE share_insert(); CREATE OR REPLACE FUNCTION path_goup( tree integer, INOUT pathid integer, levels integer, OUT pathoffset integer) AS $$DECLARE result RECORD; lvl integer := levels - 1; BEGIN IF lvl < 0 THEN RAISE EXCEPTION 'invalid parameter'; END IF; LOOP SELECT parent_id, parentfile_id FROM paths WHERE tree_id = tree AND treepath_id = pathid INTO STRICT result; pathid := result.parent_id; IF pathid = 0 THEN RAISE EXCEPTION 'too early root'; END IF; IF lvl = 0 THEN pathoffset := result.parentfile_id; RETURN; END IF; lvl := lvl - 1; END LOOP; END;$$ LANGUAGE 'plpgsql' VOLATILE COST 500; CREATE OR REPLACE FUNCTION push_path_files(tid integer, pid integer) RETURNS void AS $$DECLARE newcurs NO SCROLL CURSOR FOR SELECT pathfile_id FROM newfiles WHERE treepath_id=pid ORDER BY pathfile_id; newrec record; oldrec record; N integer := 0; BEGIN OPEN newcurs; FETCH newcurs INTO newrec; FOR oldrec IN SELECT file_id,pathfile_id FROM files WHERE tree_id=tid AND treepath_id=pid ORDER BY pathfile_id LOOP WHILE newrec IS NOT NULL AND N = newrec.pathfile_id LOOP FETCH newcurs INTO newrec; N := N + 1; END LOOP; IF newrec IS NOT NULL AND N > newrec.pathfile_id THEN RAISE check_violation; END IF; IF NOT N = oldrec.pathfile_id THEN UPDATE files SET pathfile_id=N WHERE file_id=oldrec.file_id; END IF; N := N + 1; END LOOP; CLOSE newcurs; INSERT INTO files SELECT * FROM newfiles WHERE treepath_id=pid; DELETE FROM newfiles WHERE treepath_id=pid; END;$$ LANGUAGE 'plpgsql' VOLATILE COST 1000; """) | 50cca82fa13987b2bb1ce176081364ba1005c60d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4762/50cca82fa13987b2bb1ce176081364ba1005c60d/dbinit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24183,
67,
14654,
12,
1966,
4672,
4183,
67,
2271,
12,
1966,
16,
315,
9344,
24748,
296,
412,
84,
30175,
4970,
13,
3347,
273,
1319,
18,
9216,
1435,
3347,
18,
8837,
2932,
3660,
13278,
4869,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24183,
67,
14654,
12,
1966,
4672,
4183,
67,
2271,
12,
1966,
16,
315,
9344,
24748,
296,
412,
84,
30175,
4970,
13,
3347,
273,
1319,
18,
9216,
1435,
3347,
18,
8837,
2932,
3660,
13278,
4869,... |
if defn: if 'error' in defn: entry.append(defn['error']) elif defn['long'] != defn['short']: entry.extend((defn['short'], defn['long'])) else: entry.append(defn['short']) else: entry.append(keyword) | entry.extend(vocab2row(defn, [keyword])) | def write_element(writer, number, name, element): if isinstance(element, Exception): row = [number, name, 'ERROR', element.message, element.detail] else: row = [number, name, element] | 01c6922505889d13c76f9c0fbd50f05cd367fc67 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12122/01c6922505889d13c76f9c0fbd50f05cd367fc67/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
2956,
12,
6299,
16,
1300,
16,
508,
16,
930,
4672,
309,
1549,
12,
2956,
16,
1185,
4672,
1027,
273,
306,
2696,
16,
508,
16,
296,
3589,
2187,
930,
18,
2150,
16,
930,
18,
8992,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1045,
67,
2956,
12,
6299,
16,
1300,
16,
508,
16,
930,
4672,
309,
1549,
12,
2956,
16,
1185,
4672,
1027,
273,
306,
2696,
16,
508,
16,
296,
3589,
2187,
930,
18,
2150,
16,
930,
18,
8992,... |
dockbar = win32ui.GetMainFrame().GetControlBar(ID_DOCKED_INTERACTIVE_CONTROLBAR) win32ui.GetMainFrame().ShowControlBar(dockbar, 1, 1) | try: dockbar = win32ui.GetMainFrame().GetControlBar(ID_DOCKED_INTERACTIVE_CONTROLBAR) win32ui.GetMainFrame().ShowControlBar(dockbar, 1, 1) except win32ui.error: CreateDockedInteractiveWindow() | def RecreateWindow(self): dockbar = win32ui.GetMainFrame().GetControlBar(ID_DOCKED_INTERACTIVE_CONTROLBAR) win32ui.GetMainFrame().ShowControlBar(dockbar, 1, 1) | 08bc97485c777d09802af59a0e004dba1a41d34a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/08bc97485c777d09802af59a0e004dba1a41d34a/interact.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
868,
2640,
3829,
12,
2890,
4672,
5822,
3215,
273,
5657,
1578,
4881,
18,
967,
6376,
3219,
7675,
967,
3367,
5190,
12,
734,
67,
3191,
3507,
2056,
67,
9125,
13301,
67,
6067,
1457,
12995,
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,
868,
2640,
3829,
12,
2890,
4672,
5822,
3215,
273,
5657,
1578,
4881,
18,
967,
6376,
3219,
7675,
967,
3367,
5190,
12,
734,
67,
3191,
3507,
2056,
67,
9125,
13301,
67,
6067,
1457,
12995,
985... |
cr.execute('CREATE INDEX "%s_%s_index" ON "%s" ("%s")' % (self._table, k, self._table, k)) | cr.execute('CREATE INDEX "%s_%s_index" ON "%s" ("%s")' % (self._table, k, self._table, k), debug=self._debug) | f_pg_def = res[0] | 576b9b9dde9bc5cb94ed08af963a74742efcc864 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/576b9b9dde9bc5cb94ed08af963a74742efcc864/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
284,
67,
8365,
67,
536,
273,
400,
63,
20,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
284,
67,
8365,
67,
536,
273,
400,
63,
20,
65,
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,... |
if e.message != 'unichr() arg not in range(0x10000) (narrow Python build)': | if e.args != ('unichr() arg not in range(0x10000) (narrow Python build)',): | def test_unicode(self): 'Verify the pretty-printing of unicode values' # Test the empty unicode string: self.assertGdbRepr(u'') | 901d9376eee2057b5764ff2fef7ac0df3f1e021d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/901d9376eee2057b5764ff2fef7ac0df3f1e021d/test_gdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9124,
12,
2890,
4672,
296,
8097,
326,
7517,
17,
1188,
310,
434,
5252,
924,
11,
468,
7766,
326,
1008,
5252,
533,
30,
365,
18,
11231,
43,
1966,
426,
683,
12,
89,
11,
6134,
2,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9124,
12,
2890,
4672,
296,
8097,
326,
7517,
17,
1188,
310,
434,
5252,
924,
11,
468,
7766,
326,
1008,
5252,
533,
30,
365,
18,
11231,
43,
1966,
426,
683,
12,
89,
11,
6134,
2,... |
a[0] = base_ring(a[0].lift() / (j+1)) a[1] = base_ring(a[1].lift() / (j+1)) a[2] = base_ring(a[2].lift() / (j+1)) | if (p.divides(j+1)): a[0] = base_ring(lift(a[0]) / (j+1)) a[1] = base_ring(lift(a[1]) / (j+1)) a[2] = base_ring(lift(a[2]) / (j+1)) else: j_plus_1_inv = ~base_ring(j+1) a[0] = a[0] * j_plus_1_inv a[1] = a[1] * j_plus_1_inv a[2] = a[2] * j_plus_1_inv | def reduce_negative(Q, p, coeffs, offset): """ Applies cohomology relations to incorporate negative powers of $y$ into the $y^0$ term. INPUT: p -- prime Q -- cubic polynomial coeffs -- list of length 3 lists. The i^th list [a, b, c] represents $y^{2(i - offset)} (a + bx + cx^2) dx/y$. offset -- nonnegative integer OUTPUT: The reduction is performed in-place. The output is placed in coeffs[offset]. Note that coeffs[i] will be meaningless for i < offset after this function is finished. EXAMPLE: sage: R.<x> = Integers(5^3)['x'] sage: Q = x^3 - x + R(1/4) sage: coeffs = [[10, 15, 20], [1, 2, 3], [4, 5, 6], [7, 8, 9]] sage: coeffs = [[R.base_ring()(a) for a in row] for row in coeffs] sage: monsky_washnitzer.reduce_negative(Q, 5, coeffs, 3) sage: coeffs[3] [28, 52, 9] sage: R.<x> = Integers(7^3)['x'] sage: Q = x^3 - x + R(1/4) sage: coeffs = [[7, 14, 21], [1, 2, 3], [4, 5, 6], [7, 8, 9]] sage: coeffs = [[R.base_ring()(a) for a in row] for row in coeffs] sage: monsky_washnitzer.reduce_negative(Q, 7, coeffs, 3) sage: coeffs[3] [245, 332, 9] """ m = helper_matrix(Q).list() base_ring = Q.base_ring() next_a = coeffs[0] try: three_j_plus_5 = 5 - base_ring(6*offset) three_j_plus_7 = 7 - base_ring(6*offset) six = base_ring(6) for i in range(0, offset): j = 2*(i-offset) a = next_a next_a = coeffs[i+1] # todo: the following divisions will sometimes involve # a division by (a power of) p. In all cases, we know (from # Kedlaya's estimates) that the answer should be p-integral. # However, since we're working over $Z/p^k Z$, we're not allowed # to "divide by p". So currently we lift to Q, divide, and coerce # back. Eventually, when pAdicInteger is implemented, and plays # nicely with pAdicField, we should reimplement this stuff # using pAdicInteger. a[0] = base_ring(a[0].lift() / (j+1)) a[1] = base_ring(a[1].lift() / (j+1)) a[2] = base_ring(a[2].lift() / (j+1)) c1 = m[3]*a[0] + m[4]*a[1] + m[5]*a[2] c2 = m[6]*a[0] + m[7]*a[1] + m[8]*a[2] next_a[0] = next_a[0] - three_j_plus_5 * c1 next_a[1] = next_a[1] - three_j_plus_7 * c2 three_j_plus_7 = three_j_plus_7 + six three_j_plus_5 = three_j_plus_5 + six except NotImplementedError: raise NotImplementedError, \ "It looks like you've found a non-integral matrix of Frobenius! " \ "(Q=%s, p=%s)\nTime to write a paper." % (Q, p) coeffs[int(offset)] = next_a | 3596b006f3d4354e0ecd5702d8e8c91372a58ee1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/3596b006f3d4354e0ecd5702d8e8c91372a58ee1/monsky_washnitzer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5459,
67,
13258,
12,
53,
16,
293,
16,
16530,
16,
1384,
4672,
3536,
1716,
5259,
1825,
17125,
4676,
7467,
358,
316,
3850,
3831,
340,
6092,
7602,
414,
434,
271,
93,
8,
1368,
326,
271,
93,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5459,
67,
13258,
12,
53,
16,
293,
16,
16530,
16,
1384,
4672,
3536,
1716,
5259,
1825,
17125,
4676,
7467,
358,
316,
3850,
3831,
340,
6092,
7602,
414,
434,
271,
93,
8,
1368,
326,
271,
93,... |
return | return None | def warn_with_loader(space, w_message, w_category, w_filename, lineno, w_module, w_registry, w_globals): # Check/get the requisite pieces needed for the loader. try: w_loader = space.getitem(w_globals, space.wrap("__loader__")) w_module_name = space.getitem(w_globals, space.wrap("__name__")) except OperationError, e: if not e.match(space, space.w_KeyError): raise return # perform standard call # Make sure the loader implements the optional get_source() method. try: w_get_source = space.getattr(w_loader, space.wrap("get_source")) except OperationError, e: if not e.match(space, space.w_AttributeError): raise return # perform standard call # Call get_source() to get the source code. w_source = space.call_function(w_get_source, w_module_name) if space.is_w(w_source, space.w_None): return # perform standard call # Split the source into lines. w_source_list = space.call_method(w_source, "splitlines") # Get the source line. w_source_line = space.getitem(w_source_list, space.wrap(lineno - 1)) # Handle the warning. do_warn_explicit(space, w_category, w_message, (w_filename, lineno, w_module, w_registry), w_source_line) return True | 9a9de29f1ac0e528788a1f07382723f16054532d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/9a9de29f1ac0e528788a1f07382723f16054532d/interp_warnings.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1894,
67,
1918,
67,
6714,
12,
2981,
16,
341,
67,
2150,
16,
341,
67,
4743,
16,
341,
67,
3459,
16,
7586,
16,
341,
67,
2978,
16,
341,
67,
9893,
16,
341,
67,
16227,
4672,
468,
2073,
19... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1894,
67,
1918,
67,
6714,
12,
2981,
16,
341,
67,
2150,
16,
341,
67,
4743,
16,
341,
67,
3459,
16,
7586,
16,
341,
67,
2978,
16,
341,
67,
9893,
16,
341,
67,
16227,
4672,
468,
2073,
19... |
variables = reduce(lambda g1, g2: g1.union(g2), [set(g.variables()) for g in f], set([])) f = [equify(g, variables) for g in f] | f = [equify(g) for g in f] | def region_plot(f, xrange, yrange, plot_points, incol, outcol, bordercol, borderstyle, borderwidth): r""" ``region_plot`` takes a boolean function of two variables, `f(x,y)` and plots the region where f is True over the specified ``xrange`` and ``yrange`` as demonstrated below. ``region_plot(f, (xmin, xmax), (ymin, ymax), ...)`` INPUT: - ``f`` -- a boolean function of two variables - ``(xmin, xmax)`` -- 2-tuple, the range of ``x`` values OR 3-tuple ``(x,xmin,xmax)`` - ``(ymin, ymax)`` -- 2-tuple, the range of ``y`` values OR 3-tuple ``(y,ymin,ymax)`` - ``plot_points`` -- integer (default: 100); number of points to plot in each direction of the grid - ``incol`` -- a color (default: ``'blue'``), the color inside the region - ``outcol`` -- a color (default: ``'white'``), the color of the outside of the region If any of these options are specified, the border will be shown as indicated, otherwise it is only implicit (with color ``incol``) as the border of the inside of the region. - ``bordercol`` -- a color (default: ``None``), the color of the border (``'black'`` if ``borderwidth`` or ``borderstyle`` is specified but not ``bordercol``) - ``borderstyle`` -- string (default: 'solid'), one of 'solid', 'dashed', 'dotted', 'dashdot' - ``borderwidth`` -- integer (default: None), the width of the border in pixels EXAMPLES: Here we plot a simple function of two variables:: sage: x,y = var('x,y') sage: region_plot(cos(x^2+y^2) <= 0, (x, -3, 3), (y, -3, 3)) Here we play with the colors:: sage: region_plot(x^2+y^3 < 2, (x, -2, 2), (y, -2, 2), incol='lightblue', bordercol='gray') An even more complicated plot, with dashed borders:: sage: region_plot(sin(x)*sin(y) >= 1/4, (x,-10,10), (y,-10,10), incol='yellow', bordercol='black', borderstyle='dashed', plot_points=250) A disk centered at the origin:: sage: region_plot(x^2+y^2<1, (x,-1,1), (y,-1,1)).show(aspect_ratio=1) A plot with more than one condition:: sage: region_plot([x^2+y^2<1, x<y], (x,-2,2), (y,-2,2)) Since it doesn't look very good, let's increase plot_points:: sage: region_plot([x^2+y^2<1, x<y], (x,-2,2), (y,-2,2), plot_points=400).show(aspect_ratio=1) #long time The first quadrant of the unit circle:: sage: region_plot([y>0, x>0, x^2+y^2<1], (-1.1, 1.1), (-1.1, 1.1), plot_points = 400).show(aspect_ratio=1) Here is another plot, with a huge border:: sage: region_plot(x*(x-1)*(x+1)+y^2<0, (x, -3, 2), (y, -3, 3), incol='lightblue', bordercol='gray', borderwidth=10, plot_points=50) If we want to keep only the region where x is positive:: sage: region_plot([x*(x-1)*(x+1)+y^2<0, x>-1], (x, -3, 2), (y, -3, 3), incol='lightblue', plot_points=50) Here we have a cut circle:: sage: region_plot([x^2+y^2<4, x>-1], (x, -2, 2), (y, -2, 2), incol='lightblue', bordercol='gray', plot_points=200).show(aspect_ratio=1) """ from sage.plot.plot import Graphics from sage.plot.misc import setup_for_eval_on_grid if not isinstance(f, (list, tuple)): f = [f] variables = reduce(lambda g1, g2: g1.union(g2), [set(g.variables()) for g in f], set([])) f = [equify(g, variables) for g in f] g, ranges = setup_for_eval_on_grid(f, [xrange, yrange], plot_points) xrange,yrange=[r[:2] for r in ranges] xy_data_arrays = map(lambda g: [[g(x, y) for x in xsrange(*ranges[0], include_endpoint=True)] for y in xsrange(*ranges[1], include_endpoint=True)], g) xy_data_array = map(lambda *rows: map(lambda *vals: mangle_neg(vals), *rows), *xy_data_arrays) from matplotlib.colors import ListedColormap incol = rgbcolor(incol) outcol = rgbcolor(outcol) cmap = ListedColormap([incol, outcol]) cmap.set_over(outcol) cmap.set_under(incol) g = Graphics() opt = contour_plot.options.copy() opt.pop('plot_points') opt.pop('fill') opt.pop('contours') opt.pop('frame') g.add_primitive(ContourPlot(xy_data_array, xrange,yrange, dict(plot_points=plot_points, contours=[-1e307, 0, 1e307], cmap=cmap, fill=True, **opt))) if bordercol or borderstyle or borderwidth: cmap = [rgbcolor(bordercol)] if bordercol else ['black'] linestyles = [borderstyle] if borderstyle else None linewidths = [borderwidth] if borderwidth else None opt.pop('linestyles') opt.pop('linewidths') g.add_primitive(ContourPlot(xy_data_array, xrange, yrange, dict(plot_points=plot_points, linestyles=linestyles, linewidths=linewidths, contours=[0], cmap=[bordercol], fill=False, **opt))) return g | 422030c04c64e1e92f77f462e4c47004d776f0d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/422030c04c64e1e92f77f462e4c47004d776f0d0/contour_plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3020,
67,
4032,
12,
74,
16,
12314,
16,
677,
3676,
16,
3207,
67,
4139,
16,
316,
1293,
16,
596,
1293,
16,
5795,
1293,
16,
5795,
4060,
16,
5795,
2819,
4672,
436,
8395,
12176,
6858,
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,
3020,
67,
4032,
12,
74,
16,
12314,
16,
677,
3676,
16,
3207,
67,
4139,
16,
316,
1293,
16,
596,
1293,
16,
5795,
1293,
16,
5795,
4060,
16,
5795,
2819,
4672,
436,
8395,
12176,
6858,
67,
... |
delta = _iis_solve_delta(N, features[i], f_sharp, e_empirical[i], p_yx) | delta = _iis_solve_delta(N, features[i], f_sharp, e_empirical[i], p_yx, max_newton_iterations, newton_converge) | def _train_iis(xs, classes, features, f_sharp, alphas, e_empirical): """Do one iteration of hill climbing to find better alphas (PRIVATE).""" # This is a good function to parallelize. # Pre-calculate P(y|x) p_yx = _calc_p_class_given_x(xs, classes, features, alphas) N = len(xs) newalphas = alphas[:] for i in range(len(alphas)): delta = _iis_solve_delta(N, features[i], f_sharp, e_empirical[i], p_yx) newalphas[i] += delta return newalphas | 230ddfffe0c863a6de97e38fd9fa516b5020e9d6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7167/230ddfffe0c863a6de97e38fd9fa516b5020e9d6/MaxEntropy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9754,
67,
77,
291,
12,
13713,
16,
3318,
16,
4467,
16,
284,
67,
674,
11441,
16,
524,
26377,
16,
425,
67,
30752,
481,
1706,
4672,
3536,
3244,
1245,
6532,
434,
366,
737,
927,
381,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9754,
67,
77,
291,
12,
13713,
16,
3318,
16,
4467,
16,
284,
67,
674,
11441,
16,
524,
26377,
16,
425,
67,
30752,
481,
1706,
4672,
3536,
3244,
1245,
6532,
434,
366,
737,
927,
381,
... |
submitted for the edit operation to succeed. | submitted for the edit operation to succeed. | def parse(self, create=0, num_re=re.compile('^\d+$')): """ Item properties and their values are edited with html FORM variables and their values. You can: | b7e0b3ed6412d17921124a07b91ee81dde8e7ed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b7e0b3ed6412d17921124a07b91ee81dde8e7ed7/form_parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
752,
33,
20,
16,
818,
67,
266,
33,
266,
18,
11100,
2668,
17134,
72,
15,
9227,
3719,
30,
3536,
4342,
1790,
471,
3675,
924,
854,
18532,
598,
1729,
8979,
3152,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
752,
33,
20,
16,
818,
67,
266,
33,
266,
18,
11100,
2668,
17134,
72,
15,
9227,
3719,
30,
3536,
4342,
1790,
471,
3675,
924,
854,
18532,
598,
1729,
8979,
3152,
471,
... |
self.conn.os.utime(self.path, (long(time.time()), modtime)) self.data['mtime'] = modtime | try: self.conn.os.utime(self.path, (long(time.time()), modtime)) except OverflowError: log.Log("Cannot change mtime of %s to %s - problem is probably" "64->32bit conversion" % (self.path, modtime), 2) else: self.data['mtime'] = modtime | def setmtime(self, modtime): """Set only modtime (access time to present)""" log.Log(lambda: "Setting time of %s to %d" % (self.path, modtime), 7) self.conn.os.utime(self.path, (long(time.time()), modtime)) self.data['mtime'] = modtime | 4906d1cfe71a53c036319740889c273394cd1e94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6202/4906d1cfe71a53c036319740889c273394cd1e94/rpath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
10838,
12,
2890,
16,
681,
957,
4672,
3536,
694,
1338,
681,
957,
261,
3860,
813,
358,
3430,
15574,
613,
18,
1343,
12,
14661,
30,
315,
5568,
813,
434,
738,
87,
358,
738,
72,
6,
73... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10838,
12,
2890,
16,
681,
957,
4672,
3536,
694,
1338,
681,
957,
261,
3860,
813,
358,
3430,
15574,
613,
18,
1343,
12,
14661,
30,
315,
5568,
813,
434,
738,
87,
358,
738,
72,
6,
73... |
relation = False if relation: | column = False if column: relation = column._obj | def __view_look_dom(self, cr, user, node, view_id, context=None): if not context: context = {} result = False fields = {} childs = True | 45f34ac9eb7f3d2d5bb3e09f3d53f64a9f5e642e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/45f34ac9eb7f3d2d5bb3e09f3d53f64a9f5e642e/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1945,
67,
7330,
67,
9859,
12,
2890,
16,
4422,
16,
729,
16,
756,
16,
1476,
67,
350,
16,
819,
33,
7036,
4672,
309,
486,
819,
30,
819,
273,
2618,
563,
273,
1083,
1466,
273,
2618,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
1945,
67,
7330,
67,
9859,
12,
2890,
16,
4422,
16,
729,
16,
756,
16,
1476,
67,
350,
16,
819,
33,
7036,
4672,
309,
486,
819,
30,
819,
273,
2618,
563,
273,
1083,
1466,
273,
2618,
... |
NAME ==== | def addReference(self, name, versionStr = None, flavor = None, ref = None): """ NAME ==== | 748cbae21f60ac1c42057955f2dae32754c7f701 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/748cbae21f60ac1c42057955f2dae32754c7f701/grouprecipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
2404,
12,
2890,
16,
508,
16,
1177,
1585,
273,
599,
16,
19496,
273,
599,
16,
1278,
273,
599,
4672,
3536,
6048,
422,
631,
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,
527,
2404,
12,
2890,
16,
508,
16,
1177,
1585,
273,
599,
16,
19496,
273,
599,
16,
1278,
273,
599,
4672,
3536,
6048,
422,
631,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
self._x = x self._y = y self._x0 = x | self._x0 = self._x = x self._y0 = self._y = y | def setTextOrigin(self, x, y): if self._canvas.bottomup: self._code.append('1 0 0 1 %s Tm' % fp_str(x, y)) #bottom up else: self._code.append('1 0 0 -1 %s Tm' % fp_str(x, y)) #top down self._x = x self._y = y self._x0 = x #the margin | c8807bcce56d0da528e6e56ed9baa7e7f4382f44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/c8807bcce56d0da528e6e56ed9baa7e7f4382f44/textobject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7883,
7571,
12,
2890,
16,
619,
16,
677,
4672,
309,
365,
6315,
15424,
18,
9176,
416,
30,
365,
6315,
710,
18,
6923,
2668,
21,
374,
374,
404,
738,
87,
399,
81,
11,
738,
4253,
67,
701,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7883,
7571,
12,
2890,
16,
619,
16,
677,
4672,
309,
365,
6315,
15424,
18,
9176,
416,
30,
365,
6315,
710,
18,
6923,
2668,
21,
374,
374,
404,
738,
87,
399,
81,
11,
738,
4253,
67,
701,
... |
row = model.append () model.set_value (row, 0, icon) model.set_value (row, 1, text) model.set_value (row, 2, appletpath) | row = model.append () model.set_value (row, 0, icon) model.set_value (row, 1, text) model.set_value (row, 2, appletpath) | def install_applet(self, appletpath, apply, applet_exists, msg=True): if apply: model = self.model else: model = self.appmodel | 51f27993bc62aba37b501988577eb4222fc35d11 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8416/51f27993bc62aba37b501988577eb4222fc35d11/awnApplet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
438,
1469,
12,
2890,
16,
21853,
803,
16,
2230,
16,
21853,
67,
1808,
16,
1234,
33,
5510,
4672,
309,
2230,
30,
938,
273,
365,
18,
2284,
469,
30,
938,
273,
365,
18,
2910,
2284... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
438,
1469,
12,
2890,
16,
21853,
803,
16,
2230,
16,
21853,
67,
1808,
16,
1234,
33,
5510,
4672,
309,
2230,
30,
938,
273,
365,
18,
2284,
469,
30,
938,
273,
365,
18,
2910,
2284... |
if self.command == 'POST': | if self.command == 'POST' or self.command == 'PUT': | def EchoAllHandler(self): """This handler yields a (more) human-readable page listing information about the request header & contents.""" | bc2e8a8c1241909e8289e8779767c3e860a0ab17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/bc2e8a8c1241909e8289e8779767c3e860a0ab17/testserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28995,
1595,
1503,
12,
2890,
4672,
3536,
2503,
1838,
16932,
279,
261,
10161,
13,
8672,
17,
11018,
1363,
11591,
1779,
2973,
326,
590,
1446,
473,
2939,
12123,
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,
0,
0,
0,
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,
28995,
1595,
1503,
12,
2890,
4672,
3536,
2503,
1838,
16932,
279,
261,
10161,
13,
8672,
17,
11018,
1363,
11591,
1779,
2973,
326,
590,
1446,
473,
2939,
12123,
2,
-100,
-100,
-100,
-100,
-100... |
return os.path.join(os.path.dirname(__file__), 'xxmodule.c') return os.path.join(srcdir, 'Modules', 'xxmodule.c') | return fallback_path locations = (srcdir, os.path.dirname(sys.executable)) for location in locations: path = os.path.join(location, 'Modules', 'xxmodule.c') if os.path.exists(path): return path return fallback_path | def _get_source_filename(): srcdir = sysconfig.get_config_var('srcdir') if srcdir is None: # local fallback return os.path.join(os.path.dirname(__file__), 'xxmodule.c') return os.path.join(srcdir, 'Modules', 'xxmodule.c') | 14b60886a63fde43197e72d21b7c4c01c4a37db3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/14b60886a63fde43197e72d21b7c4c01c4a37db3/test_build_ext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
3168,
67,
3459,
13332,
1705,
1214,
273,
2589,
1425,
18,
588,
67,
1425,
67,
1401,
2668,
4816,
1214,
6134,
309,
1705,
1214,
353,
599,
30,
468,
1191,
5922,
2463,
5922,
67,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
3168,
67,
3459,
13332,
1705,
1214,
273,
2589,
1425,
18,
588,
67,
1425,
67,
1401,
2668,
4816,
1214,
6134,
309,
1705,
1214,
353,
599,
30,
468,
1191,
5922,
2463,
5922,
67,
8... |
if classifier.model["label"][0] == 0: beta = -beta xcoeffs = [-x for x in xcoeffs] (basis,lookup,nlookup,coeffs) = self.getBasis(total, xcoeffs, contins, coeff_names) | (basis,lookup,nlookup,coeffs) = self.getBasis(total, xcoeffs, contins, coeff_names, tr_values) | def __call__(self,classifier,examples, buckets): if classifier.model['kernel_type'] != 0: raise "Use SVM with a linear kernel." if classifier.model["svm_type"] != 0: raise "Use ordinary SVM classification." if classifier.model["nr_class"] != 2: raise "This is not SVM with a binary class." | d5d765a106ee2fda0789f07a6a122d52f838cef9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/d5d765a106ee2fda0789f07a6a122d52f838cef9/orngLinVis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1106,
1251,
16,
16858,
16,
9169,
4672,
309,
14622,
18,
2284,
3292,
8111,
67,
723,
3546,
480,
374,
30,
1002,
315,
3727,
348,
7397,
598,
279,
9103,
5536,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1106,
1251,
16,
16858,
16,
9169,
4672,
309,
14622,
18,
2284,
3292,
8111,
67,
723,
3546,
480,
374,
30,
1002,
315,
3727,
348,
7397,
598,
279,
9103,
5536,
1... |
os.path.join(datadir, 'input', | join_path(datadir, 'input', | def test(self): """Process self.configfile.""" os.chdir(testroot) # Keyword parameters for publish_file: params = {} # Initialize 'settings_overrides' for test settings scripts, # and disable configuration files: params['settings_overrides'] = {'_disable_config': 1} # Read the variables set in the default config file and in # the current config file into params: execfile(os.path.join(datadir, 'tests', '_default.py'), params) execfile(self.configfile, params) # Check for required settings: assert params.has_key('test_source'),\ "No 'test_source' supplied in " + self.configfile assert params.has_key('test_destination'),\ "No 'test_destination' supplied in " + self.configfile # Set source_path and destination_path if not given: params.setdefault('source_path', os.path.join(datadir, 'input', params['test_source'])) # Path for actual output: params.setdefault('destination_path', os.path.join(datadir, 'output', params['test_destination'])) # Path for expected output: expected_path = os.path.join(datadir, 'expected', params['test_destination']) # test_source and test_destination aren't needed any more: del params['test_source'] del params['test_destination'] # Delete private stuff like params['__builtins__']: for key in params.keys(): if key.startswith('_'): del params[key] # Get output (automatically written to the output/ directory # by publish_file): output = docutils.core.publish_file(**params) # Get the expected output *after* writing the actual output. self.assert_(os.access(expected_path, os.R_OK),\ 'Cannot find expected output at\n' + expected_path) expected = open(expected_path).read() diff = ('Please compare the expected and actual output files:\n' 'diff %s %s\n' % (expected_path, params['destination_path'])) try: self.assertEquals(output, expected, diff) except AssertionError: if hasattr(difflib, 'unified_diff'): # Generate diff if unified_diff available: diff = ''.join( difflib.unified_diff(expected.splitlines(1), output.splitlines(1), expected_path, params['destination_path'])) print >>sys.stderr, '\n%s:' % (self,) print >>sys.stderr, diff raise | 36f9ba70826be2f0223ad8b9ec37fa8788a7569f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/36f9ba70826be2f0223ad8b9ec37fa8788a7569f/test_functional.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
12,
2890,
4672,
3536,
2227,
365,
18,
1425,
768,
12123,
1140,
18,
343,
1214,
12,
3813,
3085,
13,
468,
18317,
1472,
364,
3808,
67,
768,
30,
859,
273,
2618,
468,
9190,
296,
4272,
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,
1842,
12,
2890,
4672,
3536,
2227,
365,
18,
1425,
768,
12123,
1140,
18,
343,
1214,
12,
3813,
3085,
13,
468,
18317,
1472,
364,
3808,
67,
768,
30,
859,
273,
2618,
468,
9190,
296,
4272,
67... |
for c, v in zip(self.dbcolumnnames, values): | for c, t, v in zip(self.dbcolumnnames, self.dbcolumntypes, values): if t == "ilwd:char": v = ilwd.get_ilwdchar(v) | def row_from_cols(self, values): """ Given an iterable of values in the order of columns in the database, construct and return a row object. This is a convenience function for turning the results of database queries into Python objects. """ row = self.RowType() for c, v in zip(self.dbcolumnnames, values): setattr(row, c, v) return row | 59884e457077559377fe07954d7fdf18e9210260 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3589/59884e457077559377fe07954d7fdf18e9210260/dbtables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1027,
67,
2080,
67,
6842,
12,
2890,
16,
924,
4672,
3536,
16803,
392,
6087,
434,
924,
316,
326,
1353,
434,
2168,
316,
326,
2063,
16,
4872,
471,
327,
279,
1027,
733,
18,
225,
1220,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1027,
67,
2080,
67,
6842,
12,
2890,
16,
924,
4672,
3536,
16803,
392,
6087,
434,
924,
316,
326,
1353,
434,
2168,
316,
326,
2063,
16,
4872,
471,
327,
279,
1027,
733,
18,
225,
1220,
353,
... |
result = -2147221231 | def DllGetClassObject(rclsid, riid, ppv): # First ask ctypes.com.server than comtypes.server for the # class object. | 09a6f6aad26ddda9a8b8ffe186fb48d4235e7e0d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/09a6f6aad26ddda9a8b8ffe186fb48d4235e7e0d/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
463,
2906,
967,
797,
921,
12,
86,
6429,
350,
16,
12347,
350,
16,
8228,
90,
4672,
468,
5783,
6827,
6983,
18,
832,
18,
3567,
2353,
532,
2352,
18,
3567,
364,
326,
468,
667,
733,
18,
2,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
463,
2906,
967,
797,
921,
12,
86,
6429,
350,
16,
12347,
350,
16,
8228,
90,
4672,
468,
5783,
6827,
6983,
18,
832,
18,
3567,
2353,
532,
2352,
18,
3567,
364,
326,
468,
667,
733,
18,
2,
... | |
if request.method == 'POST': if(not id): form = TrainingForm(request.POST) if form.is_valid(): new_form = form.save(commit=False) new_form.id = request.POST['id'] new_form.save() form.save_m2m() return HttpResponse("1") else: return HttpResponse("0") else: training = Training.objects.get(id=id) form = TrainingForm(request.POST, instance = training) if form.is_valid(): form.save() return HttpResponse("1") else: return HttpResponse("0") | if request.method == 'POST': if(not id): form = TrainingForm(request.POST) if form.is_valid(): new_form = form.save(commit=False) new_form.id = request.POST['id'] new_form.save() form.save_m2m() return HttpResponse("1") else: return HttpResponse("0") else: training = Training.objects.get(id=id) form = TrainingForm(request.POST, instance = training) if form.is_valid(): form.save() return HttpResponse("1") else: return HttpResponse("0") | def save_training_offline(request, id): if request.method == 'POST': if(not id): form = TrainingForm(request.POST) if form.is_valid(): new_form = form.save(commit=False) new_form.id = request.POST['id'] new_form.save() form.save_m2m() return HttpResponse("1") else: return HttpResponse("0") else: training = Training.objects.get(id=id) form = TrainingForm(request.POST, instance = training) if form.is_valid(): form.save() #form.save_m2m() return HttpResponse("1") else: return HttpResponse("0") | 7759d6eb08a7e6568691e648ed314450c8afa48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11995/7759d6eb08a7e6568691e648ed314450c8afa48e/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
17584,
67,
23787,
12,
2293,
16,
612,
4672,
309,
590,
18,
2039,
422,
296,
3798,
4278,
309,
12,
902,
612,
4672,
646,
273,
25676,
1204,
12,
2293,
18,
3798,
13,
309,
646,
18,
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,
1923,
67,
17584,
67,
23787,
12,
2293,
16,
612,
4672,
309,
590,
18,
2039,
422,
296,
3798,
4278,
309,
12,
902,
612,
4672,
646,
273,
25676,
1204,
12,
2293,
18,
3798,
13,
309,
646,
18,
2... |
ddbb_host = configuration.getValue("pytraining","prf_ddbbhost") ddbb = configuration.getValue("pytraining","prf_ddbbname") ddbb_user = configuration.getValue("pytraining","prf_ddbbuser") ddbb_pass = configuration.getValue("pytraining","prf_ddbbpass") self.ddbbObject = Sql(ddbb_host,ddbb,ddbb_user,ddbb_pass,configuration) | ddbb_host = self.configuration.getValue("pytraining","prf_ddbbhost") ddbb = self.configuration.getValue("pytraining","prf_ddbbname") ddbb_user = self.configuration.getValue("pytraining","prf_ddbbuser") ddbb_pass = self.configuration.getValue("pytraining","prf_ddbbpass") self.ddbbObject = Sql(ddbb_host,ddbb,ddbb_user,ddbb_pass,self.configuration) | def __init__(self, configuration, pytrainer_main=None): self.pytrainer_main = pytrainer_main self.configuration = configuration self.ddbb_type = configuration.getValue("pytraining","prf_ddbb") if self.ddbb_type == "mysql": #TODO no longer supported? from mysqlUtils import Sql else: from sqliteUtils import Sql | 513f7d866dce05940de45a8915a8e04519d9bb2f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11865/513f7d866dce05940de45a8915a8e04519d9bb2f/ddbb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1664,
16,
2395,
313,
1521,
67,
5254,
33,
7036,
4672,
365,
18,
2074,
313,
1521,
67,
5254,
273,
2395,
313,
1521,
67,
5254,
365,
18,
7025,
273,
1664,
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,
1664,
16,
2395,
313,
1521,
67,
5254,
33,
7036,
4672,
365,
18,
2074,
313,
1521,
67,
5254,
273,
2395,
313,
1521,
67,
5254,
365,
18,
7025,
273,
1664,
365,
... |
if not is_unavailable_exception(e): self.assertTrue(e.headers.get("X-exception") is None) self.assertTrue(e.headers.get("X-traceback") is None) | self.assertTrue(e.headers.get("X-exception") is None) self.assertTrue(e.headers.get("X-traceback") is None) | def test_fail_no_info(self): # use the broken message class SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.MessageClass = FailingMessageClass | 80e2d701322fcd5f12786e79e34969ddd3fbc268 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/80e2d701322fcd5f12786e79e34969ddd3fbc268/test_xmlrpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
6870,
67,
2135,
67,
1376,
12,
2890,
4672,
468,
999,
326,
12933,
883,
667,
4477,
4201,
8087,
2081,
18,
5784,
4201,
8087,
28773,
18,
1079,
797,
273,
8911,
310,
1079,
797,
2,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
6870,
67,
2135,
67,
1376,
12,
2890,
4672,
468,
999,
326,
12933,
883,
667,
4477,
4201,
8087,
2081,
18,
5784,
4201,
8087,
28773,
18,
1079,
797,
273,
8911,
310,
1079,
797,
2,
-1... |
if not query: u = Group.objects.all() else: u = Group.objects.filter(name__istartswith=query) | u = Group.objects.all() if query: q = Q(name__istartswith=query) if request.GET.get('displayname', None): q = q | Q(display_name__istartswith=query) u = u.filter(q) | def group_list(request): """ Returns a list of all review groups. If the q parameter is passed, groups with a name beginning with the query value will be returned. """ # XXX Support "query" for backwards-compatibility until after 1.0. query = request.GET.get('q', request.GET.get('query', None)) if not query: u = Group.objects.all() else: u = Group.objects.filter(name__istartswith=query) return WebAPIResponse(request, { 'groups': u, }) | 245ab23f3afdc8fce9443e5b1a01fa39bd62e0e5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1600/245ab23f3afdc8fce9443e5b1a01fa39bd62e0e5/json.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1041,
67,
1098,
12,
2293,
4672,
3536,
2860,
279,
666,
434,
777,
10725,
3252,
18,
225,
971,
326,
1043,
1569,
353,
2275,
16,
3252,
598,
279,
508,
8435,
598,
326,
843,
460,
903,
506,
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,
1041,
67,
1098,
12,
2293,
4672,
3536,
2860,
279,
666,
434,
777,
10725,
3252,
18,
225,
971,
326,
1043,
1569,
353,
2275,
16,
3252,
598,
279,
508,
8435,
598,
326,
843,
460,
903,
506,
2106... |
converter = ConverterRegistry.get(mimetype) | try: converter = ConverterRegistry.get(mimetype) except: converter = False | def _fileitemkeywords(self, lang): """ """ res = '' if txng_converters: fileitem = self.getFileItem(lang) data = str(fileitem.get_data()) mimetype, encoding = guess_content_type(self.getId(), data) converter = ConverterRegistry.get(mimetype) if converter: try: res, encoding = converter.convert2(data, encoding, mimetype) except: try: res = converter.convert(data) except: pass return res | 833184394506ff1e9470586894ee98ff62c3da12 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3287/833184394506ff1e9470586894ee98ff62c3da12/NyExFile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
768,
1726,
11771,
12,
2890,
16,
3303,
4672,
3536,
3536,
400,
273,
875,
309,
2229,
3368,
67,
15747,
87,
30,
585,
1726,
273,
365,
18,
29925,
1180,
12,
4936,
13,
501,
273,
609,
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,
389,
768,
1726,
11771,
12,
2890,
16,
3303,
4672,
3536,
3536,
400,
273,
875,
309,
2229,
3368,
67,
15747,
87,
30,
585,
1726,
273,
365,
18,
29925,
1180,
12,
4936,
13,
501,
273,
609,
12,
... |
str += '<TR><TD WIDTH="15%">\n'+\ ' <B><I>'+self._link_to_href(link)+\ '</I></B></TD>\n <TD>' + csum + '</TD></TR>\n' return str + '</TABLE><p>\n\n' | str += '<tr><td width="15%">\n' str += ' <b><i>'+self._link_to_href(link) str += '</i></b></td>\n <td>' + csum + '</td></tr>\n' return str + '</table><br>\n\n' def _func_signature(self, fname, fdoc, cssclass="sig"): """ Return HTML for a signature of the given function """ str = '<b><code class=%s>' % cssclass str += '<span class=%s-name>%s</span>(' % (cssclass, fname) for param in fdoc.parameters(): str += '<span class=%s-arg>%s</span>' % (cssclass, param.name()) if param.default(): default = param.default() if len(default) > 60: default = default[:57]+'...' str += '=<span class=%s-default>%s</span>' % (cssclass, default) str += ', ' if fdoc.vararg(): str += '<span class=%s-vararg>*%s</span>, ' % (cssclass, fdoc.vararg().name()) if fdoc.kwarg(): str += '<span class=%s-kwarg>**%s</span>, ' % (cssclass, fdoc.kwarg().name()) if str[-1] != '(': str = str[:-2] return str + ')</code></b>' | def _class_summary(self, classes, heading='Class Summary'): 'Return a summary of the classes in a module' classes = self._sort(classes) if len(classes) == 0: return '' str = self._table_header(heading, 'summary') | 1b52b16120989cc834166571a9a1e9b8676d968f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/1b52b16120989cc834166571a9a1e9b8676d968f/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1106,
67,
7687,
12,
2890,
16,
3318,
16,
11053,
2218,
797,
17967,
11,
4672,
296,
990,
279,
4916,
434,
326,
3318,
316,
279,
1605,
11,
3318,
273,
365,
6315,
3804,
12,
4701,
13,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1106,
67,
7687,
12,
2890,
16,
3318,
16,
11053,
2218,
797,
17967,
11,
4672,
296,
990,
279,
4916,
434,
326,
3318,
316,
279,
1605,
11,
3318,
273,
365,
6315,
3804,
12,
4701,
13,
309,
... |
raise osv.except_osv("Error", "Camapign cannot be done before all segments are done") | raise osv.except_osv("Error", "Campaign cannot be marked as done before all segments are done") | def state_done_set(self, cr, uid, ids, *args): segment_ids = self.pool.get('marketing.campaign.segment').search(cr, uid, [('campaign_id', 'in', ids), ('state', '=', 'running')]) if segment_ids : raise osv.except_osv("Error", "Camapign cannot be done before all segments are done") self.write(cr, uid, ids, {'state': 'done'}) return True | 4760a832f354437350b06aae5ddce4f88aa00f51 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4760a832f354437350b06aae5ddce4f88aa00f51/marketing_campaign.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
919,
67,
8734,
67,
542,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
380,
1968,
4672,
3267,
67,
2232,
273,
365,
18,
6011,
18,
588,
2668,
3355,
21747,
18,
14608,
18,
9273,
16063,
3072,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
919,
67,
8734,
67,
542,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
380,
1968,
4672,
3267,
67,
2232,
273,
365,
18,
6011,
18,
588,
2668,
3355,
21747,
18,
14608,
18,
9273,
16063,
3072,
... |
svd = lapack_dgesvd(a=a.transpose().as_flex_double_matrix()) | svd = lapack_dgesvd_fem(a=a.transpose().as_flex_double_matrix()) | def get_sigma(svd, m, n): elems = [0.] * (m*n) for i in xrange(min(m,n)): elems[i*n+i] = svd.s[i] return matrix.rec(elems=elems, n=(m,n)) | 6622124d89730965de913fdc3204bb8a9666f31c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/6622124d89730965de913fdc3204bb8a9666f31c/tst_lapack_dgesvd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
13201,
12,
5751,
72,
16,
312,
16,
290,
4672,
14733,
273,
306,
20,
18,
65,
380,
261,
81,
14,
82,
13,
364,
277,
316,
12314,
12,
1154,
12,
81,
16,
82,
3719,
30,
14733,
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,
336,
67,
13201,
12,
5751,
72,
16,
312,
16,
290,
4672,
14733,
273,
306,
20,
18,
65,
380,
261,
81,
14,
82,
13,
364,
277,
316,
12314,
12,
1154,
12,
81,
16,
82,
3719,
30,
14733,
63,
... |
""" Return docstring for this unit. EXAMPLES:: sage: print units.area.acre._sage_doc_() Defined to be 10 square chains or 4840 square yards. Approximately equal to 4046.856 square meters. """ return unitdocs(self) | """ Return docstring for this unit. EXAMPLES:: sage: print units.area.acre._sage_doc_() Defined to be 10 square chains or 4840 square yards. Approximately equal to 4046.856 square meters. """ return unitdocs(self) | def _sage_doc_(self): | 36d2f28c044694ad73a4a70a9d869366d0e39ec4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/36d2f28c044694ad73a4a70a9d869366d0e39ec4/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
87,
410,
67,
2434,
67,
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,
... | [
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,
389,
87,
410,
67,
2434,
67,
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,
-... |
b[i] = tuple(list(b[i]) + ['?']*100) c = b[i] eul = format(c, 13) reg = format(c, 2) plan = format(c, 16) perf = format(c, 19) vtran = format(c, 12) etran = format(c, 15) | eul = multiple_replace(to_bool,'%s'%b[i][13]) reg = multiple_replace(to_bool,'%s'%b[i][2]) plan = multiple_replace(to_bool,'%s'%b[i][16]) perf = multiple_replace(to_bool,'%s'%b[i][19]) vtran = multiple_replace(to_bool,'%s'%b[i][12]) etran = multiple_replace(to_bool,'%s'%b[i][15]) | def display_properties(self, properties=None, layout='circular', query=None, graph6=None, \ num_vertices=None, num_edges=None, num_cycles=None, num_hamiltonian_cycles=None, \ eulerian=None, planar=None, perfect=None, lovasz_number=None, \ complement_graph6=None, aut_grp_size=None, num_orbits=None, \ num_fixed_points=None, vertex_transitive=None, edge_transitive=None, \ degree_sequence=None, min_degree=None, max_degree=None, \ average_degree=None, degrees_sd=None, regular=None, \ vertex_connectivity=None, edge_connectivity=None, \ num_components=None, girth=None, radius=None, diameter=None, \ clique_number=None, independence_number=None, num_cut_vertices=None, \ min_vertex_cover_size=None, num_spanning_trees=None, \ induced_subgraphs=None, spectrum=None, min_eigenvalue=None, \ max_eigenvalue=None, eigenvalues_sd=None, energy=None): r""" Displays the results of a query in a table, including all specified properties and an image for each graph. | d2e8907302b58a50596391405ac97f7450c43896 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/d2e8907302b58a50596391405ac97f7450c43896/graph_database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
4738,
12,
2890,
16,
1790,
33,
7036,
16,
3511,
2218,
11614,
9559,
2187,
843,
33,
7036,
16,
2667,
26,
33,
7036,
16,
521,
818,
67,
17476,
33,
7036,
16,
818,
67,
8746,
33,
7036... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
4738,
12,
2890,
16,
1790,
33,
7036,
16,
3511,
2218,
11614,
9559,
2187,
843,
33,
7036,
16,
2667,
26,
33,
7036,
16,
521,
818,
67,
17476,
33,
7036,
16,
818,
67,
8746,
33,
7036... |
self.expand_filelist_and_load_image(self.recentfiles[index]) | self.expand_filelist_and_load_image(filelist) | def recent_action_click(self, action): self.stop_now = True while gtk.events_pending(): gtk.main_iteration() cancel = self.autosave_image() if cancel == True: return index = int(action.get_name()) if os.path.isfile(self.recentfiles[index][0]) or os.path.exists(self.recentfiles[index][0]): self.recursive = self.recentfiles_recurse[index] self.expand_filelist_and_load_image(self.recentfiles[index]) else: self.image_list = [] self.curr_img_in_list = 0 self.image_list.append(self.recentfiles[index][0]) self.image_load_failed(False) self.recent_file_remove_and_refresh(index) | 3c40e11583b42ab77117119bbbf7456c6be57456 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2291/3c40e11583b42ab77117119bbbf7456c6be57456/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8399,
67,
1128,
67,
7475,
12,
2890,
16,
1301,
4672,
365,
18,
5681,
67,
3338,
273,
1053,
1323,
22718,
18,
5989,
67,
9561,
13332,
22718,
18,
5254,
67,
16108,
1435,
3755,
273,
365,
18,
21... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8399,
67,
1128,
67,
7475,
12,
2890,
16,
1301,
4672,
365,
18,
5681,
67,
3338,
273,
1053,
1323,
22718,
18,
5989,
67,
9561,
13332,
22718,
18,
5254,
67,
16108,
1435,
3755,
273,
365,
18,
21... |
del context['__last_update'] | context.pop('__last_update', None) | def write(self, cr, user, ids, vals, context=None): if context: del context['__last_update'] return super(ir_model,self).write(cr, user, ids, vals, context) | 0d6d1c4c6d6df5b4e43a8f035f26744b781390e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/0d6d1c4c6d6df5b4e43a8f035f26744b781390e6/ir_model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
4422,
16,
729,
16,
3258,
16,
5773,
16,
819,
33,
7036,
4672,
309,
819,
30,
819,
18,
5120,
2668,
972,
2722,
67,
2725,
2187,
599,
13,
327,
2240,
12,
481,
67,
2284,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
4422,
16,
729,
16,
3258,
16,
5773,
16,
819,
33,
7036,
4672,
309,
819,
30,
819,
18,
5120,
2668,
972,
2722,
67,
2725,
2187,
599,
13,
327,
2240,
12,
481,
67,
2284,
... |
"Return the end of the substring matched by group g" | """end([group=0]) -> int or None Return the indices of the end of the substring matched by group; group defaults to zero (meaning the whole matched substring). Return None if group exists but did not contribute to the match. """ | def end(self, g = 0): "Return the end of the substring matched by group g" if type(g) == type(''): try: g = self.re.groupindex[g] except (KeyError, TypeError): raise IndexError, 'group %s is undefined' % `g` return self.regs[g][1] | e6c8af476c85446f800a2bcad96d979cbf3dcfc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/e6c8af476c85446f800a2bcad96d979cbf3dcfc0/re.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
12,
2890,
16,
314,
273,
374,
4672,
3536,
409,
3816,
1655,
33,
20,
5717,
317,
509,
578,
599,
225,
2000,
326,
4295,
434,
326,
679,
434,
326,
3019,
4847,
635,
1041,
31,
1041,
3467,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
12,
2890,
16,
314,
273,
374,
4672,
3536,
409,
3816,
1655,
33,
20,
5717,
317,
509,
578,
599,
225,
2000,
326,
4295,
434,
326,
679,
434,
326,
3019,
4847,
635,
1041,
31,
1041,
3467,
... |
@dbus.service.method(PDS_IFACE, in_signature='', out_signature='') | def wake_up (self): global waitloop, runloop, jobmanager do_imports () if jobmanager == None: waitloop.quit () runloop = gobject.MainLoop () jobmanager = JobManager(bus, runloop, service_running=service_running, trayicon=trayicon, suppress_icon_hide=True) | c5463cba9fb1b9ca3aff9989e954ec45a128dd21 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1682/c5463cba9fb1b9ca3aff9989e954ec45a128dd21/printer-applet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19891,
67,
416,
261,
2890,
4672,
2552,
2529,
6498,
16,
1086,
6498,
16,
1719,
4181,
741,
67,
21350,
1832,
309,
1719,
4181,
422,
599,
30,
2529,
6498,
18,
27176,
1832,
1086,
6498,
273,
314,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19891,
67,
416,
261,
2890,
4672,
2552,
2529,
6498,
16,
1086,
6498,
16,
1719,
4181,
741,
67,
21350,
1832,
309,
1719,
4181,
422,
599,
30,
2529,
6498,
18,
27176,
1832,
1086,
6498,
273,
314,... | |
shutil.rmtree(base_path, ignore_errors=True) | def _create_and_do_getcwd(dirname, current_path_length = 0): try: os.mkdir(dirname) except: raise unittest.SkipTest, "mkdir cannot create directory sufficiently deep for getcwd test" | b0c828ae4a18591b135357c47b1baeecb02f3a5e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/b0c828ae4a18591b135357c47b1baeecb02f3a5e/test_posix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
464,
67,
2896,
67,
588,
11089,
12,
12287,
16,
783,
67,
803,
67,
2469,
273,
374,
4672,
775,
30,
1140,
18,
26686,
12,
12287,
13,
1335,
30,
1002,
2836,
3813,
18,
6368,
47... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
2640,
67,
464,
67,
2896,
67,
588,
11089,
12,
12287,
16,
783,
67,
803,
67,
2469,
273,
374,
4672,
775,
30,
1140,
18,
26686,
12,
12287,
13,
1335,
30,
1002,
2836,
3813,
18,
6368,
47... | |
'invoice_line_tax_id': [(6,0,taxes)], | 'invoice_line_tax_id': [(6,0,val['value']['invoice_line_tax_id'])], | def _createInvoices(self, cr, uid, data, context={}): list_inv = [] pool_obj = pooler.get_pool(cr.dbname) obj_sale = pool_obj.get('sale.order') data_sale = obj_sale.browse(cr,uid,data['ids']) obj_lines=pool_obj.get('account.invoice.line') for sale in data_sale: address_contact = False address_invoice = False create_ids = [] ids_inv = [] val = obj_lines.product_id_change(cr, uid, [], data['form']['product_id'],uom =False, partner_id=sale.partner_id.id) taxes = [] taxes = pool_obj.get('product.product').browse(cr,uid,data['form']['product_id']).taxes_id line_id =obj_lines.create(cr, uid, { 'name': val['value']['name'], 'account_id':val['value']['account_id'], 'price_unit': data['form']['amount'], 'quantity': 1, 'discount': False, 'uos_id': val['value']['uos_id'], 'product_id':data['form']['product_id'], 'invoice_line_tax_id': [(6,0,taxes)], 'note':'', }) create_ids.append(line_id) inv = { 'name': sale.name, 'origin': sale.name, 'type': 'out_invoice', 'reference': False, 'account_id': sale.partner_id.property_account_receivable.id, 'partner_id': sale.partner_id.id, 'address_invoice_id':sale.partner_invoice_id.id, 'address_contact_id':sale.partner_order_id.id, 'invoice_line': [(6,0,create_ids)], 'currency_id' :sale.partner_id.property_product_pricelist.currency_id.id, 'comment': '', 'payment_term':sale.partner_id.property_payment_term.id, } inv_obj = pool_obj.get('account.invoice') inv_id = inv_obj.create(cr, uid, inv) for inv in sale.invoice_ids: ids_inv.append(inv.id) ids_inv.append(inv_id) obj_sale.write(cr,uid,sale.id,{'invoice_ids':[(6,0,ids_inv)]}) list_inv.append(inv_id) return {'invoice_ids':list_inv} | 267468717da739a52860cf870d24eb94870ccf75 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7339/267468717da739a52860cf870d24eb94870ccf75/make_invoice_advance.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
3605,
17725,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
12938,
4672,
666,
67,
5768,
273,
5378,
2845,
67,
2603,
273,
2845,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2640,
3605,
17725,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
12938,
4672,
666,
67,
5768,
273,
5378,
2845,
67,
2603,
273,
2845,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
... |
current = current.get(folder, None) if current is None: | next = current.get(folder, None) if next is None: | def importcsvStep(context): """This step give you a way to import content in your website with csvreplicata. How it works: read replicata.cfg file to load configuration read replicata.csv and call csvreplicata with the config. Config: [replicable_types] #List schemata for each types you want to import #Folder : default, categorization, dates, ownership, settings #News Item : default Document: default [settings] #list here every csv settings that will be given to replicator.importcsv encoding:utf-8 delimiter:, stringdelimiter:" datetimeformat:%d/%m/%Y wf_transition = publish conflict_winner:SERVER """ replicatacfg = context.openDataFile('replicata.cfg') replicatacsv = context.openDataFile('replicata.csv') if replicatacfg is None or replicatacsv is None: return site = context.getSite() wftool = getToolByName(site, 'portal_workflow') csvreplicatatool = getToolByName(site, 'portal_csvreplicatatool') # save existents user settings old_replicabletypes_settings = csvreplicatatool.replicabletypes #get import settings Config = ConfigParser.ConfigParser() #defaults system of configparser just sucks, so set values Config.add_section("replicable_types") Config.add_section("settings") Config.set("replicable_types", "Folder","default") Config.set("replicable_types", "Document","default") Config.set("settings", "encoding","utf-8") Config.set("settings", "delimiter",",") Config.set("settings", "stringdelimiter",'"') Config.set("settings", "datetimeformat","%d/%m/%Y") Config.set("settings", "wf_transition", "publish") Config.set("settings", "conflict_winner","SERVER") Config.set("settings", "global_path","") Config.read(replicatacfg.name) options = Config.items('replicable_types', raw=True) replicable_types = {} for option in options: replicable_types[option[0].title()] = option[1].split(',') csvreplicatatool.replicabletypes = replicable_types #build kwargs of csvimport method. kwargs = {} wf_transition = Config.get('settings', 'wf_transition') kwargs['wf_transition'] = wf_transition datetimeformat = Config.get('settings', 'datetimeformat') kwargs['datetimeformat'] = datetimeformat delimiter = Config.get('settings', 'delimiter') kwargs['delimiter'] = delimiter stringdelimiter = Config.get('settings', 'stringdelimiter') kwargs['stringdelimiter'] = stringdelimiter encoding = Config.get('settings', 'encoding') kwargs['encoding'] = encoding conflict_winner = Config.get('settings', 'conflict_winner') kwargs['conflict_winner'] = conflict_winner wf_transition = Config.get('settings', 'wf_transition') kwargs['wf_transition'] = wf_transition #retrive context: global_path = Config.get('settings', 'global_path') try: folder = site.restrictedTraverse(global_path) except KeyError: folders = global_path.split('/') current = site for folder in folders: if not folder: continue current = current.get(folder, None) if current is None: try: current.invokeFactory('Folder', folder) finally: current = current.get(folder) current.reindexObject() folder = current # now import alsoProvides(folder, ICSVReplicable) replicator = Icsvreplicata(folder) replicator.csvimport(replicatacsv, **kwargs) # restore replicabletypes user settings csvreplicatatool.replicabletypes = old_replicabletypes_settings | 20a7efe6e6ef1090abc5cc069c570eb2fb6f2da3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11226/20a7efe6e6ef1090abc5cc069c570eb2fb6f2da3/setuphandlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
6715,
4160,
12,
2472,
4672,
3536,
2503,
2235,
8492,
1846,
279,
4031,
358,
1930,
913,
316,
3433,
12504,
598,
6101,
266,
1780,
396,
18,
225,
9017,
518,
6330,
30,
855,
14447,
396,
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,
1930,
6715,
4160,
12,
2472,
4672,
3536,
2503,
2235,
8492,
1846,
279,
4031,
358,
1930,
913,
316,
3433,
12504,
598,
6101,
266,
1780,
396,
18,
225,
9017,
518,
6330,
30,
855,
14447,
396,
18,... |
def onSuccess(result): | def _onSuccess(result): | def onSuccess(result): if type(result) != list and len(result) != 2: self.logger.error('Imaging: Couldn\'t set default entry on %s for %s : %s' % (num, computerUUID, str(result))) ret = False elif not result[0]: self.logger.error('Imaging: Couldn\'t set default entry on %s for %s : %s' % (num, computerUUID, str(result))) ret = False else: self.logger.error('Imaging: Couldn\'t set default entry on %s for %s : %s' % (num, computerUUID, str(result))) ret = True return ret | 9243f98ba17d3c22702ab69f4700cc04c9ed9c91 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5988/9243f98ba17d3c22702ab69f4700cc04c9ed9c91/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
265,
4510,
12,
2088,
4672,
309,
618,
12,
2088,
13,
480,
666,
471,
562,
12,
2088,
13,
480,
576,
30,
365,
18,
4901,
18,
1636,
2668,
1170,
5755,
30,
14312,
82,
3730,
88,
444,
805,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
265,
4510,
12,
2088,
4672,
309,
618,
12,
2088,
13,
480,
666,
471,
562,
12,
2088,
13,
480,
576,
30,
365,
18,
4901,
18,
1636,
2668,
1170,
5755,
30,
14312,
82,
3730,
88,
444,
805,
... |
self.putline(self._vardecl(var)) | decl = self._vardecl(var) if decl: self.putline(decl) | self.putline("def %s(%s):" % (fun.functionname, params)) | 29ef93ecf8a207ed3c64e93ed351574f5c3435e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/29ef93ecf8a207ed3c64e93ed351574f5c3435e4/genpyrex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
365,
18,
458,
1369,
2932,
536,
738,
87,
9275,
87,
13,
2773,
738,
261,
12125,
18,
915,
529,
16,
859,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
365,
18,
458,
1369,
2932,
536,
738,
87,
9275,
87,
13,
2773,
738,
261,
12125,
18,
915,
529,
16,
859,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
st = self.stream.Status() host = macdnr.AddrToStr(st.localHost) return host, st.localPort | host, port = self.stream.GetSockName() host = macdnr.AddrToStr(host) return host, port | def getsockname(self): st = self.stream.Status() host = macdnr.AddrToStr(st.localHost) return host, st.localPort | 6ee45cb8532e7bfa2e107bd9f039591d52dc3552 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/6ee45cb8532e7bfa2e107bd9f039591d52dc3552/socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5571,
975,
529,
12,
2890,
4672,
1479,
16,
1756,
273,
365,
18,
3256,
18,
967,
55,
975,
461,
1435,
1479,
273,
5318,
5176,
86,
18,
3178,
774,
1585,
12,
2564,
13,
327,
1479,
16,
1756,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5571,
975,
529,
12,
2890,
4672,
1479,
16,
1756,
273,
365,
18,
3256,
18,
967,
55,
975,
461,
1435,
1479,
273,
5318,
5176,
86,
18,
3178,
774,
1585,
12,
2564,
13,
327,
1479,
16,
1756,
22... |
elif self.dicts[i]['SPol'] == 'down' or self.dicts[i]['SPol'] == 'poordown': | phase_compu += "U" elif self.dicts[i]['SPol'] == 'poorup': Sub(pick, "polarity").text = 'positive' phase_compu += "+" elif self.dicts[i]['SPol'] == 'down': | def hyp20002XML(self): """ Returns output of hypo2000 as xml file """ xml = Element("event") Sub(Sub(xml, "event_id"), "value").text = self.xmlEventID Sub(Sub(xml, "event_type"), "value").text = "manual" # we save P picks on Z-component and S picks on N-component # XXX standard values for unset keys!!!???!!!??? epidists = [] for i in range(len(self.streams)): if self.dicts[i].has_key('P'): pick = Sub(xml, "pick") wave = Sub(pick, "waveform") wave.set("networkCode", self.streams[i][0].stats.network) wave.set("stationCode", self.streams[i][0].stats.station) wave.set("channelCode", self.streams[i][0].stats.channel) wave.set("locationCode", "") date = Sub(pick, "time") # prepare time of pick picktime = self.streams[i][0].stats.starttime picktime += (self.dicts[i]['P'] / self.streams[i][0].stats.sampling_rate) Sub(date, "value").text = picktime.isoformat() # + '.%06i' % picktime.microsecond) if self.dicts[i].has_key('PErr1') and self.dicts[i].has_key('PErr2'): temp = float(self.dicts[i]['PErr2'] - self.dicts[i]['PErr1']) temp /= self.streams[i][0].stats.sampling_rate Sub(date, "uncertainty").text = str(temp) else: Sub(date, "uncertainty") Sub(pick, "phaseHint").text = "P" if self.dicts[i].has_key('POnset'): Sub(pick, "onset").text = self.dicts[i]['POnset'] else: Sub(pick, "onset") if self.dicts[i].has_key('PPol'): if self.dicts[i]['PPol'] == 'up' or self.dicts[i]['PPol'] == 'poorup': Sub(pick, "polarity").text = 'positive' elif self.dicts[i]['PPol'] == 'down' or self.dicts[i]['PPol'] == 'poordown': Sub(pick, "polarity").text = 'negative' else: Sub(pick, "polarity") if self.dicts[i].has_key('PWeight'): Sub(pick, "weight").text = '%i' % self.dicts[i]['PWeight'] else: Sub(pick, "weight") Sub(Sub(pick, "min_amp"), "value") #XXX what is min_amp??? if self.dicts[i].has_key('Psynth'): Sub(pick, "phase_compu").text #XXX this is redundant. can be constructed from above info Sub(Sub(pick, "phase_res"), "value").text = '%s' % self.dicts[i]['Pres'] Sub(Sub(pick, "phase_weight"), "value").text = '%s' % self.dicts[i]['PsynthWeight'] Sub(Sub(pick, "phase_delay"), "value") Sub(Sub(pick, "azimuth"), "value").text = '%s' % self.dicts[i]['PAzim'] Sub(Sub(pick, "incident"), "value").text = '%s' % self.dicts[i]['PInci'] Sub(Sub(pick, "epi_dist"), "value").text = '%s' % self.dicts[i]['distEpi'] Sub(Sub(pick, "hyp_dist"), "value").text = '%s' % self.dicts[i]['distHypo'] if self.dicts[i].has_key('S'): axind = self.dicts[i]['Saxind'] pick = Sub(xml, "pick") wave = Sub(pick, "waveform") wave.set("networkCode", self.streams[i][axind].stats.network) wave.set("stationCode", self.streams[i][axind].stats.station) wave.set("channelCode", self.streams[i][axind].stats.channel) wave.set("locationCode", "") date = Sub(pick, "time") # prepare time of pick picktime = self.streams[i][axind].stats.starttime picktime += (self.dicts[i]['S'] / self.streams[i][axind].stats.sampling_rate) Sub(date, "value").text = picktime.isoformat() # + '.%06i' % picktime.microsecond) if self.dicts[i].has_key('SErr1') and self.dicts[i].has_key('SErr2'): temp = float(self.dicts[i]['SErr2'] - self.dicts[i]['SErr1']) temp /= self.streams[i][axind].stats.sampling_rate Sub(date, "uncertainty").text = str(temp) else: Sub(date, "uncertainty") Sub(pick, "phaseHint").text = "S" if self.dicts[i].has_key('SOnset'): Sub(pick, "onset").text = self.dicts[i]['SOnset'] else: Sub(pick, "onset") if self.dicts[i].has_key('SPol'): if self.dicts[i]['SPol'] == 'up' or self.dicts[i]['SPol'] == 'poorup': Sub(pick, "polarity").text = 'positive' elif self.dicts[i]['SPol'] == 'down' or self.dicts[i]['SPol'] == 'poordown': Sub(pick, "polarity").text = 'negative' else: Sub(pick, "polarity") if self.dicts[i].has_key('SWeight'): Sub(pick, "weight").text = '%i' % self.dicts[i]['SWeight'] else: Sub(pick, "weight") Sub(Sub(pick, "min_amp"), "value") #XXX what is min_amp??? if self.dicts[i].has_key('Ssynth'): Sub(pick, "phase_compu").text #XXX this is redundant. can be constructed from above info Sub(Sub(pick, "phase_res"), "value").text = '%s' % self.dicts[i]['Sres'] Sub(Sub(pick, "phase_weight"), "value").text = '%s' % self.dicts[i]['SsynthWeight'] Sub(Sub(pick, "phase_delay"), "value") Sub(Sub(pick, "azimuth"), "value").text = '%s' % self.dicts[i]['SAzim'] Sub(Sub(pick, "incident"), "value").text = '%s' % self.dicts[i]['SInci'] Sub(Sub(pick, "epi_dist"), "value").text = '%s' % self.dicts[i]['distEpi'] Sub(Sub(pick, "hyp_dist"), "value").text = '%s' % self.dicts[i]['distHypo'] #XXX XXX XXX XXX check lines below and compare to e.g. # teide:8080/xml/seismology/event/baynet09_0641.xml # especially "earth_mod" could be set with meaningful value # read from hypo2000 output origin = Sub(xml, "origin") date = Sub(origin, "time") Sub(date, "value").text = self.EventTime.isoformat() # + '.%03i' % self.EventTime.microsecond Sub(date, "uncertainty") lat = Sub(origin, "latitude") Sub(lat, "value").text = '%s' % self.EventLat Sub(lat, "uncertainty").text = '%s' % self.EventErrY #XXX Lat Error in km??!! lon = Sub(origin, "longitude") Sub(lon, "value").text = '%s' % self.EventLon Sub(lon, "uncertainty").text = '%s' % self.EventErrX #XXX Lon Error in km??!! depth = Sub(origin, "depth") Sub(depth, "value").text = '%s' % self.EventZ Sub(depth, "uncertainty").text = '%s' % self.EventErrZ Sub(origin, "depth_type").text = "from location program" Sub(origin, "earth_mod").text = "STAUFEN" Sub(origin, "originUncertainty") quality = Sub(origin, "originQuality") Sub(quality, "P_usedPhaseCount").text = '%i' % self.PCount Sub(quality, "S_usedPhaseCount").text = '%i' % self.SCount Sub(quality, "usedPhaseCount").text = '%i' % (self.PCount + self.SCount) Sub(quality, "usedStationCount").text = '%i' % self.usedStationsCount Sub(quality, "associatedPhaseCount").text = '%i' % (self.PCount + self.SCount) Sub(quality, "associatedStationCount").text = '%i' % len(self.dicts) Sub(quality, "depthPhaseCount").text = "0" Sub(quality, "standardError").text = '%s' % self.EventStdErr Sub(quality, "secondaryAzimuthalGap").text = '%s' % self.EventAzimGap Sub(quality, "groundTruthLevel") Sub(quality, "minimumDistance").text = '%s' % self.epidistMin Sub(quality, "maximumDistance").text = '%s' % self.epidistMax Sub(quality, "medianDistance").text = '%s' % self.epidistMedian magnitude = Sub(xml, "magnitude") mag = Sub(magnitude, "mag") if np.isnan(self.netMag): Sub(mag, "value") Sub(mag, "uncertainty") else: Sub(mag, "value").text = '%s' % self.netMag Sub(mag, "uncertainty").text = '%s' % self.netMagVar Sub(magnitude, "type").text = "Ml" Sub(magnitude, "stationCount").text = '%i' % self.staMagCount for i in range(len(self.streams)): stationMagnitude = Sub(xml, "stationMagnitude") if self.dicts[i].has_key('Mag'): mag = Sub(stationMagnitude, 'mag') Sub(mag, 'value').text = '%s' % self.dicts[i]['Mag'] Sub(mag, 'uncertainty').text Sub(stationMagnitude, 'station').text = '%s' % self.dicts[i]['Station'] if self.dicts[i]['MagUse']: Sub(stationMagnitude, 'weight').text = '%s' % (1. / self.staMagCount) else: Sub(stationMagnitude, 'weight').text = '0' Sub(stationMagnitude, 'channels').text = '%s' % self.dicts[i]['MagChannel'] return tostring(xml,pretty_print=True,xml_declaration=True) | cdb296935764c4f637eb405e18bf7388bd815e22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/cdb296935764c4f637eb405e18bf7388bd815e22/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16117,
6976,
3103,
4201,
12,
2890,
4672,
3536,
2860,
876,
434,
16117,
83,
17172,
487,
2025,
585,
3536,
2025,
273,
225,
3010,
2932,
2575,
7923,
2592,
12,
1676,
12,
2902,
16,
315,
2575,
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,
16117,
6976,
3103,
4201,
12,
2890,
4672,
3536,
2860,
876,
434,
16117,
83,
17172,
487,
2025,
585,
3536,
2025,
273,
225,
3010,
2932,
2575,
7923,
2592,
12,
1676,
12,
2902,
16,
315,
2575,
67... |
else: | else: | def read(self,size=None): | f260fc87b610b3af9eb777202097d1d17f433f44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/f260fc87b610b3af9eb777202097d1d17f433f44/gzip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
1467,
33,
7036,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
12,
2890,
16,
1467,
33,
7036,
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,
... |
self._logger.notifyChannel('timers', LOG_DEBUG, "Job scheduled in %s seconds for %s.%s" % (wait, fn.im_class.__name__, fn.func_name)) | self._logger.notifyChannel('timers', LOG_DEBUG, "Job scheduled in %.3g seconds for %s.%s" % (wait, fn.im_class.__name__, fn.func_name)) | def setAlarm(self, fn, dt, db_name, *args, **kwargs): wait = dt - time.time() if wait > 0: self._logger.notifyChannel('timers', LOG_DEBUG, "Job scheduled in %s seconds for %s.%s" % (wait, fn.im_class.__name__, fn.func_name)) timer = threading.Timer(wait, fn, args, kwargs) timer.start() self._timers.setdefault(db_name, []).append(timer) | 90c035038f0e566f5d354f23d2b9bb79499637b7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/90c035038f0e566f5d354f23d2b9bb79499637b7/netsvc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
16779,
12,
2890,
16,
2295,
16,
3681,
16,
1319,
67,
529,
16,
380,
1968,
16,
2826,
4333,
4672,
2529,
273,
3681,
300,
813,
18,
957,
1435,
309,
2529,
405,
374,
30,
365,
6315,
4901,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16779,
12,
2890,
16,
2295,
16,
3681,
16,
1319,
67,
529,
16,
380,
1968,
16,
2826,
4333,
4672,
2529,
273,
3681,
300,
813,
18,
957,
1435,
309,
2529,
405,
374,
30,
365,
6315,
4901,
... |
return self.userCfg[configType].Get(section, option, type=type) | return self.userCfg[configType].Get(section, option, type=type, raw=raw) | def GetOption(self, configType, section, option, default=None, type=None, warn_on_default=True): """ Get an option value for given config type and given general configuration section/option or return a default. If type is specified, return as type. Firstly the user configuration is checked, with a fallback to the default configuration, and a final 'catch all' fallback to a useable passed-in default if the option isn't present in either the user or the default configuration. configType must be one of ('main','extensions','highlight','keys') If a default is returned, and warn_on_default is True, a warning is printed to stderr. | 137bf72d36922d72ff92fe5d6f7999dd74b8fae9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/137bf72d36922d72ff92fe5d6f7999dd74b8fae9/configHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
1895,
12,
2890,
16,
642,
559,
16,
2442,
16,
1456,
16,
805,
33,
7036,
16,
618,
33,
7036,
16,
1894,
67,
265,
67,
1886,
33,
5510,
4672,
3536,
968,
392,
1456,
460,
364,
864,
642,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
1895,
12,
2890,
16,
642,
559,
16,
2442,
16,
1456,
16,
805,
33,
7036,
16,
618,
33,
7036,
16,
1894,
67,
265,
67,
1886,
33,
5510,
4672,
3536,
968,
392,
1456,
460,
364,
864,
642,
... |
self.out = self.docinfo | self.push_output_collector(self.docinfo) | def visit_docinfo(self, node): self.out = self.docinfo | 6d0e673df8a8a162ea831fe884be17ae4ef52a46 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5620/6d0e673df8a8a162ea831fe884be17ae4ef52a46/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2434,
1376,
12,
2890,
16,
756,
4672,
365,
18,
659,
273,
365,
18,
2434,
1376,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2434,
1376,
12,
2890,
16,
756,
4672,
365,
18,
659,
273,
365,
18,
2434,
1376,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
context.revertEBank() | context.revertEbank() | def parse_2CADR(self, context, operands): word1 = word2 = None expr = AddressExpression(context, operands) if expr.complete: word1 = expr.value if context.memmap.isFixed(word1): word2 = 0 # Bits 15-11 of the 2nd generated word contain the bank number. word2 |= ((context.fbank & 037) << 10) # Bits 10-8 and 4 are zero. # Bits 7-5 are 000 if F-Bank < 030, 011 if F-Bank is 030-037, or 100 if F-Bank is 040-043. if 030 <= context.fbank <= 037: word2 |= (3 << 4) elif 040 <= context.fbank <= 043: word2 |= (4 << 4) # Bits 3-1 equals the current EBANK= code. word2 |= (context.ebank & 07) else: word2 = context.memmap.getBankNumber(word1) context.currentRecord.code = [word1, word2] context.currentRecord.complete = True if context.lastEbankEquals: context.revertEBank() | bb0c9481857559544ff51b048aec8112dfafa7d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8152/bb0c9481857559544ff51b048aec8112dfafa7d9/directive.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
22,
39,
1880,
54,
12,
2890,
16,
819,
16,
14883,
4672,
2076,
21,
273,
2076,
22,
273,
599,
3065,
273,
5267,
2300,
12,
2472,
16,
14883,
13,
309,
3065,
18,
6226,
30,
2076,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
22,
39,
1880,
54,
12,
2890,
16,
819,
16,
14883,
4672,
2076,
21,
273,
2076,
22,
273,
599,
3065,
273,
5267,
2300,
12,
2472,
16,
14883,
13,
309,
3065,
18,
6226,
30,
2076,
21,
... |
if not destfolder.startswith(self.folder): | if not destfolder.startswith(trimmedFolderBasePath): | def getProperties(self, REQUEST=None): """ get the summary properties for the local filesystem directory for this class instance """ | 6abd6fb096b7cf9709c9fedce9b68c0d3cd973d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/6abd6fb096b7cf9709c9fedce9b68c0d3cd973d8/PloneLocalFolderNG.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9392,
12,
2890,
16,
12492,
33,
7036,
4672,
3536,
336,
326,
4916,
1790,
364,
326,
1191,
6496,
1867,
364,
333,
667,
791,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9392,
12,
2890,
16,
12492,
33,
7036,
4672,
3536,
336,
326,
4916,
1790,
364,
326,
1191,
6496,
1867,
364,
333,
667,
791,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
return string.join(res, '') | return ''.join(res) | def _fast_quote(s): global _fast_safe if _fast_safe is None: _fast_safe = {} for c in _fast_safe_test: _fast_safe[c] = c res = list(s) for i in range(len(res)): c = res[i] if not _fast_safe.has_key(c): res[i] = '%%%02x' % ord(c) return string.join(res, '') | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8076,
67,
6889,
12,
87,
4672,
2552,
389,
8076,
67,
4626,
309,
389,
8076,
67,
4626,
353,
599,
30,
389,
8076,
67,
4626,
273,
2618,
364,
276,
316,
389,
8076,
67,
4626,
67,
3813,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8076,
67,
6889,
12,
87,
4672,
2552,
389,
8076,
67,
4626,
309,
389,
8076,
67,
4626,
353,
599,
30,
389,
8076,
67,
4626,
273,
2618,
364,
276,
316,
389,
8076,
67,
4626,
67,
3813,
30... |
if len(candidates==1): | if len(candidates)==1: | def parse_url(url): """Try to get the amazon product ID (ASIN) out of the url. Returns (domain, asin) where domain is .co.uk/.com/.de etc""" regexps = [r'amazon\.(?P<domain>[a-z.]+)/(?:gp|exec|o)/.*/?(?:ASIN|-|product)/(?P<asin>[^?/]+)', r'amazon.(?P<domain>[a-z.]+)/[^/]+/(gp|dp)/(?P<asin>[0-9X]+)', r'amazon.(?P<domain>[a-z.]+)/([^/]+/)?dp/(?P<asin>[^/]+)' ] for r in regexps: m = re.search(r, url, re.I) if m: return m.group('domain', 'asin') # Start trying to find odd cases now. m = re.search(r'amazon.([a-z.]+)/', url) if not m: # I can't even see which amazon domain it's from. Time to give up. raise BadUrl(url) domain = m.group(1) # Maybe there's something that # looks like an ISBN sandwiched between two path separators for part in url.split("/"): v = isbn.verify(part) if v: return (domain, v) # Hunt through the URL looking for any sequence of characters # which look like an ISBN candidates = list(isbn.hunt(url)) if len(candidates==1): return (domain, candidates[0]) # Nope. I give up. raise BadUrl(url) | b945d8574351ca983b8478bc59d3d70ef7093ac7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13110/b945d8574351ca983b8478bc59d3d70ef7093ac7/amazon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
718,
12,
718,
4672,
3536,
7833,
358,
336,
326,
3750,
3017,
1599,
261,
3033,
706,
13,
596,
434,
326,
880,
18,
2860,
261,
4308,
16,
487,
267,
13,
1625,
2461,
353,
263,
2894,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
718,
12,
718,
4672,
3536,
7833,
358,
336,
326,
3750,
3017,
1599,
261,
3033,
706,
13,
596,
434,
326,
880,
18,
2860,
261,
4308,
16,
487,
267,
13,
1625,
2461,
353,
263,
2894,
... |
""" | The coefficient of 1 is also an element of the multivariate polynomial ring: sage: R.<x,y> = GF(389)[] sage: parent(R(x*y+5).coefficient(1)) Polynomial Ring in x, y over Finite Field of size 389 """ R = self.parent() | def coefficient(self, mon): """ Return the coefficient of mon in self, where mon must have the same parent as self. The coefficient is defined as follows. If f is this polynomial, then the coefficient is the sum T/mon where the sum is over terms T in f that are exactly divisible by mon. | dc3ae6969b92aeb902449664723af4c4bc2dad54 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/dc3ae6969b92aeb902449664723af4c4bc2dad54/multi_polynomial_element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16554,
12,
2890,
16,
6921,
4672,
225,
1021,
16554,
434,
404,
353,
2546,
392,
930,
434,
326,
1778,
27693,
16991,
9221,
30,
272,
410,
30,
534,
22782,
92,
16,
93,
34,
273,
611,
42,
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,
16554,
12,
2890,
16,
6921,
4672,
225,
1021,
16554,
434,
404,
353,
2546,
392,
930,
434,
326,
1778,
27693,
16991,
9221,
30,
272,
410,
30,
534,
22782,
92,
16,
93,
34,
273,
611,
42,
12,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.