rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
verbose('finished add column', t0) | def add_column(B, H_B, a): """ The add column procedure. INPUT: B -- a non-singular square matrix H_B -- the Hermite normal form of B a -- a column vector OUTPUT: x -- a vector such that H' = H_B.augment(x) is the HNF of A = B.augment(a). """ t0 = verbose('starting add_column') # We use a direct solve method without inverse. This # is more clever than what is in Allan Steel's talk and # what is in that paper, in 2 ways -- (1) no inverse need # to be computed, and (2) we cleverly solve a vastly easier # system and recover the solution to the original system. # Here's how: # 1. We make a copy of B but with the last *nasty* row of B replaced # by a random very nice row. C = copy(B) C[C.nrows()-1] = [1]*C.ncols() # 2. Then we find the unique solution to C * x = a # (todo -- recover from bad case.) x = C.solve_right(a) # 3. We next delete the last row of B and find a basis vector k # for the 1-dimensional kernel. D = B.matrix_from_rows(range(C.nrows()-1)) N = D._rational_kernel_iml() if N.ncols() != 1: raise NotImplementedError, "need to recover gracefully from rank issues with matrix." k = N.matrix_from_columns([0]) # 4. The sought for solution z to B*z = a is some linear combination # z = x + alpha*k # and setting w to be the last row of B, this column vector z satisfies # w * z = a' # where a' is the last entry of a. Thus # w * (x + alpha*k) = a' # so w * x + alpha*w*k = a' # so alpha*w*k = a' - w*x. w = B[-1] # last row of B a_prime = a[-1] lhs = w*k rhs = a_prime - w * x alpha = rhs[0] / lhs[0] z = x + alpha*k zd, d = z._clear_denom() x = H_B * zd if d > 1: for i in range(x.ncols()): x[i,0] = x[i,0]/d verbose('finished add column', t0) return x | e4efad0907e34db2c61f5c1935160aed400d9935 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/e4efad0907e34db2c61f5c1935160aed400d9935/matrix_integer_dense_hnf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2827,
12,
38,
16,
670,
67,
38,
16,
279,
4672,
3536,
1021,
527,
1057,
12131,
18,
225,
12943,
30,
605,
282,
1493,
279,
1661,
17,
17835,
8576,
3148,
670,
67,
38,
1493,
326,
670... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2827,
12,
38,
16,
670,
67,
38,
16,
279,
4672,
3536,
1021,
527,
1057,
12131,
18,
225,
12943,
30,
605,
282,
1493,
279,
1661,
17,
17835,
8576,
3148,
670,
67,
38,
1493,
326,
670... | |
log.debug("get_background_items() called") | def get_background_items(self, window, item): if not self.valid_uri(item.get_uri()): return path = unicode(gnomevfs.get_local_path_from_uri(item.get_uri()), "utf-8") self.nautilusVFSFile_table[path] = item | becd0ba6a920de5bf02e8cdb9b2b5492e1f122e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5119/becd0ba6a920de5bf02e8cdb9b2b5492e1f122e2/RabbitVCS.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9342,
67,
3319,
12,
2890,
16,
2742,
16,
761,
4672,
309,
486,
365,
18,
877,
67,
1650,
12,
1726,
18,
588,
67,
1650,
1435,
4672,
327,
589,
273,
5252,
12,
1600,
1742,
90,
2556,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9342,
67,
3319,
12,
2890,
16,
2742,
16,
761,
4672,
309,
486,
365,
18,
877,
67,
1650,
12,
1726,
18,
588,
67,
1650,
1435,
4672,
327,
589,
273,
5252,
12,
1600,
1742,
90,
2556,
... | |
-- nodes - the nodes to inspect (default is entire graph) | -- vertices - the vertices to inspect (default is entire graph) | def cliques_containing_node(self, nodes=None, cliques=None, with_labels=False): """ Returns the cliques containing each node, represented as a list of lists. (Returns a single list if only one input node). | 139028392b54ae237314b7536b21897e9b1d7ed3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/139028392b54ae237314b7536b21897e9b1d7ed3/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4942,
29896,
67,
1213,
3280,
67,
2159,
12,
2890,
16,
2199,
33,
7036,
16,
4942,
29896,
33,
7036,
16,
598,
67,
5336,
33,
8381,
4672,
3536,
2860,
326,
4942,
29896,
4191,
1517,
756,
16,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4942,
29896,
67,
1213,
3280,
67,
2159,
12,
2890,
16,
2199,
33,
7036,
16,
4942,
29896,
33,
7036,
16,
598,
67,
5336,
33,
8381,
4672,
3536,
2860,
326,
4942,
29896,
4191,
1517,
756,
16,
10... |
def redirect(self, redirect_url): | def redirect(self, request, redirect_url): | def redirect(self, redirect_url): """Send a redirect response to the given URL to the browser.""" response_headers = [('Content-type', 'text/plain'), ('Location', redirect_url)] self.start('302 REDIRECT', response_headers) return ["Redirecting to %s" % redirect_url] | 3613973e0dba8bc750646a30918b4dc7828ea1b1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/3613973e0dba8bc750646a30918b4dc7828ea1b1/open_id.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3136,
12,
2890,
16,
590,
16,
3136,
67,
718,
4672,
3536,
3826,
279,
3136,
766,
358,
326,
864,
1976,
358,
326,
4748,
12123,
766,
67,
2485,
273,
306,
2668,
1350,
17,
723,
2187,
296,
955,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3136,
12,
2890,
16,
590,
16,
3136,
67,
718,
4672,
3536,
3826,
279,
3136,
766,
358,
326,
864,
1976,
358,
326,
4748,
12123,
766,
67,
2485,
273,
306,
2668,
1350,
17,
723,
2187,
296,
955,
... |
self.env=os.environ | self.env=dict(os.environ) | def __init__(self,setup=None, setup_args=[]): "The setup script is sourced (with possible arguments) and the environment is captured" | 731741752d03285edacb9e19637a0ec628b1cc3d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1488/731741752d03285edacb9e19637a0ec628b1cc3d/Shell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8401,
33,
7036,
16,
3875,
67,
1968,
33,
8526,
4672,
315,
1986,
3875,
2728,
353,
1084,
72,
261,
1918,
3323,
1775,
13,
471,
326,
3330,
353,
19550,
6,
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,
1001,
2738,
972,
12,
2890,
16,
8401,
33,
7036,
16,
3875,
67,
1968,
33,
8526,
4672,
315,
1986,
3875,
2728,
353,
1084,
72,
261,
1918,
3323,
1775,
13,
471,
326,
3330,
353,
19550,
6,
2,
... |
in=master - master relative to which the widget is placed. | in=master - master relative to which the widget is placed in_=master - see 'in' option description | def place_configure(self, cnf={}, **kw): """Place a widget in the parent widget. Use as options: in=master - master relative to which the widget is placed. x=amount - locate anchor of this widget at position x of master y=amount - locate anchor of this widget at position y of master relx=amount - locate anchor of this widget between 0.0 and 1.0 relative to width of master (1.0 is right edge) rely=amount - locate anchor of this widget between 0.0 and 1.0 relative to height of master (1.0 is bottom edge) anchor=NSEW (or subset) - position anchor according to given direction width=amount - width of this widget in pixel height=amount - height of this widget in pixel relwidth=amount - width of this widget between 0.0 and 1.0 relative to width of master (1.0 is the same width as the master) relheight=amount - height of this widget between 0.0 and 1.0 relative to height of master (1.0 is the same height as the master) bordermode="inside" or "outside" - whether to take border width of master widget into account """ for k in ['in_']: if k in kw: kw[k[:-1]] = kw[k] del kw[k] self.tk.call( ('place', 'configure', self._w) + self._options(cnf, kw)) | bf1eb637bd2eee4cec7cf34f530910ae365b22dd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/bf1eb637bd2eee4cec7cf34f530910ae365b22dd/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3166,
67,
14895,
12,
2890,
16,
23118,
28793,
2826,
9987,
4672,
3536,
6029,
279,
3604,
316,
326,
982,
3604,
18,
2672,
487,
702,
30,
316,
33,
7525,
300,
4171,
3632,
358,
1492,
326,
3604,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3166,
67,
14895,
12,
2890,
16,
23118,
28793,
2826,
9987,
4672,
3536,
6029,
279,
3604,
316,
326,
982,
3604,
18,
2672,
487,
702,
30,
316,
33,
7525,
300,
4171,
3632,
358,
1492,
326,
3604,
... |
self.assertTrue(not self.sp.external_keywords_test) | self.assertTrue(not self.seo.external_keywords_test) | def test_externalKeyword_Off(self): self.publish(self.save_url + '&form.external_keywords_test=', self.basic_auth) self.assertTrue(not self.sp.external_keywords_test) | 96b07895f2d6a7e604b88d8343a640b5e4d3d5ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10421/96b07895f2d6a7e604b88d8343a640b5e4d3d5ea/testConfiglet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9375,
8736,
67,
7210,
12,
2890,
4672,
365,
18,
6543,
12,
2890,
18,
5688,
67,
718,
397,
5183,
687,
18,
9375,
67,
11771,
67,
3813,
33,
2187,
365,
18,
13240,
67,
1944,
13,
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,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9375,
8736,
67,
7210,
12,
2890,
4672,
365,
18,
6543,
12,
2890,
18,
5688,
67,
718,
397,
5183,
687,
18,
9375,
67,
11771,
67,
3813,
33,
2187,
365,
18,
13240,
67,
1944,
13,
365... |
exploitName(data) | exploitName(data.offset(8)) | def updateChecksum(data, len): sum = 0xB4BA for i in xrange(8, len): sum -= data[i] data[4] = sum & 0xFF data[5] = (sum >> 8) & 0xFF | fc2adc81392239262e82ac53f988dbca537d16bd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6757/fc2adc81392239262e82ac53f988dbca537d16bd/cookinject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
10723,
12,
892,
16,
562,
4672,
2142,
273,
374,
20029,
24,
12536,
364,
277,
316,
12314,
12,
28,
16,
562,
4672,
2142,
3947,
501,
63,
77,
65,
225,
501,
63,
24,
65,
273,
2142,
473,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
10723,
12,
892,
16,
562,
4672,
2142,
273,
374,
20029,
24,
12536,
364,
277,
316,
12314,
12,
28,
16,
562,
4672,
2142,
3947,
501,
63,
77,
65,
225,
501,
63,
24,
65,
273,
2142,
473,... |
self.setWhitespaceChars( " \t" ) | self.setWhitespaceChars( ParserElement.DEFAULT_WHITE_CHARS.replace("\n","") ) | def __init__( self ): super(LineEnd,self).__init__() self.setWhitespaceChars( " \t" ) self.errmsg = "Expected end of line" #self.myException.msg = self.errmsg | da74e091d4cc4f50d53af659d6e24111dda28daa /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12364/da74e091d4cc4f50d53af659d6e24111dda28daa/pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
262,
30,
2240,
12,
1670,
1638,
16,
2890,
2934,
972,
2738,
972,
1435,
365,
18,
542,
9431,
7803,
12,
6783,
1046,
18,
5280,
67,
16861,
67,
21666,
18,
2079,
31458... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
365,
262,
30,
2240,
12,
1670,
1638,
16,
2890,
2934,
972,
2738,
972,
1435,
365,
18,
542,
9431,
7803,
12,
6783,
1046,
18,
5280,
67,
16861,
67,
21666,
18,
2079,
31458... |
if lk in ['content-md5', 'content-type', 'date'] or lk.startswith(AMAZON_HEADER_PREFIX): | if headers[key] != None and (lk in ['content-md5', 'content-type', 'date'] or lk.startswith(AMAZON_HEADER_PREFIX)): | def canonical_string(method, path, headers, expires=None): interesting_headers = {} for key in headers: lk = key.lower() if lk in ['content-md5', 'content-type', 'date'] or lk.startswith(AMAZON_HEADER_PREFIX): interesting_headers[lk] = headers[key].strip() # these keys get empty strings if they don't exist if not interesting_headers.has_key('content-type'): interesting_headers['content-type'] = '' if not interesting_headers.has_key('content-md5'): interesting_headers['content-md5'] = '' # just in case someone used this. it's not necessary in this lib. if interesting_headers.has_key('x-amz-date'): interesting_headers['date'] = '' # if you're using expires for query string auth, then it trumps date # (and x-amz-date) if expires: interesting_headers['date'] = str(expires) sorted_header_keys = interesting_headers.keys() sorted_header_keys.sort() buf = "%s\n" % method for key in sorted_header_keys: val = interesting_headers[key] if key.startswith(AMAZON_HEADER_PREFIX): buf += "%s:%s\n" % (key, val) else: buf += "%s\n" % val # don't include anything after the first ? in the resource... buf += "%s" % path.split('?')[0] # ...unless there is an acl or torrent parameter if re.search("[&?]acl($|=|&)", path): buf += "?acl" elif re.search("[&?]logging($|=|&)", path): buf += "?logging" elif re.search("[&?]torrent($|=|&)", path): buf += "?torrent" elif re.search("[&?]location($|=|&)", path): buf += "?location" elif re.search("[&?]requestPayment($|=|&)", path): buf += "?requestPayment" elif re.search("[&?]versions($|=|&)", path): buf += "?versions" elif re.search("[&?]versioning($|=|&)", path): buf += "?versioning" else: m = re.search("[&?]versionId=([^&]+)($|=|&)", path) if m: buf += '?versionId=' + m.group(1) return buf | 391bb6384a083acae1baa6b2396d60487e68a049 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1098/391bb6384a083acae1baa6b2396d60487e68a049/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7378,
67,
1080,
12,
2039,
16,
589,
16,
1607,
16,
7368,
33,
7036,
4672,
26122,
67,
2485,
273,
2618,
364,
498,
316,
1607,
30,
25421,
273,
498,
18,
8167,
1435,
309,
1607,
63,
856,
65,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7378,
67,
1080,
12,
2039,
16,
589,
16,
1607,
16,
7368,
33,
7036,
4672,
26122,
67,
2485,
273,
2618,
364,
498,
316,
1607,
30,
25421,
273,
498,
18,
8167,
1435,
309,
1607,
63,
856,
65,
4... |
if energies[0][0] > param_id_boxes_match_threshold: | if len(energies) > 0 and energies[0][0] > param_id_boxes_match_threshold: | def id_boxes_adjust_points(image, p_up, p_down, line_up, line_down, x_var, iwidth): points_up = [] points_down = [] for x in range(p_up[0] - x_var, p_up[0] + x_var + 1): p = line_point(line_up, x = x) if p[0] >= 0 and p[0] < iwidth and p[1] >= 0: points_up.append(p) for x in range(p_down[0] - x_var, p_down[0] + x_var + 1): p = line_point(line_down, x = x) if p[0] >= 0 and p[0] < iwidth and p[1] >= 0: points_down.append(p) energies = [(id_boxes_match_level(image, u, v), u, v) \ for u in points_up for v in points_down] energies.sort(reverse = True) if energies[0][0] > param_id_boxes_match_threshold: lim = len(energies) for i in range(1, lim): if energies[i][0] < energies[0][0]: lim = i break best = energies[:lim] avgx_up = float(sum([u[0] for (e, u, v) in best])) / len(best) avgx_down = float(sum([v[0] for (e, u, v) in best])) / len(best) best = [(abs(avgx_up - u[0]) + abs(avgx_down - v[0]), u, v) \ for (e, u, v) in best] best.sort() selected = best[0][1:] return selected else: return None | 861a96cd1a91667a006e7df9cbcff5900d5beea8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12267/861a96cd1a91667a006e7df9cbcff5900d5beea8/imageproc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
612,
67,
15918,
67,
13362,
67,
4139,
12,
2730,
16,
293,
67,
416,
16,
293,
67,
2378,
16,
980,
67,
416,
16,
980,
67,
2378,
16,
619,
67,
1401,
16,
277,
2819,
4672,
3143,
67,
416,
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,
612,
67,
15918,
67,
13362,
67,
4139,
12,
2730,
16,
293,
67,
416,
16,
293,
67,
2378,
16,
980,
67,
416,
16,
980,
67,
2378,
16,
619,
67,
1401,
16,
277,
2819,
4672,
3143,
67,
416,
273,... |
def deleteCookie(request): | def setSessionCookie(request, u): """ Set moin_session cookie for user obj u """ import base64 import hmac cfg = request.cfg cookie_name = 'MOIN_ID' if hasattr(cfg, 'moin_session_cookie_name'): cookie_name = cfg.moin_session_cookie_name enc_username = base64.encodestring(u.auth_username) enc_id = base64.encodestring(u.id) cookie_body = "username=%s:id=%s" % (enc_username, enc_id) cookie_hmac = hmac.new(cfg.moin_session_secret, cookie_body).hexdigest() cookie_string = ':'.join([cookie_hmac, cookie_body]) setCookie(request, u, cookie_name, cookie_string) def deleteCookie(request, cookie_name='MOIN_ID'): | def deleteCookie(request): """ Delete the user cookie by sending expired cookie with null value According to http://www.cse.ohio-state.edu/cgi-bin/rfc/rfc2109.html#sec-4.2.2 Deleted cookie should have Max-Age=0. We also have expires attribute, which is probably needed for older browsers. Finally, delete the saved cookie and create a new user based on the new settings. """ moin_id = '' maxage = 0 # Set expires to one year ago for older clients expires = time.time() - (3600 * 24 * 365) # 1 year ago cookie = makeCookie(request, moin_id, maxage, expires) # Set cookie request.setHttpHeader(cookie) # IMPORTANT: Prevent caching of current page and cookie request.disableHttpCaching() | 52d72a54d36dd3229ef30015f18438b64a2efc64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/52d72a54d36dd3229ef30015f18438b64a2efc64/auth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25486,
6151,
12,
2293,
16,
582,
4672,
3536,
1000,
312,
885,
67,
3184,
3878,
364,
729,
1081,
582,
3536,
1930,
1026,
1105,
1930,
13421,
2776,
273,
590,
18,
7066,
3878,
67,
529,
273,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25486,
6151,
12,
2293,
16,
582,
4672,
3536,
1000,
312,
885,
67,
3184,
3878,
364,
729,
1081,
582,
3536,
1930,
1026,
1105,
1930,
13421,
2776,
273,
590,
18,
7066,
3878,
67,
529,
273,
296,
... |
return (False, "Hypervisor error: %s" % str(err)) | _Fail("Hypervisor error: %s", err, exc=True) | def StartInstance(instance): """Start an instance. @type instance: L{objects.Instance} @param instance: the instance object @rtype: boolean @return: whether the startup was successful or not """ running_instances = GetInstanceList([instance.hypervisor]) if instance.name in running_instances: return (True, "Already running") try: block_devices = _GatherAndLinkBlockDevs(instance) hyper = hypervisor.GetHypervisor(instance.hypervisor) hyper.StartInstance(instance, block_devices) except errors.BlockDeviceError, err: logging.exception("Failed to start instance") return (False, "Block device error: %s" % str(err)) except errors.HypervisorError, err: logging.exception("Failed to start instance") _RemoveBlockDevLinks(instance.name, instance.disks) return (False, "Hypervisor error: %s" % str(err)) return (True, "Instance started successfully") | 2cc6781aac8b53426d83d4cb8a42dc7c58efb8d6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/2cc6781aac8b53426d83d4cb8a42dc7c58efb8d6/backend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3603,
1442,
12,
1336,
4672,
3536,
1685,
392,
791,
18,
225,
632,
723,
791,
30,
511,
95,
6911,
18,
1442,
97,
632,
891,
791,
30,
326,
791,
733,
632,
86,
723,
30,
1250,
632,
2463,
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,
3603,
1442,
12,
1336,
4672,
3536,
1685,
392,
791,
18,
225,
632,
723,
791,
30,
511,
95,
6911,
18,
1442,
97,
632,
891,
791,
30,
326,
791,
733,
632,
86,
723,
30,
1250,
632,
2463,
30,
... |
th = i18ncp("%1 in the '%1 and %2 ago' message below", "1 hour", "%1 hours", hours) tm = i18ncp("%2 in the '%1 and %2 ago' message below", "1 minute", "%1 minutes", hours) | th = unicode(i18ncp("%1 in the '%1 and %2 ago' message below", "1 hour", "%1 hours", hours), 'utf-8') tm = unicode(i18ncp("%2 in the '%1 and %2 ago' message below", "1 minute", "%1 minutes", hours), 'utf-8') | def update_job_creation_times(self): now = time.time () need_update = False for job, data in self.jobs.iteritems(): if self.jobs.has_key (job): iter = self.jobiters[job] | 6424097990cc03f82d778cefdf8c8c82dbfc73db /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1682/6424097990cc03f82d778cefdf8c8c82dbfc73db/printer-applet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
4688,
67,
17169,
67,
8293,
12,
2890,
4672,
2037,
273,
813,
18,
957,
1832,
1608,
67,
2725,
273,
1083,
364,
1719,
16,
501,
316,
365,
18,
10088,
18,
2165,
3319,
13332,
309,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
4688,
67,
17169,
67,
8293,
12,
2890,
4672,
2037,
273,
813,
18,
957,
1832,
1608,
67,
2725,
273,
1083,
364,
1719,
16,
501,
316,
365,
18,
10088,
18,
2165,
3319,
13332,
309,
365,... |
def test103hasInventory(self): | def test102hasInventory(self): | def test103hasInventory(self): # Load the full inventory to test each part separately inventory = client.inventory.getLastMachineInventoryFull({}) # Assert that the inventory is not empty for the parts which are # necessarly used for part in inventory: if part == 'Hardware' or part == 'Software': self.assertNotEqual(inventory[part], []) | 70774fc66c3d56d44d0569cd35439d22ee699d4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5988/70774fc66c3d56d44d0569cd35439d22ee699d4e/mmcagent-inventory-inject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
20481,
5332,
15059,
12,
2890,
4672,
468,
4444,
326,
1983,
13086,
358,
1842,
1517,
1087,
18190,
13086,
273,
1004,
18,
26024,
18,
588,
3024,
6981,
15059,
5080,
23506,
13,
468,
5452,
71... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
20481,
5332,
15059,
12,
2890,
4672,
468,
4444,
326,
1983,
13086,
358,
1842,
1517,
1087,
18190,
13086,
273,
1004,
18,
26024,
18,
588,
3024,
6981,
15059,
5080,
23506,
13,
468,
5452,
71... |
print " %s_%s:%s," % match print " }\n" print "def get_%s_localised_past_from_enum(enum):" % name print " if PAST_%s.has_key(enum):" % name.upper() print " return PAST_%s[enum]" % name.upper() print " else:" print " return None\n" | print(" %s_%s:%s," % match) print(" }\n") print("def get_%s_localised_past_from_enum(enum):" % name) print(" if PAST_%s.has_key(enum):" % name.upper()) print(" return PAST_%s[enum]" % name.upper()) print(" else:") print(" return None\n") | print "def get_%s_animation_name_from_enum(enum):" % name | 8e9c4450c56bff53eb0384354e13d91c56601046 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11043/8e9c4450c56bff53eb0384354e13d91c56601046/enum-convertor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1172,
315,
536,
336,
10185,
87,
67,
30822,
67,
529,
67,
2080,
67,
7924,
12,
7924,
13,
2773,
738,
508,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1172,
315,
536,
336,
10185,
87,
67,
30822,
67,
529,
67,
2080,
67,
7924,
12,
7924,
13,
2773,
738,
508,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.logger.error("Client %s failed to authenticate due to metadata problem" % (address[0])) | self.logger.error("Client %s failed to resolve; metadata problem" % (address[0])) | def AuthenticateConnection(self, cert, user, password, address): '''This function checks auth creds''' if cert: certinfo = dict([x[0] for x in cert['subject']]) # look at cert.cN client = certinfo['commonName'] auth_type = self.auth.get(client, 'cert+password') addr_check = self.validate_client_address(client, address) if auth_type == 'cert': # we can't continue to password auth return addr_check if user == 'root': # we aren't using per-client keys try: client = self.resolve_client(address) except MetadataConsistencyError: self.logger.error("Client %s failed to authenticate due to metadata problem" % (address[0])) return False else: # user maps to client if user not in self.uuid: client = user self.uuid[user] = user else: client = self.uuid[user] | a9c608cbc181011cdbb0467a8f1fe0a4097f4c92 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11867/a9c608cbc181011cdbb0467a8f1fe0a4097f4c92/Metadata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26644,
1952,
12,
2890,
16,
3320,
16,
729,
16,
2201,
16,
1758,
4672,
9163,
2503,
445,
4271,
1357,
12534,
26418,
309,
3320,
30,
3320,
1376,
273,
2065,
3816,
92,
63,
20,
65,
364,
619,
316... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26644,
1952,
12,
2890,
16,
3320,
16,
729,
16,
2201,
16,
1758,
4672,
9163,
2503,
445,
4271,
1357,
12534,
26418,
309,
3320,
30,
3320,
1376,
273,
2065,
3816,
92,
63,
20,
65,
364,
619,
316... |
assert_arrays_equal(actual, desired) def base_test_lines(self,lines): | self.assertRavelEqual(actual, desired) def base_helper_lines(self,lines): | def test_add_path(self): path1 = agg.CompiledPath() path1.move_to(1.0,1.0) path1.translate_ctm(1.0,1.0) path1.line_to(2.0,2.0) #actually (3.0,3.0) path1.scale_ctm(2.0,2.0) path1.line_to(2.0,2.0) # actually (5.0,5.0) path2 = agg.CompiledPath() path2.move_to(1.0,1.0) path2.translate_ctm(1.0,1.0) path2.line_to(2.0,2.0) #actually (3.0,3.0) sub_path = agg.CompiledPath() sub_path.scale_ctm(2.0,2.0) sub_path.line_to(2.0,2.0) path2.add_path(sub_path) desired = path1._vertices() actual = path2._vertices() assert_arrays_equal(actual, desired) desired = path1.get_ctm() actual = path2.get_ctm() assert_arrays_equal(actual, desired) | 3d92c0ab4a3a1dfa3f396a7b42d8cc8314558496 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13166/3d92c0ab4a3a1dfa3f396a7b42d8cc8314558496/compiled_path_test_case.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1289,
67,
803,
12,
2890,
4672,
589,
21,
273,
10421,
18,
20733,
743,
1435,
589,
21,
18,
8501,
67,
869,
12,
21,
18,
20,
16,
21,
18,
20,
13,
589,
21,
18,
13929,
67,
299,
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,
1842,
67,
1289,
67,
803,
12,
2890,
4672,
589,
21,
273,
10421,
18,
20733,
743,
1435,
589,
21,
18,
8501,
67,
869,
12,
21,
18,
20,
16,
21,
18,
20,
13,
589,
21,
18,
13929,
67,
299,
8... |
elif name == 'createTime': self.create_time = value elif name == 'attachTime': self.attach_time = value elif name == 'size': self.size = int(value) | def endElement(self, name, value, connection): if name == 'volumeId': self.id = value elif name == 'instanceId': self.instance_id = value elif name == 'snapshotId': self.snapshot_id = value elif name == 'createTime': self.create_time = value elif name == 'attachTime': self.attach_time = value elif name == 'size': self.size = int(value) else: setattr(self, name, value) | be0f69d18c1ad0059a7def808935bef8d39dccb0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1098/be0f69d18c1ad0059a7def808935bef8d39dccb0/volume.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14840,
12,
2890,
16,
508,
16,
460,
16,
1459,
4672,
309,
508,
422,
296,
9491,
548,
4278,
365,
18,
350,
273,
460,
1327,
508,
422,
296,
1336,
548,
4278,
365,
18,
1336,
67,
350,
273,
460... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14840,
12,
2890,
16,
508,
16,
460,
16,
1459,
4672,
309,
508,
422,
296,
9491,
548,
4278,
365,
18,
350,
273,
460,
1327,
508,
422,
296,
1336,
548,
4278,
365,
18,
1336,
67,
350,
273,
460... | |
if getattr(self, 'referencesSortable', None) == None: self.referencesSortable = False | def set(self, instance, value, **kwargs): """Mutator. | 4ea460d87f984122435f57821e8e7e192eeb86e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12165/4ea460d87f984122435f57821e8e7e192eeb86e2/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
791,
16,
460,
16,
2826,
4333,
4672,
3536,
28410,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
791,
16,
460,
16,
2826,
4333,
4672,
3536,
28410,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
if prog <> self.prog: | if prog != self.prog: | def handle(self, call): # Don't use unpack_header but parse the header piecewise # XXX I have no idea if I am using the right error responses! self.unpacker.reset(call) self.packer.reset() xid = self.unpacker.unpack_uint() self.packer.pack_uint(xid) temp = self.unpacker.unpack_enum() if temp <> CALL: return None # Not worthy of a reply self.packer.pack_uint(REPLY) temp = self.unpacker.unpack_uint() if temp <> RPCVERSION: self.packer.pack_uint(MSG_DENIED) self.packer.pack_uint(RPC_MISMATCH) self.packer.pack_uint(RPCVERSION) self.packer.pack_uint(RPCVERSION) return self.packer.get_buf() self.packer.pack_uint(MSG_ACCEPTED) self.packer.pack_auth((AUTH_NULL, make_auth_null())) prog = self.unpacker.unpack_uint() if prog <> self.prog: self.packer.pack_uint(PROG_UNAVAIL) return self.packer.get_buf() vers = self.unpacker.unpack_uint() if vers <> self.vers: self.packer.pack_uint(PROG_MISMATCH) self.packer.pack_uint(self.vers) self.packer.pack_uint(self.vers) return self.packer.get_buf() proc = self.unpacker.unpack_uint() methname = 'handle_' + repr(proc) try: meth = getattr(self, methname) except AttributeError: self.packer.pack_uint(PROC_UNAVAIL) return self.packer.get_buf() cred = self.unpacker.unpack_auth() verf = self.unpacker.unpack_auth() try: meth() # Unpack args, call turn_around(), pack reply except (EOFError, GarbageArgs): # Too few or too many arguments self.packer.reset() self.packer.pack_uint(xid) self.packer.pack_uint(REPLY) self.packer.pack_uint(MSG_ACCEPTED) self.packer.pack_auth((AUTH_NULL, make_auth_null())) self.packer.pack_uint(GARBAGE_ARGS) return self.packer.get_buf() | a0d398af583af19b3d8d3ac42537b8edc0ceeb75 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a0d398af583af19b3d8d3ac42537b8edc0ceeb75/rpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
12,
2890,
16,
745,
4672,
468,
7615,
1404,
999,
6167,
67,
3374,
1496,
1109,
326,
1446,
11151,
2460,
468,
11329,
467,
1240,
1158,
21463,
309,
467,
2125,
1450,
326,
2145,
555,
7220,
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,
1640,
12,
2890,
16,
745,
4672,
468,
7615,
1404,
999,
6167,
67,
3374,
1496,
1109,
326,
1446,
11151,
2460,
468,
11329,
467,
1240,
1158,
21463,
309,
467,
2125,
1450,
326,
2145,
555,
7220,
5... |
estimated = self.getRoughEstimate() * HOURS_PER_DAY | try: estimated = self.getRoughEstimate() * HOURS_PER_DAY except: estimated = 0 | def getRawEstimate(self): """ When a story has tasks, get their estimates. If not, get the roughEstimate of this story. HOURS_PER_DAY is set in AppConfig.py (probably 8). """ tasks = self.contentValues() estimated = 0.0 estimates = [] if tasks: for task in tasks: estimates.append(task.getRawEstimate()) estimated = sum(estimates) if estimated == 0: estimated = self.getRoughEstimate() * HOURS_PER_DAY return estimated | 927df7161328f7a05014cdedf40fff50f74a419a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10431/927df7161328f7a05014cdedf40fff50f74a419a/Story.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10547,
13638,
12,
2890,
4672,
3536,
5203,
279,
17285,
711,
4592,
16,
336,
3675,
27585,
18,
971,
486,
16,
336,
326,
23909,
13638,
434,
333,
17285,
18,
17001,
55,
67,
3194,
67,
10339,
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,
10547,
13638,
12,
2890,
4672,
3536,
5203,
279,
17285,
711,
4592,
16,
336,
3675,
27585,
18,
971,
486,
16,
336,
326,
23909,
13638,
434,
333,
17285,
18,
17001,
55,
67,
3194,
67,
10339,
353,... |
raise ValueError('No cell contents found in castep file') cell_first_line = cell_contents[-1] try: n_atoms = int(castep_output[cell_first_line+2].split()[-1]) offset = 10 except IndexError: offset = 7 if cluster is not None: | if atoms_ref is None or abort: raise ValueError('No cell contents found in castep file - try passing atoms_ref') else: logging.warning('No cell contents. If this is a variable cell geometry optimisation with fixed ions this is normal') n_atoms = atoms_ref.n if cell_contents != []: cell_first_line = cell_contents[-1] try: n_atoms = int(castep_output[cell_first_line+2].split()[-1]) offset = 10 except IndexError: offset = 7 if atoms_ref is not None: | def CastepOutputReader(castep_file, cluster=None, abort=True, save_params=False): """Parse .castep file, and return Atoms object with positions, energy, forces, and possibly stress and atomic populations as well""" if type(castep_file) == type(''): castep_file = open(castep_file,'r') castep_file = iter(castep_file) param = CastepParam() got_header = False eof = False while True: castep_output = [] while True: try: line = castep_file.next() except StopIteration: eof = True break castep_output.append(line) if line == ' | CCC AA SSS TTTTT EEEEE PPPP |\n': if got_header: got_param = True break else: got_header = True if line.startswith(' Starting BFGS iteration'): break if line.startswith(' BFGS: improving iteration'): break # NB: CASTEP doesn't always print 'Total time' run_time = -1.0 total_time = filter(lambda s: s.startswith('Total time'), castep_output) if total_time == []: has_converged = filter(lambda s: s.startswith('Total energy has converged'), castep_output) if abort and has_converged == []: raise ValueError("castep didn't complete") else: run_time = float(total_time[0].split()[3]) # Now we should have contents of a valid .castep file in castep_output # First let's read the user parameters for this run from top of file new_param = CastepParam() try: new_param.read_from_castep_output(castep_output) param.update(new_param) except ValueError: pass #if abort: # raise # Next let's extract the lattice and atomic positions lattice_lines = [i for (i,x) in enumerate(castep_output) if x == ' Unit Cell\n'] if lattice_lines == []: if abort: raise ValueError('No unit cell found in castep file') else: continue lattice_line = lattice_lines[-1] # last lattice lattice_lines = castep_output[lattice_line+3:lattice_line+6] lattice = fzeros((3,3)) lattice[:,1] = map(float, lattice_lines[0].split()[0:3]) lattice[:,2] = map(float, lattice_lines[1].split()[0:3]) lattice[:,3] = map(float, lattice_lines[2].split()[0:3]) cell_contents = [i for (i,x) in enumerate(castep_output) if x == ' Cell Contents\n'] if cell_contents == []: raise ValueError('No cell contents found in castep file') cell_first_line = cell_contents[-1] # last cell contents line try: n_atoms = int(castep_output[cell_first_line+2].split()[-1]) offset = 10 except IndexError: offset = 7 if cluster is not None: # If we were passed in an Atoms object, construct mapping from # CASTEP (element, number) to original atom index atoms = cluster.copy() species_count = {} lookup = {} for i in frange(atoms.n): el = atoms.species[i].stripstrings() if species_count.has_key(el): species_count[el] += 1 else: species_count[el] = 1 lookup[(el,species_count[el])] = i else: # Otherwise we make a new, empty Atoms object. Atoms will # be ordered as they are in .castep file. lookup = {} atoms = Atoms(n=n_atoms,lattice=lattice) atoms.params['castep_run_time'] = run_time cell_lines = castep_output[cell_first_line+offset:cell_first_line+offset+n_atoms] # Fill in species and fractional positions atoms.add_property('frac_pos',0.0,n_cols=3) for i, line in fenumerate(cell_lines): x1, el, num, u, v, w, x2 = line.split() num = int(num) if not (el,num) in lookup: lookup[(el,num)] = i atoms.set_species(lookup[(el,num)], el) atoms.frac_pos[:,lookup[(el,num)]] = map(float, (u,v,w)) # Calculate cartesian postions from fractional positions atoms.pos[:] = numpy.dot(atoms.lattice, atoms.frac_pos) if param.has_key('finite_basis_corr') and param['finite_basis_corr'].lower() == 'true': energy_lines = filter(lambda s: s.startswith('Total energy corrected for finite basis set'), \ castep_output) elif param.has_key('task') and param['task'].lower() == 'geometryoptimization': energy_lines = filter(lambda s: s.startswith(' BFGS: Final Enthalpy'), castep_output) else: energy_lines = filter(lambda s: s.startswith('Final energy') and not s.endswith('<- EDFT\n'), castep_output) if (len(energy_lines) == 0): if abort: raise ValueError('No total energy found in castep file') else: # Energy is second to last field on line (last is "eV") # Use last matching energy line in file atoms.params['energy'] = float(energy_lines[-1].split()[-2]) try: for fn in ('Forces', 'Symmetrised Forces'): force_start_lines = [i for (i,s) in enumerate(castep_output) if s.find('****** %s ******' % fn) != -1] if force_start_lines != []: break if force_start_lines == []: raise ValueError # Use last set of forces force_start = force_start_lines[-1] # Extract force lines from .castep file force_lines = castep_output[force_start+6:force_start+6+atoms.n] atoms.add_property('force',0.0,n_cols=3) # Fill in the forces for i, line in enumerate(force_lines): line = line.replace('*','') # Remove the *s el, num_str, fx, fy, fz = line.split() num = int(num_str) atoms.force[:,lookup[(el,num)]] = (fx,fy,fz) except ValueError, m: if abort: raise ValueError('No forces found in castep file %s: ' % m) # Have we calculated stress? if 'calculate_stress' in param and param['calculate_stress'].lower() == 'true': try: stress_start = castep_output.index(' ***************** Stress Tensor *****************\n') stress_lines = castep_output[stress_start+6:stress_start+9] virial = fzeros((3,3),float) for i, line in fenumerate(stress_lines): star1, label, vx, vy, vz, star2 = line.split() virial[:,i] = [float(v) for v in (vx,vy,vz) ] # Convert to libAtoms units and add to atoms.params atoms.params['virial'] = virial/GPA except ValueError: if abort: raise ValueError('No stress tensor found in .castep file') # Have we calculated local populations and charges? if 'popn_calculate' in param and param['popn_calculate'].lower() == 'true': try: popn_start = castep_output.index(' Atomic Populations\n') popn_lines = castep_output[popn_start+4:popn_start+4+atoms.n] atoms.add_property('popn_s',0.0) atoms.add_property('popn_p',0.0) atoms.add_property('popn_d',0.0) atoms.add_property('popn_f',0.0) atoms.add_property('popn_total',0.0) atoms.add_property('popn_charge',0.0) for line in popn_lines: el, num_str, s, p, d, f, tot, charge = line.split() num = int(num_str) atoms.popn_s[lookup[(el,num)]] = float(s) atoms.popn_p[lookup[(el,num)]] = float(p) atoms.popn_d[lookup[(el,num)]] = float(d) atoms.popn_f[lookup[(el,num)]] = float(f) atoms.popn_total[lookup[(el,num)]] = float(tot) atoms.popn_charge[lookup[(el,num)]] = float(charge) except ValueError: if abort: raise ValueError('No populations found in castep file') if save_params: atoms.params.update(param) yield atoms if eof: break | ec8807b76757684570a516cf1219a2030cb3b7d0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8914/ec8807b76757684570a516cf1219a2030cb3b7d0/castep.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19782,
881,
1447,
2514,
12,
4155,
881,
67,
768,
16,
2855,
33,
7036,
16,
6263,
33,
5510,
16,
1923,
67,
2010,
33,
8381,
4672,
3536,
3201,
263,
4155,
881,
585,
16,
471,
327,
7149,
87,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19782,
881,
1447,
2514,
12,
4155,
881,
67,
768,
16,
2855,
33,
7036,
16,
6263,
33,
5510,
16,
1923,
67,
2010,
33,
8381,
4672,
3536,
3201,
263,
4155,
881,
585,
16,
471,
327,
7149,
87,
7... |
nodes drawn inside the disc. | vertices drawn inside the disc. | def is_circular_planar(self, ordered=True): """ Returns True if a graph with boundary is circular planar, and False otherwise. A graph (with nonempty boundary) is circular planar if it has a planar embedding in which all boundary nodes can be drawn in order on a disc boundary, with all the interior nodes drawn inside the disc. Note -- This function assumes that the graph has nonempty boundary. (Circular Planarity has no definition for graphs without boundary). -- The current version relies on computing the genus of a slightly modified graph so it is time-expensive and not reasonable to use for graphs with > 12 vertices. -- Also since the current version relies on computing the genus, it is necessary that the graph be connected in order to use Euler's formula. INPUT: ordered -- whether or not to consider the order of the boundary (set ordered=False to see if there is any possible boundary order that will satisfy circular planarity) EXAMPLES: sage: g439 = Graph({1:[5,7], 2:[5,6], 3:[6,7], 4:[5,6,7]}) sage: g439.set_boundary([1,2,3,4]) sage.: g439.show(figsize=[2,2], vertex_labels=True, vertex_size=175) sage: g439.is_circular_planar() False sage: g439.set_boundary([1,2,3]) sage: g439.is_circular_planar() True Order matters: sage: K23 = graphs.CompleteBipartiteGraph(2,3) sage: K23.set_boundary([0,1,2,3]) sage: K23.is_circular_planar() False sage: K23.set_boundary([0,2,1,3]) # Diff Order! sage: K23.is_circular_planar() True sage: K23.is_circular_planar(ordered=False) True """ if not self.is_connected(): raise TypeError("Graph must be connected to use Euler's Formula to compute minimal genus.") from sage.rings.infinity import Infinity from sage.combinat.all import CyclicPermutationsOfPartition from sage.graphs.graph_genus1 import trace_faces, nice_copy | a520fa15cff86fbbd1335f8b6f9d36203c74d574 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/a520fa15cff86fbbd1335f8b6f9d36203c74d574/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
11614,
9559,
67,
7088,
297,
12,
2890,
16,
5901,
33,
5510,
4672,
3536,
2860,
1053,
309,
279,
2667,
598,
7679,
353,
15302,
4995,
297,
16,
471,
1083,
3541,
18,
225,
432,
2667,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
11614,
9559,
67,
7088,
297,
12,
2890,
16,
5901,
33,
5510,
4672,
3536,
2860,
1053,
309,
279,
2667,
598,
7679,
353,
15302,
4995,
297,
16,
471,
1083,
3541,
18,
225,
432,
2667,
26... |
arg = re.replace('\{\d+\}$', '', arg) | arg = re.sub('\{\d+\}$', '', arg) | def imapsplit(imapstring): """Takes a string from an IMAP conversation and returns a list containing its components. One example string is: (\\HasNoChildren) "." "INBOX.Sent" The result from parsing this will be: ['(\\HasNoChildren)', '"."', '"INBOX.Sent"']""" debug("imapsplit() called with input:", imapstring) if type(imapstring) != types.StringType: debug("imapsplit() got a non-string input; working around.") # Sometimes, imaplib will throw us a tuple if the input # contains a literal. See Python bug # #619732 at https://sourceforge.net/tracker/index.php?func=detail&aid=619732&group_id=5470&atid=105470 # One example is: # result[0] = '() "\\\\" Admin' # result[1] = ('() "\\\\" {19}', 'Folder\\2') # # This function will effectively get result[0] or result[1], so # if we get the result[1] version, we need to parse apart the tuple # and figure out what to do with it. Each even-numbered # part of it should end with the {} number, and each odd-numbered # part should be directly a part of the result. We'll # artificially quote it to help out. retval = [] for i in range(len(imapstring)): if i % 2: # Odd: quote then append. arg = imapstring[i] # Quote code lifted from imaplib arg = arg.replace('\\', '\\\\') arg = arg.replace('"', '\\"') arg = '"%s"' % arg debug("imapsplit() non-string [%d]: Appending %s" %\ (i, arg)) retval.append(arg) else: # Even -- we have a string that ends with a literal # size specifier. We need to strip off that, then run # what remains through the regular imapsplit parser. # Recursion to the rescue. arg = imapstring[i] arg = re.replace('\{\d+\}$', '', arg) debug("imapsplit() non-string [%d]: Feeding %s to recursion" %\ arg) retval.extend(imapsplit(imapstring[i])) debug("imapsplit() non-string: returning %s" % str(retval)) return retval workstr = imapstring.strip() retval = [] while len(workstr): if workstr[0] == '(': # Needs rindex to properly process eg (FLAGS () UID 123) rpareni = workstr.rindex(')') + 1 parenlist = workstr[0:rpareni] workstr = workstr[rpareni:].lstrip() retval.append(parenlist) elif workstr[0] == '"': quotelist = quotere.search(workstr).group(1) workstr = workstr[len(quotelist):].lstrip() retval.append(quotelist) else: splits = string.split(workstr, maxsplit = 1) splitslen = len(splits) # The unquoted word is splits[0]; the remainder is splits[1] if splitslen == 2: # There's an unquoted word, and more string follows. retval.append(splits[0]) workstr = splits[1] # split will have already lstripped it continue elif splitslen == 1: # We got a last unquoted word, but nothing else retval.append(splits[0]) # Nothing remains. workstr would be '' break elif splitslen == 0: # There was not even an unquoted word. break debug("imapsplit() returning:", retval) return retval | d3f924f6fc97f08a073b2f8603e4dda06dbb5475 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5335/d3f924f6fc97f08a073b2f8603e4dda06dbb5475/imaputil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20226,
4939,
12,
12161,
1080,
4672,
3536,
11524,
279,
533,
628,
392,
6246,
2203,
10039,
471,
1135,
279,
666,
4191,
2097,
4085,
18,
225,
6942,
3454,
533,
353,
30,
225,
261,
1695,
5582,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20226,
4939,
12,
12161,
1080,
4672,
3536,
11524,
279,
533,
628,
392,
6246,
2203,
10039,
471,
1135,
279,
666,
4191,
2097,
4085,
18,
225,
6942,
3454,
533,
353,
30,
225,
261,
1695,
5582,
22... |
config_opts['buildgroup'] = 'build' | config_opts['chroot_dep_package'] = 'buildsys-build' | def main(): # before we go on, make sure the user is a member of the 'mock' group. member = False for item in os.getgroups(): try: grptup = grp.getgrgid(item) except KeyError, e: continue if grptup[0] == 'mock': member = True if not member: print "You need to be a member of the mock group for this to work" sys.exit(1) # and make sure they're not root if os.geteuid() == 0: error("Don't try to run mock as root!") sys.exit(1) # config path config_path='/etc/mock' # defaults config_opts = {} config_opts['basedir'] = '/var/lib/mock/' # root name is automatically added to this config_opts['chroot'] = '/usr/sbin/mock-helper chroot' config_opts['mount'] = '/usr/sbin/mock-helper mount' config_opts['umount'] = '/usr/sbin/mock-helper umount' config_opts['rm'] = '/usr/sbin/mock-helper rm' config_opts['mknod'] = '/usr/sbin/mock-helper mknod' config_opts['yum'] = '/usr/sbin/mock-helper yum' config_opts['runuser'] = '/sbin/runuser' config_opts['buildgroup'] = 'build' config_opts['chrootuser'] = 'mockbuild' config_opts['chrootgroup'] = 'mockbuild' config_opts['chrootuid'] = 500 config_opts['chrootgid'] = 500 config_opts['chroothome'] = '/builddir' config_opts['clean'] = True config_opts['debug'] = False config_opts['quiet'] = False config_opts['target_arch'] = 'i386' config_opts['files'] = {} config_opts['yum.conf'] = '' config_opts['macros'] = """ | 67b25024a129d1f0f1d521b414ba9f6e5ac071dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7328/67b25024a129d1f0f1d521b414ba9f6e5ac071dc/mock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
1865,
732,
1960,
603,
16,
1221,
3071,
326,
729,
353,
279,
3140,
434,
326,
296,
22851,
11,
1041,
18,
3140,
273,
1083,
364,
761,
316,
1140,
18,
588,
4650,
13332,
775,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
1865,
732,
1960,
603,
16,
1221,
3071,
326,
729,
353,
279,
3140,
434,
326,
296,
22851,
11,
1041,
18,
3140,
273,
1083,
364,
761,
316,
1140,
18,
588,
4650,
13332,
775,
3... |
if self.extensions.has_key(extype): | if self.extensions.has_key(extype) and \ not self.extensions[extype].exvalue is None: | def __getattr__(self,name): if self.attr2extype.has_key(name): extype = self.attr2extype[name] if self.extensions.has_key(extype): result = unquote(self.extensions[extype].exvalue) else: return None else: raise AttributeError,"%s has no attribute %s" % ( self.__class__.__name__,name ) return result # __getattr__() | 4ed5314303767c28f67e73ed8ed6e0b72c26b5aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4610/4ed5314303767c28f67e73ed8ed6e0b72c26b5aa/ldapurl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
1747,
972,
12,
2890,
16,
529,
4672,
309,
365,
18,
1747,
22,
408,
388,
18,
5332,
67,
856,
12,
529,
4672,
1110,
388,
273,
365,
18,
1747,
22,
408,
388,
63,
529,
65,
309,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
1747,
972,
12,
2890,
16,
529,
4672,
309,
365,
18,
1747,
22,
408,
388,
18,
5332,
67,
856,
12,
529,
4672,
1110,
388,
273,
365,
18,
1747,
22,
408,
388,
63,
529,
65,
309,
36... |
print e | print >> sys.stderr, e return 1 except gclient_utils.Error, e: print >> sys.stderr, e | def TryChange(argv, file_list, swallow_exception, prog=None, extra_epilog=None): """ Args: argv: Arguments and options. file_list: Default value to pass to --file. swallow_exception: Whether we raise or swallow exceptions. """ # Parse argv parser = optparse.OptionParser(usage=USAGE, version=__version__, prog=prog) epilog = EPILOG % { 'prog': prog } if extra_epilog: epilog += extra_epilog parser.epilog = epilog # Remove epilog formatting parser.format_epilog = lambda x: parser.epilog parser.add_option("-v", "--verbose", action="count", default=0, help="Prints debugging infos") group = optparse.OptionGroup(parser, "Result and status") group.add_option("-u", "--user", default=getpass.getuser(), help="Owner user name [default: %default]") group.add_option("-e", "--email", default=os.environ.get('TRYBOT_RESULTS_EMAIL_ADDRESS', os.environ.get('EMAIL_ADDRESS')), help="Email address where to send the results. Use either " "the TRYBOT_RESULTS_EMAIL_ADDRESS environment " "variable or EMAIL_ADDRESS to set the email address " "the try bots report results to [default: %default]") group.add_option("-n", "--name", help="Descriptive name of the try job") group.add_option("--issue", type='int', help="Update rietveld issue try job status") group.add_option("--patchset", type='int', help="Update rietveld issue try job status. This is " "optional if --issue is used, In that case, the " "latest patchset will be used.") group.add_option("--dry_run", action='store_true', help="Just prints the diff and quits") parser.add_option_group(group) group = optparse.OptionGroup(parser, "Try job options") group.add_option("-b", "--bot", action="append", help="Only use specifics build slaves, ex: '--bot win' to " "run the try job only on the 'win' slave; see the try " "server waterfall for the slave's name") group.add_option("-r", "--revision", help="Revision to use for the try job; default: the " "revision will be determined by the try server; see " "its waterfall for more info") group.add_option("-c", "--clobber", action="store_true", help="Force a clobber before building; e.g. don't do an " "incremental build") # TODO(maruel): help="Select a specific configuration, usually 'debug' or " # "'release'" group.add_option("--target", help=optparse.SUPPRESS_HELP) group.add_option("--project", help="Override which project to use. Projects are defined " "server-side to define what default bot set to use") group.add_option("-t", "--testfilter", action="append", help="Add a gtest_filter to a test. Use multiple times to " "specify filters for different tests. (i.e. " "--testfilter base_unittests:ThreadTest.* " "--testfilter ui_tests) If you specify any testfilters " "the test results will not be reported in rietveld and " "only tests with filters will run.") parser.add_option_group(group) group = optparse.OptionGroup(parser, "Patch to run") group.add_option("-f", "--file", default=file_list, dest="files", metavar="FILE", action="append", help="Use many times to list the files to include in the " "try, relative to the repository root") group.add_option("--diff", help="File containing the diff to try") group.add_option("--url", help="Url where to grab a patch, e.g. " "http://example.com/x.diff") group.add_option("-R", "--rietveld_url", default="codereview.appspot.com", metavar="URL", help="Has 2 usages, both refer to the rietveld instance: " "Specify which code review patch to use as the try job " "or rietveld instance to update the try job results " "Default:%default") group.add_option("--root", help="Root to use for the patch; base subdirectory for " "patch created in a subdirectory") group.add_option("-p", "--patchlevel", type='int', metavar="LEVEL", help="Used as -pN parameter to patch") group.add_option("-s", "--sub_rep", action="append", default=[], help="Subcheckout to use in addition. This is mainly " "useful for gclient-style checkouts. Use @rev or " "@branch or @branch1..branch2 to specify the " "revision/branch to diff against.") group.add_option("--no_gclient", action="store_true", help="Disable automatic search for gclient checkout.") group.add_option("-E", "--exclude", action="append", default=['ChangeLog'], metavar='REGEXP', help="Regexp patterns to exclude files. Default: %default") parser.add_option_group(group) group = optparse.OptionGroup(parser, "Access the try server by HTTP") group.add_option("--use_http", action="store_const", const=_SendChangeHTTP, dest="send_patch", help="Use HTTP to talk to the try server [default]") group.add_option("-H", "--host", help="Host address") group.add_option("-P", "--port", help="HTTP port") group.add_option("--proxy", help="HTTP proxy") parser.add_option_group(group) group = optparse.OptionGroup(parser, "Access the try server with SVN") group.add_option("--use_svn", action="store_const", const=_SendChangeSVN, dest="send_patch", help="Use SVN to talk to the try server") group.add_option("-S", "--svn_repo", metavar="SVN_URL", help="SVN url to use to write the changes in; --use_svn is " "implied when using --svn_repo") parser.add_option_group(group) options, args = parser.parse_args(argv) # Note that the args array includes the script name, so # a single argument results in len(args) == 2. # If they've asked for help, give it to them if len(args) == 2 and args[1] == 'help': parser.print_help() return 0 # If they've said something confusing, don't spawn a try job until you # understand what they want. if len(args) > 1: plural = "" if len(args) > 2: plural = "s" print "Argument%s \"%s\" not understood" % (plural, " ".join(args[1:])) parser.print_help() return 1 LOG_FORMAT = '%(levelname)s %(filename)s(%(lineno)d): %(message)s' if not swallow_exception: if options.verbose == 0: logging.basicConfig(level=logging.WARNING, format=LOG_FORMAT) elif options.verbose == 1: logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) elif options.verbose > 1: logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT) logging.debug(argv) # Strip off any @ in the user, otherwise svn gets confused. options.user = options.user.split('@', 1)[0] if options.rietveld_url: # Try to extract the review number if possible and fix the protocol. if not '://' in options.rietveld_url: options.rietveld_url = 'http://' + options.rietveld_url match = re.match(r'^(.*)/(\d+)$', options.rietveld_url) if match: if options.issue or options.patchset: parser.error('Cannot use both --issue and use a review number url') options.issue = int(match.group(2)) options.rietveld_url = match.group(1) try: # Always include os.getcwd() in the checkout settings. checkouts = [] checkouts.append(GuessVCS(options, os.getcwd())) checkouts[0].AutomagicalSettings() for item in options.sub_rep: checkout = GuessVCS(options, os.path.join(checkouts[0].checkout_root, item)) if checkout.checkout_root in [c.checkout_root for c in checkouts]: parser.error('Specified the root %s two times.' % checkout.checkout_root) checkouts.append(checkout) can_http = options.port and options.host can_svn = options.svn_repo # If there was no transport selected yet, now we must have enough data to # select one. if not options.send_patch and not (can_http or can_svn): parser.error('Please specify an access method.') # Convert options.diff into the content of the diff. if options.url: if options.files: parser.error('You cannot specify files and --url at the same time.') options.diff = urllib.urlopen(options.url).read() elif options.diff: if options.files: parser.error('You cannot specify files and --diff at the same time.') options.diff = gclient_utils.FileRead(options.diff, 'rb') elif options.issue and options.patchset is None: # Retrieve the patch from rietveld when the diff is not specified. # When patchset is specified, it's because it's done by gcl/git-try. if json is None: parser.error('json or simplejson library is missing, please install.') api_url = '%s/api/%d' % (options.rietveld_url, options.issue) logging.debug(api_url) contents = json.loads(urllib.urlopen(api_url).read()) options.patchset = contents['patchsets'][-1] diff_url = ('%s/download/issue%d_%d.diff' % (options.rietveld_url, options.issue, options.patchset)) diff = GetMungedDiff('', urllib.urlopen(diff_url).readlines()) options.diff = ''.join(diff) else: # Use this as the base. root = checkouts[0].checkout_root diffs = [] for checkout in checkouts: diff = checkout.GenerateDiff().splitlines(True) path_diff = gclient_utils.PathDifference(root, checkout.checkout_root) # Munge it. diffs.extend(GetMungedDiff(path_diff, diff)) options.diff = ''.join(diffs) if not options.bot: # Get try slaves from PRESUBMIT.py files if not specified. # Even if the diff comes from options.url, use the local checkout for bot # selection. try: import presubmit_support root_presubmit = checkouts[0].ReadRootFile('PRESUBMIT.py') options.bot = presubmit_support.DoGetTrySlaves( checkouts[0].GetFileNames(), checkouts[0].checkout_root, root_presubmit, False, sys.stdout) except ImportError: pass # If no bot is specified, either the default pool will be selected or the # try server will refuse the job. Either case we don't need to interfere. if options.name is None: if options.issue: options.name = 'Issue %s' % options.issue else: options.name = 'Unnamed' print('Note: use --name NAME to change the try job name.') if not options.email: parser.error('Using an anonymous checkout. Please use --email or set ' 'the TRYBOT_RESULTS_EMAIL_ADDRESS environment variable.') else: print('Results will be emailed to: ' + options.email) # Prevent rietveld updates if we aren't running all the tests. if options.testfilter is not None: options.issue = None options.patchset = None # Send the patch. if options.send_patch: # If forced. options.send_patch(options) PrintSuccess(options) return 0 try: if can_http: _SendChangeHTTP(options) PrintSuccess(options) return 0 except NoTryServerAccess: if not can_svn: raise _SendChangeSVN(options) PrintSuccess(options) return 0 except (InvalidScript, NoTryServerAccess), e: if swallow_exception: return 1 print e return 1 return 0 | f86b582b7be24f0b853d65bf8942aec0a34ad189 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/f86b582b7be24f0b853d65bf8942aec0a34ad189/trychange.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6161,
3043,
12,
19485,
16,
585,
67,
1098,
16,
1352,
5965,
67,
4064,
16,
11243,
33,
7036,
16,
2870,
67,
881,
21947,
33,
7036,
4672,
3536,
6634,
30,
5261,
30,
13599,
471,
702,
18,
585,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3043,
12,
19485,
16,
585,
67,
1098,
16,
1352,
5965,
67,
4064,
16,
11243,
33,
7036,
16,
2870,
67,
881,
21947,
33,
7036,
4672,
3536,
6634,
30,
5261,
30,
13599,
471,
702,
18,
585,
... |
logging.debug('thread %s starting' % (self.getName())) | logging.debug('%s starting' % (self.getName())) | def run(self): """Delegate main work to a helper method and watch for uncaught exceptions.""" self._start_time = time.time() self._num_tests = 0 try: logging.debug('thread %s starting' % (self.getName())) self._Run(test_runner=None, result_summary=None) logging.debug('thread %s done (%d tests)' % (self.getName(), self.GetNumTests())) except: # Save the exception for our caller to see. self._exception_info = sys.exc_info() self._stop_time = time.time() # Re-raise it and die. logging.error('thread %s dying: %s' % (self.getName(), self._exception_info)) raise self._stop_time = time.time() | e84e0af1bb8bce9694f71c06db04a4ee04ce4fa7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/e84e0af1bb8bce9694f71c06db04a4ee04ce4fa7/test_shell_thread.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
3536,
9586,
2774,
1440,
358,
279,
4222,
707,
471,
4267,
364,
6301,
16510,
4798,
12123,
365,
6315,
1937,
67,
957,
273,
813,
18,
957,
1435,
365,
6315,
2107,
67,
16341... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
3536,
9586,
2774,
1440,
358,
279,
4222,
707,
471,
4267,
364,
6301,
16510,
4798,
12123,
365,
6315,
1937,
67,
957,
273,
813,
18,
957,
1435,
365,
6315,
2107,
67,
16341... |
self.verbose_logger.log(logginglevels.DEBUG_6, | self.verbose_logger.log(logginglevels.DEBUG_3, | def installPkgs(self, userlist=None): """Attempts to take the user specified list of packages/wildcards and install them, or if they are installed, update them to a newer version. If a complete version number if specified, attempt to downgrade them to the specified version""" # get the list of available packages # iterate over the user's list # add packages to Transaction holding class if they match. # if we've added any packages to the transaction then return 2 and a string # if we've hit a snag, return 1 and the failure explanation # if we've got nothing to do, return 0 and a 'nothing available to install' string oldcount = len(self.tsInfo) if not userlist: userlist = self.extcmds | 032941fe36fb17e87b289a8b06371250ecd13e2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/032941fe36fb17e87b289a8b06371250ecd13e2c/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
7789,
564,
12,
2890,
16,
26860,
33,
7036,
4672,
3536,
10113,
358,
4862,
326,
729,
1269,
666,
434,
5907,
19,
22887,
87,
471,
3799,
2182,
16,
578,
309,
2898,
854,
5876,
16,
1089,
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,
3799,
7789,
564,
12,
2890,
16,
26860,
33,
7036,
4672,
3536,
10113,
358,
4862,
326,
729,
1269,
666,
434,
5907,
19,
22887,
87,
471,
3799,
2182,
16,
578,
309,
2898,
854,
5876,
16,
1089,
2... |
try: file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) self.DownloadAndWaitForStart(file_url) pause_dict = self.PerformActionOnDownload(self._GetDownloadId(), 'toggle_pause') if pause_dict['state'] == 'COMPLETE': logging.info('The download completed before pause. Stopping test.') return self.assertTrue(pause_dict['is_paused']) self.assertTrue(pause_dict['state'] == 'IN_PROGRESS') resume_dict = self.PerformActionOnDownload(self._GetDownloadId(), 'toggle_pause') self.assertFalse(resume_dict['is_paused']) self._CallFunctionWithNewTimeout(2 * 60 * 1000, self.WaitForAllDownloadsToComplete) self.assertTrue(os.path.exists(downloaded_pkg), 'Downloaded file %s missing.' % downloaded_pkg) self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg), 'Downloaded file %s does not match original' % downloaded_pkg) finally: os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) os.path.exists(file_path) and os.remove(file_path) | file_url = self.GetFileURLForPath(file_path) downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), os.path.basename(file_path)) os.path.exists(downloaded_pkg) and os.remove(downloaded_pkg) self.DownloadAndWaitForStart(file_url) self._DeleteAfterShutdown(downloaded_pkg) self._DeleteAfterShutdown(file_path) pause_dict = self.PerformActionOnDownload(self._GetDownloadId(), 'toggle_pause') if pause_dict['state'] == 'COMPLETE': logging.info('The download completed before pause. Stopping test.') return self.assertTrue(pause_dict['is_paused']) self.assertTrue(pause_dict['state'] == 'IN_PROGRESS') resume_dict = self.PerformActionOnDownload(self._GetDownloadId(), 'toggle_pause') self.assertFalse(resume_dict['is_paused']) self._CallFunctionWithNewTimeout(2 * 60 * 1000, self.WaitForAllDownloadsToComplete) self.assertTrue(os.path.exists(downloaded_pkg), 'Downloaded file %s missing.' % downloaded_pkg) self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg), 'Downloaded file %s does not match original' % downloaded_pkg) | def testPauseAndResume(self): """Verify that pause and resume work while downloading a file. | 9951757e1f667c18359da5732e2c0a70ed2be48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/9951757e1f667c18359da5732e2c0a70ed2be48e/downloads.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
19205,
1876,
20911,
12,
2890,
4672,
3536,
8097,
716,
11722,
471,
10774,
1440,
1323,
23742,
279,
585,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
19205,
1876,
20911,
12,
2890,
4672,
3536,
8097,
716,
11722,
471,
10774,
1440,
1323,
23742,
279,
585,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if input.color: red, green, blue = RGBTuple(input.color) context.set_source_rgba(red,green,blue,1) context.set_line_width(input.stroke) context.stroke() | def rect(input, context): context.rectangle(input.x, input.y, input.width, input.height) if input.fill: r,g,b = RGBTuple(input.fill) context.set_source_rgba(r,g,b,1) context.fill() if input.color: red, green, blue = RGBTuple(input.color) context.set_source_rgba(red,green,blue,1) context.set_line_width(input.stroke) context.stroke() | ae7b5044f6598967bf2329294cb36e9a4c957da8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6163/ae7b5044f6598967bf2329294cb36e9a4c957da8/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4917,
12,
2630,
16,
819,
4672,
819,
18,
2607,
4341,
12,
2630,
18,
92,
16,
810,
18,
93,
16,
810,
18,
2819,
16,
810,
18,
4210,
13,
225,
309,
810,
18,
5935,
30,
436,
16,
75,
16,
70,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4917,
12,
2630,
16,
819,
4672,
819,
18,
2607,
4341,
12,
2630,
18,
92,
16,
810,
18,
93,
16,
810,
18,
2819,
16,
810,
18,
4210,
13,
225,
309,
810,
18,
5935,
30,
436,
16,
75,
16,
70,... | |
self._system = alg self._type = type self._prec = prec | self._system = algorithm if not (typ in ['I', 'J', 'K', 'Y']): raise ValueError, "typ must be one of I, J, K, Y" self._type = typ prec = int(prec) if prec < 0: raise ValueError, "prec must be a positive integer" self._prec = int(prec) | def __init__(self, nu, type = "J", alg = "pari", prec = 53): self._order = nu self._system = alg self._type = type self._prec = prec | aae4eb29e05d770a5cff5dd41ca537c970622119 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/aae4eb29e05d770a5cff5dd41ca537c970622119/special.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
9244,
16,
618,
273,
315,
46,
3113,
11989,
273,
315,
1065,
77,
3113,
13382,
273,
15935,
4672,
365,
6315,
1019,
273,
9244,
365,
6315,
4299,
273,
11989,
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,
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,
9244,
16,
618,
273,
315,
46,
3113,
11989,
273,
315,
1065,
77,
3113,
13382,
273,
15935,
4672,
365,
6315,
1019,
273,
9244,
365,
6315,
4299,
273,
11989,
365,
... |
if color == sping.pid.transparent: | if color == sping_pid.transparent: | def _getWXbrush(self, color, default_color = None): '''Converts PIDDLE colors to a wx brush''' | 6e8a8ce76fe5285ec893e7cdee3dc6699665e83a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9195/6e8a8ce76fe5285ec893e7cdee3dc6699665e83a/pidWxDc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
59,
60,
2848,
1218,
12,
2890,
16,
2036,
16,
805,
67,
3266,
273,
599,
4672,
9163,
5692,
14788,
40,
900,
5740,
358,
279,
7075,
5186,
1218,
26418,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
59,
60,
2848,
1218,
12,
2890,
16,
2036,
16,
805,
67,
3266,
273,
599,
4672,
9163,
5692,
14788,
40,
900,
5740,
358,
279,
7075,
5186,
1218,
26418,
2,
-100,
-100,
-100,
-100,
-10... |
self.connect(self.resizeTimer, SIGNAL('timeout()'), self._resizeTimeout) | def __init__(self, assy, parent): """ Constructor for the part window. | 78cee7d87681716c89c16ba27c2643c4f3449af4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/78cee7d87681716c89c16ba27c2643c4f3449af4/Ui_PartWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1551,
93,
16,
982,
4672,
3536,
11417,
364,
326,
1087,
2742,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1551,
93,
16,
982,
4672,
3536,
11417,
364,
326,
1087,
2742,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
i.e. multiplies $c_i$ by $u^i$. This is another | i.e., multiplies $c_i$ by $u^i$. This is another | def scale_curve(self, u): """ Transforms the elliptic curve using scale factor $u$, i.e. multiplies $c_i$ by $u^i$. This is another special case of change_weierstrass_model(). Returns the transformed curve. | 4f0514b45a47cdf92a6d781876aa0dd2f3653f54 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/4f0514b45a47cdf92a6d781876aa0dd2f3653f54/ell_generic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3159,
67,
16683,
12,
2890,
16,
582,
4672,
3536,
2604,
9741,
326,
415,
549,
21507,
8882,
1450,
3159,
5578,
271,
89,
8,
16,
277,
18,
73,
12990,
3309,
5259,
271,
71,
67,
77,
8,
635,
271... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3159,
67,
16683,
12,
2890,
16,
582,
4672,
3536,
2604,
9741,
326,
415,
549,
21507,
8882,
1450,
3159,
5578,
271,
89,
8,
16,
277,
18,
73,
12990,
3309,
5259,
271,
71,
67,
77,
8,
635,
271... |
FakeProxyHandler.digest_auth_handler.set_qop("auth") | self.digest_auth_handler.set_qop("auth") | def test_proxy_with_bad_password_raises_httperror(self): self._digest_auth_handler.add_password(self.REALM, self.URL, self.USER, self.PASSWD+"bad") FakeProxyHandler.digest_auth_handler.set_qop("auth") self.assertRaises(urllib2.HTTPError, self.opener.open, self.URL) | 687287dc4c0a16cd88f8d63dab0e06fd15e5b096 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/687287dc4c0a16cd88f8d63dab0e06fd15e5b096/test_urllib2_localnet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5656,
67,
1918,
67,
8759,
67,
3664,
67,
354,
6141,
67,
2505,
1636,
12,
2890,
4672,
365,
6315,
10171,
67,
1944,
67,
4176,
18,
1289,
67,
3664,
12,
2890,
18,
31052,
49,
16,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5656,
67,
1918,
67,
8759,
67,
3664,
67,
354,
6141,
67,
2505,
1636,
12,
2890,
4672,
365,
6315,
10171,
67,
1944,
67,
4176,
18,
1289,
67,
3664,
12,
2890,
18,
31052,
49,
16,
36... |
if self._user_set_data: return None | def _getCachedInfo(self, *key_names): """Returns the cached collection of info regarding this object If not available in cache, it will be downloaded first. """ if self._user_set_data: return None if not self._cached_info: self._cached_info = self._getInfo() if not self._cached_info: return None value_or_container = self._cached_info for key in key_names: value_or_container = value_or_container[key] return value_or_container | ba6699cc31d0861d78d62c80ca116f43d3d3c269 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9926/ba6699cc31d0861d78d62c80ca116f43d3d3c269/pylast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
9839,
966,
12,
2890,
16,
380,
856,
67,
1973,
4672,
3536,
1356,
326,
3472,
1849,
434,
1123,
29012,
333,
733,
971,
486,
2319,
316,
1247,
16,
518,
903,
506,
13549,
1122,
18,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
9839,
966,
12,
2890,
16,
380,
856,
67,
1973,
4672,
3536,
1356,
326,
3472,
1849,
434,
1123,
29012,
333,
733,
971,
486,
2319,
316,
1247,
16,
518,
903,
506,
13549,
1122,
18,
353... | |
data = commands.getoutput(aptcommand % (distro, distro, distro, 'show', pkg)) data2 = commands.getoutput(aptcommand % (distro, distro, distro, 'showsrc', pkg)) if not data or 'E: No packages found' in data: return 'Package %s does not exist in %s' % (pkg, distro) maxp = {'Version': '0'} packages = [x.strip() for x in data.split('\n\n')] for p in packages: if not p.strip(): | for distro in checkdists: data = commands.getoutput(aptcommand % (distro, distro, distro, 'show', pkg)) data2 = commands.getoutput(aptcommand % (distro, distro, distro, 'showsrc', pkg)) if not data or 'E: No packages found' in data: | def pkginfo(pkg): _pkg = ''.join([x for x in pkg.strip().split(None,1)[0] if x.isalnum() or x in '.-']) distro = defaultdistro if len(pkg.strip().split()) > 1: distro = ''.join([x for x in pkg.strip().split(None,2)[1] if x.isalnum() or x in '-.']) if distro not in distros: distro = defaultdistro pkg = _pkg data = commands.getoutput(aptcommand % (distro, distro, distro, 'show', pkg)) data2 = commands.getoutput(aptcommand % (distro, distro, distro, 'showsrc', pkg)) if not data or 'E: No packages found' in data: return 'Package %s does not exist in %s' % (pkg, distro) maxp = {'Version': '0'} packages = [x.strip() for x in data.split('\n\n')] for p in packages: if not p.strip(): continue parser = FeedParser.FeedParser() parser.feed(p) p = parser.close() if apt_pkg.VersionCompare(maxp['Version'], p['Version']) < 0: maxp = p del parser maxp2 = {'Version': '0'} packages2 = [x.strip() for x in data2.split('\n\n')] for p in packages2: if not p.strip(): continue parser = FeedParser.FeedParser() parser.feed(p) p = parser.close() if apt_pkg.VersionCompare(maxp2['Version'], p['Version']) < 0: maxp2 = p del parser archs = '' if maxp2['Architecture'] not in ('all','any'): archs = ' (Only available for %s)' % maxp2['Architecture'] return("%s: %s. In component %s, is %s. Version %s (%s), package size %s kB, installed size %s kB%s" % (maxp['Package'], maxp['Description'].split('\n')[0], component(maxp['Section']), maxp['Priority'], maxp['Version'], distro, int(maxp['Size'])/1024, maxp['Installed-Size'], archs)) | 1f3df0eb3cc6aef0bdd5aebdba2fc378d4552fd4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3105/1f3df0eb3cc6aef0bdd5aebdba2fc378d4552fd4/plugin_ng.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3475,
1376,
12,
10657,
4672,
389,
10657,
273,
875,
18,
5701,
3816,
92,
364,
619,
316,
3475,
18,
6406,
7675,
4939,
12,
7036,
16,
21,
25146,
20,
65,
309,
619,
18,
291,
287,
2107,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3475,
1376,
12,
10657,
4672,
389,
10657,
273,
875,
18,
5701,
3816,
92,
364,
619,
316,
3475,
18,
6406,
7675,
4939,
12,
7036,
16,
21,
25146,
20,
65,
309,
619,
18,
291,
287,
2107,
1435,
... |
"""SMTP 'rcpt' command. Indicates 1 recipient for this mail.""" | """SMTP 'rcpt' command -- indicates 1 recipient for this mail.""" | def rcpt(self,recip,options=[]): """SMTP 'rcpt' command. Indicates 1 recipient for this mail.""" optionlist = '' if options and self.does_esmtp: optionlist = string.join(options, ' ') self.putcmd("rcpt","TO:%s %s" % (quoteaddr(recip),optionlist)) return self.getreply() | 58a0b3fcac35fd85d6794fbcb62a4f4925cb00da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/58a0b3fcac35fd85d6794fbcb62a4f4925cb00da/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4519,
337,
12,
2890,
16,
266,
3449,
16,
2116,
33,
8526,
4672,
3536,
55,
14636,
296,
1310,
337,
11,
1296,
1493,
8527,
404,
8027,
364,
333,
4791,
12123,
1456,
1098,
273,
875,
309,
702,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4519,
337,
12,
2890,
16,
266,
3449,
16,
2116,
33,
8526,
4672,
3536,
55,
14636,
296,
1310,
337,
11,
1296,
1493,
8527,
404,
8027,
364,
333,
4791,
12123,
1456,
1098,
273,
875,
309,
702,
4... |
@wrap_exceptions() | def set_status(self,text): #wid,pos = self.frame.body.get_focus() #text = text +' '+ str(pos) self.frame.set_footer(urwid.AttrWrap(urwid.Text(text),'important')) | b1475ce12c0b990f7b6a595934f0c2377bb8c973 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12280/b1475ce12c0b990f7b6a595934f0c2377bb8c973/wicd-curses.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2327,
12,
2890,
16,
955,
4672,
468,
30902,
16,
917,
273,
365,
18,
3789,
18,
3432,
18,
588,
67,
13923,
1435,
468,
955,
273,
977,
397,
11,
15126,
609,
12,
917,
13,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2327,
12,
2890,
16,
955,
4672,
468,
30902,
16,
917,
273,
365,
18,
3789,
18,
3432,
18,
588,
67,
13923,
1435,
468,
955,
273,
977,
397,
11,
15126,
609,
12,
917,
13,
365,
18,
... | |
raise TypeError("input array incorrect shape %s"%I.shape) | raise TypeError("input array incorrect shape %s"%str(I.shape)) | def rebin2d(x,y,I,xo,yo,Io=None,dtype=None): """ Rebin a matrix. x,y are the existing bin edges xo,yo are the new bin edges I is the existing counts (one fewer than edges in each direction) Io will be used if present; this allows you to pass in a slice of an 3-D matrix, though it must be a contiguous slice for this to work. Otherwise you can simply assign the return value of the rebinning to the slice and it will perform a copy. dtype is the type to use for the intensity vectors. This can be integer (uint8, uint16, uint32) or real (float32 or f, float64 or d). The edge vectors are all coerced to doubles. Note that total intensity is not preserved for integer rebinning. The algorithm uses truncation so total intensity will be down on average by half the total number of bins. """ # Coerce axes to float arrays x,y,xo,yo = [_input(v) for v in (x,y,xo,yo)] shape_in = numpy.array([x.shape[0]-1,y.shape[0]-1]) shape_out = numpy.array([xo.shape[0]-1,yo.shape[0]-1]) # Coerce counts to correct type and check shape if dtype is None: try: dtype = I.dtype except AttributeError: dtype = numpy.float64 I = _input(I, dtype=dtype) if (shape_in != I.shape).any(): raise TypeError("input array incorrect shape %s"%I.shape) # Create output vector Io = _output(Io,shape_out,dtype=dtype) # Call rebin on type if it is available try: rebincore = getattr(_reduction,'rebin2d_'+I.dtype.name) except AttributeError: raise TypeError("rebin2d supports uint8 uint16 uint32 float32 float64, not " + I.dtype.name) rebincore(x,y,I,xo,yo,Io) return Io | ecc5cc9311b8dae4343a8a0700e16623fb2319a7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13135/ecc5cc9311b8dae4343a8a0700e16623fb2319a7/rebin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
4757,
22,
72,
12,
92,
16,
93,
16,
45,
16,
25272,
16,
93,
83,
16,
15963,
33,
7036,
16,
8972,
33,
7036,
4672,
3536,
868,
4757,
279,
3148,
18,
225,
619,
16,
93,
854,
326,
2062,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
4757,
22,
72,
12,
92,
16,
93,
16,
45,
16,
25272,
16,
93,
83,
16,
15963,
33,
7036,
16,
8972,
33,
7036,
4672,
3536,
868,
4757,
279,
3148,
18,
225,
619,
16,
93,
854,
326,
2062,
... |
range(len(self.button_names)), self.button_names, self.values): checked = (self.checked == i) items.append(RadioButton(self.name, value, checked)) items.append(name) | range(len(self.button_names)), self.button_names, self.values): ischecked = (self.checked == i) item = RadioButton(self.name, value, ischecked).Format() + name items.append(item) if not self.horizontal: t.AddRow(items) items = [] | def Format(self, indent=0): | 3e1ae52bd2838ec45824a41f79837325a29b5092 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/3e1ae52bd2838ec45824a41f79837325a29b5092/htmlformat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4077,
12,
2890,
16,
3504,
33,
20,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
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,
4077,
12,
2890,
16,
3504,
33,
20,
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,
... |
RA("%s=%s;" % (self._reserved[K], _getdate(V))) | RA("%s=%s" % (self._reserved[K], _getdate(V))) | def OutputString(self, attrs=None): # Build up our result # result = [] RA = result.append | eebb4bbe4670c7d4c05857583386a55110f30b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/eebb4bbe4670c7d4c05857583386a55110f30b32/Cookie.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3633,
780,
12,
2890,
16,
3422,
33,
7036,
4672,
468,
3998,
731,
3134,
563,
468,
563,
273,
5378,
26880,
273,
563,
18,
6923,
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,
3633,
780,
12,
2890,
16,
3422,
33,
7036,
4672,
468,
3998,
731,
3134,
563,
468,
563,
273,
5378,
26880,
273,
563,
18,
6923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
filename = dialog.get_filename() try: vcard = vobject.readOne(file(filename, "r")) vcard.filename = filename vcard.iter = None self.fullscreen = False self.fullscreenButton_click(self.actiongroup.get_action("Fullscreen")) if check.get_active(): vcard.filename = None add_to_list(self.contactData, vcard) self.contactSelection.select_iter(vcard.iter) self.contactSelection_change(None) self.contactView.save() else: self.contactSelection.unselect_all() self.check_if_changed() self.contactView.clear() self.contactView.load_contact(vcard) except: raise error_dialog = gtk.MessageDialog(self, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, _("Unable to load the contact.")) error_dialog.run() error_dialog.destroy() | for filename in dialog.get_filenames(): self.import_contact(filename, dialog.get_extra_widget().get_active()) | def openButton_click(self, widget): dialog = gtk.FileChooserDialog(title=_("Open Contact"),action=gtk.FILE_CHOOSER_ACTION_OPEN,buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK)) filter = gtk.FileFilter() filter.set_name(_("vCard Files")) filter.add_mime_type("application/vcard") filter.add_mime_type("text/x-vcard") dialog.add_filter(filter) filter = gtk.FileFilter() filter.set_name(_("All Files")) filter.add_pattern("*") dialog.add_filter(filter) check = gtk.CheckButton(_("Import to contactlist")) dialog.set_extra_widget(check) dialog.set_default_response(gtk.RESPONSE_OK) | 2ad15db6a51bfcf2a0840391722baa6f915c8e69 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2651/2ad15db6a51bfcf2a0840391722baa6f915c8e69/arkadas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
3616,
67,
7475,
12,
2890,
16,
3604,
4672,
6176,
273,
22718,
18,
812,
17324,
6353,
12,
2649,
33,
67,
2932,
3678,
13329,
6,
3631,
1128,
33,
4521,
79,
18,
3776,
67,
22213,
51,
2123,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
3616,
67,
7475,
12,
2890,
16,
3604,
4672,
6176,
273,
22718,
18,
812,
17324,
6353,
12,
2649,
33,
67,
2932,
3678,
13329,
6,
3631,
1128,
33,
4521,
79,
18,
3776,
67,
22213,
51,
2123,... |
if not len(ref) == 1: raise Exception('Failed to find one reference to %s. %s' % ( url.module_name, ref)) | if not ref: raise gclient_utils.Error('Failed to find one reference to %s. %s' % ( url.module_name, ref)) | def LateOverride(self, url): """Resolves the parsed url from url. | 21a852a5adfcef94e3f326c8281ddef4c796f902 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/21a852a5adfcef94e3f326c8281ddef4c796f902/gclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
511,
340,
6618,
12,
2890,
16,
880,
4672,
3536,
17453,
326,
2707,
880,
628,
880,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
511,
340,
6618,
12,
2890,
16,
880,
4672,
3536,
17453,
326,
2707,
880,
628,
880,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
keyval['Efficiency_C'] = total_bw/keyval['CPU_C'] | if keyval['CPU_C']: keyval['Efficiency_C'] = total_bw/keyval['CPU_C'] else: keyval['Efficiency_C'] = total_bw | def postprocess(self): """The following patterns parse the following outputs: TCP -- bidirectional 20080806120605,10.75.222.14,59744,10.75.222.13,5001,13,0.0-10.0,105054208,84029467 20080806120605,10.75.222.14,5001,10.75.222.13,46112,12,0.0-10.0,1176387584,940172245 CPU: 38.88% -- 85 samples | dc922cffa78641d46d2f63f718d7ace073d60d09 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/dc922cffa78641d46d2f63f718d7ace073d60d09/iperf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
2567,
12,
2890,
4672,
3536,
1986,
3751,
6884,
1109,
326,
3751,
6729,
30,
9911,
1493,
9949,
24699,
4044,
3672,
3672,
26,
22343,
4848,
25,
16,
2163,
18,
5877,
18,
28855,
18,
3461,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
2567,
12,
2890,
4672,
3536,
1986,
3751,
6884,
1109,
326,
3751,
6729,
30,
9911,
1493,
9949,
24699,
4044,
3672,
3672,
26,
22343,
4848,
25,
16,
2163,
18,
5877,
18,
28855,
18,
3461,
16... |
ORDER BY ac.constraint_name, loc.position""" | ORDER BY ac.constraint_name, loc.position, rem.position""" | def get_col_spec(self): return "BOOLEAN" | 81f6188b400b7b65819b738b3621378874dfef35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1074/81f6188b400b7b65819b738b3621378874dfef35/oracle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1293,
67,
2793,
12,
2890,
4672,
327,
315,
17900,
6,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1293,
67,
2793,
12,
2890,
4672,
327,
315,
17900,
6,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
wake = autoStartTimer.getWakeTime() | wake = autoStartTimer.update() | def onBootStartCheck(): global autoStartTimer print>>log, "[EPGImport] onBootStartCheck" now = int(time.time()) wake = autoStartTimer.getWakeTime() print>>log, "[EPGImport] now=%d wake=%d wake-now=%d" % (now, wake, wake-now) if (wake < 0) or (wake - now > 600): print>>log, "[EPGImport] starting import because auto-run on boot is enabled" autoStartTimer.runImport() else: print>>log, "[EPGImport] import to start in less than 10 minutes anyway, skipping..." | c591350f9b5900da893cac9104ccea096701fa4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10939/c591350f9b5900da893cac9104ccea096701fa4e/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
15817,
1685,
1564,
13332,
2552,
3656,
1685,
6777,
1172,
9778,
1330,
16,
5158,
10541,
43,
5010,
65,
603,
15817,
1685,
1564,
6,
2037,
273,
509,
12,
957,
18,
957,
10756,
19891,
273,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
15817,
1685,
1564,
13332,
2552,
3656,
1685,
6777,
1172,
9778,
1330,
16,
5158,
10541,
43,
5010,
65,
603,
15817,
1685,
1564,
6,
2037,
273,
509,
12,
957,
18,
957,
10756,
19891,
273,
36... |
def command_unquery(self, args): | def command_unquery(self, arg): | def command_unquery(self, args): """ /unquery """ room = self.current_room() if room.jid is not None: self.rooms.remove(room) self.window.refresh(self.rooms) | 1c7377804051166c26f33457378524d192077c66 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9814/1c7377804051166c26f33457378524d192077c66/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1296,
67,
318,
2271,
12,
2890,
16,
1501,
4672,
3536,
342,
318,
2271,
3536,
7725,
273,
365,
18,
2972,
67,
13924,
1435,
309,
7725,
18,
18252,
353,
486,
599,
30,
365,
18,
13924,
87,
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1296,
67,
318,
2271,
12,
2890,
16,
1501,
4672,
3536,
342,
318,
2271,
3536,
7725,
273,
365,
18,
2972,
67,
13924,
1435,
309,
7725,
18,
18252,
353,
486,
599,
30,
365,
18,
13924,
87,
18,
... |
q.put((self.path, event)) | out_event_queue.put((self.path, event)) | def process_events(self): event_list = self.kq.control(list(self.kevent_list), MAX_EVENTS) | 09ecd9924d39b4cf792a21ecb88668e201f538fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14346/09ecd9924d39b4cf792a21ecb88668e201f538fd/kqueue_observer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
5989,
12,
2890,
4672,
871,
67,
1098,
273,
365,
18,
79,
85,
18,
7098,
12,
1098,
12,
2890,
18,
79,
2575,
67,
1098,
3631,
4552,
67,
29221,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
5989,
12,
2890,
4672,
871,
67,
1098,
273,
365,
18,
79,
85,
18,
7098,
12,
1098,
12,
2890,
18,
79,
2575,
67,
1098,
3631,
4552,
67,
29221,
13,
2,
-100,
-100,
-100,
-100,
-100,... |
"times", "getlogin", "getloadavg", "tmpnam", | "times", "getloadavg", "tmpnam", | def testNoArgFunctions(self): # test posix functions which take no arguments and have # no side-effects which we need to cleanup (e.g., fork, wait, abort) NO_ARG_FUNCTIONS = [ "ctermid", "getcwd", "getcwdu", "uname", "times", "getlogin", "getloadavg", "tmpnam", "getegid", "geteuid", "getgid", "getgroups", "getpid", "getpgrp", "getppid", "getuid", ] for name in NO_ARG_FUNCTIONS: posix_func = getattr(posix, name, None) if posix_func is not None: posix_func() self.assertRaises(TypeError, posix_func, 1) | 71b13e8b4c4aad547d870a63e9b2f8784835eb2f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/71b13e8b4c4aad547d870a63e9b2f8784835eb2f/test_posix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2279,
4117,
7503,
12,
2890,
4672,
468,
1842,
16366,
4186,
1492,
4862,
1158,
1775,
471,
1240,
468,
1158,
4889,
17,
13867,
87,
1492,
732,
1608,
358,
6686,
261,
73,
18,
75,
12990,
125... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2279,
4117,
7503,
12,
2890,
4672,
468,
1842,
16366,
4186,
1492,
4862,
1158,
1775,
471,
1240,
468,
1158,
4889,
17,
13867,
87,
1492,
732,
1608,
358,
6686,
261,
73,
18,
75,
12990,
125... |
self.body_prefix = ['\n%%% Body\n'] | self.body_prefix = ['\n%%% Body\n\\begin{document}\n'] | def __init__(self, document): nodes.NodeVisitor.__init__(self, document) self.settings = settings = document.settings self.latex_encoding = self.to_latex_encoding(settings.output_encoding) self.use_latex_toc = settings.use_latex_toc self.use_latex_docinfo = settings.use_latex_docinfo self.use_latex_footnotes = settings.use_latex_footnotes self._use_latex_citations = settings.use_latex_citations self.embed_stylesheet = settings.embed_stylesheet self._reference_label = settings.reference_label self.hyperlink_color = settings.hyperlink_color self.compound_enumerators = settings.compound_enumerators self.font_encoding = settings.font_encoding self.section_prefix_for_enumerators = ( settings.section_prefix_for_enumerators) self.section_enumerator_separator = ( settings.section_enumerator_separator.replace('_', '\\_')) if self.hyperlink_color == '0': self.hyperlink_color = 'black' self.colorlinks = 'false' else: self.colorlinks = 'true' if self.settings.literal_block_env != '': self.settings.use_verbatim_when_possible = True if self.settings.use_bibtex: self.bibtex = self.settings.use_bibtex.split(',',1) # TODO avoid errors on not declared citations. else: self.bibtex = None # language: labels, bibliographic_fields, and author_separators. # to allow writing labes for specific languages. self.language = languages.get_language(settings.language_code) self.babel = Babel(settings.language_code) self.author_separator = self.language.author_separators[0] self.d_options = self.settings.documentoptions if self.babel.get_language(): self.d_options += ',%s' % self.babel.get_language() self.latex_equivalents[u'\u00A0'] = self.babel.nobr | e6dd1bf37f940e4bb62e65a85b414caa9a5c54aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5620/e6dd1bf37f940e4bb62e65a85b414caa9a5c54aa/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1668,
4672,
2199,
18,
907,
7413,
16186,
2738,
972,
12,
2890,
16,
1668,
13,
365,
18,
4272,
273,
1947,
273,
1668,
18,
4272,
365,
18,
26264,
67,
5999,
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,
1668,
4672,
2199,
18,
907,
7413,
16186,
2738,
972,
12,
2890,
16,
1668,
13,
365,
18,
4272,
273,
1947,
273,
1668,
18,
4272,
365,
18,
26264,
67,
5999,
273,
... |
newbucket = Bucket(calendar=self, startdate=start, value=value) newbucket.save() | Bucket(calendar=self, startdate=start, value=value).save() | def setvalue(self, start, end, value, user=None): '''Update calendar buckets such that the calendar value is changed in the specified date range. The admin log is updated if a user is passed as argument. ''' # Create a change log entry, if a user is specified if user: global CALENDARID if not CALENDARID: CALENDARID = ContentType.objects.get_for_model(models.get_model('input','calendar')).id LogEntry.objects.log_action( user.id, CALENDARID, self.name, self.name, CHANGE, "Updated value to %s for the daterange %s to %s" % (value, start, end) ) for b in self.buckets.all(): if b.enddate <= start: # Earlier bucket continue elif b.startdate >= end: # Later bucket return elif b.startdate == start and b.enddate <= end: # Overwrite entire bucket b.value = value b.save() elif b.startdate >= start and b.enddate <= end: # Bucket became redundant b.delete() elif b.startdate < start and b.enddate > end: # New value is completely within this bucket newbucket = Bucket(calendar=self, startdate=start, value=value) newbucket.save() newbucket = Bucket(calendar=self, startdate=end, value=b.value) newbucket.save() elif b.startdate < start: # An existing bucket is partially before the new daterange newbucket = Bucket(calendar=self, startdate=start, value=value) newbucket.save() elif b.enddate > end: # An existing bucket is partially after the new daterange newbucket = Bucket(calendar=self, startdate=b.startdate, value=value) newbucket.save() b.startdate = end b.save() return | d2095577795f63005c897c11277c19930f5fddda /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8604/d2095577795f63005c897c11277c19930f5fddda/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
1132,
12,
2890,
16,
787,
16,
679,
16,
460,
16,
729,
33,
7036,
4672,
9163,
1891,
5686,
9169,
4123,
716,
326,
5686,
460,
353,
3550,
316,
326,
1269,
1509,
1048,
18,
1021,
3981,
613,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1132,
12,
2890,
16,
787,
16,
679,
16,
460,
16,
729,
33,
7036,
4672,
9163,
1891,
5686,
9169,
4123,
716,
326,
5686,
460,
353,
3550,
316,
326,
1269,
1509,
1048,
18,
1021,
3981,
613,
... |
def save_gp(self, filepath=None, **kwargw): | def save_gp(self, filepath=None, **kwargs): | def save_gp(self, filepath=None, **kwargw): '''Save file that can be opened with gnuplot.''' s = self.get_commands() s += self.create_plot_command(fullpath=False) self._write_gp(s, filepath=filepath, **kwargs) | 473bf5663b2e84cfd870b1a85e6f13fba80ce6df /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6471/473bf5663b2e84cfd870b1a85e6f13fba80ce6df/qtgnuplot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
6403,
12,
2890,
16,
3608,
33,
7036,
16,
2826,
4333,
4672,
9163,
4755,
585,
716,
848,
506,
10191,
598,
314,
13053,
4032,
1093,
6309,
272,
273,
365,
18,
588,
67,
7847,
1435,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6403,
12,
2890,
16,
3608,
33,
7036,
16,
2826,
4333,
4672,
9163,
4755,
585,
716,
848,
506,
10191,
598,
314,
13053,
4032,
1093,
6309,
272,
273,
365,
18,
588,
67,
7847,
1435,
27... |
def processComment(self, data): self.parser.document.appendChild(CommentNode(data)) | def processComment(self, data): self.parser.document.appendChild(CommentNode(data)) | 22ba9dab3834147341a8aa3162fe6c07a00e7dcb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10463/22ba9dab3834147341a8aa3162fe6c07a00e7dcb/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
4469,
12,
2890,
16,
501,
4672,
365,
18,
4288,
18,
5457,
18,
6923,
1763,
12,
4469,
907,
12,
892,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
4469,
12,
2890,
16,
501,
4672,
365,
18,
4288,
18,
5457,
18,
6923,
1763,
12,
4469,
907,
12,
892,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
def docbuiltin(self, object): """Produce text documentation for a built-in function object.""" return (self.bold(object.__name__) + '(...)\n' + rstrip(self.indent(object.__doc__)) + '\n') | def docfunction(self, object): """Produce text documentation for a function object.""" try: args, varargs, varkw, defaults = inspect.getargspec(object) argspec = inspect.formatargspec( args, varargs, varkw, defaults, formatvalue=self.formatvalue) except TypeError: argspec = '(...)' | 66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
915,
12,
2890,
16,
733,
4672,
3536,
25884,
977,
7323,
364,
279,
445,
733,
12123,
775,
30,
833,
16,
19732,
16,
569,
9987,
16,
3467,
273,
5334,
18,
588,
23172,
12,
1612,
13,
23837,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
915,
12,
2890,
16,
733,
4672,
3536,
25884,
977,
7323,
364,
279,
445,
733,
12123,
775,
30,
833,
16,
19732,
16,
569,
9987,
16,
3467,
273,
5334,
18,
588,
23172,
12,
1612,
13,
23837,
... | |
self.assertEqual(m, t.__dict__[meth]) | self.assertEqual(getattr(m, 'im_func', m), t.__dict__[meth]) | def ternop_test(self, a, b, c, res, expr="a[b:c]", meth="__getslice__"): d = {'a': a, 'b': b, 'c': c} self.assertEqual(eval(expr, d), res) t = type(a) m = getattr(t, meth) while meth not in t.__dict__: t = t.__bases__[0] self.assertEqual(m, t.__dict__[meth]) self.assertEqual(m(a, b, c), res) bm = getattr(a, meth) self.assertEqual(bm(b, c), res) | 36f4733acef5aa12ca3417779ae3f11e59199f70 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/36f4733acef5aa12ca3417779ae3f11e59199f70/test_descr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
8865,
556,
67,
3813,
12,
2890,
16,
279,
16,
324,
16,
276,
16,
400,
16,
3065,
1546,
69,
63,
70,
30,
71,
65,
3113,
7917,
1546,
972,
588,
6665,
14437,
4672,
302,
273,
13666,
69,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
8865,
556,
67,
3813,
12,
2890,
16,
279,
16,
324,
16,
276,
16,
400,
16,
3065,
1546,
69,
63,
70,
30,
71,
65,
3113,
7917,
1546,
972,
588,
6665,
14437,
4672,
302,
273,
13666,
69,
... |
print "x,y scale: %s, %s" % (x_scale, y_scale) | def draw_on(self, drawing, frame): """Draw the scatterplot.""" assert isinstance(drawing, Drawing) width, height = self.size x_vals = self.xy_dict.keys() max_y = 0 for x in x_vals: largest = max(self.xy_dict[x]) if largest > max_y: max_y = largest x_scale = float(width) / max(x_vals) y_scale = float(height) / max_y print "x,y scale: %s, %s" % (x_scale, y_scale) drawing.comment("Scatterplot Layer") # Save context drawing.push() drawing.fill(None) # Draw axes drawing.comment("Axes of scatterplot") drawing.push() drawing.stroke('black') drawing.stroke_width(3) drawing.polyline([(0, 0), (0, height), (width, height)]) drawing.pop() | edee111cabddd047c31e51f145e946155e81fcca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4675/edee111cabddd047c31e51f145e946155e81fcca/layer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
67,
265,
12,
2890,
16,
16327,
16,
2623,
4672,
3536,
6493,
326,
14644,
4032,
12123,
1815,
1549,
12,
9446,
310,
16,
10184,
310,
13,
1835,
16,
2072,
273,
365,
18,
1467,
619,
67,
452... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
67,
265,
12,
2890,
16,
16327,
16,
2623,
4672,
3536,
6493,
326,
14644,
4032,
12123,
1815,
1549,
12,
9446,
310,
16,
10184,
310,
13,
1835,
16,
2072,
273,
365,
18,
1467,
619,
67,
452... | |
print _("could not create "), legend | self.logger.debug(_("could %s not create ") % legend) | def check_create(self, check_name, legend, folder=True): if not exists(check_name): try: if folder: mkdir(check_name) else: open(check_name, "w") print legend, _("created") except: print _("could not create "), legend exit() | 213ab6e45a494f2064aa636fb3916c152c7744e4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9838/213ab6e45a494f2064aa636fb3916c152c7744e4/Core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
2640,
12,
2890,
16,
866,
67,
529,
16,
7241,
16,
3009,
33,
5510,
4672,
309,
486,
1704,
12,
1893,
67,
529,
4672,
775,
30,
309,
3009,
30,
6535,
12,
1893,
67,
529,
13,
469,
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,
866,
67,
2640,
12,
2890,
16,
866,
67,
529,
16,
7241,
16,
3009,
33,
5510,
4672,
309,
486,
1704,
12,
1893,
67,
529,
4672,
775,
30,
309,
3009,
30,
6535,
12,
1893,
67,
529,
13,
469,
30... |
def runner(self, command): | def runner(self, *args): | def runner(self, command): """ The default command runner. Override this in a subclass if you want to write your own auto-dependency runner.""" return self.smart_runner(command) | de8ed355fef3c5fd7a14c435783f5e59145a2f2b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7381/de8ed355fef3c5fd7a14c435783f5e59145a2f2b/fabricate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8419,
12,
2890,
16,
380,
1968,
4672,
3536,
1021,
805,
1296,
8419,
18,
1439,
333,
316,
279,
10177,
309,
1846,
2545,
358,
1045,
3433,
4953,
3656,
17,
15896,
8419,
12123,
327,
365,
18,
2641... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8419,
12,
2890,
16,
380,
1968,
4672,
3536,
1021,
805,
1296,
8419,
18,
1439,
333,
316,
279,
10177,
309,
1846,
2545,
358,
1045,
3433,
4953,
3656,
17,
15896,
8419,
12123,
327,
365,
18,
2641... |
self.current['comment'], | changelog, | def endElement(self, name): if name == 'patch': # Sort the paths to make tests easier self.current['entries'].sort(lambda x,y: cmp(x.name, y.name)) cset = Changeset(self.current['name'], self.current['date'], self.current['author'], self.current['comment'], self.current['entries']) | 63b166e5675fdc221094b22724138f7015629cb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5981/63b166e5675fdc221094b22724138f7015629cb3/darcs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14840,
12,
2890,
16,
508,
4672,
309,
508,
422,
296,
2272,
4278,
468,
5928,
326,
2953,
358,
1221,
7434,
15857,
365,
18,
2972,
3292,
8219,
29489,
3804,
12,
14661,
619,
16,
93,
30,
9411,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14840,
12,
2890,
16,
508,
4672,
309,
508,
422,
296,
2272,
4278,
468,
5928,
326,
2953,
358,
1221,
7434,
15857,
365,
18,
2972,
3292,
8219,
29489,
3804,
12,
14661,
619,
16,
93,
30,
9411,
... |
G.shift(self.x,self.y) | G.shift(x,y) | def draw(self): fillColor = self.fillColor strokeColor = self.strokeColor g = Group() bg = self.background shadow = self.shadow if bg: shadow = Color(bg.red*shadow,bg.green*shadow,bg.blue*shadow) self._paintLogo(g,dy=-2.5, dx=2,fillColor=shadow) self._paintLogo(g,fillColor=fillColor) g.skew(kx=10, ky=0) g.shift(0,35.5) G = Group() G.add(g) _w, _h = 129, 86 w, h = self.width, self.height if w!=_w or h!=_h: G.scale(w/float(_w),h/float(_h)) if bg is not None: G.insert(0,Rect(0,0,w,h,fillColor=bg,strokeColor=None)) | 52735650fe65e7b701c80dd27326b3086bdc15b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/52735650fe65e7b701c80dd27326b3086bdc15b9/corp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
3636,
2957,
273,
365,
18,
5935,
2957,
11040,
2957,
273,
365,
18,
16181,
2957,
314,
273,
3756,
1435,
7611,
273,
365,
18,
9342,
10510,
273,
365,
18,
19119,
309,
7611,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
3636,
2957,
273,
365,
18,
5935,
2957,
11040,
2957,
273,
365,
18,
16181,
2957,
314,
273,
3756,
1435,
7611,
273,
365,
18,
9342,
10510,
273,
365,
18,
19119,
309,
7611,... |
status = """<b><span class="warning">ERROR 2:Query</span></b>""" | status = """<b><span class="warning">2:Query</span></b>""" | def perform_validateconf(colID, ln, confirm=0, callback='yes'): """Validation of the configuration of the collections""" subtitle = """<a name="11"></a>Collections Status""" output = "" colID = int(colID) col_dict = dict(get_def_name('', "collection")) collections = run_sql("SELECT id, name, dbquery, restricted FROM collection ORDER BY id") header = ['Id', 'Name', 'Query', 'Subcollections', 'Restricted', 'I8N','Status'] rnk_list = get_def_name('', "rnkMETHOD") actions = [] for (id, name, dbquery, restricted) in collections: reg_sons = len(get_col_tree(id, 'r')) vir_sons = len(get_col_tree(id, 'v')) status = "" langs = run_sql("SELECT ln from collectionname where id_collection=%s" % id) i8n = "" if len(langs) > 0: for lang in langs: i8n += "%s, " % lang else: i8n = """<b><span class="info">None</span></b>""" if (reg_sons > 1 and dbquery) or dbquery=="": status = """<b><span class="warning">ERROR 1:Query</span></b>""" elif dbquery is None and reg_sons == 1: status = """<b><span class="warning">ERROR 2:Query</span></b>""" elif dbquery == "" and reg_sons == 1: status = """<b><span class="warning">ERROR 3:Query</span></b>""" if (reg_sons > 1 or vir_sons > 1): subs = """<b><span class="info">Yes</span></b>""" else: subs = """<b><span class="info">No</span></b>""" if dbquery is None: dbquery = """<b><span class="info">No</span></b>""" if restricted == "": restricted = "" if status: status += """<b><span class="warning">,4:Restricted</span></b>""" else: status += """<b><span class="warning">ERROR 4:Restricted</span></b>""" elif restricted is None: restricted = """<b><span class="info">No</span></b>""" if status == "": status = """<b><span class="info">OK</span></b>""" actions.append([id, """<a href="%s/admin/websearch/websearchadmin.py/editcollection?colID=%s&ln=%s">%s</a>""" % (weburl, id, ln, name), dbquery, subs, restricted, i8n, status]) output += tupletotable(header=header, tuple=actions) try: body = [output, extra] except NameError: body = [output] if callback: return perform_index(colID, ln, "perform_validateconf", addadminbox(subtitle, body)) else: return addadminbox(subtitle, body) | 31263b92d0781de306d2784945c4ebefc2a5f3ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/31263b92d0781de306d2784945c4ebefc2a5f3ac/websearchadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
5662,
3923,
12,
1293,
734,
16,
7211,
16,
6932,
33,
20,
16,
1348,
2218,
9707,
11,
4672,
3536,
4354,
434,
326,
1664,
434,
326,
6980,
8395,
225,
20281,
273,
3536,
32,
69,
508,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
5662,
3923,
12,
1293,
734,
16,
7211,
16,
6932,
33,
20,
16,
1348,
2218,
9707,
11,
4672,
3536,
4354,
434,
326,
1664,
434,
326,
6980,
8395,
225,
20281,
273,
3536,
32,
69,
508,
... |
first = 0 if values is None: selection.select_path((0,)) else: for row in model: if row[0] in values: selection.select_path(row.path) first = first or row.path[0] if first == 0: selection.select_path((0,)) if jump and len(model): self.scroll_to_cell(first) | first = None if None in values: selection.select_path((0,)) first = ((0,)) for row in model: if row[0] != ALL and row[1].key in values: selection.select_path(row.path) first = first or row.path if jump and first: self.scroll_to_cell(first) | def set_selected(self, values, jump=False): model = self.get_model() selection = self.get_selection() if values == self.get_selected(): model, rows = selection.get_selected_rows() for row in rows: self.scroll_to_cell(row) break return elif values is None and selection.path_is_selected((0,)): return | 65c353a2f58dd189cd3918d5836dbf8ca05e5f5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4764/65c353a2f58dd189cd3918d5836dbf8ca05e5f5f/paned.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
8109,
12,
2890,
16,
924,
16,
11833,
33,
8381,
4672,
938,
273,
365,
18,
588,
67,
2284,
1435,
4421,
273,
365,
18,
588,
67,
10705,
1435,
309,
924,
422,
365,
18,
588,
67,
8109,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8109,
12,
2890,
16,
924,
16,
11833,
33,
8381,
4672,
938,
273,
365,
18,
588,
67,
2284,
1435,
4421,
273,
365,
18,
588,
67,
10705,
1435,
309,
924,
422,
365,
18,
588,
67,
8109,
... |
ui.status(_('basic commands:\n\n')) | header = _('basic commands:\n\n') | def helpext(name): try: mod = extensions.find(name) except KeyError: raise cmdutil.UnknownCommand(name) | 1f927f278317cc1ccdc32f468ac904e391fcef70 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/1f927f278317cc1ccdc32f468ac904e391fcef70/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2809,
408,
12,
529,
4672,
775,
30,
681,
273,
4418,
18,
4720,
12,
529,
13,
1335,
4999,
30,
1002,
24884,
18,
4874,
2189,
12,
529,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2809,
408,
12,
529,
4672,
775,
30,
681,
273,
4418,
18,
4720,
12,
529,
13,
1335,
4999,
30,
1002,
24884,
18,
4874,
2189,
12,
529,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
res = c.fetchone() if res: file_id = res[0] else: print 'File %r not in database. Not on mirrors yet? Inserting.' % self.src_rel | res_filearr = c.fetchone() if res_filearr: file_id = res_filearr[0] c.execute("SELECT file_id, mtime, size FROM hash WHERE file_id = %s LIMIT 1", [file_id]) res_hash = c.fetchone() else: print 'File %r not in database. Not on mirrors yet? Will be inserted.' % self.src_rel file_id = None res_hash = None if not res_hash: if dry_run: print 'Would create hashes in db for: ', self.src_rel return if self.hb.empty: self.hb.fill(verbose=verbose) if self.hb.empty: sys.stderr.write('skipping db hash generation\n') return c.execute("BEGIN") | def check_db(self, conn, verbose=False, dry_run=False, force=False): """check if the hashes that are stored in the database are up to date for performance, this function talks very low level to the database""" # get a database cursor, but make it persistent which is faster try: conn.mycursor except AttributeError: conn.mycursor = conn.Hash._connection.getConnection().cursor() c = conn.mycursor | ef0c889e6b860a33e3563a751fac9ad31ab50ab2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10990/ef0c889e6b860a33e3563a751fac9ad31ab50ab2/hashes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1966,
12,
2890,
16,
1487,
16,
3988,
33,
8381,
16,
10299,
67,
2681,
33,
8381,
16,
2944,
33,
8381,
4672,
3536,
1893,
309,
326,
9869,
716,
854,
4041,
316,
326,
2063,
854,
731,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1966,
12,
2890,
16,
1487,
16,
3988,
33,
8381,
16,
10299,
67,
2681,
33,
8381,
16,
2944,
33,
8381,
4672,
3536,
1893,
309,
326,
9869,
716,
854,
4041,
316,
326,
2063,
854,
731,
... |
nbd = NA.zeros((n,), NA.Int) | nbd = NA.zeros((n,), NA.Int32) | def func_and_grad(x): f = func(x, *args) g = fprime(x, *args) return f, g | 4f45d3d90a3ca78491a1a589df0d34c7a011e42d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/4f45d3d90a3ca78491a1a589df0d34c7a011e42d/lbfgsb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1326,
67,
464,
67,
9974,
12,
92,
4672,
284,
273,
1326,
12,
92,
16,
380,
1968,
13,
314,
273,
284,
16382,
12,
92,
16,
380,
1968,
13,
327,
284,
16,
314,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1326,
67,
464,
67,
9974,
12,
92,
4672,
284,
273,
1326,
12,
92,
16,
380,
1968,
13,
314,
273,
284,
16382,
12,
92,
16,
380,
1968,
13,
327,
284,
16,
314,
2,
-100,
-100,
-100,
-100,
-10... |
self.atcr = data.endswith(u"\r") if self.atcr and size is None: | if data.endswith(u"\r"): | def readline(self, size=None, keepends=True): | 726050eec20d94e5c75880fe069f0aeea595c117 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/726050eec20d94e5c75880fe069f0aeea595c117/codecs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12023,
12,
2890,
16,
963,
33,
7036,
16,
3455,
5839,
33,
5510,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12023,
12,
2890,
16,
963,
33,
7036,
16,
3455,
5839,
33,
5510,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
return '' def GetAvailableAuthMethods(self, iwlistauth=None): | def GetOperationalMode(self, iwconfig=None): """ Get the MAC address for the interface. """ # TODO: implement me return '' | 1e65babbd91a128171b8b012ccfd017dab3b717f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12280/1e65babbd91a128171b8b012ccfd017dab3b717f/be-ioctl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2988,
287,
2309,
12,
2890,
16,
25522,
1425,
33,
7036,
4672,
3536,
968,
326,
14246,
1758,
364,
326,
1560,
18,
3536,
468,
2660,
30,
2348,
1791,
327,
875,
2,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2988,
287,
2309,
12,
2890,
16,
25522,
1425,
33,
7036,
4672,
3536,
968,
326,
14246,
1758,
364,
326,
1560,
18,
3536,
468,
2660,
30,
2348,
1791,
327,
875,
2,
-100,
-100,
-100,
-100,
... | |
windows = [win for win in windows if win.Parent == parent] | windows = [win for win in windows if handleprops.parent(win) == parent] | def find_windows(class_name = None, class_name_re = None, parent = None, process = None, title = None, title_re = None, top_level_only = True, visible_only = True, enabled_only = True, #best_match = None ): """Find windows based on criteria passed in Possible values are: class_name Windows with this window class class_name_re Windows whose class match this regular expression parent Windows that are children of this process Windows running in this process title Windows with this Text title_re Windows whose Text match this regular expression top_level_only Top level windows only (default=True) visible_only Visible windows only (default=True) enabled_only Enabled windows only (default=True) """ if top_level_only: windows = enum_windows() if parent: windows = [win for win in windows if win.Parent == parent] else: if parent: windows = enum_child_windows(parent) else: # find all the children of the desktop parent = win32functions.GetDesktopWindow() windows = enum_child_windows(parent) windows = [win for win in windows if handleprops.parent(win) == parent] if class_name and windows: windows = [win for win in windows if class_name == handleprops.classname(win)] if class_name_re and windows: windows = [win for win in windows if re.match(class_name_re, handleprops.classname(win))] if process and windows: windows = [win for win in windows if handleprops.processid(win) == process] if title and windows: windows = [win for win in windows if title == handleprops.text(win)] elif title_re and windows: windows = [win for win in windows if re.match(title_re, handleprops.text(win))] | ffa30b7ca2fbd9870b339e62108d49afd5a6699f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6953/ffa30b7ca2fbd9870b339e62108d49afd5a6699f/findwindows.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
13226,
12,
1106,
67,
529,
273,
599,
16,
667,
67,
529,
67,
266,
273,
599,
16,
982,
273,
599,
16,
1207,
273,
599,
16,
2077,
273,
599,
16,
2077,
67,
266,
273,
599,
16,
1760,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
13226,
12,
1106,
67,
529,
273,
599,
16,
667,
67,
529,
67,
266,
273,
599,
16,
982,
273,
599,
16,
1207,
273,
599,
16,
2077,
273,
599,
16,
2077,
67,
266,
273,
599,
16,
1760,... |
elif lastchar == os.sep: | elif lastchar in SEPS: | def try_open_completions_event(self, event): """Happens when it would be nice to open a completion list, but not really neccesary, for example after an dot, so function calls won't be made. """ lastchar = self.text.get("insert-1c") if lastchar == ".": self._open_completions_later(False, False, False, COMPLETE_ATTRIBUTES) elif lastchar == os.sep: self._open_completions_later(False, False, False, COMPLETE_FILES) | 4a48c9e3f632e83bf9ced0e3bbee093da93f5b3c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/4a48c9e3f632e83bf9ced0e3bbee093da93f5b3c/AutoComplete.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
775,
67,
3190,
67,
7806,
1115,
67,
2575,
12,
2890,
16,
871,
4672,
3536,
44,
10345,
1347,
518,
4102,
506,
13752,
358,
1696,
279,
8364,
666,
16,
1496,
486,
8654,
290,
557,
764,
814,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
775,
67,
3190,
67,
7806,
1115,
67,
2575,
12,
2890,
16,
871,
4672,
3536,
44,
10345,
1347,
518,
4102,
506,
13752,
358,
1696,
279,
8364,
666,
16,
1496,
486,
8654,
290,
557,
764,
814,
16,
... |
if job.runningJob['schedulerId'] is None: | if job.runningJob['schedulerId'] is None \ and job['name'] not in self.failedSubmission: | def doSubmit(self): """ __doSubmit__ | 01d17db2acf7930660260bdff56a19d1757566b1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/01d17db2acf7930660260bdff56a19d1757566b1/BossLiteBulkInterface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
11620,
12,
2890,
4672,
3536,
1001,
2896,
11620,
972,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
741,
11620,
12,
2890,
4672,
3536,
1001,
2896,
11620,
972,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
packet = devh.interruptRead(usb.ENDPOINT_IN + 1, 0x0000008, 10000) errors = 0 | try: packet = devh.interruptRead(usb.ENDPOINT_IN + 1, 0x0000008, 10000) errors = 0 except usb.USBError as e: if e.args == ('No error',): self._logger.debug('USBError("No error") exception received. Ignoring...(http://bugs.debian.org/476796)') packet = None else: raise e | def _run(self, devh): input_buffer = [] errors = 0 while True: try: packet = devh.interruptRead(usb.ENDPOINT_IN + 1, # endpoint number 0x0000008, # bytes to read 10000) # timeout (10 seconds) errors = 0 except Exception, e: self._logger.exception("Exception reading interrupt: "+ str(e)) errors = errors + 1 if errors > 3: break ## Maximum 3 consecutive errors before reconnection time.sleep(3) | f16f5b2cf29d41b7877367ab8000adcb237b7d9b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3323/f16f5b2cf29d41b7877367ab8000adcb237b7d9b/WMRS200Reader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2681,
12,
2890,
16,
4461,
76,
4672,
810,
67,
4106,
273,
5378,
1334,
273,
374,
1323,
1053,
30,
775,
30,
4414,
273,
4461,
76,
18,
31847,
1994,
12,
25525,
18,
18506,
67,
706,
397,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2681,
12,
2890,
16,
4461,
76,
4672,
810,
67,
4106,
273,
5378,
1334,
273,
374,
1323,
1053,
30,
775,
30,
4414,
273,
4461,
76,
18,
31847,
1994,
12,
25525,
18,
18506,
67,
706,
397,
... |
self._count2types = invertDict(type2count) | self._count2types = invertDictLossless(type2count) | def __init__(self, objects): self._objs = list(objects) self._type2objs = {} self._count2types = {} self._len2obj = {} type2count = {} for obj in self._objs: typ = itype(obj) type2count.setdefault(typ, 0) type2count[typ] += 1 self._type2objs.setdefault(typ, []) self._type2objs[typ].append(obj) try: self._len2obj[len(obj)] = obj except: pass self._count2types = invertDict(type2count) | 3ca67a4446150254249b7af7a05e2ea39a6c2405 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/3ca67a4446150254249b7af7a05e2ea39a6c2405/ObjectPool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2184,
4672,
365,
6315,
18093,
273,
666,
12,
6911,
13,
365,
6315,
723,
22,
18093,
273,
2618,
365,
6315,
1883,
22,
2352,
273,
2618,
365,
6315,
1897,
22,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2184,
4672,
365,
6315,
18093,
273,
666,
12,
6911,
13,
365,
6315,
723,
22,
18093,
273,
2618,
365,
6315,
1883,
22,
2352,
273,
2618,
365,
6315,
1897,
22,
26... |
return instance.children.in_navigation() | \ | queryset = instance.children.in_navigation() | \ | def entries(self, instance, level=1, depth=1, show_all_subnav=False): if level <= 1: if depth == 1: return Page.objects.toplevel_navigation() elif show_all_subnav: return Page.objects.in_navigation().filter(level__lt=depth) else: return Page.objects.toplevel_navigation() | \ instance.get_ancestors().filter(in_navigation=True) | \ instance.get_siblings(include_self=True).filter(in_navigation=True, level__lt=depth) | \ instance.children.filter(in_navigation=True, level__lt=depth) | 4e262d60778420ddf57e19cae98c29677c5109fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10899/4e262d60778420ddf57e19cae98c29677c5109fa/incunafein_tags.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3222,
12,
2890,
16,
791,
16,
1801,
33,
21,
16,
3598,
33,
21,
16,
2405,
67,
454,
67,
1717,
11589,
33,
8381,
4672,
309,
1801,
1648,
404,
30,
309,
3598,
422,
404,
30,
327,
3460,
18,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3222,
12,
2890,
16,
791,
16,
1801,
33,
21,
16,
3598,
33,
21,
16,
2405,
67,
454,
67,
1717,
11589,
33,
8381,
4672,
309,
1801,
1648,
404,
30,
309,
3598,
422,
404,
30,
327,
3460,
18,
6... |
error_handler=log.err) | error_handler=d.errback) | def check_numeric_oper_too(imsi): # we should be registered with out home network self.failUnless(imsi.startswith(numeric_oper)) d.callback(True) | 45c00959c14e666ef31b3f93137f14e6d66959e4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12036/45c00959c14e666ef31b3f93137f14e6d66959e4/test_dbus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
5246,
67,
4063,
67,
16431,
12,
381,
7722,
4672,
468,
732,
1410,
506,
4104,
598,
596,
6382,
2483,
365,
18,
6870,
984,
2656,
12,
381,
7722,
18,
17514,
1918,
12,
5246,
67,
4063,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
866,
67,
5246,
67,
4063,
67,
16431,
12,
381,
7722,
4672,
468,
732,
1410,
506,
4104,
598,
596,
6382,
2483,
365,
18,
6870,
984,
2656,
12,
381,
7722,
18,
17514,
1918,
12,
5246,
67,
4063,
... |
TESTS: | TESTS:: | def random_all_graph_colorings(self,tests = 1000): """ Verifies the results of all_graph_colorings in three ways: 1) all colorings are unique 2) number of m-colorings is P(m) (where P is the chromatic polynomial of the graph being tested) 3) colorings are valid -- that is, that no two vertices of the same color share an edge. | ccfc053e0300fe1bc0d898174322301c9db7ff10 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/ccfc053e0300fe1bc0d898174322301c9db7ff10/graph_coloring.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2744,
67,
454,
67,
4660,
67,
3266,
899,
12,
2890,
16,
16341,
273,
4336,
4672,
3536,
6160,
5032,
326,
1686,
434,
777,
67,
4660,
67,
3266,
899,
316,
8925,
16226,
30,
404,
13,
777,
2036,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2744,
67,
454,
67,
4660,
67,
3266,
899,
12,
2890,
16,
16341,
273,
4336,
4672,
3536,
6160,
5032,
326,
1686,
434,
777,
67,
4660,
67,
3266,
899,
316,
8925,
16226,
30,
404,
13,
777,
2036,
... |
def _find_groups(self): self._groups = [] if self._tmp_groups: elts = {} processed = {} for m in self.allmethods(): elts[m.name()] = m.target() for p in self.properties(): elts[p.name()] = p.target() for v in self.ivariables(): elts[v.name()] = v.uid() for v in self.cvariables(): elts[v.name()] = v.uid() for c in self.subclasses(): elts[c.name()] = c.uid() for name in self._tmp_group_order: members = self._tmp_groups[name] group = [] for member in members: try: group.append(elts[member]) processed[member] = name del elts[member] except KeyError: if processed.has_key(member): estr = ('%s.%s is already in group %s.' % (self.uid(), member, processed[member])) else: estr = ('Group member not found: %s.%s' % (self.uid(), member)) self._field_warnings.append(estr) if group: self._groups.append((name, group)) else: estr = 'Empty group %r deleted' % name self._field_warnings.append(estr) del self._tmp_groups del self._tmp_group_order | def _find_groups(self): # Put together groups self._groups = [] if self._tmp_groups: elts = {} processed = {} # For error messages. for m in self.allmethods(): elts[m.name()] = m.target() for p in self.properties(): elts[p.name()] = p.target() for v in self.ivariables(): elts[v.name()] = v.uid() for v in self.cvariables(): elts[v.name()] = v.uid() for c in self.subclasses(): elts[c.name()] = c.uid() for name in self._tmp_group_order: members = self._tmp_groups[name] group = [] for member in members: try: group.append(elts[member]) processed[member] = name del elts[member] except KeyError: if processed.has_key(member): estr = ('%s.%s is already in group %s.' % (self.uid(), member, processed[member])) else: estr = ('Group member not found: %s.%s' % (self.uid(), member)) self._field_warnings.append(estr) if group: self._groups.append((name, group)) else: estr = 'Empty group %r deleted' % name self._field_warnings.append(estr) del self._tmp_groups del self._tmp_group_order | ab822894d6e2a7d6720010ae6c6d714b5b5fea7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/ab822894d6e2a7d6720010ae6c6d714b5b5fea7f/objdoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
4650,
12,
2890,
4672,
468,
4399,
9475,
3252,
365,
6315,
4650,
273,
5378,
225,
309,
365,
6315,
5645,
67,
4650,
30,
415,
3428,
273,
2618,
5204,
273,
2618,
468,
2457,
555,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4720,
67,
4650,
12,
2890,
4672,
468,
4399,
9475,
3252,
365,
6315,
4650,
273,
5378,
225,
309,
365,
6315,
5645,
67,
4650,
30,
415,
3428,
273,
2618,
5204,
273,
2618,
468,
2457,
555,
... | |
tidier.process_directory(args[0], opts) | tidy.process_directory(args[0], opts) | def _cell(self, data, header=False): if header: data = '*%s*' % data self._output.write(data.encode('UTF-8') + '\t') | c415e0968259cb2290e0a1c1f65494d611b0c4d5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7408/c415e0968259cb2290e0a1c1f65494d611b0c4d5/robotidy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3855,
12,
2890,
16,
501,
16,
1446,
33,
8381,
4672,
309,
1446,
30,
501,
273,
14609,
9,
87,
4035,
738,
501,
365,
6315,
2844,
18,
2626,
12,
892,
18,
3015,
2668,
5159,
17,
28,
6134,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3855,
12,
2890,
16,
501,
16,
1446,
33,
8381,
4672,
309,
1446,
30,
501,
273,
14609,
9,
87,
4035,
738,
501,
365,
6315,
2844,
18,
2626,
12,
892,
18,
3015,
2668,
5159,
17,
28,
6134,... |
def __repr__(self): | self.max_entry = len(mu) def _repr_(self): | def __init__(self, n, mu): """ TESTS:: sage: SST = SemistandardTableaux(3, [2,1]) sage: SST == loads(dumps(SST)) True """ self.n = n self.mu = mu | 6ec7d5a4cd0b83ae5413f0375d51a0339f12b4b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6ec7d5a4cd0b83ae5413f0375d51a0339f12b4b7/tableau.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
290,
16,
4129,
4672,
3536,
22130,
55,
2866,
225,
272,
410,
30,
348,
882,
273,
15661,
376,
2958,
1388,
18196,
12,
23,
16,
306,
22,
16,
21,
5717,
272,
41... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
290,
16,
4129,
4672,
3536,
22130,
55,
2866,
225,
272,
410,
30,
348,
882,
273,
15661,
376,
2958,
1388,
18196,
12,
23,
16,
306,
22,
16,
21,
5717,
272,
41... |
i = 0 for text in self.texts: if text == data: return i else: i += 1 | return self.texts.index(data) | def addRawText( self, data ): # Find the text if data in self.texts: i = 0 for text in self.texts: if text == data: return i else: i += 1 else: # Insert the text self.texts.append( data ) return len( self.texts ) - 1 | 78d66f34808b4d474b797de5fc7cf6b4b1545a89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/78d66f34808b4d474b797de5fc7cf6b4b1545a89/gumps.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
4809,
1528,
12,
365,
16,
501,
262,
30,
468,
4163,
326,
977,
309,
501,
316,
365,
18,
26256,
30,
327,
365,
18,
26256,
18,
1615,
12,
892,
13,
469,
30,
468,
8040,
326,
977,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
4809,
1528,
12,
365,
16,
501,
262,
30,
468,
4163,
326,
977,
309,
501,
316,
365,
18,
26256,
30,
327,
365,
18,
26256,
18,
1615,
12,
892,
13,
469,
30,
468,
8040,
326,
977,
365,
1... |
selections.extend(sheet.as_atom_selections(params)) | try: selections.extend(sheet.as_atom_selections(params)) except RuntimeError, e : pass | def overall_sheet_selection (self, params=ss_input_params) : for sheet in self.sheets : selections.extend(sheet.as_atom_selections(params)) return "(" + ") or (".join(selections) + ")" | b454654f537945bca30baa72dad62b4cb5de09fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/b454654f537945bca30baa72dad62b4cb5de09fb/secondary_structure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13914,
67,
8118,
67,
10705,
261,
2890,
16,
859,
33,
1049,
67,
2630,
67,
2010,
13,
294,
364,
6202,
316,
365,
18,
87,
10245,
294,
775,
30,
21738,
18,
14313,
12,
8118,
18,
345,
67,
7466... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13914,
67,
8118,
67,
10705,
261,
2890,
16,
859,
33,
1049,
67,
2630,
67,
2010,
13,
294,
364,
6202,
316,
365,
18,
87,
10245,
294,
775,
30,
21738,
18,
14313,
12,
8118,
18,
345,
67,
7466... |
except socket.error, e: | except select.error, e: | def handleReadIfReady(self, sleep=0.1): if self.fd is None: return ready = None try: ready = select.select([self], [], [], sleep)[0] except socket.error, e: pass if ready: return self.handle_read() | 0d53a2d685bb306b3753e8e0d449707dd423819b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8749/0d53a2d685bb306b3753e8e0d449707dd423819b/pipereader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
1994,
2047,
8367,
12,
2890,
16,
5329,
33,
20,
18,
21,
4672,
309,
365,
18,
8313,
353,
599,
30,
327,
5695,
273,
599,
775,
30,
5695,
273,
2027,
18,
4025,
3816,
2890,
6487,
5378,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1994,
2047,
8367,
12,
2890,
16,
5329,
33,
20,
18,
21,
4672,
309,
365,
18,
8313,
353,
599,
30,
327,
5695,
273,
599,
775,
30,
5695,
273,
2027,
18,
4025,
3816,
2890,
6487,
5378,
1... |
if order is Infinity: | if order == 1: if isinstance(w, (tuple,str,list)): length = 'finite' elif isinstance(w, FiniteWord_class): length = sum(self._morph[a].length() * b for (a,b) in w.evaluation_dict().iteritems()) elif hasattr(w, '__iter__'): length = Infinity datatype = 'iter' elif w in self._domain.alphabet(): return self._morph[w] else: raise TypeError, "Don't know how to handle an input (=%s) that is not iterable or not in the domain alphabet."%w return self.codomain()((x for y in w for x in self._morph[y]), length=length, datatype=datatype) elif order is Infinity: | def __call__(self, w, order=1, datatype='iter'): r""" Returns the image of ``w`` under self to the given order. INPUT: | 63ef5a16a7bf336ae877bde43a56785e2ceb33e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/63ef5a16a7bf336ae877bde43a56785e2ceb33e0/morphism.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
341,
16,
1353,
33,
21,
16,
11172,
2218,
2165,
11,
4672,
436,
8395,
2860,
326,
1316,
434,
12176,
91,
10335,
3613,
365,
358,
326,
864,
1353,
18,
225,
12943... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
1991,
972,
12,
2890,
16,
341,
16,
1353,
33,
21,
16,
11172,
2218,
2165,
11,
4672,
436,
8395,
2860,
326,
1316,
434,
12176,
91,
10335,
3613,
365,
358,
326,
864,
1353,
18,
225,
12943... |
self.assertTrue(u.fp._sock.fp._sock.gettimeout() is None) | self.assertTrue(u.fp.raw.fp._sock.gettimeout() is None) | def test_http_basic(self): u = urllib2.urlopen("http://www.python.org") self.assertTrue(u.fp._sock.fp._sock.gettimeout() is None) | cf2f41919c226d1ac04ea74a0138eae3af030554 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/cf2f41919c226d1ac04ea74a0138eae3af030554/test_urllib2net.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2505,
67,
13240,
12,
2890,
4672,
582,
273,
11527,
22,
18,
295,
18589,
2932,
2505,
2207,
5591,
18,
8103,
18,
3341,
7923,
365,
18,
11231,
5510,
12,
89,
18,
7944,
6315,
15031,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2505,
67,
13240,
12,
2890,
4672,
582,
273,
11527,
22,
18,
295,
18589,
2932,
2505,
2207,
5591,
18,
8103,
18,
3341,
7923,
365,
18,
11231,
5510,
12,
89,
18,
7944,
6315,
15031,
1... |
The quaternion algebra of the form (a,b/R), where i^2=a, j^2 = b, and i*j=-j*i=k. | The quaternion algebra of the form (a,b/K), where i^2=a, j^2 = b, and j*i=-i*j. K is a field not of characteristic and a,b are nonzero elements of K. | def vector_space(self): """ Return vector space with inner product associated to self. | 48b328d83169177c002516f19cf8242db1504925 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/48b328d83169177c002516f19cf8242db1504925/quaternion_algebra.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3806,
67,
2981,
12,
2890,
4672,
3536,
2000,
3806,
3476,
598,
3443,
3017,
3627,
358,
365,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3806,
67,
2981,
12,
2890,
4672,
3536,
2000,
3806,
3476,
598,
3443,
3017,
3627,
358,
365,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'certificate': terp.get('certificate', ''), | 'certificate': terp.get('certificate'), | def update_list(self, cr, uid, context={}): robj = self.pool.get('ir.module.repository') res = [0, 0] # [update, add] | 7a39d075905015df8a4effc2b0457c1deea774a3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/7a39d075905015df8a4effc2b0457c1deea774a3/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1098,
12,
2890,
16,
4422,
16,
4555,
16,
819,
12938,
4672,
721,
441,
273,
365,
18,
6011,
18,
588,
2668,
481,
18,
2978,
18,
9071,
6134,
400,
273,
306,
20,
16,
374,
65,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1098,
12,
2890,
16,
4422,
16,
4555,
16,
819,
12938,
4672,
721,
441,
273,
365,
18,
6011,
18,
588,
2668,
481,
18,
2978,
18,
9071,
6134,
400,
273,
306,
20,
16,
374,
65,
468,
... |
return 2 | return Integer(2) | def _eval(self, n): if n == 0: return 2 elif n == 1: return 1 else: return sloane.A000045(n+1) + sloane.A000045(n-1) | 69a199217d612e1c590af73e16003812c85b93ec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/69a199217d612e1c590af73e16003812c85b93ec/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8622,
12,
2890,
16,
290,
4672,
309,
290,
422,
374,
30,
327,
2144,
12,
22,
13,
1327,
290,
422,
404,
30,
327,
404,
469,
30,
327,
272,
383,
8806,
18,
37,
2787,
7950,
12,
82,
15,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8622,
12,
2890,
16,
290,
4672,
309,
290,
422,
374,
30,
327,
2144,
12,
22,
13,
1327,
290,
422,
404,
30,
327,
404,
469,
30,
327,
272,
383,
8806,
18,
37,
2787,
7950,
12,
82,
15,
... |
"Choose a VTK polydata filename", "VTK Polydata (*.vtk)|*.vtk|All files (*)|*") | "Choose an STL filename", "STL data (*.stl)|*.stl|All files (*)|*") | def fn_browse_cb(self, event): path = self.fn_browse(self._view_frame, "Choose a VTK polydata filename", "VTK Polydata (*.vtk)|*.vtk|All files (*)|*") | 69e58778845289cb3a03989886ce0b4bb314de19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4494/69e58778845289cb3a03989886ce0b4bb314de19/vtk_stl_rdr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2295,
67,
25731,
67,
7358,
12,
2890,
16,
871,
4672,
589,
273,
365,
18,
4293,
67,
25731,
12,
2890,
6315,
1945,
67,
3789,
16,
315,
24529,
279,
22944,
47,
7573,
892,
1544,
3113,
315,
58,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2295,
67,
25731,
67,
7358,
12,
2890,
16,
871,
4672,
589,
273,
365,
18,
4293,
67,
25731,
12,
2890,
6315,
1945,
67,
3789,
16,
315,
24529,
279,
22944,
47,
7573,
892,
1544,
3113,
315,
58,
... |
if message.startswith("SHOW: "): | if message.startswith(u"SHOW: "): | def processSocketMsg(self, message): if message.startswith("ACTIVATE: "): NSApp.activateIgnoringOtherApps_(True) return "" if message.startswith("HIDE: "): self.window.orderOut_(self) return "" if message.startswith("SHOW: "): self.window.orderFront_(self) return "" if message.startswith("TITLE: "): self.window.setTitle_(message[7:]) return "" if message.startswith("MESSAGE: "): self.messageFld.setStringValue_(message[9:]) return "" if message.startswith("DETAIL: "): self.detailFld.setStringValue_(message[8:]) return "" if message.startswith("PERCENT: "): self.setPercentageDone(message[9:]) return "" if message.startswith("GETSTOPBUTTONSTATE: "): return "%s\n" % self.stopBtnState if message.startswith("HIDESTOPBUTTON: "): self.stopBtn.setHidden_(True) return "" if message.startswith("SHOWSTOPBUTTON: "): self.stopBtn.setHidden_(False) return "" if message.startswith("ENABLESTOPBUTTON: "): self.stopBtn.setEnabled_(True) return "" if message.startswith("DISABLESTOPBUTTON: "): self.stopBtn.setEnabled_(False) return "" if message.startswith("RESTARTALERT: "): self.doRestartAlert() while 1: if self.restartAlertDismissed: break return "1\n" | 54e92711e9eb2572d70240c4a8cff7dd10c36120 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6241/54e92711e9eb2572d70240c4a8cff7dd10c36120/MSController.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
4534,
3332,
12,
2890,
16,
883,
4672,
309,
883,
18,
17514,
1918,
2932,
22271,
1777,
30,
315,
4672,
11472,
3371,
18,
10014,
21702,
8290,
16339,
67,
12,
5510,
13,
327,
1408,
309,
883,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
4534,
3332,
12,
2890,
16,
883,
4672,
309,
883,
18,
17514,
1918,
2932,
22271,
1777,
30,
315,
4672,
11472,
3371,
18,
10014,
21702,
8290,
16339,
67,
12,
5510,
13,
327,
1408,
309,
883,... |
final_date = year+ month | final_date = year + month | def _camp_group_code(self, cr, uid, ids, name, args, context=None): if context is None: context = {} | f6d113c75eca7219ac297e62d5d222f7c83a7abe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/f6d113c75eca7219ac297e62d5d222f7c83a7abe/dm_campaign_group.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
71,
931,
67,
1655,
67,
710,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
71,
931,
67,
1655,
67,
710,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
2,
-100,
-100,
-100,
-10... |
if _deubg: print "\tCalled Camera.getAzimuth()" | debugMsg("Called Camera.getAzimuth()") | def getAzimuth(self): """ Get the azimuthal angle (in degrees) of the Camera """ if _deubg: print "\tCalled Camera.getAzimuth()" | 1854c8488520f906732b4f370cdb2d7253cc6936 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8476/1854c8488520f906732b4f370cdb2d7253cc6936/camera.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4506,
94,
15968,
12,
2890,
4672,
3536,
968,
326,
23090,
287,
5291,
261,
267,
10904,
13,
434,
326,
30355,
3536,
309,
389,
323,
373,
75,
30,
1172,
1548,
88,
8185,
30355,
18,
588,
37,
94,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4506,
94,
15968,
12,
2890,
4672,
3536,
968,
326,
23090,
287,
5291,
261,
267,
10904,
13,
434,
326,
30355,
3536,
309,
389,
323,
373,
75,
30,
1172,
1548,
88,
8185,
30355,
18,
588,
37,
94,... |
ifStatement = \ Group(kw('if') + ES(expression + ':' + suite + ZeroOrMore(kw('elif') + ES(expression + ':' + suite) .setErrMsgStart('elif: ')) + Optional( kw('else') + ES(':' + suite) .setErrMsgStart('else: ')) ) .setErrMsgStart('if: ') ) .setParseAction(self._actionIfStatement)\ .setName('ifStatement') | if_stmt = \ Group(kw('if') - expression + ':' + suite + ZeroOrMore(kw('elif') - expression + ':' + suite) + Optional( kw('else') - ':' + suite) ) .setParseAction(self._actionIfStatement)\ .setName('ifStatement') | def _defineLanguageSyntax(self): ''' Here is Siml's BNF Creates the objects of the pyParsing library, that do all the work. ''' #define short alias so they don't clutter the text kw = self.defineKeyword # Usage: test = kw('variable') L = Literal # Usage: L('+') S = Suppress ES = ErrStop | 8d423a3a49fcffb9fd2045c1638eeede3472d2e1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2720/8d423a3a49fcffb9fd2045c1638eeede3472d2e1/simlparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11255,
3779,
8070,
12,
2890,
4672,
9163,
13743,
353,
9587,
80,
1807,
605,
26473,
10210,
326,
2184,
434,
326,
2395,
13963,
5313,
16,
716,
741,
777,
326,
1440,
18,
9163,
468,
11255,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11255,
3779,
8070,
12,
2890,
4672,
9163,
13743,
353,
9587,
80,
1807,
605,
26473,
10210,
326,
2184,
434,
326,
2395,
13963,
5313,
16,
716,
741,
777,
326,
1440,
18,
9163,
468,
11255,
3... |
type: flavorSetRef: C{str} | @type: flavorSetRef: C{str} | def addBuildDefinition(self, name = None, image = None, stages = None, imageGroup = None, sourceGroup = None, architectureRef = None, containerTemplateRef = None, buildTemplateRef = None, flavorSetRef = None, flavor = None): """ Add a build definition. Image types are specified by calling C{ProductDefinition.imageType}. Note that the usage of baseFlavor is deprecated in favor of using references to architectures and image templates. @param name: the name for the build definition @type name: C{str} or C{None} @param image: an image type, as returned by C{ProductDefinition.imageType}. @type image: an instance of an C{imageTypes.ImageType_Base} @param stages: Stages for which to build this image type @type stages: C{list} of C{str} referring to a C{_Stage} object's name @param imageGroup: An optional image group that will override the product definition's image group @type imageGroup: C{str} @param sourceGroup: An optional source group that will override the product definition's source group @type sourceGroup: C{str} @param architectureRef: the name of an architecture to inherit flavors from. @type architectureRef: C{str} @param containerTemplateRef: the name of the containerTemplate for this image. This value overrides the value implied by the buildTemplateRef, if supplied. @type containerTemplateRef: C{str} @param buildTemplateRef: the name of the buildTemplate to derive values for containerTemplateRef and architectureRef. type: buildTemplateRef: C{str} @param flavorSetRef: the name of the flavorSet to use for this image type: flavorSetRef: C{str} @param flavor: additional flavors @type flavor: C{str} """ if architectureRef: # Make sure we have the architecture arch = self.getArchitecture(architectureRef, None) if not arch: self.getPlatformArchitecture(architectureRef) if containerTemplateRef: # make sure we have the containerTemplate tmpl = self.getContainerTemplate(containerTemplateRef, None) if not tmpl: self.getPlatformContainerTemplate(containerTemplateRef) if flavorSetRef: # make sure we have the flavorSet fs = self.getFlavorSet(flavorSetRef, None) if not fs: self.getPlatformFlavorSet(flavorSetRef) | eb566febab924b9408dcbd0aa60e234e50c97c7a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7634/eb566febab924b9408dcbd0aa60e234e50c97c7a/api1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
3116,
1852,
12,
2890,
16,
508,
273,
599,
16,
1316,
273,
599,
16,
20298,
273,
599,
16,
1316,
1114,
273,
599,
16,
1084,
1114,
273,
599,
16,
27418,
1957,
273,
599,
16,
1478,
2283,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
3116,
1852,
12,
2890,
16,
508,
273,
599,
16,
1316,
273,
599,
16,
20298,
273,
599,
16,
1316,
1114,
273,
599,
16,
1084,
1114,
273,
599,
16,
27418,
1957,
273,
599,
16,
1478,
2283,
... |
logkpr('conffile of ' + username + ' exists') | logkpr('configuration file for %s exists' % username) | def fromtoday(fname): # Returns True if a file was last modified today fdate = strftime("%Y%m%d", localtime(getmtime(fname))) today = strftime("%Y%m%d", localtime()) return fdate == today | 74b3799025d3bd8dded6111ac337b8d5d8394b0f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1574/74b3799025d3bd8dded6111ac337b8d5d8394b0f/timekpr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
30064,
12,
12749,
4672,
468,
2860,
1053,
309,
279,
585,
1703,
1142,
4358,
10074,
284,
712,
273,
10405,
27188,
61,
9,
81,
9,
72,
3113,
1191,
957,
12,
588,
10838,
12,
12749,
20349,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
628,
30064,
12,
12749,
4672,
468,
2860,
1053,
309,
279,
585,
1703,
1142,
4358,
10074,
284,
712,
273,
10405,
27188,
61,
9,
81,
9,
72,
3113,
1191,
957,
12,
588,
10838,
12,
12749,
20349,
... |
elif value is Nil and newValue is Nil: continue | def _applyChanges(self, view, flag, dirties, ask, newChanges, changes, dangling): | 2c60582f20bdc00555d53ee9363d62953e685319 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/2c60582f20bdc00555d53ee9363d62953e685319/Values.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9010,
7173,
12,
2890,
16,
1476,
16,
2982,
16,
1577,
88,
606,
16,
6827,
16,
394,
7173,
16,
3478,
16,
302,
539,
2456,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9010,
7173,
12,
2890,
16,
1476,
16,
2982,
16,
1577,
88,
606,
16,
6827,
16,
394,
7173,
16,
3478,
16,
302,
539,
2456,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
"build-all" : | "build-all" : | def process(options): global verbose global quiet verbose = options.verbose quiet = options.quiet if verbose: quiet = False print ">>> Processing..." if not quiet: print " - Configuration: %s" % options.config print " - Jobs: %s" % ", ".join(options.jobs) # TODO: File parser # - Translate dashed to camelcase # - Translate "true" to Python "True" # Include/Exclude hints # # class/module => # include items with their dependencies # exclude items, also remove items not needed by other modules than the removed ones # # =class/module => # explicit include/exclude of given module or class # config = { "common" : { "classPath" : [ "framework/source/class", "application/apiviewer/source/class", "application/feedreader/source/class", "application/webmail/source/class", "application/showcase/source/class" ], "require" : { "qx.log.Logger" : ["qx.log.appender.Native"] } }, "source" : { "extend" : ["common"], "sourceScript" : "source.js" }, "api-feedreader" : { "extend" : ["common"], "apiScript" : "api-feedreader", "include" : ["feedreader.Application"] }, "build-common" : { "extend" : ["common"] }, "build-all" : { "extend" : ["build-common"], "buildScript" : "build-all" }, "build-core" : { "extend" : ["build-common"], "buildScript" : "build-core", "include" : ["apiviewer.Application"], "exclude" : ["ui_tree","=qx.ui.core.Widget"] }, "build-apiviewer" : { "extend" : ["build-common"], "buildScript" : "build-apiviewer", "include" : ["apiviewer.*","qx.theme.ClassicRoyale"], "buildProcess" : [ "optimize-variables", "optimize-basecalls", "optimize-strings", "optimize-privates" ] }, "build-apiviewer-variants" : { "extend" : ["build-common"], "buildScript" : "build-apiviewer-variants", "include" : ["apiviewer.*","qx.theme.ClassicRoyale"], "variants" : { #"qx.debug" : ["on","off"], "qx.debug" : ["off"], "qx.aspects" : ["off"], #"qx.client" : ["gecko","mshtml","webkit","opera"], "qx.client" : ["gecko","mshtml"] }, "buildProcess" : [ "optimize-variables", "optimize-basecalls", "optimize-strings" ] }, "build-feedreader" : { "extend" : ["build-common"], "buildScript" : "build-feedreader", "include" : ["feedreader.Application"] }, "build-parts-common" : { "extend" : ["build-common"], "optimizeLatency" : 5000 }, "build-app-views" : { "extend" : ["build-parts-common"], "buildScript" : "build-app-views", #"collapseParts" : ["webmail","feedreader","showcase"], "views" : { "apiviewer" : ["apiviewer.Application"], "feedreader" : ["feedreader.Application"], "webmail" : ["webmail.Application"], "showcase" : ["showcase.Application"] } }, "build-comp-views" : { "extend" : ["build-parts-common"], "buildScript" : "build-comp-parts", "parts" : { "tree" : ["ui_tree"], "colorselector" : ["qx.ui.component.ColorSelector"], "window" : ["ui_window"], "toolbar" : ["ui_toolbar", "ui_menu"], "table" : ["ui_table"], "form" : ["ui_form"] } }, "build-feedreader-parts" : { "extend" : ["build-parts-common"], "buildScript" : "build-feedreader-parts", "collapseParts" : ["core"], "parts" : { "core" : ["feedreader.Application","qx.theme.ClassicRoyale"], "table" : ["qx.ui.table.Table", "qx.ui.table.model.Simple", "qx.ui.table.columnmodel.Resize"], "article" : ["feedreader.ArticleView"], "preferences" : ["ui_window"] } }, "build-apiviewer-parts" : { "extend" : ["build-parts-common"], "buildScript" : "build-apiviewer-parts", "variants" : { "qx.debug" : ["off"], "qx.client" : ["gecko","mshtml"] }, "collapseParts" : ["core"], "parts" : { "core" : ["apiviewer.Application","qx.theme.ClassicRoyale"], "viewer" : ["apiviewer.Viewer"], "content" : ["apiviewer.ui.ClassViewer","apiviewer.ui.PackageViewer"] } }, "build-apiviewer-parts-noqx" : { "extend" : ["build-parts-common"], "buildScript" : "build-apiviewer-parts-noqx", "variants" : { "qx.debug" : ["off"], "qx.client" : ["gecko","mshtml"] }, "collapseParts" : ["core"], "include" : ["apiviewer.Application"], "exclude" : ["=qx.*"], "parts" : { "core" : ["apiviewer.Application","qx.theme.ClassicRoyale"], "viewer" : ["apiviewer.Viewer"], "content" : ["apiviewer.ui.ClassViewer","apiviewer.ui.PackageViewer"] } } } resolve(config, options.jobs) for job in options.jobs: execute(job, config[job]) | e3364bd2416dfe75fd85aeea0ded427372ef3d08 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/e3364bd2416dfe75fd85aeea0ded427372ef3d08/generator2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
2116,
4672,
2552,
3988,
2552,
10902,
225,
3988,
273,
702,
18,
11369,
10902,
273,
702,
18,
20380,
225,
309,
3988,
30,
10902,
273,
1083,
225,
1172,
315,
23012,
19652,
7070,
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,
1207,
12,
2116,
4672,
2552,
3988,
2552,
10902,
225,
3988,
273,
702,
18,
11369,
10902,
273,
702,
18,
20380,
225,
309,
3988,
30,
10902,
273,
1083,
225,
1172,
315,
23012,
19652,
7070,
309,
... |
vals = '(%s,%s)' % (basket_id, record_ids[0]) if nrec > 1: for i in record_ids[1:]: vals += ',(%s, %s)' % (basket_id, i) | def add_records_to_basket(record_ids, basket_id): nrec = len(record_ids) if nrec > 0: vals = '(%s,%s)' % (basket_id, record_ids[0]) if nrec > 1: for i in record_ids[1:]: vals += ',(%s, %s)' % (basket_id, i) if CFG_WEBALERT_DEBUG_LEVEL > 0: print "-> adding %s records into basket %s: %s" % (nrec, basket_id, vals) try: if CFG_WEBALERT_DEBUG_LEVEL < 4: return run_sql('insert into basket_record (id_basket, id_record) values %s;' % vals) # Cannot use the run_sql(<query>, (<arg>,)) form for some reason else: print ' NOT ADDED, DEBUG LEVEL == 4' return 0 except Exception: register_exception() return 0 else: return 0 | 7fd38a342394a9733a4995f21b115dc0ee9a9425 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/7fd38a342394a9733a4995f21b115dc0ee9a9425/alert_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
7094,
67,
869,
67,
26219,
12,
3366,
67,
2232,
16,
12886,
67,
350,
4672,
225,
290,
3927,
273,
562,
12,
3366,
67,
2232,
13,
309,
290,
3927,
405,
374,
30,
309,
7577,
67,
14778,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
7094,
67,
869,
67,
26219,
12,
3366,
67,
2232,
16,
12886,
67,
350,
4672,
225,
290,
3927,
273,
562,
12,
3366,
67,
2232,
13,
309,
290,
3927,
405,
374,
30,
309,
7577,
67,
14778,... | |
def newTarget(self, *a, **kw): super(PersonEditor, self).newTarget(*a, **kw) self.nameWidget.newTarget(self.target) self.surnameWidget.newTarget(self.target) def refresh(self): self.nameWidget.refresh() self.surnameWidget.refresh() | def newTarget(self, target): super(PersonEditor, self).newTarget(target) for w in self.widgets: w.newTarget(self.value) | def newTarget(self, *a, **kw): super(PersonEditor, self).newTarget(*a, **kw) self.nameWidget.newTarget(self.target) self.surnameWidget.newTarget(self.target) | 4ad54af2f3a2cd95f4bcb6f6011d866f2d3b8e59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2750/4ad54af2f3a2cd95f4bcb6f6011d866f2d3b8e59/simplepersoneditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
2326,
12,
2890,
16,
380,
69,
16,
2826,
9987,
4672,
2240,
12,
8346,
6946,
16,
365,
2934,
2704,
2326,
30857,
69,
16,
2826,
9987,
13,
365,
18,
529,
4609,
18,
2704,
2326,
12,
2890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
2326,
12,
2890,
16,
380,
69,
16,
2826,
9987,
4672,
2240,
12,
8346,
6946,
16,
365,
2934,
2704,
2326,
30857,
69,
16,
2826,
9987,
13,
365,
18,
529,
4609,
18,
2704,
2326,
12,
2890,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.