rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
lines.appendChild(node_line) | lines.append(node_line) | def _append_node(name, text): n = new_doc.createElement(name) t = new_doc.createTextNode(text) n.appendChild(t) config.appendChild(n) | 32aa89f603ce93d4388ce6f049f482862969ced9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/32aa89f603ce93d4388ce6f049f482862969ced9/custom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6923,
67,
2159,
12,
529,
16,
977,
4672,
290,
273,
394,
67,
2434,
18,
2640,
1046,
12,
529,
13,
268,
273,
394,
67,
2434,
18,
2640,
17299,
12,
955,
13,
290,
18,
6923,
1763,
12,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6923,
67,
2159,
12,
529,
16,
977,
4672,
290,
273,
394,
67,
2434,
18,
2640,
1046,
12,
529,
13,
268,
273,
394,
67,
2434,
18,
2640,
17299,
12,
955,
13,
290,
18,
6923,
1763,
12,
8... |
root = server.pool.pop() | root = server.root | def handle_request(connection, server): # Build the request object resource = File(connection) try: request = Request(resource) except BadRequest, exception: request = None request_line = exception.args[0] else: # Keep here (though redundant) to be used later in the access log request_line = request.state.request_line if request is None: # Build response for the 400 error response = Response(status_code=400) response.set_body('Bad Request') # Access Log content_length = response.get_content_length() server.log_access(connection, request_line, 400, content_length) # Send response response = response.to_str() connection.send(response) return # Build and set the context context = Context(request) set_context(context) # Get the root handler root = server.pool.pop() context.root = root # Authenticate cname = '__ac' cookie = context.get_cookie(cname) if cookie is not None: cookie = unquote(cookie) cookie = decodestring(cookie) username, password = cookie.split(':', 1) try: user = root.get_handler('users/%s' % username) except LookupError: pass except: server.log_error() else: if user.authenticate(password): context.user = user user = context.user # Hook (used to set the language) try: root.before_traverse() except: server.log_error() response = context.response # Traverse try: handler = root.get_handler(context.path) except LookupError: # Not Found (response code 404) response.set_status(404) method = root.not_found context.handler = root except: server.log_error() # Internal Server Error (500) response.set_status(500) method = root.internal_server_error else: context.handler = handler # Get the method name method_name = context.method if method_name is None: method_name = request.method # Check the method exists try: getattr(handler, method_name) except AttributeError: # Not Found (response code 404) response.set_status(404) method = root.not_found else: # Get the method method = handler.get_method(method_name) # Check security if method is None: if user is None: # Unauthorized (401) method = root.login_form else: # Forbidden (403) method = root.forbidden else: mtime = getattr(handler, '%s__mtime__' % method_name, None) if mtime is not None: mtime = mtime().replace(microsecond=0) response.set_header('last-modified', mtime) if request.method == 'GET': if request.has_header('if-modified-since'): msince = request.get_header('if-modified-since') if mtime <= msince: # Not modified (304) response.set_status(304) if response.get_status() != 304: # Set the list of needed resources. The method we are going to # call may need external resources to be rendered properly, for # example it could need an style sheet or a javascript file to # be included in the html head (which it can not control). This # attribute lets the interface to add those resources. context.styles = [] context.scripts = [] # Get the transaction object transaction = transactions.get_transaction() try: # Call the method if method.im_func.func_code.co_flags & 8: response_body = method(**request.form) else: response_body = method() except UserError, exception: # Redirection transaction.rollback() goto = copy(request.referrer) goto.query['message'] = exception.args[0].encode('utf8') context.redirect(goto) response_body = None except Forbidden: transaction.rollback() if user is None: # Unauthorized (401) response_body = root.login_form() else: # Forbidden (403) response_body = root.forbidden() except: server.log_error() transaction.rollback() response_body = root.internal_server_error() else: # Save changes username = user and user.name or 'NONE' note = str(request.path) transaction.commit(username, note) # XXX Since the lock and unlock operations don't modify any # handler, they are not commited in the database, so we do here # explicitly. if request.method == 'LOCK' or request.method == 'UNLOCK': from transaction import get as get_zodb_transaction zodb_transaction = get_zodb_transaction() zodb_transaction.setUser(username, '') zodb_transaction.note(note) zodb_transaction.commit() # Set the response body response.set_body(response_body) # After traverse hook try: root.after_traverse() except: response.set_status(500) body = root.internal_server_error() response.set_body(body) server.log_error() # Free the root object server.pool.push(root) # Access Log server.log_access(connection, request_line, response.state.status, response.get_content_length()) # HEAD if request.method == 'HEAD': response.set_header('content-length', response.get_content_length()) response.set_body(None) # Finish, send back the response response = response.to_str() connection.send(response) connection.close() | 869db13f355be95f734bd0bcee6da5af85dbabb9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/869db13f355be95f734bd0bcee6da5af85dbabb9/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
2293,
12,
4071,
16,
1438,
4672,
468,
3998,
326,
590,
733,
1058,
273,
1387,
12,
4071,
13,
775,
30,
590,
273,
1567,
12,
3146,
13,
1335,
23223,
16,
1520,
30,
590,
273,
599,
59... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
2293,
12,
4071,
16,
1438,
4672,
468,
3998,
326,
590,
733,
1058,
273,
1387,
12,
4071,
13,
775,
30,
590,
273,
1567,
12,
3146,
13,
1335,
23223,
16,
1520,
30,
590,
273,
599,
59... |
except (ValueError,TypeError): | except (ValueError,TypeError,decimal.InvalidOperation): | def _convertNumberWithCulture(variant, f): try: return f(variant) except (ValueError,TypeError): try: europeVsUS = str(variant).replace(",",".") return f(europeVsUS) except (ValueError,TypeError): pass | 74ab8571f116533d1cec2d41b38fa26c64a882ae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/677/74ab8571f116533d1cec2d41b38fa26c64a882ae/adodbapi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6283,
1854,
1190,
39,
29923,
12,
8688,
16,
284,
4672,
775,
30,
327,
284,
12,
8688,
13,
1335,
261,
23610,
16,
19030,
16,
12586,
18,
1941,
2988,
4672,
775,
30,
425,
24428,
16082,
33... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6283,
1854,
1190,
39,
29923,
12,
8688,
16,
284,
4672,
775,
30,
327,
284,
12,
8688,
13,
1335,
261,
23610,
16,
19030,
16,
12586,
18,
1941,
2988,
4672,
775,
30,
425,
24428,
16082,
33... |
__all__.append(func.__name__) | def gmt_drywet(range, **traits): """ Generator function for the 'GMT Dry-Wet' gradient """ _data = {'red': ((0.00000,0.5255,0.5255), (0.16670,0.9333,0.9333), (0.33330,0.7059,0.7059), (0.50000,0.1961,0.1961), (0.66670,0.0471,0.0471), (0.83330,0.1490,0.1490), (1.00000,0.0314,0.0314)), 'green': ((0.00000,0.3804,0.3804), (0.16670,0.7804,0.7804), (0.33330,0.9333,0.9333), (0.50000,0.9333,0.9333), (0.66670,0.4706,0.4706), (0.83330,0.0039,0.0039), (1.00000,0.2000,0.2000)), 'blue': ((0.00000,0.1647,0.1647), (0.16670,0.3922,0.3922), (0.33330,0.5294,0.5294), (0.50000,0.9216,0.9216), (0.66670,0.9333,0.9333), (0.83330,0.7176,0.7176), (1.00000,0.4431,0.4431)) } return ColorMapper.from_segment_map(_data, range=range) | da90829f0c68c68066ac72470a127341776cb6b9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13167/da90829f0c68c68066ac72470a127341776cb6b9/default_colormaps.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
314,
1010,
67,
25011,
91,
278,
12,
3676,
16,
2826,
2033,
1282,
4672,
3536,
10159,
445,
364,
326,
296,
25315,
463,
1176,
17,
59,
278,
11,
10292,
3536,
225,
389,
892,
273,
13666,
1118,
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,
314,
1010,
67,
25011,
91,
278,
12,
3676,
16,
2826,
2033,
1282,
4672,
3536,
10159,
445,
364,
326,
296,
25315,
463,
1176,
17,
59,
278,
11,
10292,
3536,
225,
389,
892,
273,
13666,
1118,
4... | |
self.document.note_internal_target(next_node) | if isinstance(next_node, nodes.target): self.document.note_internal_target(next_node) | def apply(self): for target in self.document.internal_targets: if not (len(target) == 0 and not (target.attributes.has_key('refid') or target.attributes.has_key('refuri') or target.attributes.has_key('refname'))): continue next_node = target.next_node(ascend=1) # Do not move names and ids into Invisibles (we'd lose the # attributes) or different Targetables (e.g. footnotes). if (next_node is not None and ((not isinstance(next_node, nodes.Invisible) and not isinstance(next_node, nodes.Targetable)) or isinstance(next_node, nodes.target))): next_node['ids'].extend(target['ids']) next_node['names'].extend(target['names']) # Set defaults for next_node.expect_referenced_by_name/id. if not hasattr(next_node, 'expect_referenced_by_name'): next_node.expect_referenced_by_name = {} if not hasattr(next_node, 'expect_referenced_by_id'): next_node.expect_referenced_by_id = {} for id in target['ids']: # Update IDs to node mapping. self.document.ids[id] = next_node # If next_node is referenced by id ``id``, this # target shall be marked as referenced. next_node.expect_referenced_by_id[id] = target for name in target['names']: next_node.expect_referenced_by_name[name] = target # If there are any expect_referenced_by_... attributes # in target set, copy them to next_node. next_node.expect_referenced_by_name.update( getattr(target, 'expect_referenced_by_name', {})) next_node.expect_referenced_by_id.update( getattr(target, 'expect_referenced_by_id', {})) # Set refid to point to the first former ID of target # which is now an ID of next_node. target['refid'] = target['ids'][0] # Clear ids and names; they have been moved to # next_node. target['ids'] = [] target['names'] = [] self.document.note_refid(target) self.document.note_internal_target(next_node) | 6b84e357978066bd033b4eab3f2086e406d25fb9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/6b84e357978066bd033b4eab3f2086e406d25fb9/references.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
12,
2890,
4672,
364,
1018,
316,
365,
18,
5457,
18,
7236,
67,
11358,
30,
309,
486,
261,
1897,
12,
3299,
13,
422,
374,
471,
486,
261,
3299,
18,
4350,
18,
5332,
67,
856,
2668,
173... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
12,
2890,
4672,
364,
1018,
316,
365,
18,
5457,
18,
7236,
67,
11358,
30,
309,
486,
261,
1897,
12,
3299,
13,
422,
374,
471,
486,
261,
3299,
18,
4350,
18,
5332,
67,
856,
2668,
173... |
return new Node(t) | return Node(t) | def ADD__build(t): # NB t.token.type must be PLUS or MINUS. return new Node(t) | c7acf93c85d2480e1e64e292c2f42ae1721eefbe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/c7acf93c85d2480e1e64e292c2f42ae1721eefbe/Builder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11689,
972,
3510,
12,
88,
4672,
468,
20096,
268,
18,
2316,
18,
723,
1297,
506,
22443,
3378,
578,
6989,
3378,
18,
327,
394,
2029,
12,
88,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11689,
972,
3510,
12,
88,
4672,
468,
20096,
268,
18,
2316,
18,
723,
1297,
506,
22443,
3378,
578,
6989,
3378,
18,
327,
394,
2029,
12,
88,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
line = line.strip() | def file_copy(file, output): fp = open(file, "r") for line in fp: line = line.strip() # Blank line or comment. if not line or line[0] == "#": continue output.write(line + "\n") fp.close() | 6d96c929638f6adcc9b034bd8f768a36c4e57bac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8118/6d96c929638f6adcc9b034bd8f768a36c4e57bac/collect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
585,
67,
3530,
12,
768,
16,
876,
4672,
4253,
273,
1696,
12,
768,
16,
315,
86,
7923,
225,
364,
980,
316,
4253,
30,
468,
8069,
2304,
980,
578,
2879,
18,
309,
486,
980,
578,
980,
63,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
585,
67,
3530,
12,
768,
16,
876,
4672,
4253,
273,
1696,
12,
768,
16,
315,
86,
7923,
225,
364,
980,
316,
4253,
30,
468,
8069,
2304,
980,
578,
2879,
18,
309,
486,
980,
578,
980,
63,
... | |
result = self.pt_render() | result = self.read() | def manage_FTPget(self): "Get source for FTP download" result = self.pt_render() return result.encode(self.output_encoding) | 09be733c0b3b454faaa551339c377fdaec09f55a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9658/09be733c0b3b454faaa551339c377fdaec09f55a/ZopePageTemplate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
17104,
588,
12,
2890,
4672,
315,
967,
1084,
364,
19324,
4224,
6,
563,
273,
365,
18,
896,
1435,
327,
563,
18,
3015,
12,
2890,
18,
2844,
67,
5999,
13,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
17104,
588,
12,
2890,
4672,
315,
967,
1084,
364,
19324,
4224,
6,
563,
273,
365,
18,
896,
1435,
327,
563,
18,
3015,
12,
2890,
18,
2844,
67,
5999,
13,
2,
-100,
-100,
-100,
-... |
AbelianGroup( 3, [2, 3, 4]) | Abelian Group isomorphic to Z/2Z x Z/3Z x Z/4Z | def word_problem(words, g, verbose = False): r""" G and H are abelian, g in G, H is a subgroup of G generated by a list (words) of elements of G. If g is in H, return the expression for g as a word in the elements of (words). The 'word problem' for a finite abelian group G boils down to the following matrix-vector analog of the Chinese remainder theorem. Problem: Fix integers $1<n_1\leq n_2\leq ...\leq n_k$ (indeed, these $n_i$ will all be prime powers), fix a generating set $g_i=(a_{i1},...,a_{ik})$ (with $a_{ij}\in \Z/n_j\Z$), for $1\leq i\leq \ell$, for the group $G$, and let $d = (d_1,...,d_k)$ be an element of the direct product $\Z/n_1\Z \times ...\times \Z/n_k\Z$. Find, if they exist, integers $c_1,...,c_\ell$ such that $c_1g_1+...+c_\ell g_\ell = d$. In other words, solve the equation $cA=d$ for $c\in \Z^\ell$, where $A$ is the matrix whose rows are the $g_i$'s. Of course, it suffices to restrict the $c_i$'s to the range $0\leq c_i\leq N-1$, where $N$ denotes the least common multiple of the integers $n_1,...,n_k$. This function does not solve this directly, as perhaps it should. Rather (for both speed and as a model for a similar function valid for more general groups), it pushes it over to GAP, which has optimized algorithms for the word problem. Essentially, this function is a wrapper for the GAP function 'Factorization'. EXAMPLE: sage: G.<a,b,c> = AbelianGroup(3,[2,3,4]); G AbelianGroup( 3, [2, 3, 4]) sage: word_problem([a*b,a*c], b*c) [[a*b, 1], [a*c, 1]] sage: word_problem([a*b,a*c],b*c) [[a*b, 1], [a*c, 1]] sage: A.<a,b,c,d,e> = AbelianGroup(5,[4, 5, 5, 7, 8]) sage: b1 = a^3*b*c*d^2*e^5 sage: b2 = a^2*b*c^2*d^3*e^3 sage: b3 = a^7*b^3*c^5*d^4*e^4 sage: b4 = a^3*b^2*c^2*d^3*e^5 sage: b5 = a^2*b^4*c^2*d^4*e^5 sage: word_problem([b1,b2,b3,b4,b5],e) [[a^3*b*c*d^2*e^5, 1], [a^2*b*c^2*d^3*e^3, 1], [a^3*b^3*d^4*e^4, 3], [a^3*b^2*c^2*d^3*e^5, 1]] WARNINGS: (1) Might have unpleasant effect when the word problem cannot be solved. (2) Uses permutation groups, so may be slow when group is large. The instance method word_problem of the class AbelianGroupElement is implemented differently (wrapping GAP's"EpimorphismFromFreeGroup" and "PreImagesRepresentative") and may be faster. """ from sage.groups.perm_gps.all import PermutationGroup from sage.interfaces.all import gap G = g.parent() invs = G.invariants() gap.eval("l:=One(Rationals)") s1 = 'A:=AbelianGroup(%s)'%invs gap.eval(s1) s2 = 'phi:=IsomorphismPermGroup(A)' gap.eval(s2) s3 = "gens := GeneratorsOfGroup(A)" gap.eval(s3) L = g.list() gap.eval("L1:="+str(L)) s4 = "L2:=List([l..%s], i->gens[i]^L1[i]);"%len(L) gap.eval(s4) gap.eval("g:=Product(L2); gensH:=[]") for w in words: L = w.list() gap.eval("L1:="+str(L)) s4 = "L2:=List([1..%s], i->gens[i]^L1[i]);"%len(L) gap.eval(s4) gap.eval("w:=Product(L2)") gap.eval("gensH:=Concatenation(gensH,[w])") s5 = 'H:=Group(gensH)' gap.eval(s5) gap.eval("x:=Factorization(H,g)") l3 = gap.eval("L3:=ExtRepOfObj(x)") nn = gap.eval("n:=Int(Length(L3)/2)") LL = eval(gap.eval("L4:=List([l..n],i->L3[2*i])")) if verbose: v = '*'.join(['(%s)^%s'%(words[i], LL[i]) for i in range(len(LL))]) print '%s = %s'%(g, v) return [[words[i],LL[i]] for i in range(len(LL))] | 474e9cd21e5543c10385340d5e9747ad7d0f1773 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/474e9cd21e5543c10385340d5e9747ad7d0f1773/abelian_group.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2076,
67,
18968,
12,
3753,
16,
314,
16,
3988,
273,
1083,
4672,
436,
8395,
611,
471,
670,
854,
1223,
292,
2779,
16,
314,
316,
611,
16,
670,
353,
279,
720,
1655,
434,
611,
4374,
635,
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,
2076,
67,
18968,
12,
3753,
16,
314,
16,
3988,
273,
1083,
4672,
436,
8395,
611,
471,
670,
854,
1223,
292,
2779,
16,
314,
316,
611,
16,
670,
353,
279,
720,
1655,
434,
611,
4374,
635,
2... |
pyfvalues = numpy.sort(pyfvalues) | pyfvalues = numpy.array(pyfvalues, dtype=dtype) pyfvalues.sort() | def test_method(self): vprint("* Condition is ``%s``." % cond) # Replace bitwise operators with their logical counterparts. pycond = cond for (ptop, pyop) in [('&', 'and'), ('|', 'or'), ('~', 'not')]: pycond = pycond.replace(ptop, pyop) pycond = compile(pycond, '<string>', 'eval') | ec673503a1f19513c76804b2395a74a44d564db6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12687/ec673503a1f19513c76804b2395a74a44d564db6/test_queries.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2039,
12,
2890,
4672,
331,
1188,
2932,
14,
7949,
353,
12176,
9,
87,
10335,
1199,
738,
6941,
13,
468,
6910,
25337,
12213,
598,
3675,
6374,
3895,
6019,
18,
2395,
10013,
273,
6941... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2039,
12,
2890,
4672,
331,
1188,
2932,
14,
7949,
353,
12176,
9,
87,
10335,
1199,
738,
6941,
13,
468,
6910,
25337,
12213,
598,
3675,
6374,
3895,
6019,
18,
2395,
10013,
273,
6941... |
self.display() | self.display(fractionDone = 1) | def finished(self): self.done = 1 self.activity = 'download succeeded!' self.downRate = '---' self.display() | 475bc2502a2632d7599dddb0ed5ed686f6cf773d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/475bc2502a2632d7599dddb0ed5ed686f6cf773d/btdownloadcurses.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6708,
12,
2890,
4672,
365,
18,
8734,
273,
404,
365,
18,
9653,
273,
296,
7813,
15784,
5124,
365,
18,
2378,
4727,
273,
3534,
6627,
365,
18,
5417,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6708,
12,
2890,
4672,
365,
18,
8734,
273,
404,
365,
18,
9653,
273,
296,
7813,
15784,
5124,
365,
18,
2378,
4727,
273,
3534,
6627,
365,
18,
5417,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-... |
s.connect(('google.com', 80)) | try: s.connect(('google.com', 80)) except Exception, e: raise e | def getmyip(): """ <Purpose> Provides the external IP of this computer. Does some clever trickery. <Arguments> None <Exceptions> As from socket.gethostbyname_ex() <Side Effects> None. <Returns> The localhost's IP address python docs for socket.gethostbyname_ex() """ restrictions.assertisallowed('getmyip') # I got this from: http://groups.google.com/group/comp.lang.python/browse_thread/thread/d931cdc326d7032b?hl=en # Open a connectionless socket s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # Tell it to connect to google (we assume that the DNS entry for this works) # however, using port 0 causes some issues on FreeBSD! I choose port 80 # instead... s.connect(('google.com', 80)) # and the IP of the interface this connects on is the first item of the tuple (myip, localport) = s.getsockname() s.close() return myip | 0ed3ffa65aabbb3d085e760e84bd6eb7b09abb86 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7263/0ed3ffa65aabbb3d085e760e84bd6eb7b09abb86/emulcomm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
4811,
625,
13332,
3536,
411,
10262,
4150,
34,
28805,
326,
3903,
2971,
434,
333,
26579,
18,
282,
9637,
2690,
1619,
502,
28837,
627,
18,
225,
411,
4628,
34,
599,
225,
411,
11416,
34,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
4811,
625,
13332,
3536,
411,
10262,
4150,
34,
28805,
326,
3903,
2971,
434,
333,
26579,
18,
282,
9637,
2690,
1619,
502,
28837,
627,
18,
225,
411,
4628,
34,
599,
225,
411,
11416,
34,
... |
if ext_h or ext_c or not vms or CopyAssemblyToTarget: | if ext_h or ext_c or not vms or AssembleOnTarget: | def Boot(): global BuildLocal BuildLocal += " -boot -keep -DM3CC_TARGET=" + Config Version = "1" # This information is duplicated from the config files. # TBD: put it only in one place. # The older bootstraping method does get that right. vms = StringTagged(Config, "VMS") if Config == "ALPHA32_VMS": Compile = "cc " elif Config == "ALPHA64_VMS": Compile = "cc /pointer_size=64 " elif StringTagged(Config, "SOLARIS") or Config == "SOLsun": Compile = "/usr/ccs/bin/cc -g -mt -xcode=pic32 -xldscope=symbolic " else: Compile = { "I386_INTERIX" : "gcc -g ", # gcc -fPIC generates incorrect code on Interix "SOLgnu" : "/usr/sfw/bin/gcc -g ", # -fPIC? }.get(Config) or "gcc -g -fPIC " Compile = Compile + ({ "AMD64_LINUX" : " -m64 -mno-align-double ", "AMD64_DARWIN" : " -arch x86_64 ", "PPC64_DARWIN" : " -arch ppc64 ", "ARM_DARWIN" : " -march=armv6 -mcpu=arm1176jzf-s ", "LINUXLIBC6" : " -m32 -mno-align-double ", "MIPS64_OPENBSD" : " -mabi=64 ", "SOLgnu" : " -m32 -mcpu=v9 ", "SOLsun" : " -xarch=v8plus ", "SPARC32_LINUX" : " -m32 -mcpu=v9 -munaligned-doubles ", "SPARC64_LINUX" : " -m64 -munaligned-doubles ", }.get(Config) or " ") Link = Compile + " *.mo *.io *.o " if StringTagged(Target, "DARWIN"): pass elif StringTagged(Target, "SOLARIS") or Target.startswith("SOL"): Link = Link + " -lrt -lm -lnsl -lsocket -lpthread " elif StringTagged(Target, "HPUX"): Link = Link + " -lrt -lm " elif StringTagged(Target, "INTERIX"): Link = Link + " -lm " else: Link = Link + " -lm -lpthread " # not in Link if not StringTagged(Config, "VMS"): Compile += " -c " AssembleOnHost = False CopyAssemblyToTarget = True if StringTagged(Target, "VMS"): Assemble = "macro /alpha " elif StringTagged(Target, "SOLARIS") or Target.startswith("SOL"): Assemble = "/usr/ccs/bin/as " else: Assemble = "as " if Target != "PPC32_OPENBSD" and Target != "PPC_LINUX": if Target.find("LINUX") != -1 or Target.find("BSD") != -1: if Target.find("64") != -1 or (StringTagged(Target, "ALPHA") and not StringTagged(Target, "ALPHA32_")): Assemble = Assemble + " --64" else: Assemble = Assemble + " --32" Assemble = (Assemble + ({ "AMD64_DARWIN" : " -arch x86_64 ", "PPC64_DARWIN" : " -arch ppc64 ", "ARM_DARWIN" : " -arch armv6 ", "SOLgnu" : " -s -xarch=v8plus ", "SOLsun" : " -s -xarch=v8plus ", "SPARC32_SOLARIS" : " -s -xarch=v8plus ", "SPARC64_SOLARIS" : " -s -xarch=v9 ", }.get(Target) or "")) GnuPlatformPrefix = { "ARM_DARWIN" : "arm-apple-darwin8-", "ALPHA32_VMS" : "alpha-dec-vms-", "ALPHA64_VMS" : "alpha64-dec-vms-", }.get(Target) or "" if not vms: Compile = GnuPlatformPrefix + Compile Link = GnuPlatformPrefix + Link Assemble = GnuPlatformPrefix + Assemble if vms and AssembleOnHost: Assemble = GnuPlatformPrefix + Assemble # # squeeze runs of spaces and spaces at end # Compile = re.sub(" +", " ", Compile) Compile = re.sub(" +$", "", Compile) Link = re.sub(" +", " ", Link) Link = re.sub(" +$", "", Link) Assemble = re.sub(" +", " ", Assemble) Assemble = re.sub(" +$", "", Assemble) BootDir = "./cm3-boot-" + Target + "-" + Version P = [ "m3cc", "import-libs", "m3core", "libm3", "sysutils", "m3middle", "m3quake", "m3objfile", "m3linker", "m3back", "m3front", "cm3" ] #DoPackage(["", "realclean"] + P) or sys.exit(1) DoPackage(["", "buildlocal"] + P) or sys.exit(1) try: shutil.rmtree(BootDir) except: pass try: os.mkdir(BootDir) except: pass # # This would probably be a good use of XSL (xml style sheets) # Make = open(os.path.join(BootDir, "make.sh"), "wb") VmsMake = open(os.path.join(BootDir, "vmsmake.com"), "wb") Makefile = open(os.path.join(BootDir, "Makefile"), "wb") UpdateSource = open(os.path.join(BootDir, "updatesource.sh"), "wb") Objects = [ ] Makefile.write(".SUFFIXES:\nall: cm3\n\n") for a in [UpdateSource, Make]: a.write("#!/bin/sh\n\nset -e\nset -x\n\n") for a in [Makefile]: a.write("# edit up here\n\n") a.write("Assemble=" + Assemble + "\nCompile=" + Compile + "\nLink=" + Link + "\n") a.write("\n\n# no more editing should be needed\n\n") for a in [Make]: a.write("Assemble=\"" + Assemble + "\"\nCompile=\"" + Compile + "\"\nLink=\"" + Link + "\"\n") for q in P: dir = GetPackagePath(q) for a in os.listdir(os.path.join(Root, dir, Config)): ext_c = a.endswith(".c") ext_h = a.endswith(".h") ext_s = a.endswith(".s") ext_ms = a.endswith(".ms") ext_is = a.endswith(".mi") if not (ext_c or ext_h or ext_s or ext_ms or ext_is): continue fullpath = os.path.join(Root, dir, Config, a) if ext_h or ext_c or not vms or CopyAssemblyToTarget: CopyFile(fullpath, BootDir) if ext_h: continue Object = GetObjectName(a) Objects += [Object] if vms: if ext_c: VmsMake.write(Compile + " " + a + "\n") else: if AssembleOnHost: # must have cross assembler a = Assemble + " " + fullpath + " -o " + BootDir + "/" + Object print(a) os.system(a) else: VmsMake.write(Assemble + " " + a + "\n") continue Makefile.write("Objects=$(Objects) " + Object + "\n" + Object + ": " + a + "\n\t") if ext_c: Command = "Compile" else: Command = "Assemble" for b in [Make, Makefile]: b.write("$(" + Command + ") " + a + " -o " + Object + "\n") Makefile.write("cm3: $(Objects)\n\t") VmsMake.write("link /executable=cm3.exe ") for a in Objects: VmsMake.write(a + " ") VmsMake.write("\n") for a in [Make, Makefile]: a.write("$(Link) -o cm3\n") for a in [ # # Add to this list as needed. # Adding more than necessary is ok -- assume the target system has no changes, # so we can replace whatever is there. # "m3-libs/libm3/src/os/POSIX/OSConfigPosix.m3", "m3-libs/libm3/src/random/m3makefile", "m3-libs/m3core/src/m3makefile", "m3-libs/m3core/src/Uwaitpid.quake", "m3-libs/m3core/src/thread.quake", "m3-libs/m3core/src/C/m3makefile", "m3-libs/m3core/src/C/" + Target + "/m3makefile", "m3-libs/m3core/src/C/Common/m3makefile", "m3-libs/m3core/src/Csupport/m3makefile", "m3-libs/m3core/src/float/m3makefile", "m3-libs/m3core/src/runtime/m3makefile", "m3-libs/m3core/src/runtime/common/m3makefile", "m3-libs/m3core/src/runtime/common/Compiler.tmpl", "m3-libs/m3core/src/runtime/common/m3text.h", "m3-libs/m3core/src/runtime/common/RTError.h", "m3-libs/m3core/src/runtime/common/RTMachine.i3", "m3-libs/m3core/src/runtime/common/RTProcess.h", "m3-libs/m3core/src/runtime/common/RTSignalC.c", "m3-libs/m3core/src/runtime/common/RTSignalC.h", "m3-libs/m3core/src/runtime/common/RTSignalC.i3", "m3-libs/m3core/src/runtime/common/RTSignal.i3", "m3-libs/m3core/src/runtime/common/RTSignal.m3", "m3-libs/m3core/src/runtime/" + Target + "/m3makefile", "m3-libs/m3core/src/runtime/" + Target + "/RTMachine.m3", "m3-libs/m3core/src/runtime/" + Target + "/RTSignal.m3", "m3-libs/m3core/src/runtime/" + Target + "/RTThread.m3", "m3-libs/m3core/src/text/TextLiteral.i3", "m3-libs/m3core/src/thread/m3makefile", "m3-libs/m3core/src/thread/PTHREAD/m3makefile", "m3-libs/m3core/src/thread/PTHREAD/ThreadPThread.m3", "m3-libs/m3core/src/thread/PTHREAD/ThreadPThreadC.i3", "m3-libs/m3core/src/thread/PTHREAD/ThreadPThreadC.c", "m3-libs/m3core/src/time/POSIX/m3makefile", "m3-libs/m3core/src/unix/m3makefile", "m3-libs/m3core/src/unix/Common/m3makefile", "m3-libs/m3core/src/unix/Common/m3unix.h", "m3-libs/m3core/src/unix/Common/Udir.i3", "m3-libs/m3core/src/unix/Common/UdirC.c", "m3-libs/m3core/src/unix/Common/Usignal.i3", "m3-libs/m3core/src/unix/Common/Ustat.i3", "m3-libs/m3core/src/unix/Common/UstatC.c", "m3-libs/m3core/src/unix/Common/UtimeC.c", "m3-libs/m3core/src/unix/Common/Uucontext.i3", "m3-sys/cminstall/src/config-no-install/SOLgnu", "m3-sys/cminstall/src/config-no-install/SOLsun", "m3-sys/cminstall/src/config-no-install/Solaris.common", "m3-sys/cminstall/src/config-no-install/Unix.common", "m3-sys/cminstall/src/config-no-install/cm3cfg.common", "m3-sys/cminstall/src/config-no-install/" + Target, "m3-sys/m3cc/src/m3makefile", "m3-sys/m3cc/src/gcc/m3cg/parse.c", "m3-sys/m3middle/src/Target.i3", "m3-sys/m3middle/src/Target.m3", "scripts/python/pylib.py", "m3-libs/m3core/src/C/" + Target + "/Csetjmp.i3", "m3-libs/m3core/src/C/" + Target + "/m3makefile", "m3-libs/m3core/src/C/Common/Csetjmp.i3", "m3-libs/m3core/src/C/Common/Csignal.i3", "m3-libs/m3core/src/C/Common/Cstdio.i3", "m3-libs/m3core/src/C/Common/Cstring.i3", "m3-libs/m3core/src/C/Common/m3makefile", ]: source = os.path.join(Root, a) if FileExists(source): name = GetLastPathElement(a) reldir = RemoveLastPathElement(a) destdir = os.path.join(BootDir, reldir) dest = os.path.join(destdir, name) try: os.makedirs(destdir) except: pass CopyFile(source, dest) for b in [UpdateSource, Make]: b.write("mkdir -p /dev2/cm3/" + reldir + "\n") b.write("cp " + a + " /dev2/cm3/" + a + "\n") for a in [UpdateSource, Make, Makefile, VmsMake]: a.close() # write entirely new custom makefile for NT # We always have object files so just compile and link in one fell swoop. if StringTagged(Config, "NT") or Config == "NT386": DeleteFile("updatesource.sh") DeleteFile("make.sh") Makefile = open(os.path.join(BootDir, "Makefile"), "wb") Makefile.write("cm3.exe: *.io *.mo *.c\r\n" + " cl -Zi -MD *.c -link *.mo *.io -out:cm3.exe user32.lib kernel32.lib wsock32.lib comctl32.lib gdi32.lib advapi32.lib netapi32.lib\r\n") Makefile.close() _MakeArchive(BootDir[2:]) | 0aaa1f5072814c2e412f3bde57c60fe3a1a72786 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9328/0aaa1f5072814c2e412f3bde57c60fe3a1a72786/pylib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26254,
13332,
225,
2552,
3998,
2042,
3998,
2042,
1011,
315,
300,
7137,
300,
10102,
300,
16125,
23,
6743,
67,
16374,
1546,
397,
1903,
225,
4049,
273,
315,
21,
6,
225,
468,
1220,
1779,
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,
26254,
13332,
225,
2552,
3998,
2042,
3998,
2042,
1011,
315,
300,
7137,
300,
10102,
300,
16125,
23,
6743,
67,
16374,
1546,
397,
1903,
225,
4049,
273,
315,
21,
6,
225,
468,
1220,
1779,
353... |
report_progress(count,_("Parsing video: %s")% os.path.basename(filepath)) | report_progress(count,_("Parsing video: %s")% os.path.basename(filepath).decode(sys.getfilesystemencoding())) | def ScanFolder(folderpath,recursively = True,report_progress=None, progress_end=None): #Let's reset the progress bar to 0% log.debug("Scanning Folder %s" % folderpath) if report_progress == None: report_progress = FakeProgress #Let's reset the progress bar to 0% report_progress(0) parser = RecursiveParser.RecursiveParser() files_found = [] try: # it's a file open(folderpath, 'r') if get_extension(folderpath).lower() in videofile.VIDEOS_EXT: files_found.append(folderpath) folderpath = os.path.dirname(folderpath) except IOError: # it's a directory #Scanning VIDEOS files_found = parser.getRecursiveFileList(folderpath, videofile.VIDEOS_EXT) videos_found = [] # only work the video files if any were found if len(files_found): percentage = 100 / len(files_found) count = 0 for i, filepath in enumerate(files_found): log.debug("Parsing %s ..."% filepath) if metadata.parse(filepath): videos_found.append(videofile.VideoFile(filepath)) count += percentage if not report_progress(): #If it has been canceled raise UserActionCanceled() report_progress(count,_("Parsing video: %s")% os.path.basename(filepath)) report_progress(0) #Scanning Subs files_found = parser.getRecursiveFileList(folderpath,subtitlefile.SUBTITLES_EXT) subs_found = [] # only work the subtitles if any were found if len(files_found): percentage = 100 / len(files_found) count = 0 for i, filepath in enumerate(files_found): subs_found.append(subtitlefile.SubtitleFile(online = False,id = filepath)) count += percentage report_progress(count,_("Parsing sub: %s") % os.path.basename(filepath)) report_progress(100,_("Finished hashing")) if progress_end: progress_end() return videos_found,subs_found | 0fa322b9fb8f9db0ff2805d57f424d14565cce9c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1108/0fa322b9fb8f9db0ff2805d57f424d14565cce9c/FileScan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8361,
3899,
12,
5609,
803,
16,
266,
6235,
273,
1053,
16,
6006,
67,
8298,
33,
7036,
16,
4007,
67,
409,
33,
7036,
4672,
468,
24181,
1807,
2715,
326,
4007,
4653,
358,
374,
9,
613,
18,
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,
8361,
3899,
12,
5609,
803,
16,
266,
6235,
273,
1053,
16,
6006,
67,
8298,
33,
7036,
16,
4007,
67,
409,
33,
7036,
4672,
468,
24181,
1807,
2715,
326,
4007,
4653,
358,
374,
9,
613,
18,
4... |
""" | """ | def flimage_add_marker(pImage, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11): """ flimage_add_marker(pImage, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) -> num. """ retval = _flimage_add_marker(pImage, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
2730,
67,
1289,
67,
11145,
12,
84,
2040,
16,
293,
22,
16,
293,
23,
16,
293,
24,
16,
293,
25,
16,
293,
26,
16,
293,
27,
16,
293,
28,
16,
293,
29,
16,
293,
2163,
16,
293,
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,
1183,
2730,
67,
1289,
67,
11145,
12,
84,
2040,
16,
293,
22,
16,
293,
23,
16,
293,
24,
16,
293,
25,
16,
293,
26,
16,
293,
27,
16,
293,
28,
16,
293,
29,
16,
293,
2163,
16,
293,
2... |
element = parent.find( key ) | if parent is None : return default if key is None : element = parent else : element = parent.find( key ) | def GetText( parent, key, default = '' ) : | 9cf35a2006ca545113338f41730afc334acf147a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8076/9cf35a2006ca545113338f41730afc334acf147a/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
1528,
12,
982,
16,
498,
16,
805,
273,
875,
262,
294,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
1528,
12,
982,
16,
498,
16,
805,
273,
875,
262,
294,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
"""In BytesIO, this is the same as read. | """This is the same as read. | def read1(self, n): """In BytesIO, this is the same as read. """ return self.read(n) | 5b033ad1f0eb92fd321e2a2ddc00699a5d7a423c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/5b033ad1f0eb92fd321e2a2ddc00699a5d7a423c/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
21,
12,
2890,
16,
290,
4672,
3536,
2503,
353,
326,
1967,
487,
855,
18,
3536,
327,
365,
18,
896,
12,
82,
13,
2,
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,
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,
855,
21,
12,
2890,
16,
290,
4672,
3536,
2503,
353,
326,
1967,
487,
855,
18,
3536,
327,
365,
18,
896,
12,
82,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
assert(callback != None) | assert(callable(callback)) | def _disconnect(self, callback, args, kwargs): assert(callback != None) new_callbacks = [] for cb in self._callbacks[:]: cb_callback, cb_args, cb_kwargs, cb_once, cb_weak = cb if cb_weak: cb_callback_u = cb_callback._get_callback() cb_args_u, cb_kwargs_u = unweakref_data((cb_args, cb_kwargs)) else: cb_callback_u = cb_args_u = cb_kwargs_u = None | a757bb79c95c98116a6ce7438aa116032db3e4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11722/a757bb79c95c98116a6ce7438aa116032db3e4c1/callback.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
20177,
12,
2890,
16,
1348,
16,
833,
16,
1205,
4672,
1815,
12,
7293,
12,
3394,
3719,
394,
67,
13316,
273,
5378,
364,
2875,
316,
365,
6315,
13316,
10531,
14542,
2875,
67,
3394,
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,
389,
20177,
12,
2890,
16,
1348,
16,
833,
16,
1205,
4672,
1815,
12,
7293,
12,
3394,
3719,
394,
67,
13316,
273,
5378,
364,
2875,
316,
365,
6315,
13316,
10531,
14542,
2875,
67,
3394,
16,
... |
raise NotImplementerError("_nulp not implemented for complex array") | raise NotImplementedError("_nulp not implemented for complex array") | def nulp_diff(x, y, dtype=None): """For each item in x and y, eeturn the number of representable floating points between them. Parameters ---------- x : array_like first input array y : array_like second input array Returns ------- nulp: array_like number of representable floating point numbers between each item in x and y. Examples -------- # By definition, epsilon is the smallest number such as 1 + eps != 1, so # there should be exactly one ULP between 1 and 1 + eps >>> nulp_diff(1, 1 + np.finfo(x.dtype).eps) 1.0 """ import numpy as np if dtype: x = np.array(x, dtype=dtype) y = np.array(y, dtype=dtype) else: x = np.array(x) y = np.array(y) t = np.common_type(x, y) if np.iscomplexobj(x) or np.iscomplexobj(y): raise NotImplementerError("_nulp not implemented for complex array") x = np.array(x, dtype=t) y = np.array(y, dtype=t) if not x.shape == y.shape: raise ValueError("x and y do not have the same shape: %s - %s" % \ (x.shape, y.shape)) def _diff(rx, ry, vdt): diff = np.array(rx-ry, dtype=vdt) return np.abs(diff) rx = integer_repr(x) ry = integer_repr(y) return _diff(rx, ry, t) | 3e5a12cb388e5d9a0b8dba3d1ebf4c55bf419272 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14925/3e5a12cb388e5d9a0b8dba3d1ebf4c55bf419272/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
14290,
67,
5413,
12,
92,
16,
677,
16,
3182,
33,
7036,
4672,
3536,
1290,
1517,
761,
316,
619,
471,
677,
16,
425,
851,
326,
1300,
434,
2406,
429,
13861,
3143,
3086,
2182,
18,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
14290,
67,
5413,
12,
92,
16,
677,
16,
3182,
33,
7036,
4672,
3536,
1290,
1517,
761,
316,
619,
471,
677,
16,
425,
851,
326,
1300,
434,
2406,
429,
13861,
3143,
3086,
2182,
18,
225,
... |
print "var %s = {}" % module_name | print "var %s = {};" % module_name | def substitute_locals(str): return NAME_RE.sub(substitute_name, str) | f96fb5c7ee6e14725bba8518c1da59ce4e410724 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5771/f96fb5c7ee6e14725bba8518c1da59ce4e410724/flattener.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14811,
67,
17977,
12,
701,
4672,
327,
6048,
67,
862,
18,
1717,
12,
1717,
17207,
67,
529,
16,
609,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14811,
67,
17977,
12,
701,
4672,
327,
6048,
67,
862,
18,
1717,
12,
1717,
17207,
67,
529,
16,
609,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
def trivial_match_function(self): | def trivial_match_function(self, name): | def trivial_match_function(self): """ This outputs a trivial matching function (case independent, same starting letters). More sophisticated ones could be developed. It is the default match function, but can be overwritten by the user. """ def output (x): return x.lower().startswith(self.query_name.lower()) return output | 9879fe34327a0531a251b32a3f2a97392af9dca9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9450/9879fe34327a0531a251b32a3f2a97392af9dca9/notmuch_addresses.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
433,
20109,
67,
1916,
67,
915,
12,
2890,
16,
508,
4672,
3536,
1220,
6729,
279,
433,
20109,
3607,
445,
261,
3593,
14807,
16,
1967,
5023,
13768,
2934,
16053,
272,
23169,
5846,
690,
5945,
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,
433,
20109,
67,
1916,
67,
915,
12,
2890,
16,
508,
4672,
3536,
1220,
6729,
279,
433,
20109,
3607,
445,
261,
3593,
14807,
16,
1967,
5023,
13768,
2934,
16053,
272,
23169,
5846,
690,
5945,
3... |
audio = service.audioTracks() | audio = service and service.audioTracks() | def audioSelection(self): service = self.session.nav.getCurrentService() audio = service.audioTracks() self.audioTracks = audio n = audio.getNumberOfTracks() keys = [ "red", "", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] + [""]*n tlist = [] print "tlist:", tlist if n > 0: self.audioChannel = service.audioChannel() | 0150e4463bb1204307de78d6826cecfb6492d7c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/0150e4463bb1204307de78d6826cecfb6492d7c2/InfoBarGenerics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7447,
6233,
12,
2890,
4672,
1156,
273,
365,
18,
3184,
18,
11589,
18,
588,
3935,
1179,
1435,
7447,
273,
1156,
471,
1156,
18,
11509,
22138,
1435,
365,
18,
11509,
22138,
273,
7447,
290,
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,
7447,
6233,
12,
2890,
4672,
1156,
273,
365,
18,
3184,
18,
11589,
18,
588,
3935,
1179,
1435,
7447,
273,
1156,
471,
1156,
18,
11509,
22138,
1435,
365,
18,
11509,
22138,
273,
7447,
290,
273... |
def eventhandler(self, event, menuw): | def eventhandler(self, event, menuw=None): | def eventhandler(self, event, menuw): """ catch the IDENTIFY_MEDIA event to redraw the skin (maybe the cd status plugin wants to redraw) """ if plugin.isevent(event) == 'IDENTIFY_MEDIA': skin.get_singleton().redraw() return FALSE | 2d46689a84d58205bfe56ed5a81ebae4a7d75a9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/2d46689a84d58205bfe56ed5a81ebae4a7d75a9e/idlebar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
871,
4176,
12,
2890,
16,
871,
16,
3824,
91,
33,
7036,
4672,
3536,
1044,
326,
19768,
12096,
67,
26368,
871,
358,
16540,
326,
18705,
261,
19133,
326,
7976,
1267,
1909,
14805,
358,
16540,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
871,
4176,
12,
2890,
16,
871,
16,
3824,
91,
33,
7036,
4672,
3536,
1044,
326,
19768,
12096,
67,
26368,
871,
358,
16540,
326,
18705,
261,
19133,
326,
7976,
1267,
1909,
14805,
358,
16540,
1... |
(err, msg) = e | (err, msg) = e.args | def bind_port(sock, host='', preferred_port=54321): """Try to bind the sock to a port. If we are running multiple tests and we don't try multiple ports, the test can fails. This makes the test more robust.""" # some random ports that hopefully no one is listening on. for port in [preferred_port, 9907, 10243, 32999]: try: sock.bind((host, port)) return port except socket.error as e: (err, msg) = e if err != errno.EADDRINUSE: raise print(' WARNING: failed to listen on port %d, trying another' % port, file=sys.__stderr__) raise TestFailed('unable to find port to listen on') | edd5d291933eb377a3ca484c3bbc980b2f4cd8ec /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/edd5d291933eb377a3ca484c3bbc980b2f4cd8ec/test_support.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1993,
67,
655,
12,
15031,
16,
1479,
2218,
2187,
9119,
67,
655,
33,
6564,
1578,
21,
4672,
3536,
7833,
358,
1993,
326,
7313,
358,
279,
1756,
18,
225,
971,
732,
854,
3549,
3229,
7434,
471... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1993,
67,
655,
12,
15031,
16,
1479,
2218,
2187,
9119,
67,
655,
33,
6564,
1578,
21,
4672,
3536,
7833,
358,
1993,
326,
7313,
358,
279,
1756,
18,
225,
971,
732,
854,
3549,
3229,
7434,
471... |
idFile.write('\n'+id) | idFile.write( '\n' + id ) | def getJobStatus(self,jobIDList): """ Get the status information for the given list of jobs """ workingDirectory = self.ceParameters['WorkingDirectory'] fd, idFileName = tempfile.mkstemp( suffix = '.ids', prefix = 'CREAM_', dir = workingDirectory ) idFile = os.fdopen( fd, 'w' ) idFile.write('##CREAMJOBS##') for id in jobIDList: idFile.write('\n'+id) idFile.close() cmd = ['glite-ce-job-status','-n','-i','%s' % idFileName ] result = executeGridCommand(self.proxy,cmd,self.gridEnv) os.unlink(idFileName) resultDict = {} if result['Value'][1]: resultDict = self.__parseJobStatus(result['Value'][1]) | 45afa08b7552c5b79d1cfd9cac53e65115f5e15a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/45afa08b7552c5b79d1cfd9cac53e65115f5e15a/CREAMComputingElement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13024,
1482,
12,
2890,
16,
4688,
24583,
4672,
3536,
968,
326,
1267,
1779,
364,
326,
864,
666,
434,
6550,
3536,
225,
5960,
2853,
273,
365,
18,
311,
2402,
3292,
14836,
2853,
3546,
5194,
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,
13024,
1482,
12,
2890,
16,
4688,
24583,
4672,
3536,
968,
326,
1267,
1779,
364,
326,
864,
666,
434,
6550,
3536,
225,
5960,
2853,
273,
365,
18,
311,
2402,
3292,
14836,
2853,
3546,
5194,
16... |
self.level = 1 | self.level = level | def __init__(self, cache_dir): self.cache_dir = cache_dir self.prepareCacheDir() self.level = 1 # How many dir levels will we create? | 850776bcba4396239be6850852ff675c433bdb38 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9481/850776bcba4396239be6850852ff675c433bdb38/cachemanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1247,
67,
1214,
4672,
365,
18,
2493,
67,
1214,
273,
1247,
67,
1214,
365,
18,
9366,
29582,
1435,
365,
18,
2815,
273,
1801,
468,
9017,
4906,
1577,
7575,
90... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1247,
67,
1214,
4672,
365,
18,
2493,
67,
1214,
273,
1247,
67,
1214,
365,
18,
9366,
29582,
1435,
365,
18,
2815,
273,
1801,
468,
9017,
4906,
1577,
7575,
90... |
portal_languages = getToolByName(self.context, 'portal_languages') portal_catalog = getToolByName(self.context, 'portal_catalog') | portal_languages = cmfutils.getToolByName(self.context, 'portal_languages') portal_catalog = cmfutils.getToolByName(self.context, 'portal_catalog') | def folderContents(self): query = {} portal_languages = getToolByName(self.context, 'portal_languages') portal_catalog = getToolByName(self.context, 'portal_catalog') preflang = portal_languages.getPreferredLanguage() currpath = "/".join(self.context.getPhysicalPath()) canonicalpath = "/".join(self.context.getCanonical().getPhysicalPath()) if self.context.portal_type=='Topic': query = {'portal_type': 'File', 'sort_on': 'effective', 'sort_order': 'reverse'} results = self.context.queryCatalog(contentFilter=query) else: query = dict(object_provides='slc.publications.interfaces.IPublicationEnhanced', sort_on='effective', sort_order='reverse', Language=['', preflang], path=[currpath, canonicalpath] ) results = portal_catalog(query) | 3d77394df490e0f6f99621f25e073bbac0df9898 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10274/3d77394df490e0f6f99621f25e073bbac0df9898/publication.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3009,
6323,
12,
2890,
4672,
843,
273,
2618,
11899,
67,
14045,
273,
5003,
74,
5471,
18,
588,
6364,
5911,
12,
2890,
18,
2472,
16,
296,
24386,
67,
14045,
6134,
11899,
67,
7199,
273,
5003,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3009,
6323,
12,
2890,
4672,
843,
273,
2618,
11899,
67,
14045,
273,
5003,
74,
5471,
18,
588,
6364,
5911,
12,
2890,
18,
2472,
16,
296,
24386,
67,
14045,
6134,
11899,
67,
7199,
273,
5003,
... |
if data.strip(): | if node.strip(): | def process_message(message, keep_spaces): # Normalize the message message.normalize() # Left strip if message: x = message[0] if isinstance(x, unicode) and x.strip() == u'': del message[0] # Right strip if message: x = message[-1] if isinstance(x, unicode) and x.strip() == u'': del message[-1] # Process if message: # Check wether the message is only one element if len(message) == 1 and isinstance(message[0], XML.Element): node = message[0] message = i18n.segment.Message(node.children) for x in process_message(message, keep_spaces): yield x else: # Check wether the node message has real text to process. for x in message: if isinstance(x, unicode): if x.strip(): break elif isinstance(x, XML.Element): for node in x.traverse(): if isinstance(node, unicode): if data.strip(): break else: continue break else: # Nothing to translate raise StopIteration # Something to translate: segmentation for segment in message.get_segments(keep_spaces): segment = segment.replace('"', '\\"') yield segment | 56a29d1b2f9b3b307279c183ec23bafbccddaa5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/56a29d1b2f9b3b307279c183ec23bafbccddaa5e/XHTML.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2150,
12,
2150,
16,
3455,
67,
9554,
4672,
468,
14282,
326,
883,
883,
18,
12237,
1435,
468,
13338,
2569,
309,
883,
30,
619,
273,
883,
63,
20,
65,
309,
1549,
12,
92,
16,
5252... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
2150,
12,
2150,
16,
3455,
67,
9554,
4672,
468,
14282,
326,
883,
883,
18,
12237,
1435,
468,
13338,
2569,
309,
883,
30,
619,
273,
883,
63,
20,
65,
309,
1549,
12,
92,
16,
5252... |
gridSizer.AddGrowableCol(0) | def __init__(self, parent, title): wxDialog.__init__(self, parent, -1, title) | 1d19ce5cb35cf6ceaf0d05c89edb9c29531b82e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10056/1d19ce5cb35cf6ceaf0d05c89edb9c29531b82e7/dialoglineup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
2077,
4672,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
982,
16,
300,
21,
16,
2077,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
2077,
4672,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
982,
16,
300,
21,
16,
2077,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
os.chdir(os.path.dirname(__file__)) | os.chdir(os.path.dirname(__file__) or os.path.curdir) | def after_request_form_access(): global REQUEST REQUEST = None | f179a6c42949356e5c2cfa554f5e2c20fa780e55 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14437/f179a6c42949356e5c2cfa554f5e2c20fa780e55/wzbench.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1839,
67,
2293,
67,
687,
67,
3860,
13332,
2552,
12492,
12492,
273,
599,
282,
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,... | [
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,
1839,
67,
2293,
67,
687,
67,
3860,
13332,
2552,
12492,
12492,
273,
599,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for y in range(height+1): | for y in range(height): | def sysbox(size): canvas = {} # The system box of the computer. height = int(round(3*size)) width = int(round(17*size)) depth = int(round(2*size)) highlight = int(round(1*size)) bothighlight = int(round(0.49*size)) floppystart = int(round(19*size)) # measured in half-pixels floppyend = int(round(29*size)) # measured in half-pixels floppybottom = height - bothighlight floppyrheight = 0.7 * size floppyheight = int(round(floppyrheight)) if floppyheight < 1: floppyheight = 1 floppytop = floppybottom - floppyheight # The front panel is rectangular. for x in range(width): for y in range(height): grey = 3 if x < highlight or y < highlight: grey = grey + 1 if x >= width-highlight or y >= height-bothighlight: grey = grey - 1 if y < highlight and x >= width-highlight: v = (highlight-1-y) - (x-(width-highlight)) if v < 0: grey = grey - 1 elif v > 0: grey = grey + 1 if y >= floppytop and y < floppybottom and \ 2*x+2 > floppystart and 2*x < floppyend: if 2*x >= floppystart and 2*x+2 <= floppyend and \ floppyrheight >= 0.7: grey = 0 else: grey = 2 pixel(x, y, greypix(grey/4.0), canvas) # The side panel is a parallelogram. for x in range(depth): for y in range(height+1): pixel(x+width, y-(x+1), greypix(0.5), canvas) # The top panel is another parallelogram. for x in range(width-1): for y in range(depth): grey = 3 if x >= width-1 - highlight: grey = grey + 1 pixel(x+(y+1), -(y+1), greypix(grey/4.0), canvas) # And draw a border. border(canvas, size, []) return canvas | dcad6105fd2144eeecd41b4d5c9d1d07998cb50a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13182/dcad6105fd2144eeecd41b4d5c9d1d07998cb50a/mkicon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2589,
2147,
12,
1467,
4672,
5953,
273,
2618,
225,
468,
1021,
2619,
3919,
434,
326,
26579,
18,
225,
2072,
273,
509,
12,
2260,
12,
23,
14,
1467,
3719,
1835,
273,
509,
12,
2260,
12,
4033,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2589,
2147,
12,
1467,
4672,
5953,
273,
2618,
225,
468,
1021,
2619,
3919,
434,
326,
26579,
18,
225,
2072,
273,
509,
12,
2260,
12,
23,
14,
1467,
3719,
1835,
273,
509,
12,
2260,
12,
4033,... |
f.write( ' > <A HREF="../'+mainPageFile+'">Data 2010</A>'); | pageName = os.path.splitext(os.path.split(mainPageFile)[1])[0] f.write( ' > <A HREF="../'+mainPageFile+'">'+pageName+'</A>'); | def createPage(myDir, histoPrefix = "", mainPageFile = "index"): | 6daad9f9a2ad95a588f7f074a22b4060bb8d8580 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8994/6daad9f9a2ad95a588f7f074a22b4060bb8d8580/createPage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
1964,
12,
4811,
1621,
16,
5356,
83,
2244,
273,
23453,
2774,
1964,
812,
273,
315,
1615,
6,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
1964,
12,
4811,
1621,
16,
5356,
83,
2244,
273,
23453,
2774,
1964,
812,
273,
315,
1615,
6,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
counter += update(node, found, 0, prefix, skipPrefix, verbose) | if level==0: counter += update(node, found, 0, prefix, skipPrefix, verbose) | def search(node, found, counter, level=0, prefix="$", skipPrefix="", register=False, verbose=False): if node.type == "function": if register: name = node.get("name", False) if name != None and not name in found: # print "Name: %s" % name found.append(name) foundLen = len(found) register = True if verbose: print "\n%s<scope line='%s'>" % ((" " * level), node.get("line")) # e.g. func(name1, name2); elif register and node.type == "variable" and node.hasChildren() and len(node.children) == 1: if node.parent.type == "params" and node.parent.parent.type != "call": first = node.getFirstChild() if first.type == "identifier": name = first.get("name") if not name in found: # print "Name: %s" % name found.append(name) # e.g. var name1, name2 = "foo"; elif register and node.type == "definition": name = node.get("identifier", False) if name != None: if not name in found: # print "Name: %s" % name found.append(name) # Iterate over children if node.hasChildren(): if node.type == "function": for child in node.children: counter += search(child, found, 0, level+1, prefix, skipPrefix, register, verbose) else: for child in node.children: counter += search(child, found, 0, level, prefix, skipPrefix, register, verbose) # Function closed if node.type == "function": # Debug if verbose: for item in found: print " %s<item>%s</item>" % ((" " * level), item) print "%s</scope>" % (" " * level) # Iterate over content # Replace variables in current scope counter += update(node, found, 0, prefix, skipPrefix, verbose) # this breaks the index in cases where variables are defined after # the declaration of a inner function and used in this function. # del found[foundLen:] return counter | 6aafeba40bdbda5fed0def5d884c8d4e4f468e32 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/6aafeba40bdbda5fed0def5d884c8d4e4f468e32/variableoptimizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2159,
16,
1392,
16,
3895,
16,
1801,
33,
20,
16,
1633,
1546,
8,
3113,
2488,
2244,
1546,
3113,
1744,
33,
8381,
16,
3988,
33,
8381,
4672,
309,
756,
18,
723,
422,
315,
915,
687... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2159,
16,
1392,
16,
3895,
16,
1801,
33,
20,
16,
1633,
1546,
8,
3113,
2488,
2244,
1546,
3113,
1744,
33,
8381,
16,
3988,
33,
8381,
4672,
309,
756,
18,
723,
422,
315,
915,
687... |
" %s(%s, len + 1, &len, bucket->GetDataAs<GLchar*>(0, len + 1));\n" % (func.GetGLFunctionName(), id_arg.name)) | " %s %s = GetSharedMemoryAs<%s>(\n" % (dest_arg.type, dest_arg.name, dest_arg.type)) file.Write( " c.%s_shm_id, c.%s_shm_offset, %s);\n" % (dest_arg.name, dest_arg.name, bufsize_arg.name)) for arg in all_but_last_2_args + [dest_arg]: arg.WriteValidationCode(file) func.WriteValidationCode(file) func.WriteHandlerImplementation(file) | def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "error::Error GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) args = func.GetCmdArgs() id_arg = args[0] bucket_arg = args[1] id_arg.WriteGetCode(file) bucket_arg.WriteGetCode(file) id_arg.WriteValidationCode(file) file.Write(" GLint len = 0;\n") file.Write(" %s(%s, %s, &len);\n" % ( func.GetInfo('get_len_func'), id_arg.name, func.GetInfo('get_len_enum'))) file.Write(" Bucket* bucket = CreateBucket(%s);\n" % bucket_arg.name) file.Write(" bucket->SetSize(len + 1);\n"); file.Write( " %s(%s, len + 1, &len, bucket->GetDataAs<GLchar*>(0, len + 1));\n" % (func.GetGLFunctionName(), id_arg.name)) file.Write(" return error::kNoError;\n") file.Write("}\n") file.Write("\n") | 4f0c32d419b2a9783e1458192f5c0d3d79813764 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/4f0c32d419b2a9783e1458192f5c0d3d79813764/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
1179,
13621,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
12,
315,
1636,
2866,
668,
611,
11386,
22,
7975,
2828,
2866,
3259,
9,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
1179,
13621,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
12,
315,
1636,
2866,
668,
611,
11386,
22,
7975,
2828,
2866,
3259,
9,
... |
style = self.get_line_style(**param) self.prop_stack.AddStyle(style.Duplicate()) self.bezier(path,) | style = self.get_line_style(**param) self.prop_stack.AddStyle(style.Duplicate()) self.bezier(path,) | def spline(self): param={ '70': 0, # Spline flag '71': 0, # Degree of the spline curve '72': 0, # Number of knots '73': 0, # Number of control points '74': 0, # Number of fit points '40': [], # Knot value '10': [], # Control points X '20': [], # Control points Y #'30': [], # Control points Z } param.update(self.general_param) param = self.read_param(param) print param print 'SPLINE', param['70'] print 'Контрольных точек', param['73'], (1, len(param['10'])-2, 2) closed = param['70'] & 1 if param['70'] & 4 == 4: print 'if param[ 70 ] & 4 == 4:' if param['70'] & 8 == 8: f13 = 1.0 / 3.0; f23 = 2.0 / 3.0 path = CreatePath() pts = map(lambda x, y: self.trafo(x, y), param['10'],param['20']) curve = path.AppendBezier straight = path.AppendLine last = pts[0] cur = pts[1] start = node = pts[0] | 02df12c26818fd938357920396a246a253220885 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3123/02df12c26818fd938357920396a246a253220885/dxfloader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22826,
12,
2890,
4672,
579,
5899,
202,
11,
7301,
4278,
374,
16,
468,
11484,
558,
2982,
296,
11212,
4278,
374,
16,
468,
463,
1332,
992,
434,
326,
22826,
8882,
296,
9060,
4278,
374,
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,
22826,
12,
2890,
4672,
579,
5899,
202,
11,
7301,
4278,
374,
16,
468,
11484,
558,
2982,
296,
11212,
4278,
374,
16,
468,
463,
1332,
992,
434,
326,
22826,
8882,
296,
9060,
4278,
374,
16,
... |
if wid is self.wlessLB: | elif wid is self.wlessLB: | def call_connect(self): wid = self.thePile.get_focus() if wid is self.wiredCB: #wid2,pos = self.wiredCB.get_focus() # Apparently, connect() doesn't care about the networkid self.connect(self,'wired',0) #return "Wired network %i" % pos if wid is self.wlessLB: #self.footer1 = urwid.Text("Wireless!") wid2,pos = self.wlessLB.get_focus() self.connect(self,'wireless',pos) else: return "Failure!" | da132a92d95413fee383557405ce376958f0527a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/353/da132a92d95413fee383557405ce376958f0527a/wicd-curses.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
67,
3612,
12,
2890,
4672,
15481,
273,
365,
18,
5787,
52,
398,
18,
588,
67,
13923,
1435,
309,
15481,
353,
365,
18,
91,
2921,
8876,
30,
468,
30902,
22,
16,
917,
273,
365,
18,
91,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
67,
3612,
12,
2890,
4672,
15481,
273,
365,
18,
5787,
52,
398,
18,
588,
67,
13923,
1435,
309,
15481,
353,
365,
18,
91,
2921,
8876,
30,
468,
30902,
22,
16,
917,
273,
365,
18,
91,
... |
>>> from Products.Archetypes.atapi import StringField as SF | >>> from Products.Archetypes.public import StringField as SF | def moveField(self, name, direction=None, pos=None, after=None, before=None): """Move a field | b9a35d44b511b5a532334179a24412a4695367d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/b9a35d44b511b5a532334179a24412a4695367d1/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
974,
12,
2890,
16,
508,
16,
4068,
33,
7036,
16,
949,
33,
7036,
16,
1839,
33,
7036,
16,
1865,
33,
7036,
4672,
3536,
7607,
279,
652,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
974,
12,
2890,
16,
508,
16,
4068,
33,
7036,
16,
949,
33,
7036,
16,
1839,
33,
7036,
16,
1865,
33,
7036,
4672,
3536,
7607,
279,
652,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if (data) and (data != '""'): | if (data) and (data != '""') and (data != "None"): | def GetImageSeriesNumber(self): """ Return integer related to acquisition series where this slice is included. Return "" if field is not defined. | d6c3efa5f0c947a5fc9a4479e74b729058af098b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10228/d6c3efa5f0c947a5fc9a4479e74b729058af098b/dicom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2040,
6485,
1854,
12,
2890,
4672,
3536,
2000,
3571,
3746,
358,
1721,
22094,
4166,
1625,
333,
2788,
353,
5849,
18,
2000,
1408,
309,
652,
353,
486,
2553,
18,
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,
0,
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,
2040,
6485,
1854,
12,
2890,
4672,
3536,
2000,
3571,
3746,
358,
1721,
22094,
4166,
1625,
333,
2788,
353,
5849,
18,
2000,
1408,
309,
652,
353,
486,
2553,
18,
2,
-100,
-100,
-100,
-100... |
return None | return None | def build_search_url(self, basic_search_units, lang=cdslang): """Build an URL for CERN EDMS.""" super(CERNEDMSSearchEngine, self).build_search_url(basic_search_units) if len(self.fields_content["default"]) > 0: free_text = self.bind_fields(["author", "keyword", "abstract", "title", "reportnumber", "default"]) return self.search_url_simple + free_text else: authors = self.bind_fields(["author"]) title = self.bind_fields(["title", "abstract", "keyword"]) reportnumber = self.bind_fields(["reportnumber"]) url_parts = [] if authors != '': url_parts.append('p_author=' + authors) if title != "": url_parts.append('p_title=' + title) if reportnumber != "": url_parts.append('p_document_id=' + reportnumber) if len(url_parts) == 0: return None return self.search_url + "&".join(url_parts) | cefcba8a41a9b60c5e147d46565944869f31e70a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2139/cefcba8a41a9b60c5e147d46565944869f31e70a/websearch_external_collections_searcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
3072,
67,
718,
12,
2890,
16,
5337,
67,
3072,
67,
7705,
16,
3303,
33,
4315,
2069,
539,
4672,
3536,
3116,
392,
1976,
364,
385,
654,
50,
15585,
3537,
12123,
2240,
12,
39,
654,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
3072,
67,
718,
12,
2890,
16,
5337,
67,
3072,
67,
7705,
16,
3303,
33,
4315,
2069,
539,
4672,
3536,
3116,
392,
1976,
364,
385,
654,
50,
15585,
3537,
12123,
2240,
12,
39,
654,
... |
warning.warn("Cannot add element of type %s to ParserElement" % type(other), | warnings.warn("Cannot add element of type %s to ParserElement" % type(other), | def __radd__(self, other ): """Implementation of += operator""" if isinstance( other, basestring ): other = Literal( other ) if not isinstance( other, ParserElement ): warning.warn("Cannot add element of type %s to ParserElement" % type(other), SyntaxWarning, stacklevel=2) return other + self | dda2a500387325587692217da639d3c17f38e5a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12364/dda2a500387325587692217da639d3c17f38e5a1/pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
354,
449,
972,
12,
2890,
16,
1308,
262,
30,
3536,
13621,
434,
1011,
3726,
8395,
309,
1549,
12,
1308,
16,
10699,
262,
30,
1308,
273,
14392,
12,
1308,
262,
309,
486,
1549,
12,
1308... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
354,
449,
972,
12,
2890,
16,
1308,
262,
30,
3536,
13621,
434,
1011,
3726,
8395,
309,
1549,
12,
1308,
16,
10699,
262,
30,
1308,
273,
14392,
12,
1308,
262,
309,
486,
1549,
12,
1308... |
portal.group_id.write(cr,uid,[portal.group_id.id],{'rule_groups': [(4,model.rule_group_id.id)]}) | group_obj = self.pool.get('res.groups') group_obj.write(cr,uid,[portal.group_id.id],{'rule_groups': [(4,model.rule_group_id.id)]}) | def create_menu(self, cr, uid,portal_id, portal_model_id, menu_name, action_id,parent_menu_id=None,view_ids=None,view_type=False,context=None): """ Create a menuitem for the given portal and model whith the given name and action. """ | bb76d5b3360a6ff4906a9cfbe5a2772dc00bb599 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/bb76d5b3360a6ff4906a9cfbe5a2772dc00bb599/portal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
5414,
12,
2890,
16,
4422,
16,
4555,
16,
24386,
67,
350,
16,
11899,
67,
2284,
67,
350,
16,
3824,
67,
529,
16,
1301,
67,
350,
16,
2938,
67,
5414,
67,
350,
33,
7036,
16,
1945... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
5414,
12,
2890,
16,
4422,
16,
4555,
16,
24386,
67,
350,
16,
11899,
67,
2284,
67,
350,
16,
3824,
67,
529,
16,
1301,
67,
350,
16,
2938,
67,
5414,
67,
350,
33,
7036,
16,
1945... |
run_suite(unittest.makeSuite(testclass)) | run_suite(unittest.makeSuite(testclass), testclass) | def run_unittest(testclass): """Run tests from a unittest.TestCase-derived class.""" run_suite(unittest.makeSuite(testclass)) | 266410355f7faa7c98b29a16b9f50c56a9224f4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/266410355f7faa7c98b29a16b9f50c56a9224f4b/test_support.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
4873,
3813,
12,
3813,
1106,
4672,
3536,
1997,
7434,
628,
279,
2836,
3813,
18,
4709,
2449,
17,
765,
2950,
667,
12123,
1086,
67,
30676,
12,
4873,
3813,
18,
6540,
13587,
12,
3813,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1086,
67,
4873,
3813,
12,
3813,
1106,
4672,
3536,
1997,
7434,
628,
279,
2836,
3813,
18,
4709,
2449,
17,
765,
2950,
667,
12123,
1086,
67,
30676,
12,
4873,
3813,
18,
6540,
13587,
12,
3813,... |
raise ValueError("n must be > 0: %s" % `n`) | raise ValueError("n must be > 0: " + `n`) | def get_close_matches(word, possibilities, n=3, cutoff=0.6): """Use SequenceMatcher to return list of the best "good enough" matches. word is a sequence for which close matches are desired (typically a string). possibilities is a list of sequences against which to match word (typically a list of strings). Optional arg n (default 3) is the maximum number of close matches to return. n must be > 0. Optional arg cutoff (default 0.6) is a float in [0, 1]. Possibilities that don't score at least that similar to word are ignored. The best (no more than n) matches among the possibilities are returned in a list, sorted by similarity score, most similar first. >>> get_close_matches("appel", ["ape", "apple", "peach", "puppy"]) ['apple', 'ape'] >>> import keyword >>> get_close_matches("wheel", keyword.kwlist) ['while'] >>> get_close_matches("apple", keyword.kwlist) [] >>> get_close_matches("accept", keyword.kwlist) ['except'] """ if not n > 0: raise ValueError("n must be > 0: %s" % `n`) if not 0.0 <= cutoff <= 1.0: raise ValueError("cutoff must be in [0.0, 1.0]: %s" % `cutoff`) result = [] s = SequenceMatcher() s.set_seq2(word) for x in possibilities: s.set_seq1(x) if s.real_quick_ratio() >= cutoff and \ s.quick_ratio() >= cutoff and \ s.ratio() >= cutoff: result.append((s.ratio(), x)) # Sort by score. result.sort() # Retain only the best n. result = result[-n:] # Move best-scorer to head of list. result.reverse() # Strip scores. return [x for score, x in result] | 73eab40ad39fd56f1b3dc0ce6f441d0c8221f5ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/73eab40ad39fd56f1b3dc0ce6f441d0c8221f5ef/difflib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4412,
67,
8436,
12,
1095,
16,
28550,
16,
290,
33,
23,
16,
13383,
33,
20,
18,
26,
4672,
3536,
3727,
8370,
6286,
358,
327,
666,
434,
326,
3796,
315,
19747,
7304,
6,
1885,
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,
336,
67,
4412,
67,
8436,
12,
1095,
16,
28550,
16,
290,
33,
23,
16,
13383,
33,
20,
18,
26,
4672,
3536,
3727,
8370,
6286,
358,
327,
666,
434,
326,
3796,
315,
19747,
7304,
6,
1885,
18,
... |
"""Return True if pid is alive, otherwise return False.""" try: os.kill(current_pid, 0) except OSError: return False else: return True | """Return True if pid is alive, otherwise return False. FIXME: os.kill() doesn't work on Windows for checking if a pid is alive, so always return True""" if sys.platform in ('darwin', 'linux2'): try: os.kill(current_pid, 0) except OSError: return False return True | def _check_pid(self, current_pid): """Return True if pid is alive, otherwise return False.""" try: os.kill(current_pid, 0) except OSError: return False else: return True | 8a8edf72fd1ed3542d6d124952c436ad9e5bbe66 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/8a8edf72fd1ed3542d6d124952c436ad9e5bbe66/http_lock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
6610,
12,
2890,
16,
783,
67,
6610,
4672,
3536,
990,
1053,
309,
4231,
353,
13714,
16,
3541,
327,
1083,
12123,
775,
30,
1140,
18,
16418,
12,
2972,
67,
6610,
16,
374,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
6610,
12,
2890,
16,
783,
67,
6610,
4672,
3536,
990,
1053,
309,
4231,
353,
13714,
16,
3541,
327,
1083,
12123,
775,
30,
1140,
18,
16418,
12,
2972,
67,
6610,
16,
374,
13,
... |
aargs = args kkwargs = kwargs rArgs = [`x`+', ' for x in args] + [ x + ' = ' + '%s, ' % `y` for x,y in kwargs.items()] | if args: rArgs = [args[0].__class__.__name__ + ', '] else: rArgs = [] if 'args' in types: rArgs += [`x`+', ' for x in args[1:]] + \ [ x + ' = ' + '%s, ' % `y` for x,y in kwargs.items()] | def wrap(*args,**kwargs): aargs = args kkwargs = kwargs rArgs = [`x`+', ' for x in args] + [ x + ' = ' + '%s, ' % `y` for x,y in kwargs.items()] if not rArgs: rArgs = '()' else: rArgs = '(' + reduce(str.__add__,rArgs)[:-2] + ')' outStr = f.func_name + rArgs if 'frameCount' in types: outStr = '%8d : %s' % (globalClock.getFrameCount(), outStr) if 'timeStamp' in types: outStr = '%5.3f : %s' % (globalClock.getFrameTime(), outStr) | 41c519ad20d28321edb128740d7f157b28c18c9e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8543/41c519ad20d28321edb128740d7f157b28c18c9e/PythonUtil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
30857,
1968,
16,
636,
4333,
4672,
309,
833,
30,
436,
2615,
273,
306,
1968,
63,
20,
8009,
972,
1106,
972,
16186,
529,
972,
397,
2265,
12671,
469,
30,
436,
2615,
273,
5378,
225,
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,
2193,
30857,
1968,
16,
636,
4333,
4672,
309,
833,
30,
436,
2615,
273,
306,
1968,
63,
20,
8009,
972,
1106,
972,
16186,
529,
972,
397,
2265,
12671,
469,
30,
436,
2615,
273,
5378,
225,
30... |
else | else: | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 949) else quickfix.StringField.__init__(self, 949, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
2468,
7616,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
2468,
7616,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738... |
sqlite_setup_debug = True | sqlite_setup_debug = False | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | dcf84003c18ccd6e7ccf176dab069b1900bb651c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/dcf84003c18ccd6e7ccf176dab069b1900bb651c/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... |
if event is not None: data = parseEvent(event) begin = time.time() end = begin + 3600 * 10 data = (begin, end, data[2], data[3], data[4]) else: data = (time.time(), time.time() + 3600 * 10, "instant record", "", None) | data = (begin, end, name, description, eventid) | def startInstantRecording(self, limitEvent = False): serviceref = self.session.nav.getCurrentlyPlayingServiceReference() # try to get event info event = None if limitEvent: try: service = self.session.nav.getCurrentService() epg = eEPGCache.getInstance() event = epg.lookupEventTime(serviceref, -1, 0) if event is None: info = service.info() ev = info.getEvent(0) event = ev except: pass if event is None: self.session.open(MessageBox, _("No event info found, recording indefinitely."), MessageBox.TYPE_INFO) | 25978791bdc8abdf339026a74036fa17ebb19053 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/25978791bdc8abdf339026a74036fa17ebb19053/InfoBarGenerics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
10675,
21037,
12,
2890,
16,
1800,
1133,
273,
1083,
4672,
24658,
822,
74,
273,
365,
18,
3184,
18,
11589,
18,
588,
3935,
715,
11765,
310,
1179,
2404,
1435,
225,
468,
775,
358,
336,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
10675,
21037,
12,
2890,
16,
1800,
1133,
273,
1083,
4672,
24658,
822,
74,
273,
365,
18,
3184,
18,
11589,
18,
588,
3935,
715,
11765,
310,
1179,
2404,
1435,
225,
468,
775,
358,
336,
... |
self.stopReadTimeout() if self.readSomeData: timeout = SOCKET_READ_TIMEOUT else: timeout = SOCKET_INITIAL_READ_TIMEOUT self.readTimeout = eventloop.addTimeout(timeout, self.onReadTimeout, | return self.readTimeout = eventloop.addTimeout(SOCKET_INITIAL_READ_TIMEOUT, self.onReadTimeout, | def startReadTimeout(self): if self.disableReadTimeout: return if self.readTimeout is not None: self.stopReadTimeout() if self.readSomeData: timeout = SOCKET_READ_TIMEOUT else: timeout = SOCKET_INITIAL_READ_TIMEOUT self.readTimeout = eventloop.addTimeout(timeout, self.onReadTimeout, "AsyncSocket.onReadTimeout") | ff8ef8eb0e2be65d1404d9d144b1f685e26ef2ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12354/ff8ef8eb0e2be65d1404d9d144b1f685e26ef2ab/httpclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1994,
2694,
12,
2890,
4672,
309,
365,
18,
8394,
1994,
2694,
30,
327,
309,
365,
18,
896,
2694,
353,
486,
599,
30,
327,
365,
18,
896,
2694,
273,
871,
6498,
18,
1289,
2694,
12,
256... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1994,
2694,
12,
2890,
4672,
309,
365,
18,
8394,
1994,
2694,
30,
327,
309,
365,
18,
896,
2694,
353,
486,
599,
30,
327,
365,
18,
896,
2694,
273,
871,
6498,
18,
1289,
2694,
12,
256... |
if screen_style_id is None and name.find('Summary') > 0: | if screen_style_id is None and name.find('ummary') > 0: | def lookupScreen(name, style_id): for (path, skin) in dom_skins: # first, find the corresponding screen element for x in skin.findall("screen"): if x.attrib.get('name', '') == name: screen_style_id = x.attrib.get('id', None) if screen_style_id is None and name.find('Summary') > 0: screen_style_id = 1 if screen_style_id is None or screen_style_id == style_id: return x, path return None, None | e801c8052a5daa60c576d5231cb90f7ae6ed6c33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6652/e801c8052a5daa60c576d5231cb90f7ae6ed6c33/skin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3689,
7956,
12,
529,
16,
2154,
67,
350,
4672,
364,
261,
803,
16,
18705,
13,
316,
4092,
67,
7771,
2679,
30,
468,
1122,
16,
1104,
326,
4656,
5518,
930,
364,
619,
316,
18705,
18,
4720,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3689,
7956,
12,
529,
16,
2154,
67,
350,
4672,
364,
261,
803,
16,
18705,
13,
316,
4092,
67,
7771,
2679,
30,
468,
1122,
16,
1104,
326,
4656,
5518,
930,
364,
619,
316,
18705,
18,
4720,
... |
gLogger.exception("Failed to remove source dir.",getFileDir,x) | gLogger.exception("Failed to remove destination dir.",putFileDir,x) | def __uploadFile(self, se, pfn): res = self.__prepareSecurityDetails() if not res['OK']: return res | bb03aba7caa0495e51cb4def068fb6d7556dc08d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/bb03aba7caa0495e51cb4def068fb6d7556dc08d/StorageElementProxyHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
6327,
812,
12,
2890,
16,
695,
16,
293,
4293,
4672,
400,
273,
365,
16186,
9366,
4368,
3790,
1435,
309,
486,
400,
3292,
3141,
3546,
30,
327,
400,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
6327,
812,
12,
2890,
16,
695,
16,
293,
4293,
4672,
400,
273,
365,
16186,
9366,
4368,
3790,
1435,
309,
486,
400,
3292,
3141,
3546,
30,
327,
400,
2,
-100,
-100,
-100,
-100,
-100,
-... |
result['name'] = product_obj.partner_ref | if not flag: result['name'] = product_obj.partner_ref | def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False): if not partner_id: raise osv.except_osv(_('No Customer Defined !'), _('You have to select a customer in the sale form !\nPlease set one customer before choosing a product.')) warning={} product_uom_obj = self.pool.get('product.uom') partner_obj = self.pool.get('res.partner') product_obj = self.pool.get('product.product') if partner_id: lang = partner_obj.browse(cr, uid, partner_id).lang context = {'lang': lang, 'partner_id': partner_id} | 05582c015af748d18e8072defd0be9f7ccdda1b0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/05582c015af748d18e8072defd0be9f7ccdda1b0/sale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
350,
67,
3427,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
846,
335,
5449,
16,
3017,
16,
26667,
33,
20,
16,
582,
362,
33,
8381,
16,
26667,
67,
89,
538,
33,
20,
16,
582,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
350,
67,
3427,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
846,
335,
5449,
16,
3017,
16,
26667,
33,
20,
16,
582,
362,
33,
8381,
16,
26667,
67,
89,
538,
33,
20,
16,
582,
... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 452) else quickfix.IntField.__init__(self, 452, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
1059,
9401,
13,
469,
9549,
904,
18,
1702,
974,
16186,
2738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
1059,
9401,
13,
469,
9549,
904,
18,
1702,
974,
16186,
2738,
... |
truncate_along_axis(h_MM, s_MM, centers_ic, cutoff) | truncate_along_axis(h_MM, s_MM, direction, centers_ic, cutoff) | def get_hs(self, kpt=(0, 0, 0), spin=0, remove_pbc=None): """Hamiltonian and overlap matrices for an arbitrary k-point. The default values corresponds to the Gamma point for spin 0 and periodic boundary conditions. | 89edf239079595badc0b41abaed8dbaa0def2dc8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1380/89edf239079595badc0b41abaed8dbaa0def2dc8/siesta.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4487,
12,
2890,
16,
417,
337,
28657,
20,
16,
374,
16,
374,
3631,
12490,
33,
20,
16,
1206,
67,
5733,
71,
33,
7036,
4672,
3536,
44,
11580,
1917,
2779,
471,
7227,
16415,
364,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4487,
12,
2890,
16,
417,
337,
28657,
20,
16,
374,
16,
374,
3631,
12490,
33,
20,
16,
1206,
67,
5733,
71,
33,
7036,
4672,
3536,
44,
11580,
1917,
2779,
471,
7227,
16415,
364,
3... |
if sres.getResult() == SUCCESS: | if sbuild.getResult() == SUCCESS: | def start(self): self.logfiles = {} global ports_pool builder_props = self.build.getProperties() if not ports_pool: # Effectively, the range of these ports will limit the number of # simultaneous databases that can be tested min_port = builder_props.getProperty('min_port',8200) max_port = builder_props.getProperty('max_port',8299) port_spacing = builder_props.getProperty('port_spacing',4) ports_pool = tools.Pool(iter(range(min_port, max_port, port_spacing))) | c423298fc170d1184f515f50e366369af0005734 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12355/c423298fc170d1184f515f50e366369af0005734/buildstep.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
365,
18,
1330,
2354,
273,
2618,
2552,
9048,
67,
6011,
2089,
67,
9693,
273,
365,
18,
3510,
18,
588,
2297,
1435,
309,
486,
9048,
67,
6011,
30,
468,
30755,
4492,
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,
787,
12,
2890,
4672,
365,
18,
1330,
2354,
273,
2618,
2552,
9048,
67,
6011,
2089,
67,
9693,
273,
365,
18,
3510,
18,
588,
2297,
1435,
309,
486,
9048,
67,
6011,
30,
468,
30755,
4492,
16,
... |
EventCollections.EventCategories['DatePickerCtrlEvent'] = ('wx.EVT_DATE_CHANGED') | EventCollections.EventCategories['DatePickerCtrlEvent'] = ('wx.EVT_DATE_CHANGED',) | def inspectorEdit(self): if self.value.IsValid(): PropertyEditors.BITPropEditor.inspectorEdit(self) | 7a5043c9f452d32ca6acdc5be09febf80af030f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/7a5043c9f452d32ca6acdc5be09febf80af030f8/DateTimeCompanions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22700,
4666,
12,
2890,
4672,
309,
365,
18,
1132,
18,
20536,
13332,
4276,
4666,
1383,
18,
15650,
4658,
6946,
18,
12009,
280,
4666,
12,
2890,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
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,
22700,
4666,
12,
2890,
4672,
309,
365,
18,
1132,
18,
20536,
13332,
4276,
4666,
1383,
18,
15650,
4658,
6946,
18,
12009,
280,
4666,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
def __init__( self, enableReactorThread = True, minPeriod = 60 ): | def __init__( self, enableReactorThread = True, minPeriod = 1 ): | def __init__( self, enableReactorThread = True, minPeriod = 60 ): self.__thId = False self.__minPeriod = minPeriod self.__taskDict = {} self.__hood = [] self.__createReactorThread = enableReactorThread self.__nowEpoch = time.time self.__sleeper = time.sleep | bc726cc4a54f92f64c8cfd45aaaf12319ef78e35 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/bc726cc4a54f92f64c8cfd45aaaf12319ef78e35/ThreadScheduler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
4237,
426,
3362,
3830,
273,
1053,
16,
1131,
5027,
273,
404,
262,
30,
365,
16186,
451,
548,
273,
1083,
365,
16186,
1154,
5027,
273,
1131,
5027,
365,
16186,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16,
4237,
426,
3362,
3830,
273,
1053,
16,
1131,
5027,
273,
404,
262,
30,
365,
16186,
451,
548,
273,
1083,
365,
16186,
1154,
5027,
273,
1131,
5027,
365,
16186,
... |
'<th>Total Residues</th>', | '<th>Total Residues</th>', | def html_completed_job_table(self, job_list): completed_list = [] for jdict in job_list: ## Added more states to job_table. Christoph Champ, 2008-02-03 if jdict.get("state") in ["completed", "success", "errors", # completed w/errors "warnings", # completed w/warnings "killed", "died", "defunct"]: completed_list.append(jdict) | bb3b5e8c7c0e2fcb8020d92f6dcfef34849d771b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10674/bb3b5e8c7c0e2fcb8020d92f6dcfef34849d771b/webtlsmd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
13615,
67,
4688,
67,
2121,
12,
2890,
16,
1719,
67,
1098,
4672,
5951,
67,
1098,
273,
5378,
364,
525,
1576,
316,
1719,
67,
1098,
30,
7541,
25808,
1898,
5493,
358,
1719,
67,
212... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
13615,
67,
4688,
67,
2121,
12,
2890,
16,
1719,
67,
1098,
4672,
5951,
67,
1098,
273,
5378,
364,
525,
1576,
316,
1719,
67,
1098,
30,
7541,
25808,
1898,
5493,
358,
1719,
67,
212... |
sys.exit(1) | sys.exit(EXIT_EOPTION) | def main(): metric=True gnuplot=False xvar=var_dist yvar=var_ele imagefile=None tzname=None try: opts,args=getopt.getopt(sys.argv[1:],'hgEx:y:o:t:',['help',]) except: print __doc__ sys.exit(1) for o, a in opts: if o in ['-h','--help']: print __doc__ sys.exit(0) if o == '-E': metric=False if o == '-g': gnuplot=True if o == '-x': if var_names.has_key(a): xvar=var_names[a] else: print 'unknown x variable' print __doc__ sys.exit(1) if o == '-y': if var_names.has_key(a): yvar=var_names[a] else: print 'unknown y variable' print __doc__ sys.exit(1) if o == '-o': imagefile=a if o == '-t': if not globals().has_key('pytz'): print 'pytz module is required to change timezone' print __doc__ sys.exit(2) tzname=a if len(args) > 1: print 'too many files given' print __doc__ sys.exit(1) file=args[0] trk=read_gpx_trk(file,tzname) if gnuplot: plot_in_gnuplot(trk,x=xvar,y=yvar,metric=metric,savefig=imagefile) else: print_gpx_trk(trk,metric=metric) | 57d740e668a260e73a20750b97e687c0e22703cb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4805/57d740e668a260e73a20750b97e687c0e22703cb/gpxplot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3999,
33,
5510,
314,
13053,
4032,
33,
8381,
619,
1401,
33,
1401,
67,
4413,
677,
1401,
33,
1401,
67,
6516,
1316,
768,
33,
7036,
6016,
529,
33,
7036,
775,
30,
1500,
16,
1968... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3999,
33,
5510,
314,
13053,
4032,
33,
8381,
619,
1401,
33,
1401,
67,
4413,
677,
1401,
33,
1401,
67,
6516,
1316,
768,
33,
7036,
6016,
529,
33,
7036,
775,
30,
1500,
16,
1968... |
@param bmask: bitmask of the constant ordinary enums accept | @param bmask: bitmask of the constant ordinary enums accept | def DelConstEx(enum_id, value, serial, bmask): """ Delete a member of enum - a symbolic constant @param enum_id: id of enum @param value: value of symbolic constant. @param serial: serial number of the constant in the enumeration. See OpEnumEx() for for details. @param bmask: bitmask of the constant ordinary enums accept only -1 as a bitmask @return: 1-ok, 0-failed """ return idaapi.del_const(enum_id, value, serial, bmask) | bf1ab9894aabbc1bcdadb6513fc5ef25283e4f52 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3410/bf1ab9894aabbc1bcdadb6513fc5ef25283e4f52/idc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6603,
9661,
424,
12,
7924,
67,
350,
16,
460,
16,
2734,
16,
324,
4455,
4672,
3536,
2504,
279,
3140,
434,
2792,
300,
279,
16754,
5381,
225,
632,
891,
2792,
67,
350,
30,
612,
434,
2792,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6603,
9661,
424,
12,
7924,
67,
350,
16,
460,
16,
2734,
16,
324,
4455,
4672,
3536,
2504,
279,
3140,
434,
2792,
300,
279,
16754,
5381,
225,
632,
891,
2792,
67,
350,
30,
612,
434,
2792,
... |
record = SeqIO.read(open(t_filename),t_format,given_alpha) | record = SeqIO.read(open(t_filename,mode),t_format,given_alpha) | def check_simple_write_read(records, indent=" "): #print indent+"Checking we can write and then read back these records" for format in test_write_read_alignment_formats: if format not in possible_unknown_seq_formats \ and isinstance(records[0].seq, UnknownSeq) \ and len(records[0].seq) > 100: #Skipping for speed. Some of the unknown sequences are #rather long, and it seems a bit pointless to record them. continue print indent+"Checking can write/read as '%s' format" % format #Going to write to a handle... handle = StringIO() try: c = SeqIO.write(sequences=records, handle=handle, format=format) assert c == len(records) except (TypeError, ValueError), e: #This is often expected to happen, for example when we try and #write sequences of different lengths to an alignment file. if "len()" in str(e): #Python 2.4.3, #>>> len(None) #... #TypeError: len() of unsized object # #Python 2.5.2, #>>> len(None) #... #TypeError: object of type 'NoneType' has no len() print "Failed: Probably len() of None" else: print indent+"Failed: %s" % str(e) assert format != t_format, \ "Should be able to re-write in the original format!" #Carry on to the next format: continue handle.flush() handle.seek(0) #Now ready to read back from the handle... try: records2 = list(SeqIO.parse(handle=handle, format=format)) except ValueError, e: #This is BAD. We can't read our own output. #I want to see the output when called from the test harness, #run_tests.py (which can be funny about new lines on Windows) handle.seek(0) raise ValueError("%s\n\n%s\n\n%s" \ % (str(e), repr(handle.read()), repr(records))) assert len(records2) == t_count for r1, r2 in zip(records, records2): #Check the bare minimum (ID and sequence) as #many formats can't store more than that. #Check the sequence if format in ["gb", "genbank", "embl"]: #The GenBank/EMBL parsers will convert to upper case. assert r1.seq.tostring().upper() == r2.seq.tostring() elif format == "qual": assert isinstance(r2.seq, UnknownSeq) assert len(r2) == len(r1) else: assert r1.seq.tostring() == r2.seq.tostring() #Beware of different quirks and limitations in the #valid character sets and the identifier lengths! if format=="phylip": assert r1.id.replace("[","").replace("]","")[:10] == r2.id, \ "'%s' vs '%s'" % (r1.id, r2.id) elif format=="clustal": assert r1.id.replace(" ","_")[:30] == r2.id, \ "'%s' vs '%s'" % (r1.id, r2.id) elif format=="stockholm": assert r1.id.replace(" ","_") == r2.id, \ "'%s' vs '%s'" % (r1.id, r2.id) elif format=="fasta": assert r1.id.split()[0] == r2.id else: assert r1.id == r2.id, \ "'%s' vs '%s'" % (r1.id, r2.id) | 3e60a601eafa492cf904cc785d9e486ca5080e08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7167/3e60a601eafa492cf904cc785d9e486ca5080e08/test_SeqIO.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
9647,
67,
2626,
67,
896,
12,
7094,
16,
3504,
1546,
315,
4672,
468,
1188,
3504,
9078,
14294,
732,
848,
1045,
471,
1508,
855,
1473,
4259,
3853,
6,
364,
740,
316,
1842,
67,
2626,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9647,
67,
2626,
67,
896,
12,
7094,
16,
3504,
1546,
315,
4672,
468,
1188,
3504,
9078,
14294,
732,
848,
1045,
471,
1508,
855,
1473,
4259,
3853,
6,
364,
740,
316,
1842,
67,
2626,... |
return None argspec = inspect.getargspec(self.object) | if self.env.config.autodoc_builtin_argspec: argspec = self.env.config.autodoc_builtin_argspec(self.object) else: return None else: argspec = inspect.getargspec(self.object) | def format_args(self): if inspect.isbuiltin(self.object) or \ inspect.ismethoddescriptor(self.object): # can never get arguments of a C function or method return None argspec = inspect.getargspec(self.object) if argspec[0] and argspec[0][0] in ('cls', 'self'): del argspec[0][0] return inspect.formatargspec(*argspec) | 198a060551268ce5ddd29a64a8ad67f9bdb7ac92 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/198a060551268ce5ddd29a64a8ad67f9bdb7ac92/autodoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
1968,
12,
2890,
4672,
309,
5334,
18,
291,
24553,
12,
2890,
18,
1612,
13,
578,
521,
5334,
18,
291,
2039,
12628,
12,
2890,
18,
1612,
4672,
468,
848,
5903,
336,
1775,
434,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
1968,
12,
2890,
4672,
309,
5334,
18,
291,
24553,
12,
2890,
18,
1612,
13,
578,
521,
5334,
18,
291,
2039,
12628,
12,
2890,
18,
1612,
4672,
468,
848,
5903,
336,
1775,
434,
279,
... |
sage: R = ZZ | sage: R = ZZ[x] | def is_prime(self): r""" Returns True if the ideal is prime in the ring containing the ideal. | 43ca92fb44dc3b03619e2a94a4ce9ddd45efebc1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/43ca92fb44dc3b03619e2a94a4ce9ddd45efebc1/ideal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
16382,
12,
2890,
4672,
436,
8395,
2860,
1053,
309,
326,
23349,
353,
17014,
316,
326,
9221,
4191,
326,
23349,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
16382,
12,
2890,
4672,
436,
8395,
2860,
1053,
309,
326,
23349,
353,
17014,
316,
326,
9221,
4191,
326,
23349,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.files_to_remove.append(os.path.join(download_dir, name)) | self._files_to_remove.append(os.path.join(download_dir, name)) | def tearDown(self): # Cleanup all files we created in the download dir download_dir = self.GetDownloadDirectory().value() if os.path.isdir(download_dir): for name in os.listdir(download_dir): if name not in self._existing_downloads: self.files_to_remove.append(os.path.join(download_dir, name)) pyauto.PyUITest.tearDown(self) for item in self.files_to_remove: pyauto_utils.RemovePath(item) | b305895514a6affd4ba076d5655fe86eb71be9cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/b305895514a6affd4ba076d5655fe86eb71be9cc/downloads.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
468,
19968,
777,
1390,
732,
2522,
316,
326,
4224,
1577,
4224,
67,
1214,
273,
365,
18,
967,
7109,
2853,
7675,
1132,
1435,
309,
1140,
18,
803,
18,
291,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
468,
19968,
777,
1390,
732,
2522,
316,
326,
4224,
1577,
4224,
67,
1214,
273,
365,
18,
967,
7109,
2853,
7675,
1132,
1435,
309,
1140,
18,
803,
18,
291,
1... |
return tab.isGuide() and not tab.obj.isDefault() | return tab.isGuide() and not tab.obj.getDefault() | def validateMenuItem_(self, item): if item.action() == 'removeGuide:': tab = app.controller.currentSelectedTab return tab.isGuide() and not tab.obj.isDefault() else: return item.action() in self.itemsAlwaysAvailable | 1b9186cfd73fe55e9f0cb4b9b40c3be70a0ab3c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12354/1b9186cfd73fe55e9f0cb4b9b40c3be70a0ab3c4/Application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
12958,
67,
12,
2890,
16,
761,
4672,
309,
761,
18,
1128,
1435,
422,
296,
4479,
17424,
2497,
30,
3246,
273,
595,
18,
5723,
18,
2972,
7416,
5661,
327,
3246,
18,
291,
17424,
1435,
47... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
12958,
67,
12,
2890,
16,
761,
4672,
309,
761,
18,
1128,
1435,
422,
296,
4479,
17424,
2497,
30,
3246,
273,
595,
18,
5723,
18,
2972,
7416,
5661,
327,
3246,
18,
291,
17424,
1435,
47... |
file = open('/tmp/pippy.py', 'w', 0) | pippy_app_name = '%s/tmp/pippy_app.py' % self.get_activity_root() file = open(pippy_app_name, 'w', 0) | def gobutton_cb(self, button): self._vte.grab_focus() self._vte.feed("\x1B[H\x1B[J\x1B[0;39m") # FIXME: We're losing an odd race here # gtk.main_iteration(block=False) start, end = self.text_buffer.get_bounds() text = self.text_buffer.get_text(start, end) | 6b9a427f10ebf8b233c1640532ba7b5a9ae71315 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7610/6b9a427f10ebf8b233c1640532ba7b5a9ae71315/activity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20062,
2644,
67,
7358,
12,
2890,
16,
3568,
4672,
365,
6315,
90,
736,
18,
2752,
70,
67,
13923,
1435,
365,
6315,
90,
736,
18,
7848,
31458,
92,
21,
38,
63,
44,
64,
92,
21,
38,
63,
46,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20062,
2644,
67,
7358,
12,
2890,
16,
3568,
4672,
365,
6315,
90,
736,
18,
2752,
70,
67,
13923,
1435,
365,
6315,
90,
736,
18,
7848,
31458,
92,
21,
38,
63,
44,
64,
92,
21,
38,
63,
46,... |
if not self._is_tracking_a_remote_branch(self._get_current_branch()): | if not self.is_tracking_a_remote_branch(self.get_current_branch()): | def _pull_current_branch(self, buildscript): """Pull the current branch if it is tracking a remote branch.""" if not self._is_tracking_a_remote_branch(self._get_current_branch()): return | f3dca446ec51b04ec85ec73c7ed97895744dff87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4596/f3dca446ec51b04ec85ec73c7ed97895744dff87/git.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
13469,
67,
2972,
67,
7500,
12,
2890,
16,
1361,
4263,
4672,
3536,
9629,
326,
783,
3803,
309,
518,
353,
11093,
279,
2632,
3803,
12123,
309,
486,
365,
18,
291,
67,
6440,
67,
69,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
13469,
67,
2972,
67,
7500,
12,
2890,
16,
1361,
4263,
4672,
3536,
9629,
326,
783,
3803,
309,
518,
353,
11093,
279,
2632,
3803,
12123,
309,
486,
365,
18,
291,
67,
6440,
67,
69,
67,
... |
git.diff([], series.get_patch(series.get_current()).get_bottom(), None, f) | diff_str = git.diff(rev1 = series.get_patch(series.get_current()).get_bottom()) f.write(diff_str) | def edit_file(series, line, comment, show_patch = True): fname = '.stgitmsg.txt' tmpl = templates.get_template('patchdescr.tmpl') f = file(fname, 'w+') if line: print >> f, line elif tmpl: print >> f, tmpl, else: print >> f print >> f, __comment_prefix, comment print >> f, __comment_prefix, \ 'Lines prefixed with "%s" will be automatically removed.' \ % __comment_prefix print >> f, __comment_prefix, \ 'Trailing empty lines will be automatically removed.' if show_patch: print >> f, __patch_prefix # series.get_patch(series.get_current()).get_top() git.diff([], series.get_patch(series.get_current()).get_bottom(), None, f) #Vim modeline must be near the end. print >> f, __comment_prefix, 'vi: set textwidth=75 filetype=diff nobackup:' f.close() call_editor(fname) f = file(fname, 'r+') __clean_comments(f) f.seek(0) result = f.read() f.close() os.remove(fname) return result | f1c5519a186e6ed20a4206be093cc1b14e755984 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12366/f1c5519a186e6ed20a4206be093cc1b14e755984/stack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
67,
768,
12,
10222,
16,
980,
16,
2879,
16,
2405,
67,
2272,
273,
1053,
4672,
5299,
273,
2418,
334,
6845,
3576,
18,
5830,
11,
10720,
273,
5539,
18,
588,
67,
3202,
2668,
2272,
28313... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
67,
768,
12,
10222,
16,
980,
16,
2879,
16,
2405,
67,
2272,
273,
1053,
4672,
5299,
273,
2418,
334,
6845,
3576,
18,
5830,
11,
10720,
273,
5539,
18,
588,
67,
3202,
2668,
2272,
28313... |
filename = "0-REGTYPE-TEXT" | filename = "/0-REGTYPE-TEXT" | def test_readlines(self): """Test readlines() method of _FileObject. """ if self.sep != "|": filename = "0-REGTYPE-TEXT" self.tar.extract(filename, dirname()) lines1 = file(os.path.join(dirname(), filename), "r").readlines() lines2 = self.tar.extractfile(filename).readlines() self.assert_(lines1 == lines2, "_FileObject.readline() does not work correctly") | 6284c8dd59cadc161fe9dd2cc2eed2d6ac38a170 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/6284c8dd59cadc161fe9dd2cc2eed2d6ac38a170/test_tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
896,
3548,
12,
2890,
4672,
3536,
4709,
17546,
1435,
707,
434,
389,
21471,
18,
3536,
309,
365,
18,
10814,
480,
11747,
6877,
1544,
273,
2206,
20,
17,
5937,
2399,
17,
5151,
6,
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,
1842,
67,
896,
3548,
12,
2890,
4672,
3536,
4709,
17546,
1435,
707,
434,
389,
21471,
18,
3536,
309,
365,
18,
10814,
480,
11747,
6877,
1544,
273,
2206,
20,
17,
5937,
2399,
17,
5151,
6,
3... |
support.run_unittest(FnmatchTestCase) | support.run_unittest(FnmatchTestCase, TranslateTestCase, FilterTestCase) | def test_main(): support.run_unittest(FnmatchTestCase) | 3dbecd45042dd11aa028e6bad1d3d789b8d445fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/3dbecd45042dd11aa028e6bad1d3d789b8d445fb/test_fnmatch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
13332,
2865,
18,
2681,
67,
4873,
3813,
12,
5372,
1916,
4709,
2449,
16,
16820,
4709,
2449,
16,
4008,
4709,
2449,
13,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
13332,
2865,
18,
2681,
67,
4873,
3813,
12,
5372,
1916,
4709,
2449,
16,
16820,
4709,
2449,
16,
4008,
4709,
2449,
13,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
list_copy = [x for x in str_list] | def get_buff_size(str_list): list_copy = [x for x in str_list] total_length=0 for str in list_copy: total_length= total_length + len(str) return total_length | af7b0bcb583945cc32ce1e6ac1cd2acbd599a1e9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/af7b0bcb583945cc32ce1e6ac1cd2acbd599a1e9/forwarder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
20664,
67,
1467,
12,
701,
67,
1098,
4672,
2078,
67,
2469,
33,
20,
364,
609,
316,
666,
67,
3530,
30,
2078,
67,
2469,
33,
2078,
67,
2469,
397,
562,
12,
701,
13,
327,
2078,
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,
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,
20664,
67,
1467,
12,
701,
67,
1098,
4672,
2078,
67,
2469,
33,
20,
364,
609,
316,
666,
67,
3530,
30,
2078,
67,
2469,
33,
2078,
67,
2469,
397,
562,
12,
701,
13,
327,
2078,
6... | |
tmp.append(finalReport) self.errorDict[methodName]=tmp else: self.errorDict[methodName]=[finalReport] self.log.verbose(finalReport) return S_ERROR(finalReport) | tmp.append( finalReport ) self.errorDict[methodName] = tmp else: self.errorDict[methodName] = [finalReport] self.log.verbose( finalReport ) return S_ERROR( finalReport ) | def _reportError(self,message,name='',**kwargs): """Internal Function. Gets caller method name and arguments, formats the information and adds an error to the global error dictionary to be returned to the user. """ className = name if not name: className = __name__ methodName = sys._getframe(1).f_code.co_name arguments = [] for key in kwargs: if kwargs[key]: arguments.append('%s = %s ( %s )' %(key,kwargs[key],type(kwargs[key]))) finalReport = 'Problem with %s.%s() call:\nArguments: %s\nMessage: %s\n' %(className,methodName,string.join(arguments,', '),message) if self.errorDict.has_key(methodName): tmp = self.errorDict[methodName] tmp.append(finalReport) self.errorDict[methodName]=tmp else: self.errorDict[methodName]=[finalReport] self.log.verbose(finalReport) return S_ERROR(finalReport) | 50b3322668816ba92ea3f9b253d993dc34c53a21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/50b3322668816ba92ea3f9b253d993dc34c53a21/Job.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6006,
668,
12,
2890,
16,
2150,
16,
529,
2218,
2187,
636,
4333,
4672,
3536,
3061,
4284,
18,
11881,
4894,
707,
508,
471,
1775,
16,
6449,
326,
1779,
471,
4831,
392,
555,
358,
326,
25... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6006,
668,
12,
2890,
16,
2150,
16,
529,
2218,
2187,
636,
4333,
4672,
3536,
3061,
4284,
18,
11881,
4894,
707,
508,
471,
1775,
16,
6449,
326,
1779,
471,
4831,
392,
555,
358,
326,
25... |
See also invertible_residues() for a simpler version without the units. | See also invertible_residues() for a simpler version without the subgroup. | def invertible_residues_mod_units(self, units=[], reduce=True): """ Returns a iterator through a list of invertible residues modulo this integral ideal and modulo the group generated by the given units. | e462b4d226d7b8f741f48ed1e071494aa5463b8a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/e462b4d226d7b8f741f48ed1e071494aa5463b8a/number_field_ideal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9848,
1523,
67,
15567,
3610,
67,
1711,
67,
7705,
12,
2890,
16,
4971,
22850,
6487,
5459,
33,
5510,
4672,
3536,
2860,
279,
2775,
3059,
279,
666,
434,
9848,
1523,
25435,
26109,
333,
21423,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9848,
1523,
67,
15567,
3610,
67,
1711,
67,
7705,
12,
2890,
16,
4971,
22850,
6487,
5459,
33,
5510,
4672,
3536,
2860,
279,
2775,
3059,
279,
666,
434,
9848,
1523,
25435,
26109,
333,
21423,
... |
glLoadName(name) | if name != 0: glPushName(name) | def finish(): """\ Finish sorting - objects recorded since "start" will be sorted and invoked now. """ if TEST_PYREX_OPENGL: quux.shapeRendererInit() # print "VBO %s enabled" % (('is not', 'is')[quux.shapeRendererGetInteger(quux.IS_VBO_ENABLED)]) quux.shapeRendererSetUseDynamicLOD(0) quux.shapeRendererStartDrawing() quux.shapeRendererSetStaticLODLevels(ColorSorter.sphereLevel, 1) ColorSorter._cur_shapelist.draw() quux.shapeRendererFinishDrawing() ColorSorter.sorting = False | 7997651af53055a7ee71653f664cfd1ce78a79ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/7997651af53055a7ee71653f664cfd1ce78a79ad/drawer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
13332,
3536,
64,
18560,
9602,
300,
2184,
16421,
3241,
315,
1937,
6,
903,
506,
3115,
471,
8187,
2037,
18,
3536,
309,
22130,
67,
16235,
862,
60,
67,
11437,
11261,
30,
719,
2616,
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,
4076,
13332,
3536,
64,
18560,
9602,
300,
2184,
16421,
3241,
315,
1937,
6,
903,
506,
3115,
471,
8187,
2037,
18,
3536,
309,
22130,
67,
16235,
862,
60,
67,
11437,
11261,
30,
719,
2616,
18,
... |
self.pdbg("parse_size, expr=%s" % expr) | if Opt.ParseDBG: self.pdbg("parse_size, expr=%s" % expr) | def parse_size(self): """check the given size of the plugin.""" self.parse_dbg_indent += " " match = re_size_fun.match(self.buffer) if match: p = match.span(0)[1] self.buffer = self.buffer[p:] self.pdbg("parse_size new buffer = %s" % self.buffer) bang = match.group(1) # means "is not this size" wanted_size = int(match.group(2)) plugin_name = match.group(3) expr = "[SIZE %s%d %s]" % (bang, wanted_size, plugin_name) self.pdbg("parse_size, expr=%s" % expr) expanded = self.expand_filename(plugin_name) if len(expanded) == 1: expr = "[SIZE %s%d %s]" % (bang, wanted_size, expanded[0]) elif expanded == []: self.pdbg("parse_size [SIZE] \"%s\" not active" % match.group(3)) self.parse_dbg_indent = self.parse_dbg_indent[:-2] return(False, expr) # file does not exist if self.datadir == None: # this case is reached when doing fromfile checks, # which do not have access to the actual plugin, so we # always assume the test is merely for file existence, # to err on the side of caution self.parse_dbg_indent = self.parse_dbg_indent[:-2] return(True, expr) for xp in expanded: plugin = C.cname(xp) plugin_t = C.truename(plugin) actual_size = os.path.getsize(self.datadir.find_path(plugin)) bool = (actual_size == wanted_size) if bang == "!": bool = not bool self.pdbg("parse_size [SIZE] returning: (%s, %s)" % (bool, expr)) self.parse_dbg_indent = self.parse_dbg_indent[:-2] if bool: self.parse_dbg_indent = self.parse_dbg_indent[:-2] return(True, "[SIZE %s%d %s]" % (bang, wanted_size, plugin_t)) self.parse_dbg_indent = self.parse_dbg_indent[:-2] return(False, expr) self.parse_dbg_indent = self.parse_dbg_indent[:-2] self.parse_error(_["Invalid [SIZE] function"]) return(None, None) | 0c9007da0c07e550781c18146d5a05ade578dced /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2827/0c9007da0c07e550781c18146d5a05ade578dced/mlox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1467,
12,
2890,
4672,
3536,
1893,
326,
864,
963,
434,
326,
1909,
12123,
365,
18,
2670,
67,
1966,
75,
67,
9355,
1011,
315,
225,
315,
845,
273,
283,
67,
1467,
67,
12125,
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,
1109,
67,
1467,
12,
2890,
4672,
3536,
1893,
326,
864,
963,
434,
326,
1909,
12123,
365,
18,
2670,
67,
1966,
75,
67,
9355,
1011,
315,
225,
315,
845,
273,
283,
67,
1467,
67,
12125,
18,
... |
print rows | def _FindItemsWithValue(folder, prop_tag, prop_val): tab = folder.GetContentsTable(0) # Restriction for the table: get rows where our prop values match restriction = (mapi.RES_CONTENT, # a property restriction (mapi.FL_SUBSTRING | mapi.FL_IGNORECASE | mapi.FL_LOOSE, # fuzz level prop_tag, # of the given prop (prop_tag, prop_val))) # with given val | 651ac5d80d327ce0a7930fa57f7594888a7d4eee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/651ac5d80d327ce0a7930fa57f7594888a7d4eee/dump_props.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3125,
3126,
1190,
620,
12,
5609,
16,
2270,
67,
2692,
16,
2270,
67,
1125,
4672,
3246,
273,
3009,
18,
967,
6323,
1388,
12,
20,
13,
468,
1124,
6192,
364,
326,
1014,
30,
225,
336,
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,
389,
3125,
3126,
1190,
620,
12,
5609,
16,
2270,
67,
2692,
16,
2270,
67,
1125,
4672,
3246,
273,
3009,
18,
967,
6323,
1388,
12,
20,
13,
468,
1124,
6192,
364,
326,
1014,
30,
225,
336,
2... | |
Initializes the TCPServerSocket. The socket should already be established by listenforconnection | Initializes the UDPServerSocket. The socket should already be established by listenformessage | def __init__(self, identity): """ <Purpose> Initializes the TCPServerSocket. The socket should already be established by listenforconnection prior to calling the initializer. | cdc73d35527f2e8ba9aecc2ad1a44f2831f9c68c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7263/cdc73d35527f2e8ba9aecc2ad1a44f2831f9c68c/emulcomm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4215,
4672,
3536,
411,
10262,
4150,
34,
10188,
3128,
326,
16230,
2081,
4534,
18,
1021,
2987,
1410,
1818,
506,
19703,
635,
6514,
687,
615,
6432,
358,
4440,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2738,
972,
12,
2890,
16,
4215,
4672,
3536,
411,
10262,
4150,
34,
10188,
3128,
326,
16230,
2081,
4534,
18,
1021,
2987,
1410,
1818,
506,
19703,
635,
6514,
687,
615,
6432,
358,
4440,
... |
if repr(listValue) == value: list.remove(listValue) | if isinstance(listValue, repository.item.Item.Item): if str(listValue.itsUUID) == value: list.remove(listValue) print "Reload: item %s, unassigning %s = '%s'" % \ (self.item.itsPath, attrName, listValue.itsPath) else: if str(listValue) == value: list.remove(listValue) print "Reload: item %s, unassigning %s = '%s'" % \ (self.item.itsPath, attrName, value) else: attrValue = self.item.getAttributeValue(attrName) if isinstance(attrValue, repository.item.Item.Item): if str(attrValue.itsUUID) == value: self.item.removeAttributeValue(attrName) print "Reload: item %s, unassigning %s = '%s'" % \ (self.item.itsPath, attrName, attrValue.itsPath) else: if str(attrValue) == value: self.item.removeAttributeValue(attrName) | def unapplyAssignments(self): """ Do whatever needs to be done to the item to "remove" this assignment. """ for (attrName, value, key) in self.getAssignments(): card = self.item.getAttributeAspect(attrName, "cardinality") if card == "dict": print "Reload: item %s, unassigning %s[%s] = '%s'" % \ (self.item.itsPath, attrName, key, value) self.item.removeValue(attrName, key) elif card == "list": list = self.item.getAttributeValue(attrName) for listValue in list: if repr(listValue) == value: list.remove(listValue) print "Reload: item %s, unassigning %s = '%s'" % \ (self.item.itsPath, attrName, value) else: if repr(self.item.getAttributeValue(attrName)) == value: print "Reload: item %s, unassigning %s = '%s'" % \ (self.item.itsPath, attrName, value) self.item.removeAttributeValue(attrName) | 4dea23bc60b6ddf48185a0673c01c4e9b396c6cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/4dea23bc60b6ddf48185a0673c01c4e9b396c6cf/Parcel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
9010,
18628,
12,
2890,
4672,
3536,
2256,
15098,
4260,
358,
506,
2731,
358,
326,
761,
358,
315,
4479,
6,
333,
6661,
18,
3536,
364,
261,
1747,
461,
16,
460,
16,
498,
13,
316,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
9010,
18628,
12,
2890,
4672,
3536,
2256,
15098,
4260,
358,
506,
2731,
358,
326,
761,
358,
315,
4479,
6,
333,
6661,
18,
3536,
364,
261,
1747,
461,
16,
460,
16,
498,
13,
316,
365,
... |
thisEndFreq = thisStartFreq + freqSubBand | thisEndFreq = thisStartFreq + freqSubBand if (thisEndFreq == endFreq): thisEndFreq = thisEndFreq - 1 | def usage(): msg = """\ | 15f9fb4dbf9712572473a1d7006be249051290cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/15f9fb4dbf9712572473a1d7006be249051290cc/fscanDriver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1234,
273,
3536,
64,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1234,
273,
3536,
64,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if func.is_method(): container = func.cls() | if func.is_method(): container = func.cls() inherit = (container != cls.uid()) | def _func_details(self, functions, cls, heading='Function Details'): """ @return: The HTML code for a function details table. This is used by L{_module_to_html} to describe the functions in a module; and by L{_class_to_html} to describe member functions. @rtype: C{string} """ functions = self._sort(functions) if len(functions) == 0: return '' str = self._table_header(heading, 'details')+'</table>' | 62ff4e473663c51d0a945a451e36120f11d9450a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/62ff4e473663c51d0a945a451e36120f11d9450a/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
644,
67,
6395,
12,
2890,
16,
4186,
16,
2028,
16,
11053,
2218,
2083,
21897,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
445,
3189,
1014,
18,
225,
1220,
353,
1399,
635... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
644,
67,
6395,
12,
2890,
16,
4186,
16,
2028,
16,
11053,
2218,
2083,
21897,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
445,
3189,
1014,
18,
225,
1220,
353,
1399,
635... |
self.portal.REQUEST.set('If-Modified-Since', rfc1123_date((DateTime() - 60.0/(24.0*3600.0)).timeTime())) | request = self.portal.REQUEST request.environ['IF_MODIFIED_SINCE'] = rfc1123_date((DateTime() - 60.0/(24.0*3600.0))) print ' print 'if-modified-since: ', request.get_header('If-Modified-Since', None) assert request.get_header('If-Modified-Since') | def testIfModifiedSinceHeaders(self): # test with if-modified-since headers early and late (since client clock won't necessarily be synchronized) # Test that the main page retains its content-type self.setRoles(['Manager']) self.portal.REQUEST.set('If-Modified-Since', rfc1123_date((DateTime() - 60.0/(24.0*3600.0)).timeTime())) # if modified in the last minute self.portal.addDTMLMethod('testmethod', file="""/* YES WE ARE RENDERED */""") self.tool.registerStylesheet('testmethod') response = self.publish(self.toolpath+'/testmethod') self.assertEqual(response.getHeader('Content-Type'), 'text/css') self.assertEqual(response.getStatus(), 200) | 23564e4c1744b683ba80a4d953653cd70f6b0441 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12274/23564e4c1744b683ba80a4d953653cd70f6b0441/testHTTPHeaders.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2047,
29943,
3121,
12,
2890,
4672,
468,
1842,
598,
309,
17,
7342,
17,
9256,
1607,
11646,
471,
26374,
261,
9256,
1004,
7268,
8462,
1404,
23848,
506,
3852,
13,
225,
468,
7766,
716,
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,
1842,
2047,
29943,
3121,
12,
2890,
4672,
468,
1842,
598,
309,
17,
7342,
17,
9256,
1607,
11646,
471,
26374,
261,
9256,
1004,
7268,
8462,
1404,
23848,
506,
3852,
13,
225,
468,
7766,
716,
3... |
wordTable = WordTable(index_id, index_tags, reindex_prefix + 'idxWORD%02dF', fnc_get_words_from_phrase, {'8564_u': get_words_from_fulltext}, is_fulltext_index=is_fulltext_index) | wordTable = WordTable(index_id=index_id, fields_to_index=index_tags, table_name_pattern=reindex_prefix + 'idxWORD%02dF', default_get_words_fnc=fnc_get_words_from_phrase, tag_to_words_fnc_map={'8564_u': get_words_from_fulltext}, is_fulltext_index=is_fulltext_index, wash_index_terms=50) | def task_run_core(): """Runs the task by fetching arguments from the BibSched task queue. This is what BibSched will be invoking via daemon call. The task prints Fibonacci numbers for up to NUM on the stdout, and some messages on stderr. Return 1 in case of success and 0 in case of failure.""" global _last_word_table if task_get_option("cmd") == "check": wordTables = get_word_tables(task_get_option("windex")) for index_id, index_name, index_tags in wordTables: if index_name == 'year' and CFG_INSPIRE_SITE: fnc_get_words_from_phrase = get_words_from_date_tag else: fnc_get_words_from_phrase = get_words_from_phrase wordTable = WordTable(index_id, index_tags, 'idxWORD%02dF', fnc_get_words_from_phrase, {'8564_u': get_words_from_fulltext}) _last_word_table = wordTable wordTable.report_on_table_consistency() task_sleep_now_if_required(can_stop_too=True) wordTable = WordTable(index_id, index_tags, 'idxPAIR%02dF', get_pairs_from_phrase, {'8564_u': get_nothing_from_phrase}, False) _last_word_table = wordTable wordTable.report_on_table_consistency() task_sleep_now_if_required(can_stop_too=True) if index_name == 'author': fnc_get_phrases_from_phrase = get_fuzzy_authors_from_phrase elif index_name == 'exactauthor': fnc_get_phrases_from_phrase = get_exact_authors_from_phrase else: fnc_get_phrases_from_phrase = get_phrases_from_phrase wordTable = WordTable(index_id, index_tags, 'idxPHRASE%02dF', fnc_get_phrases_from_phrase, {'8564_u': get_nothing_from_phrase}, False) _last_word_table = wordTable wordTable.report_on_table_consistency() task_sleep_now_if_required(can_stop_too=True) _last_word_table = None return True # Let's work on single words! wordTables = get_word_tables(task_get_option("windex")) for index_id, index_name, index_tags in wordTables: is_fulltext_index = index_name == 'fulltext' reindex_prefix = "" if task_get_option("reindex"): reindex_prefix = "tmp_" init_temporary_reindex_tables(index_id, reindex_prefix) if index_name == 'year' and CFG_INSPIRE_SITE: fnc_get_words_from_phrase = get_words_from_date_tag else: fnc_get_words_from_phrase = get_words_from_phrase wordTable = WordTable(index_id, index_tags, reindex_prefix + 'idxWORD%02dF', fnc_get_words_from_phrase, {'8564_u': get_words_from_fulltext}, is_fulltext_index=is_fulltext_index) _last_word_table = wordTable wordTable.report_on_table_consistency() try: if task_get_option("cmd") == "del": if task_get_option("id"): wordTable.del_recIDs(task_get_option("id")) task_sleep_now_if_required(can_stop_too=True) elif task_get_option("collection"): l_of_colls = task_get_option("collection").split(",") recIDs = perform_request_search(c=l_of_colls) recIDs_range = [] for recID in recIDs: recIDs_range.append([recID,recID]) wordTable.del_recIDs(recIDs_range) task_sleep_now_if_required(can_stop_too=True) else: error_message = "Missing IDs of records to delete from " \ "index %s." % wordTable.tablename write_message(error_message, stream=sys.stderr) raise StandardError, error_message elif task_get_option("cmd") == "add": if task_get_option("id"): wordTable.add_recIDs(task_get_option("id"), task_get_option("flush")) task_sleep_now_if_required(can_stop_too=True) elif task_get_option("collection"): l_of_colls = task_get_option("collection").split(",") recIDs = perform_request_search(c=l_of_colls) recIDs_range = [] for recID in recIDs: recIDs_range.append([recID,recID]) wordTable.add_recIDs(recIDs_range, task_get_option("flush")) task_sleep_now_if_required(can_stop_too=True) else: wordTable.add_recIDs_by_date(task_get_option("modified"), task_get_option("flush")) ## here we used to update last_updated info, if run via automatic mode; ## but do not update here anymore, since idxPHRASE will be acted upon later task_sleep_now_if_required(can_stop_too=True) elif task_get_option("cmd") == "repair": wordTable.repair(task_get_option("flush")) task_sleep_now_if_required(can_stop_too=True) else: error_message = "Invalid command found processing %s" % \ wordTable.tablename write_message(error_message, stream=sys.stderr) raise StandardError, error_message except StandardError, e: write_message("Exception caught: %s" % e, sys.stderr) register_exception(alert_admin=True) task_update_status("ERROR") if _last_word_table: _last_word_table.put_into_db() sys.exit(1) wordTable.report_on_table_consistency() task_sleep_now_if_required(can_stop_too=True) # Let's work on pairs now wordTable = WordTable(index_id, index_tags, reindex_prefix + 'idxPAIR%02dF', get_pairs_from_phrase, {'8564_u': get_nothing_from_phrase}, False) _last_word_table = wordTable wordTable.report_on_table_consistency() try: if task_get_option("cmd") == "del": if task_get_option("id"): wordTable.del_recIDs(task_get_option("id")) task_sleep_now_if_required(can_stop_too=True) elif task_get_option("collection"): l_of_colls = task_get_option("collection").split(",") recIDs = perform_request_search(c=l_of_colls) recIDs_range = [] for recID in recIDs: recIDs_range.append([recID,recID]) wordTable.del_recIDs(recIDs_range) task_sleep_now_if_required(can_stop_too=True) else: error_message = "Missing IDs of records to delete from " \ "index %s." % wordTable.tablename write_message(error_message, stream=sys.stderr) raise StandardError, error_message elif task_get_option("cmd") == "add": if task_get_option("id"): wordTable.add_recIDs(task_get_option("id"), task_get_option("flush")) task_sleep_now_if_required(can_stop_too=True) elif task_get_option("collection"): l_of_colls = task_get_option("collection").split(",") recIDs = perform_request_search(c=l_of_colls) recIDs_range = [] for recID in recIDs: recIDs_range.append([recID,recID]) wordTable.add_recIDs(recIDs_range, task_get_option("flush")) task_sleep_now_if_required(can_stop_too=True) else: wordTable.add_recIDs_by_date(task_get_option("modified"), task_get_option("flush")) # let us update last_updated timestamp info, if run via automatic mode: task_sleep_now_if_required(can_stop_too=True) elif task_get_option("cmd") == "repair": wordTable.repair(task_get_option("flush")) task_sleep_now_if_required(can_stop_too=True) else: error_message = "Invalid command found processing %s" % \ wordTable.tablename write_message(error_message, stream=sys.stderr) raise StandardError, error_message except StandardError, e: write_message("Exception caught: %s" % e, sys.stderr) register_exception() task_update_status("ERROR") if _last_word_table: _last_word_table.put_into_db() sys.exit(1) wordTable.report_on_table_consistency() task_sleep_now_if_required(can_stop_too=True) # Let's work on phrases now if index_name == 'author': fnc_get_phrases_from_phrase = get_fuzzy_authors_from_phrase elif index_name == 'exactauthor': fnc_get_phrases_from_phrase = get_exact_authors_from_phrase else: fnc_get_phrases_from_phrase = get_phrases_from_phrase wordTable = WordTable(index_id, index_tags, reindex_prefix + 'idxPHRASE%02dF', fnc_get_phrases_from_phrase, {'8564_u': get_nothing_from_phrase}, False) _last_word_table = wordTable wordTable.report_on_table_consistency() try: if task_get_option("cmd") == "del": if task_get_option("id"): wordTable.del_recIDs(task_get_option("id")) task_sleep_now_if_required(can_stop_too=True) elif task_get_option("collection"): l_of_colls = task_get_option("collection").split(",") recIDs = perform_request_search(c=l_of_colls) recIDs_range = [] for recID in recIDs: recIDs_range.append([recID,recID]) wordTable.del_recIDs(recIDs_range) task_sleep_now_if_required(can_stop_too=True) else: error_message = "Missing IDs of records to delete from " \ "index %s." % wordTable.tablename write_message(error_message, stream=sys.stderr) raise StandardError, error_message elif task_get_option("cmd") == "add": if task_get_option("id"): wordTable.add_recIDs(task_get_option("id"), task_get_option("flush")) task_sleep_now_if_required(can_stop_too=True) elif task_get_option("collection"): l_of_colls = task_get_option("collection").split(",") recIDs = perform_request_search(c=l_of_colls) recIDs_range = [] for recID in recIDs: recIDs_range.append([recID,recID]) wordTable.add_recIDs(recIDs_range, task_get_option("flush")) task_sleep_now_if_required(can_stop_too=True) else: wordTable.add_recIDs_by_date(task_get_option("modified"), task_get_option("flush")) # let us update last_updated timestamp info, if run via automatic mode: update_index_last_updated(index_id, task_get_task_param('task_starting_time')) task_sleep_now_if_required(can_stop_too=True) elif task_get_option("cmd") == "repair": wordTable.repair(task_get_option("flush")) task_sleep_now_if_required(can_stop_too=True) else: error_message = "Invalid command found processing %s" % \ wordTable.tablename write_message(error_message, stream=sys.stderr) raise StandardError, error_message except StandardError, e: write_message("Exception caught: %s" % e, sys.stderr) register_exception() task_update_status("ERROR") if _last_word_table: _last_word_table.put_into_db() sys.exit(1) wordTable.report_on_table_consistency() task_sleep_now_if_required(can_stop_too=True) if task_get_option("reindex"): swap_temporary_reindex_tables(index_id, reindex_prefix) update_index_last_updated(index_id, task_get_task_param('task_starting_time')) task_sleep_now_if_required(can_stop_too=True) _last_word_table = None return True | 72ed665460767a1dfec90bd7e425d998bebd05ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/72ed665460767a1dfec90bd7e425d998bebd05ed/bibindex_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
67,
2681,
67,
3644,
13332,
3536,
9361,
326,
1562,
635,
16191,
1775,
628,
326,
605,
495,
55,
2049,
1562,
2389,
18,
225,
1220,
353,
4121,
605,
495,
55,
2049,
903,
506,
15387,
3970,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1562,
67,
2681,
67,
3644,
13332,
3536,
9361,
326,
1562,
635,
16191,
1775,
628,
326,
605,
495,
55,
2049,
1562,
2389,
18,
225,
1220,
353,
4121,
605,
495,
55,
2049,
903,
506,
15387,
3970,
... |
self.opts.log.info(self.updateProgressFullStep("generateHTMLByTitle()")) | self.updateProgressFullStep("Books by Title") | def generateHTMLByTitle(self): # Write books by title A-Z to HTML file | 1ce23c231468dc03709ee76c7da814fa41c6e4a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/1ce23c231468dc03709ee76c7da814fa41c6e4a7/catalog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
4870,
858,
4247,
12,
2890,
4672,
468,
2598,
6978,
87,
635,
2077,
432,
17,
62,
358,
3982,
585,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
2103,
4870,
858,
4247,
12,
2890,
4672,
468,
2598,
6978,
87,
635,
2077,
432,
17,
62,
358,
3982,
585,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
info['principals'] = self._listRolePrincipals(role_id) | info['principals'] = self._listRolePrincipals(role_id) | def _getExportInfo(self): role_info = [] | dce9fd7141ae7d9f8a9830c3a5cfc4b253fc33c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5303/dce9fd7141ae7d9f8a9830c3a5cfc4b253fc33c2/exportimport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
6144,
966,
12,
2890,
4672,
2478,
67,
1376,
273,
5378,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
6144,
966,
12,
2890,
4672,
2478,
67,
1376,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if isinstance(op.args[1], Constant) and op.args[1].value == 0: | if (isinstance(op.args[1], Constant) and type(op.args[1].value) is int and op.args[1].value == 0): | def tointtype(int0): if int0.knowntype is bool: return int return int0.knowntype | 2bb9b42dacc720af399ff942fa21354b02c83950 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/2bb9b42dacc720af399ff942fa21354b02c83950/binaryop.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
474,
723,
12,
474,
20,
4672,
309,
509,
20,
18,
79,
3338,
496,
388,
353,
1426,
30,
327,
509,
327,
509,
20,
18,
79,
3338,
496,
388,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
474,
723,
12,
474,
20,
4672,
309,
509,
20,
18,
79,
3338,
496,
388,
353,
1426,
30,
327,
509,
327,
509,
20,
18,
79,
3338,
496,
388,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
result = bridge2.close() self.assertEqual(result.status, 0) | def test_dynamic_direct_reorigin(self): session = self.session r_conn = self.connect(host=self.remote_host(), port=self.remote_port()) r_session = r_conn.session("test_dynamic_direct_reorigin") | 2072603d7a3bf49684f421ffac870ab375a9e0b9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/198/2072603d7a3bf49684f421ffac870ab375a9e0b9/federation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
14507,
67,
7205,
67,
266,
10012,
12,
2890,
4672,
1339,
273,
365,
18,
3184,
436,
67,
4646,
273,
365,
18,
3612,
12,
2564,
33,
2890,
18,
7222,
67,
2564,
9334,
1756,
33,
2890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
14507,
67,
7205,
67,
266,
10012,
12,
2890,
4672,
1339,
273,
365,
18,
3184,
436,
67,
4646,
273,
365,
18,
3612,
12,
2564,
33,
2890,
18,
7222,
67,
2564,
9334,
1756,
33,
2890,
... | |
<menu action="ToolsMenu"> <menuitem action="Options"/> | <menu action="SettingsMenu"> <menuitem action="Preferences"/> | def __init__(self): # Constants self.open_mode_smart = 0 self.open_mode_fit = 1 self.open_mode_1to1 = 2 self.open_mode_last = 3 self.max_zoomratio = 5 # 5 x self.zoomratio_for_zoom_to_fit self.min_zoomratio = 0.1 # 0.1 x self.zoomratio_for_zoom_to_fit | e8ef0dd37447e2201f950e7071f9510e00f4b2f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/e8ef0dd37447e2201f950e7071f9510e00f4b2f7/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
225,
468,
5245,
365,
18,
3190,
67,
3188,
67,
26416,
273,
374,
365,
18,
3190,
67,
3188,
67,
7216,
273,
404,
365,
18,
3190,
67,
3188,
67,
21,
869,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
225,
468,
5245,
365,
18,
3190,
67,
3188,
67,
26416,
273,
374,
365,
18,
3190,
67,
3188,
67,
7216,
273,
404,
365,
18,
3190,
67,
3188,
67,
21,
869,
21,
... |
common.message(_('Connection error !\n' \ 'Unable to connect to the server !'), self.window) | common.message(_('Connection error!\n' \ 'Unable to connect to the server!'), self.window) | def sig_login(self, widget=None, dbname=False, res=None): if not res: try: dblogin = DBLogin(self.window) res = dblogin.run(dbname, self.window) except Exception, exception: if exception.args == ('QueryCanceled',): return False raise self.window.present() self.sig_logout(widget, disconnect=False) log_response = rpc.login(*res) self.refresh_ssl() if log_response > 0: try: prefs = rpc.execute('object', 'execute', 'res.user', 'get_preferences', False, rpc.CONTEXT) except: prefs = None menu_id = self.sig_win_menu(quiet=False, prefs=prefs) if menu_id: self.sig_home_new(quiet=True, except_id=menu_id, prefs=prefs) self.request_set() if prefs and 'language' in prefs: translate.setlang(prefs['language']) CONFIG['client.lang'] = prefs['language'] CONFIG.save() elif log_response == -1: common.message(_('Connection error !\n' \ 'Unable to connect to the server !'), self.window) elif log_response == -2: common.message(_('Connection error !\n' \ 'Bad username or password !'), self.window) return self.sig_login() if not self.shortcut_menu.get_property('sensitive'): self.shortcut_set() self.glade.get_widget('but_menu').set_sensitive(True) self.glade.get_widget('user').set_sensitive(True) self.glade.get_widget('form').set_sensitive(True) self.glade.get_widget('plugins').set_sensitive(True) self.glade.get_widget('request_new_but').set_sensitive(True) self.glade.get_widget('req_search_but').set_sensitive(True) self.notebook.grab_focus() return True | bb9050c5d847f9b9616dfd128a3b11b6307b5109 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9151/bb9050c5d847f9b9616dfd128a3b11b6307b5109/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3553,
67,
5819,
12,
2890,
16,
3604,
33,
7036,
16,
18448,
33,
8381,
16,
400,
33,
7036,
4672,
309,
486,
400,
30,
775,
30,
1319,
5819,
273,
2383,
5358,
12,
2890,
18,
5668,
13,
400,
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,
3553,
67,
5819,
12,
2890,
16,
3604,
33,
7036,
16,
18448,
33,
8381,
16,
400,
33,
7036,
4672,
309,
486,
400,
30,
775,
30,
1319,
5819,
273,
2383,
5358,
12,
2890,
18,
5668,
13,
400,
273,... |
if charStack[0] in spaceCharacters or charStack[0] in (EOF, u"<", u"&") \ or (allowedChar is not None and allowedChar == charStack[0]): | if (charStack[0] in spaceCharacters or charStack[0] in (EOF, u"<", u"&") or (allowedChar is not None and allowedChar == charStack[0])): | def consumeEntity(self, allowedChar=None, fromAttribute=False): # Initialise to the default output for when no entity is matched output = u"&" | 3e7509c77eee033a7220e6befa14b415d8ee5ef4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10463/3e7509c77eee033a7220e6befa14b415d8ee5ef4/tokenizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7865,
1943,
12,
2890,
16,
2935,
2156,
33,
7036,
16,
628,
1499,
33,
8381,
4672,
468,
31739,
358,
326,
805,
876,
364,
1347,
1158,
1522,
353,
4847,
876,
273,
582,
6,
10,
6,
2,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7865,
1943,
12,
2890,
16,
2935,
2156,
33,
7036,
16,
628,
1499,
33,
8381,
4672,
468,
31739,
358,
326,
805,
876,
364,
1347,
1158,
1522,
353,
4847,
876,
273,
582,
6,
10,
6,
2,
-100,
-10... |
print "dragToItem=%s" %repr(dragToItem) | def changeHierarchy(self, data, x, y): print "Changing hierarchy for %s..." % repr(data) | 018dc2f3a19f43f863b8a1cd816cbdb4591b1bce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7242/018dc2f3a19f43f863b8a1cd816cbdb4591b1bce/SceneGraphUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
12074,
12,
2890,
16,
501,
16,
619,
16,
677,
4672,
1172,
315,
782,
18183,
9360,
364,
738,
87,
7070,
738,
8480,
12,
892,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
12074,
12,
2890,
16,
501,
16,
619,
16,
677,
4672,
1172,
315,
782,
18183,
9360,
364,
738,
87,
7070,
738,
8480,
12,
892,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
active= fields.Boolean('Active') sequence= fields.Integer('Sequence', required=True,) | active = fields.Boolean('Active') sequence = fields.Integer('Sequence', required=True,) | def on_change_with_unique_identifier(self, cursor, user, vals, context=None): if vals.get('name'): if not vals.get('unique_identifier'): vals['unique_identifier'] = slugify(vals['name']) return vals['unique_identifier'] | cf86e7bebe414008530c7f832e51325ec2785dc7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2593/cf86e7bebe414008530c7f832e51325ec2785dc7/cms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
3427,
67,
1918,
67,
6270,
67,
5644,
12,
2890,
16,
3347,
16,
729,
16,
5773,
16,
819,
33,
7036,
4672,
309,
5773,
18,
588,
2668,
529,
11,
4672,
309,
486,
5773,
18,
588,
2668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
3427,
67,
1918,
67,
6270,
67,
5644,
12,
2890,
16,
3347,
16,
729,
16,
5773,
16,
819,
33,
7036,
4672,
309,
5773,
18,
588,
2668,
529,
11,
4672,
309,
486,
5773,
18,
588,
2668,
... |
def kirchhoff_matrix(self): | def weighted_adjacency_matrix(self, sparse=True): """ Returns the weighted adjacency matrix of the graph. Each vertex is represented by its position in the list returned by the vertices() function. EXAMPLES: sage: G = Graph() sage: G.add_edges([(0,1,1),(1,2,2),(0,2,3),(0,3,4)]) sage: M = G.weighted_adjacency_matrix(); M [0 1 3 4] [1 0 2 0] [3 2 0 0] [4 0 0 0] sage: H = Graph(data=M, format='weighted_adjacency_matrix') sage: H == G True """ if self.multiple_edges(): raise NotImplementedError, "Don't know how to represent weights for a multigraph." n = len(self._nxg.adj) verts = self.vertices() D = {} for e in self.edge_iterator(): i,j,l = e i = verts.index(i) j = verts.index(j) D[(i,j)] = l D[(j,i)] = l from sage.matrix.constructor import matrix M = matrix(D, sparse=sparse) return M def kirchhoff_matrix(self, weighted=False): | def kirchhoff_matrix(self): """ Returns the Kirchhoff matrix (a.k.a. the Laplacian) of the graph. The Kirchhoff matrix is defined to be D - M, where D is the diagonal degree matrix (each diagonal entry is the degree of the corresponding vertex), and M is the adjacency matrix. AUTHOR: Tom Boothby EXAMPLES: sage: G = graphs.PetersenGraph() sage: G.kirchhoff_matrix() [ 3 -1 0 0 -1 -1 0 0 0 0] [-1 3 -1 0 0 0 -1 0 0 0] [ 0 -1 3 -1 0 0 0 -1 0 0] [ 0 0 -1 3 -1 0 0 0 -1 0] [-1 0 0 -1 3 0 0 0 0 -1] [-1 0 0 0 0 3 0 -1 -1 0] [ 0 -1 0 0 0 0 3 0 -1 -1] [ 0 0 -1 0 0 -1 0 3 0 -1] [ 0 0 0 -1 0 -1 -1 0 3 0] [ 0 0 0 0 -1 0 -1 -1 0 3] | ec09881a92ec8dd2b80398dcd1c90d9d7fbb1acd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/ec09881a92ec8dd2b80398dcd1c90d9d7fbb1acd/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13747,
67,
13829,
1077,
2075,
67,
5667,
12,
2890,
16,
9387,
33,
5510,
4672,
3536,
2860,
326,
13747,
25220,
3148,
434,
326,
2667,
18,
8315,
5253,
353,
10584,
635,
2097,
1754,
316,
326,
66... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13747,
67,
13829,
1077,
2075,
67,
5667,
12,
2890,
16,
9387,
33,
5510,
4672,
3536,
2860,
326,
13747,
25220,
3148,
434,
326,
2667,
18,
8315,
5253,
353,
10584,
635,
2097,
1754,
316,
326,
66... |
'libbonobomm']) | 'gnomemm/libbonobomm']) | def sfcvsroot(project): return ':pserver:anonymous@cvs.%s.sourceforge.net:/cvsroot/%s' % \ (project, project) | 73260a74e74ca35da24e6932ad9fb874a86e6c37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4596/73260a74e74ca35da24e6932ad9fb874a86e6c37/moduleinfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
7142,
6904,
3085,
12,
4406,
4672,
327,
4290,
84,
3567,
30,
19070,
36,
71,
6904,
7866,
87,
18,
3168,
1884,
908,
18,
2758,
27824,
71,
6904,
3085,
5258,
87,
11,
738,
521,
261,
4406,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
272,
7142,
6904,
3085,
12,
4406,
4672,
327,
4290,
84,
3567,
30,
19070,
36,
71,
6904,
7866,
87,
18,
3168,
1884,
908,
18,
2758,
27824,
71,
6904,
3085,
5258,
87,
11,
738,
521,
261,
4406,
... |
shutil.copy(image_file, os.path.join(config['exported_dir'],'posters')) | try: shutil.copy(image_file, os.path.join(config['exported_dir'],'posters')) except: gdebug.debug("Can't copy %s" % image_file) | def export_data(self, widget): '''Main exporting function''' | 114272bff5b189e5cfac10a2378458bd61fd4eb8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2687/114272bff5b189e5cfac10a2378458bd61fd4eb8/PluginExportHTML.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
892,
12,
2890,
16,
3604,
4672,
9163,
6376,
3359,
310,
445,
26418,
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,
... | [
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,
3359,
67,
892,
12,
2890,
16,
3604,
4672,
9163,
6376,
3359,
310,
445,
26418,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'setter': ak[2].split(' ')[1], 'expiry': ak[3], 'reason': ak[4]} | 'setter': ak[1].split(' ')[1], 'expiry': ak[2], 'reason': ak[3][1:-1]} | def akill_list(self): akills = self.parent.atheme.command(self.parent.authcookie, self.parent.username, self.parent.ipaddr, 'OperServ', 'AKILL', 'LIST', 'FULL').split('\n')[1:-1] akillset = {} | b1da0a8c7d3be71ac737a3e5145aea0c4f86fcb3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11146/b1da0a8c7d3be71ac737a3e5145aea0c4f86fcb3/athemeconnection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
279,
16418,
67,
1098,
12,
2890,
4672,
279,
16418,
87,
273,
365,
18,
2938,
18,
421,
4698,
18,
3076,
12,
2890,
18,
2938,
18,
1944,
8417,
16,
365,
18,
2938,
18,
5053,
16,
365,
18,
2938,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
279,
16418,
67,
1098,
12,
2890,
4672,
279,
16418,
87,
273,
365,
18,
2938,
18,
421,
4698,
18,
3076,
12,
2890,
18,
2938,
18,
1944,
8417,
16,
365,
18,
2938,
18,
5053,
16,
365,
18,
2938,... |
'sk': u'Bot: [[%s:%s]] je najlep lnok', | 'sk': u'Bot: [[%s:%s]] je najlepší článok', | def LINKS(site,name, ignore=[]): p=wikipedia.Page(site, name) links=p.linkedPages() for n in links[:]: t=n.titleWithoutNamespace() if t[0] in u"/#" or t in ignore: links.remove(n) links.sort() return links | fde4f73f7cf66d70c5ebc526c0042321b7ac3043 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/fde4f73f7cf66d70c5ebc526c0042321b7ac3043/featured.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22926,
55,
12,
4256,
16,
529,
16,
2305,
33,
8526,
4672,
293,
33,
11999,
13744,
18,
1964,
12,
4256,
16,
508,
13,
4716,
33,
84,
18,
17738,
5716,
1435,
364,
290,
316,
4716,
10531,
14542,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22926,
55,
12,
4256,
16,
529,
16,
2305,
33,
8526,
4672,
293,
33,
11999,
13744,
18,
1964,
12,
4256,
16,
508,
13,
4716,
33,
84,
18,
17738,
5716,
1435,
364,
290,
316,
4716,
10531,
14542,
... |
>>> np.allclose(a, np.dot(U, np.dot(S, Vh.T))) | >>> np.allclose(a, np.dot(U.T, np.dot(S, Vh.T))) | def svd_device(a, a_dtype, a_shape, full_matrices=1, compute_uv=1): """ Singular Value Decomposition. Factorizes the matrix `a` into two unitary matrices, ``U`` and ``Vh``, and a 1-dimensional array of singular values, ``s`` (real, non-negative), such that ``a == U S Vh``, where ``S`` is the diagonal matrix ``np.diag(s)``. Parameters ---------- a : c_void_p Pointer to device memory containing matrix of shape ``(M, N)`` to decompose. a_dtype : type Type of matrix data. a_shape : tuple Shape of matrix data ``(M, N)``. full_matrices : bool, optional If True (default), ``u`` and ``v.H`` have the shapes ``(M, M)`` and ``(N, N)``, respectively. Otherwise, the shapes are ``(M, K)`` and ``(K, N)``, resp., where ``K = min(M, N)``. compute_uv : bool, optional Whether or not to compute ``u`` and ``v.H`` in addition to ``s``. True by default. Returns ------- u : c_void_p Pointer to device memory containing unitary matrix. The shape of `U` is ``(M, M)`` or ``(M, K)`` depending on value of `full_matrices`. s : c_void_p Pointer to device memory containing the singular values, sorted so that ``s[i] >= s[i+1]``. `S` is a 1-D array of length ``min(M, N)`` v.H : c_void_p Pointer to device memory containing unitary matrix of shape ``(N, N)`` or ``(K, N)``, depending on `full_matrices`. Raises ------ LinAlgError If SVD computation does not converge. Notes ----- Because of the limitations of the free version of CULA, the argument is cast to single precision. If `a` is a matrix object (as opposed to an `ndarray`), then so are all the return values. Examples -------- >>> import cula >>> cula.culaInitialize() 0 >>> a = np.random.randn(9, 6) + 1j*np.random.randn(9, 6) >>> a = np.asarray(a, np.complex64) >>> m, n = a.shape >>> at = a.T.copy() >>> a_ptr = cula.cuda_malloc(a.nbytes) >>> cula.cuda_memcpy_htod(a_ptr, at.ctypes.data, a.nbytes) >>> U_ptr, s_ptr, Vh_ptr = cula.svd_device(a_ptr, a.dtype, a.shape, full_matrices=False) >>> U = np.empty((m, min(m, n)), a.dtype) >>> s = np.empty(min(m, n), np.float32) >>> Vh = np.empty((n, min(m, n)), a.dtype) >>> cula.cuda_memcpy_dtoh(U.ctypes.data, U_ptr, U.nbytes) >>> cula.cuda_memcpy_dtoh(s.ctypes.data, s_ptr, s.nbytes) >>> cula.cuda_memcpy_dtoh(Vh.ctypes.data, Vh_ptr, Vh.nbytes) >>> S = np.diag(s) >>> np.allclose(a, np.dot(U, np.dot(S, Vh.T))) True """ # The free version of CULA only supports single precision floating # point numbers: real_dtype = np.float32 real_dtype_nbytes = np.nbytes[real_dtype] if a_dtype == np.complex64: cula_func = _libcula.culaDeviceCgesvd a_dtype_nbytes = np.nbytes[a_dtype] elif a_dtype == np.float32: cula_func = _libcula.culaDeviceSgesvd a_dtype_nbytes = np.nbytes[a_dtype] else: raise ValueError('unsupported type') cula_func.restype = int cula_func.argtypes = [ctypes.c_char, ctypes.c_char, ctypes.c_int, ctypes.c_int, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_int] (m, n) = a_shape # Set LDA: lda = max(1, m) # Set S: s = cuda_malloc(min(m, n)*real_dtype_nbytes) # Set JOBU and JOBVT: if compute_uv: if full_matrices: jobu = 'A' jobvt = 'A' else: jobu = 'S' jobvt = 'S' else: jobu = 'N' jobvt = 'N' # Set LDU and transpose of U: ldu = m if jobu == 'A': u = cuda_malloc(ldu*m*a_dtype_nbytes) elif jobu == 'S': u = cuda_malloc(min(m, n)*ldu*a_dtype_nbytes) else: ldu = 1 u = cuda_malloc(a_dtype_nbytes) # Set LDVT and transpose of VT: if jobvt == 'A': ldvt = n vt = cuda_malloc(n*n*a_dtype_nbytes) elif jobvt == 'S': ldvt = min(m, n) vt = cuda_malloc(n*ldvt*a_dtype_nbytes) else: ldvt = 1 vt = cuda_malloc(a_dtype_nbytes) status = cula_func(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt) if status != 0: status = culaInitialize() culaCheckStatus(status) status = cula_func(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt) if status > 0: raise LinAlgError, 'SVD did not converge' if compute_uv: return u, s, vt else: cuda_free(u) cuda_free(vt) return s | 7fc4e451024ef5d36885b07be6a15417c4ae54c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14753/7fc4e451024ef5d36885b07be6a15417c4ae54c3/cula.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25656,
67,
5964,
12,
69,
16,
279,
67,
8972,
16,
279,
67,
4867,
16,
1983,
67,
7373,
12660,
33,
21,
16,
3671,
67,
16303,
33,
21,
4672,
3536,
348,
17830,
1445,
26824,
3276,
18,
225,
264... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25656,
67,
5964,
12,
69,
16,
279,
67,
8972,
16,
279,
67,
4867,
16,
1983,
67,
7373,
12660,
33,
21,
16,
3671,
67,
16303,
33,
21,
4672,
3536,
348,
17830,
1445,
26824,
3276,
18,
225,
264... |
mode=JPanel(layout=BorderLayout(),opaque=False) cb=JComboBox(['default','rate','direct']) if self.view.network.mode in [SimulationMode.DEFAULT,SimulationMode.PRECISE]: cb.setSelectedIndex(0) elif self.view.network.mode in [SimulationMode.RATE]: cb.setSelectedIndex(1) elif self.view.network.mode in [SimulationMode.DIRECT,SimulationMode.APPROXIMATE]: cb.setSelectedIndex(2) cb.addActionListener(self) self.mode_combobox=cb mode.add(cb) mode.add(JLabel('mode'),BorderLayout.NORTH) mode.maximumSize=mode.preferredSize configPanel.add(mode) | if self.view.network.mode!=SimulationMode.DIRECT: mode=JPanel(layout=BorderLayout(),opaque=False) cb=JComboBox(['default','rate','direct']) if self.view.network.mode in [SimulationMode.DEFAULT,SimulationMode.PRECISE]: cb.setSelectedIndex(0) elif self.view.network.mode in [SimulationMode.RATE]: cb.setSelectedIndex(1) elif self.view.network.mode in [SimulationMode.DIRECT,SimulationMode.APPROXIMATE]: cb.setSelectedIndex(2) cb.addActionListener(self) self.mode_combobox=cb mode.add(cb) mode.add(JLabel('mode'),BorderLayout.NORTH) mode.maximumSize=mode.preferredSize configPanel.add(mode) else: self.mode_combobox=None | def __init__(self,view): JPanel.__init__(self) self.view=view self.background=Color.white self.config_panel_height=60 #self.config_panel_width = 675 mainPanel=JPanel(background=self.background,layout=BorderLayout()) mainPanel.border=RoundedBorder() configPanel=JPanel(background=self.background,visible=False) | c84f5121abb9d03cdbbc5ed01466046d771afed3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9336/c84f5121abb9d03cdbbc5ed01466046d771afed3/view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1945,
4672,
24048,
16186,
2738,
972,
12,
2890,
13,
365,
18,
1945,
33,
1945,
365,
18,
9342,
33,
2957,
18,
14739,
365,
18,
1425,
67,
13916,
67,
4210,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1945,
4672,
24048,
16186,
2738,
972,
12,
2890,
13,
365,
18,
1945,
33,
1945,
365,
18,
9342,
33,
2957,
18,
14739,
365,
18,
1425,
67,
13916,
67,
4210,
33,
... |
fn = str(abs(hash(eq))) | if wl: fn = str(abs(hash(eq + 'wl120930alsdk'))) else: fn = str(abs(hash(eq))) | def replaceequations(b, f): # replace $sections$ and \[sections\] as equations. rs = ((re.compile(r'(?<!\\)\$(.*?)(?<!\\)\$', re.M + re.S), False), (re.compile(r'(?<!\\)\\\((.*?)(?<!\\)\\\)', re.M + re.S), True)) for (r, wl) in rs: m = r.search(b) while m: eq = m.group(1) fn = str(abs(hash(eq))) # Find out the baseline when we first encounter an equation (don't # bother, otherwise). # Other initialization stuff which we do only once we know we have # equations. if f.baseline is None: # See if the eqdir exists, and if not, create it. if not os.path.isdir(f.eqdir): os.mkdir(f.eqdir) # Check that the tools we need exist. (supported, message) = testeqsupport() if not supported: print 'WARNING: equation support disabled.' print message f.eqsupport = False return b # Calculate the baseline. eqt = "0123456789xxxXXxX" (f.baseline, blfn) = geneq(f, eqt, dpi=f.eqdpi, wl=False, outname='baseline-' + str(f.eqdpi)) if os.path.exists(blfn): os.remove(blfn) fn = fn + '-' + str(f.eqdpi) (depth, fullfn) = geneq(f, eq, dpi=f.eqdpi, wl=wl, outname=fn) offset = depth - f.baseline + 1 eqtext = allreplace(eq) eqtext = eqtext.replace('\\', '') eqtext = eqtext.replace('\n', ' ') if wl: b = b[:m.start()] + \ '{{<br />\n<img class="eqwl" src="%s" alt="%s" />\n<br />}}' % (fullfn, eqtext) + b[m.end():] else: b = b[:m.start()] + \ '{{<img class="eq" src="%s" alt="%s" style="vertical-align: -%dpx" />}}' % (fullfn, eqtext, offset) + b[m.end():] # jem: also clean out line breaks in the alttext? m = r.search(b, m.start()) return replacequoted(b) | 5f78e080a64db081121ccf39581539574854cf5b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12594/5f78e080a64db081121ccf39581539574854cf5b/jemdoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
14298,
1012,
12,
70,
16,
284,
4672,
468,
1453,
271,
11657,
8,
471,
521,
63,
11657,
64,
65,
487,
30369,
18,
225,
3597,
273,
14015,
266,
18,
11100,
12,
86,
11,
24261,
1695,
5153,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
14298,
1012,
12,
70,
16,
284,
4672,
468,
1453,
271,
11657,
8,
471,
521,
63,
11657,
64,
65,
487,
30369,
18,
225,
3597,
273,
14015,
266,
18,
11100,
12,
86,
11,
24261,
1695,
5153,
... |
return self.open(shouldLock=False) | return self.open() | def open(self, shouldLock = True): """ Attempt to open the file. Returns a file object if the file exists. Returns None if the file does not exist, and needs to be created. At this point the lock is acquired. Use write() and commit() to have the file created and the lock released. """ | 8e6da5492afee0caefcfa80fa3be04c9e5d59b41 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8747/8e6da5492afee0caefcfa80fa3be04c9e5d59b41/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
1410,
2531,
273,
1053,
4672,
3536,
12864,
358,
1696,
326,
585,
18,
2860,
279,
585,
733,
309,
326,
585,
1704,
18,
2860,
599,
309,
326,
585,
1552,
486,
1005,
16,
471,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
1410,
2531,
273,
1053,
4672,
3536,
12864,
358,
1696,
326,
585,
18,
2860,
279,
585,
733,
309,
326,
585,
1704,
18,
2860,
599,
309,
326,
585,
1552,
486,
1005,
16,
471,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.