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 |
|---|---|---|---|---|---|---|
def __getDn(self, username): """Private method to find the distinguished name for a given username""" sres = self.__usernamesearch(username) if len(sres) > 1: raise AmbiguousAccount(email, len(sres)) if len(sres) == 0: raise NoSuchAccount(username) return sres[0][0] def connect(self, username, password): """ Retrieves the distinguished name associated with the given username, then binds to the server using that distinguished name and the given password. If the bind fails, the appropriate exception will be raised after the connection is rebound using the anonymous credentials, as per the invariant described in the class docstring that this object must be bound to the server after any public method exits. """ dn = self.__getDn(username) try: self.ldo.simple_bind_s(dn, password) except: self.__bindAnon() raise def isCorrectCredentials(self, username, password): """Tries to connect to the server using the given username and password, and returns whether the connection was successful, which also indicates whether the given username and password were valid credentials. """ try: self.connect(username, password) except NoSuchAccount: return False except ldap.INVALID_CREDENTIALS: return False except ldap.UNWILLING_TO_PERFORM: return False except: raise else: return True def hasAccountType(self, email, acctType): """Finds the entry in the LDAP with the desired e-mail address, then determines (using __hasRights) whether that entry is of type acctType. """ sres = self.__mailsearch(email) if len(sres) > 1: raise AmbiguousAccount(email, len(sres)) if len(sres) == 0: raise NoSuchAccount(email) acctDict = sres[0][1] return self.__hasRights(acctDict, acctType) def getFullName(self, email): """Returns the full name of the perswon with the given e-mail, or throws an appropriate exception (NoSuchAccount or AmbiguousAccount) """ sres = self.__mailsearch(email) if len(sres) > 1: raise AmbiguousAccount(email, len(sres)) if len(sres) == 0: raise NoSuchAccount(email) acctDict = sres[0][1] return self.__findFullName(acctDict) def hasAccount(self, email): """Given an e-mail, returns a boolean indicating if there is a valid LDAP entry with that e-mail. """ sres = self.__mailsearch(email) if len(sres) > 1: raise AmbiguousAccount(email, len(sres)) if len(sres) == 1: return True return False class AmbiguousAccount(Exception): """Exception thrown when an LDAP operation returned too many users.""" def __init__(self, username, numusers): self.username = username self.numusers = numusers def __str__(self): return "Ambiguous Account: %d users found for username %s." \ % (self.numusers, self.username) class NoSuchAccount(Exception): """Exception thrown when an operation returned no users, and users were expected. | class HashLoginChecker(AlchemyLoginChecker): """A login checker duplicating the capabilities of the default LoginChecker, but supporting the iscorrectpass method. | def __getDn(self, username): """Private method to find the distinguished name for a given username""" | 4d2d0fe5a513038fd2443c1ce683be382bfedece /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11388/4d2d0fe5a513038fd2443c1ce683be382bfedece/mozldap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
19053,
12,
2890,
16,
2718,
4672,
3536,
6014,
707,
358,
1104,
326,
19559,
5992,
508,
364,
279,
864,
2718,
8395,
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,
1001,
588,
19053,
12,
2890,
16,
2718,
4672,
3536,
6014,
707,
358,
1104,
326,
19559,
5992,
508,
364,
279,
864,
2718,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
sys.stdout.write(' | line = pyop.get_truncated_repr(MAX_OUTPUT_LEN) write_unicode(sys.stdout, ' | def print_summary(self): if self.is_evalframeex(): pyop = self.get_pyop() if pyop: sys.stdout.write('#%i %s\n' % (self.get_index(), pyop.get_truncated_repr(MAX_OUTPUT_LEN))) sys.stdout.write(pyop.current_line()) else: sys.stdout.write('#%i (unable to read python frame information)\n' % self.get_index()) else: sys.stdout.write('#%i\n' % self.get_index()) | 0e5a41b8f5b87bf07ed6368df5a84137d3e4e4da /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/0e5a41b8f5b87bf07ed6368df5a84137d3e4e4da/libpython.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
7687,
12,
2890,
4672,
309,
365,
18,
291,
67,
8622,
3789,
338,
13332,
2395,
556,
273,
365,
18,
588,
67,
2074,
556,
1435,
309,
2395,
556,
30,
2589,
18,
10283,
18,
2626,
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,
1172,
67,
7687,
12,
2890,
4672,
309,
365,
18,
291,
67,
8622,
3789,
338,
13332,
2395,
556,
273,
365,
18,
588,
67,
2074,
556,
1435,
309,
2395,
556,
30,
2589,
18,
10283,
18,
2626,
2668,
... |
if 'id' in attributes: id = attributes['id'] elem.uri = self.namespace['id' + id] elif name in self.nameIdElems: elem.uri = self.NAME_ID_URI elif len(self.elems) == 1: | if len(self.elems) == 1: | def _pushElem(self, name, attributes): elem = VModellElem() elem.name = name self.elems.append(elem) | 9def0e48cb10709a6ad3225d36acc7c8453d296f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5223/9def0e48cb10709a6ad3225d36acc7c8453d296f/vmodellparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6206,
7498,
12,
2890,
16,
508,
16,
1677,
4672,
3659,
273,
776,
1488,
80,
7498,
1435,
3659,
18,
529,
273,
508,
365,
18,
292,
7424,
18,
6923,
12,
10037,
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,
389,
6206,
7498,
12,
2890,
16,
508,
16,
1677,
4672,
3659,
273,
776,
1488,
80,
7498,
1435,
3659,
18,
529,
273,
508,
365,
18,
292,
7424,
18,
6923,
12,
10037,
13,
2,
-100,
-100,
-100,
-... |
if isinstance(value, table): value = 'Table:' + value.name; | val = value; if isinstance(val, table): val = _add_prefix (val.name()); | def putcolkeyword (self, columnname, keyword, value, makesubrecord=False): if isinstance(value, table): value = 'Table:' + value.name; if isinstance(keyword, str): return self._putkeyword (columnname, keyword, -1, value, makesubrecord); else: return self._putkeyword (columnname, '', keyword, value, makesubrecord); | b13db46f8db806e414f7bc202101951114c714ea /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7472/b13db46f8db806e414f7bc202101951114c714ea/table.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
1293,
11041,
261,
2890,
16,
1057,
529,
16,
4932,
16,
460,
16,
7297,
373,
3366,
33,
8381,
4672,
1244,
273,
460,
31,
309,
1549,
12,
1125,
16,
1014,
4672,
1244,
273,
389,
1289,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
1293,
11041,
261,
2890,
16,
1057,
529,
16,
4932,
16,
460,
16,
7297,
373,
3366,
33,
8381,
4672,
1244,
273,
460,
31,
309,
1549,
12,
1125,
16,
1014,
4672,
1244,
273,
389,
1289,
67,
... |
def generate_dot(self, name, parts=0, urls={}, env=None, | def generate_dot(self, name, urls={}, env=None, | def generate_dot(self, name, parts=0, urls={}, env=None, graph_attrs={}, node_attrs={}, edge_attrs={}): """ Generate a graphviz dot graph from the classes that were passed in to __init__. | c27cf37aa3413c1706ea1f344972d60ea1f8fe98 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/c27cf37aa3413c1706ea1f344972d60ea1f8fe98/inheritance_diagram.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
9811,
12,
2890,
16,
508,
16,
6903,
28793,
1550,
33,
7036,
16,
2667,
67,
7039,
28793,
756,
67,
7039,
28793,
3591,
67,
7039,
12938,
4672,
3536,
6654,
279,
2667,
23167,
3928,
2667... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
9811,
12,
2890,
16,
508,
16,
6903,
28793,
1550,
33,
7036,
16,
2667,
67,
7039,
28793,
756,
67,
7039,
28793,
3591,
67,
7039,
12938,
4672,
3536,
6654,
279,
2667,
23167,
3928,
2667... |
_notfound = None | def execvpe(file, args, env): """execv(file, args, env) Execute the executable file (which is searched for along $PATH) with argument list args and environment env , replacing the current process. args may be a list or tuple of strings. """ _execvpe(file, args, env) | 899022e9441b26d70ad8fdc1c95c8ea45b8bdd88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/899022e9441b26d70ad8fdc1c95c8ea45b8bdd88/os.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1196,
90,
347,
12,
768,
16,
833,
16,
1550,
4672,
3536,
4177,
90,
12,
768,
16,
833,
16,
1550,
13,
225,
7903,
326,
9070,
585,
261,
12784,
353,
19242,
364,
7563,
271,
4211,
13,
598,
123... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1196,
90,
347,
12,
768,
16,
833,
16,
1550,
4672,
3536,
4177,
90,
12,
768,
16,
833,
16,
1550,
13,
225,
7903,
326,
9070,
585,
261,
12784,
353,
19242,
364,
7563,
271,
4211,
13,
598,
123... | |
desc = split(freshimport(modname).__doc__ or '', '\n')[0] if find(lower(modname + ' - ' + desc), key) >= 0: callback(None, modname, desc) | if key is None: callback(None, modname, '') else: desc = split(freshimport(modname).__doc__ or '', '\n')[0] if find(lower(modname + ' - ' + desc), key) >= 0: callback(None, modname, desc) | def run(self, key, callback, completer=None): key = lower(key) self.quit = 0 seen = {} | cdd3c5fa22c1696864e701e1c4335969c936cd77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/cdd3c5fa22c1696864e701e1c4335969c936cd77/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
498,
16,
1348,
16,
31848,
33,
7036,
4672,
498,
273,
2612,
12,
856,
13,
365,
18,
27176,
273,
374,
5881,
273,
2618,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
498,
16,
1348,
16,
31848,
33,
7036,
4672,
498,
273,
2612,
12,
856,
13,
365,
18,
27176,
273,
374,
5881,
273,
2618,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
break | return | def _flush(): '''Wait for the page-putter to flush its queue; called automatically upon exiting from Python. ''' if page_put_queue.qsize() > 0: import datetime remaining = datetime.timedelta(seconds=(page_put_queue.qsize()+1) * config.put_throttle) output('Waiting for %i pages to be put. Estimated time remaining: %s' % (page_put_queue.qsize()+1, remaining)) page_put_queue.put((None, None, None, None, None)) while(_putthread.isAlive()): try: _putthread.join(1) except KeyboardInterrupt: answer = inputChoice(u'There are %i pages remaining in the queue. Estimated time remaining: %s\nReally exit?' % (page_put_queue.qsize(), datetime.timedelta(seconds=(page_put_queue.qsize()) * config.put_throttle)), ['yes', 'no'], ['y', 'N'], 'N') if answer in ['y', 'Y']: break | e730524cd5be39ec1fd511a2e2746b78a799de65 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/e730524cd5be39ec1fd511a2e2746b78a799de65/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11330,
13332,
9163,
5480,
364,
326,
1363,
17,
458,
387,
358,
3663,
2097,
2389,
31,
2566,
6635,
12318,
15702,
628,
6600,
18,
9163,
309,
1363,
67,
458,
67,
4000,
18,
85,
1467,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11330,
13332,
9163,
5480,
364,
326,
1363,
17,
458,
387,
358,
3663,
2097,
2389,
31,
2566,
6635,
12318,
15702,
628,
6600,
18,
9163,
309,
1363,
67,
458,
67,
4000,
18,
85,
1467,
1435,
... |
self.assertEqual(slice(TrapLong(0)).indices(0), (0,0,1)) | def test_subclasses(self): r = list(range(10)) self.assertEqual(r[TrapInt(5):TrapInt(10)], r[5:10]) self.assertEqual(r[TrapLong(5):TrapLong(10)], r[5:10]) self.assertEqual(slice(TrapInt()).indices(0), (0,0,1)) self.assertEqual(slice(TrapLong(0)).indices(0), (0,0,1)) | 0d4cbc19eb2c7ce9725c851f862b87c26a75c899 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/0d4cbc19eb2c7ce9725c851f862b87c26a75c899/test_index.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1717,
4701,
12,
2890,
4672,
436,
273,
666,
12,
3676,
12,
2163,
3719,
365,
18,
11231,
5812,
12,
86,
63,
56,
1266,
1702,
12,
25,
4672,
56,
1266,
1702,
12,
2163,
13,
6487,
436... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1717,
4701,
12,
2890,
4672,
436,
273,
666,
12,
3676,
12,
2163,
3719,
365,
18,
11231,
5812,
12,
86,
63,
56,
1266,
1702,
12,
25,
4672,
56,
1266,
1702,
12,
2163,
13,
6487,
436... | |
self.debug("Connect to %r failed" % sockaddr) | self.debug("Connect to %r failed" % (sockaddr,)) | def _connect(self,addr,port,to=None): if to is None: to=str(addr) if type(addr) in (StringType,UnicodeType): self.state_change("resolving",addr) s=None for res in socket.getaddrinfo(addr,port,0,socket.SOCK_STREAM): family,socktype,proto,canonname,sockaddr=res try: s=socket.socket(family,socktype,proto) self.state_change("connecting",sockaddr) s.connect(sockaddr) self.state_change("connected",sockaddr) except socket.error, msg: self.debug("Connect to %r failed" % sockaddr) if s: s.close() continue break if not s: raise socket.error, msg | 9f647280460a6b52ca1da56c01e02382c23e3300 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12769/9f647280460a6b52ca1da56c01e02382c23e3300/stream.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3612,
12,
2890,
16,
4793,
16,
655,
16,
869,
33,
7036,
4672,
309,
358,
353,
599,
30,
358,
33,
701,
12,
4793,
13,
309,
618,
12,
4793,
13,
316,
261,
780,
559,
16,
16532,
559,
467... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3612,
12,
2890,
16,
4793,
16,
655,
16,
869,
33,
7036,
4672,
309,
358,
353,
599,
30,
358,
33,
701,
12,
4793,
13,
309,
618,
12,
4793,
13,
316,
261,
780,
559,
16,
16532,
559,
467... |
self.physical_id[0], self.physical_id[1], self.physical_id[2], self.physical_id[3]) | (self.physical_id[0], self.physical_id[1], self.physical_id[2], self.physical_id[3])) | def __str__(self): """Custom str() formatter for disks. | 25a915d0bb07f469ac17b78fb6282a4beeba1b18 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7542/25a915d0bb07f469ac17b78fb6282a4beeba1b18/objects.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
3536,
3802,
609,
1435,
4453,
364,
17164,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
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,
1001,
701,
972,
12,
2890,
4672,
3536,
3802,
609,
1435,
4453,
364,
17164,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.statusTime = time.time() | self.statusTime = time.localtime() | def __init__(self,wps, processes=None): | 88a4e52fcf30a4cf07b3a338d1d926ae7658cb77 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10967/88a4e52fcf30a4cf07b3a338d1d926ae7658cb77/Execute.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
91,
1121,
16,
8488,
33,
7036,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
91,
1121,
16,
8488,
33,
7036,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if self.gen_requires: gen_requires(self.module) | def add_access(self, av_set): """Add the access from the access vector set to this module. """ # Use the interface generator to split the access # into raw allow rules and interfaces. After this # a will contain a list of access that should be # used as raw allow rules and the interfaces will # be added to the module. if self.ifgen: raw_allow, ifcalls = self.ifgen.gen(av_set, self.explain) self.module.children.extend(ifcalls) else: raw_allow = av_set | f210ced209102d187ae788413603ef1ed9d44680 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7147/f210ced209102d187ae788413603ef1ed9d44680/policygen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
3860,
12,
2890,
16,
1712,
67,
542,
4672,
3536,
986,
326,
2006,
628,
326,
2006,
3806,
444,
358,
333,
1605,
18,
3536,
468,
2672,
326,
1560,
4456,
358,
1416,
326,
2006,
468,
1368... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
3860,
12,
2890,
16,
1712,
67,
542,
4672,
3536,
986,
326,
2006,
628,
326,
2006,
3806,
444,
358,
333,
1605,
18,
3536,
468,
2672,
326,
1560,
4456,
358,
1416,
326,
2006,
468,
1368... | |
A notification can be canceled even if it has not been shown yet. | This function should NOT be called until |WaitForNotificationCount| has been used to verify the notification is showing. This function cannot be used to cancel a notification that is in the display queue. | def _CancelNotification(self, notification_id, tab_index=0, windex=0): """Cancels a notification with the given id. | 1e55a10eb4cd8a39edfb8c06c80b7c24e70d3fce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/1e55a10eb4cd8a39edfb8c06c80b7c24e70d3fce/notifications.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6691,
4386,
12,
2890,
16,
3851,
67,
350,
16,
3246,
67,
1615,
33,
20,
16,
341,
1615,
33,
20,
4672,
3536,
6691,
87,
279,
3851,
598,
326,
864,
612,
18,
2,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6691,
4386,
12,
2890,
16,
3851,
67,
350,
16,
3246,
67,
1615,
33,
20,
16,
341,
1615,
33,
20,
4672,
3536,
6691,
87,
279,
3851,
598,
326,
864,
612,
18,
2,
-100,
-100,
-100,
-100,
... |
pass | def clear_cache(): """ Clear the global conflict resolve cache """ pass | c28a0f5b107c1189f5a606ab186df796c776ebfe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/c28a0f5b107c1189f5a606ab186df796c776ebfe/conflict.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
67,
2493,
13332,
3536,
10121,
326,
2552,
7546,
2245,
1247,
3536,
1342,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
2424,
67,
2493,
13332,
3536,
10121,
326,
2552,
7546,
2245,
1247,
3536,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
``Expires`` and ``Cache-Control`` headers for static assets served. Note that this argument has no effect when the ``name`` is a *url prefix*. By default, this argument is ``None``, meaning that no particular Expires or Cache-Control headers are set in the response. | ``Expires`` and ``Cache-Control`` headers for static assets served. Note that this argument has no effect when the ``name`` is a *url prefix*. By default, this argument is ``None``, meaning that no particular Expires or Cache-Control headers are set in the response. | def add_static_view(self, name, path, **kw): """ Add a view used to render static assets such as images and CSS files. | 781f9e02e0433a77e78f07f28e5b7d2064e73af4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/781f9e02e0433a77e78f07f28e5b7d2064e73af4/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
3845,
67,
1945,
12,
2890,
16,
508,
16,
589,
16,
2826,
9987,
4672,
3536,
1436,
279,
1476,
1399,
358,
1743,
760,
7176,
4123,
487,
4602,
471,
6765,
1390,
18,
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,
527,
67,
3845,
67,
1945,
12,
2890,
16,
508,
16,
589,
16,
2826,
9987,
4672,
3536,
1436,
279,
1476,
1399,
358,
1743,
760,
7176,
4123,
487,
4602,
471,
6765,
1390,
18,
2,
-100,
-100,
-100,... |
self.t = self.get_time() - t | self.t = get_time() - t | def simulate_cmd_complete(self): t = self.get_time() - self.t while self.cur[-1]: # We *can* cause assertion errors here if # dispatch_trace_return checks for a frame match! a = self.dispatch['return'](self.cur[-2], t) t = 0 self.t = self.get_time() - t | edb5ffb2c145fc52df2195c22688db51034b08d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/edb5ffb2c145fc52df2195c22688db51034b08d5/profile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20089,
67,
4172,
67,
6226,
12,
2890,
4672,
268,
273,
365,
18,
588,
67,
957,
1435,
300,
365,
18,
88,
1323,
365,
18,
1397,
18919,
21,
14542,
468,
1660,
380,
4169,
14,
4620,
11240,
1334,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20089,
67,
4172,
67,
6226,
12,
2890,
4672,
268,
273,
365,
18,
588,
67,
957,
1435,
300,
365,
18,
88,
1323,
365,
18,
1397,
18919,
21,
14542,
468,
1660,
380,
4169,
14,
4620,
11240,
1334,
... |
print "\nThe disabled sites that are reporting: \n" + \ | print "\nThe disabled storage resources that are reporting: \n" + \ | def DataTransferSumup(range_end = datetime.date.today(), range_begin = None, output = "text", header = True): if not gGrid or gGrid.lower() == 'local': try: gridDisplayName = gConfig.get("local", "grid_name") except: gridDisplayName = "" else: gridDisplayName = 'OSG' if not range_end: if not range_begin: range_end = datetime.date.today() else: range_end = range_begin + datetime.timedelta(days=+1) if not range_begin: range_begin = range_end + datetime.timedelta(days=-1) timediff = range_end - range_begin regSites = GetListOfOSGSEs(); disabledSites = GetListOfDisabledOSGSites() reportingSitesDate = GetSiteLastReportingDate(range_begin, True) pingSites = [] for data in reportingSitesDate: if ( len(data) > 0 ): (name,lastreport) = data.split("\t") pingSites.append(name) exceptionSites = ['AGLT2_CE_2', 'BNL-LCG2', 'BNL_ATLAS_1', 'BNL_ATLAS_2', 'FNAL_GPGRID_2', 'USCMS-FNAL-XEN', 'USCMS-FNAL-WC1-CE2', 'USCMS-FNAL-WC1-CE3', 'USCMS-FNAL-WC1-CE4', 'BNL_LOCAL', 'BNL_OSG', 'BNL_PANDA', 'GLOW-CMS', 'UCSDT2-B', 'Purdue-Lear' ] #exceptionSites = ['BNL_ATLAS_1', 'BNL_ATLAS_2', 'USCMS-FNAL-WC1-CE2', 'USCMS-FNAL-WC1-CE3', 'USCMS-FNAL-WC1-CE4', 'BNL_LOCAL', 'BNL_OSG', 'BNL_PANDA', 'GLOW-CMS', 'UCSDT2-B'] reportingSites = GetListOfDataTransferReportingSites(range_begin,range_end) #print "reporting sites",reportingSites allSites = None if regSites != None: allSites = [name for name in regSites if name not in exceptionSites] #print "allSites is ", allSites missingSites, emptySites = None, None if allSites: missingSites = [name for name in allSites if name not in \ reportingSites and name not in pingSites] emptySites = [name for name in allSites if name not in reportingSites \ and name in pingSites] extraSites = [name for name in reportingSites if allSites and name not in \ allSites and disabledSites and name not in disabledSites] knownExtras = [name for name in extraSites if name in exceptionSites and \ name not in regSites] extraSites = [name for name in extraSites if name not in exceptionSites] reportingDisabled = None if disabledSites != None: reportingDisabled = [name for name in reportingSites if name in \ disabledSites] #print allSites #print reportingSites #print missingSites #print extraSites if allSites != None: print "As of %s, there are %s registered SRMv2 %s sites." % \ (DateToString(datetime.date.today(),False), prettyInt(len(allSites)), gridDisplayName) print "\nBetween %s - %s (midnight - midnight UTC):\n" % \ (DateToString(range_begin, False), DateToString(range_end, False)) n = len(reportingSites) print prettyInt(n)+" sites reported\n" #[njobs,wallduration,div] = GetTotals(range_begin,range_end) [njobs,wallduration] = GetDataTransferTotals(range_begin,range_end) if (njobs != "NULL"): njobs = int(njobs); wallduration = float(wallduration) else: njobs = 0 wallduration = 0 print "Total number of transfers: "+prettyInt(njobs) print "Total transfer duration: "+niceNum( wallduration / 3600, 1 )+ " hours" if reportingSites != None and extraSites != None and knownExtras != None \ and allSites != None: n = len(reportingSites)-len(extraSites)-len(knownExtras) print "%s registered sites reported (%s%% of %s sites)" % \ (prettyInt(n), niceNum(n*100/len(allSites),1), gridDisplayName) if missingSites != None and allSites != None: n = len(missingSites) print "%s registered sites have NOT reported (%s%% of %s sites)" % \ (prettyInt(n), niceNum(n*100/len(allSites),1), gridDisplayName) if emptySites != None and allSites != None: n = len(emptySites) print "%s registered sites have reported but have no activity (%s%% " \ "of %s sites)" % (prettyInt(n), niceNum(n*100/len(allSites), 1), gridDisplayName) print n = len(extraSites); if not gGrid or gGrid.lower() != "local": print prettyInt(n)+" non-sanctioned non-registered sites reported " \ "(might indicate a discrepancy between OIM and Gratia)." elif allSites != None: print prettyInt(n)+" non-sanctioned non-registered sites reported." if reportingDisabled != None: n = len(reportingDisabled) print prettyInt(n)+" disabled sites have reported." if emptySites != None: print "\nThe sites with no activity are: \n"+prettyList(emptySites) if missingSites != None: print "\nThe non reporting sites are: \n"+prettyList(missingSites) if allSites != None: print "\nThe non registered sites are: \n"+prettyList(extraSites) if reportingDisabled != None: print "\nThe disabled sites that are reporting: \n" + \ prettyList(reportingDisabled) print "\n" return missingSites | 6d8a4b1e13b56fd714149dae3171a05103390c56 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/637/6d8a4b1e13b56fd714149dae3171a05103390c56/AccountingReports.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1910,
5912,
3495,
416,
12,
3676,
67,
409,
273,
3314,
18,
712,
18,
30064,
9334,
1048,
67,
10086,
273,
599,
16,
876,
273,
315,
955,
3113,
1446,
273,
1053,
4672,
225,
309,
486,
314,
6313,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1910,
5912,
3495,
416,
12,
3676,
67,
409,
273,
3314,
18,
712,
18,
30064,
9334,
1048,
67,
10086,
273,
599,
16,
876,
273,
315,
955,
3113,
1446,
273,
1053,
4672,
225,
309,
486,
314,
6313,... |
index_html_=HTML("""\ | def index_html(self, REQUEST=None): """ View the STX Help Topic """ if Globals.DevelopmentMode: try: mtime=os.stat(self.file) except: mtime=0 if mtime != self._v_last_read: self.obj = open(self.file).read() self._v_last_read=mtime self.reindex_object() return self.htmlfile(self, REQUEST) htmlfile = HTML("""\ | def SearchableText(self): "The full text of the Help Topic, for indexing purposes" return '%s %s' % (self.title, self.obj) | b38c71929f2b00c0412bff5e1a395235424c1dcc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b38c71929f2b00c0412bff5e1a395235424c1dcc/HelpTopic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5167,
429,
1528,
12,
2890,
4672,
315,
1986,
1983,
977,
434,
326,
11288,
11789,
16,
364,
14403,
13694,
6,
327,
1995,
87,
738,
87,
11,
738,
261,
2890,
18,
2649,
16,
365,
18,
2603,
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,
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,
5167,
429,
1528,
12,
2890,
4672,
315,
1986,
1983,
977,
434,
326,
11288,
11789,
16,
364,
14403,
13694,
6,
327,
1995,
87,
738,
87,
11,
738,
261,
2890,
18,
2649,
16,
365,
18,
2603,
13,
... |
nframes = N.size(input) | nframes = N.size(input) / nc | def write_frames(self, input, nframes = -1): """write data to file. :Parameters: input : ndarray array containing data to write. nframes : int number of frames to write. | db4fa25679edf61a9d200b0a7207a799f2b5d02e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11419/db4fa25679edf61a9d200b0a7207a799f2b5d02e/pysndfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
10278,
12,
2890,
16,
810,
16,
290,
10278,
273,
300,
21,
4672,
3536,
2626,
501,
358,
585,
18,
225,
294,
2402,
30,
810,
294,
8304,
526,
4191,
501,
358,
1045,
18,
290,
10278,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
10278,
12,
2890,
16,
810,
16,
290,
10278,
273,
300,
21,
4672,
3536,
2626,
501,
358,
585,
18,
225,
294,
2402,
30,
810,
294,
8304,
526,
4191,
501,
358,
1045,
18,
290,
10278,
... |
s2 = removeLanguageLinks(s2.replace(marker,'').strip(), site) + site.family.category_text_separator + s | s2 = removeLanguageLinks(s2.replace(marker,''), site) + site.family.category_text_separator + s | def replaceCategoryLinks(oldtext, new, site = None, addOnly = False): """Replace the category links given in the wikitext given in oldtext by the new links given in new. 'new' should be a list of Category objects. If addOnly is True, the old category won't be deleted and the category(s) given will be added (and so they won't replace anything). """ # Find a marker that is not already in the text. marker = '@@' while marker in oldtext: marker += '@' if site is None: site = getSite() if site.sitename() == 'wikipedia:de' and "{{Personendaten" in oldtext: raise Error('The PyWikipediaBot is no longer allowed to touch categories on the German Wikipedia on pages that contain the person data template because of the non-standard placement of that template. See http://de.wikipedia.org/wiki/Hilfe_Diskussion:Personendaten/Archiv/bis_2006#Position_der_Personendaten_am_.22Artikelende.22') s = categoryFormat(new, insite = site) if addOnly: s2 = oldtext else: s2 = removeCategoryLinks(oldtext, site = site, marker = marker) if s: if site.language() in site.family.category_attop: newtext = s + site.family.category_text_separator + s2 else: # calculate what was after the categories links on the page firstafter = s2.find(marker) # Is there any text in the 'after' part that means we should keep it after? if "</noinclude>" in s2[firstafter:]: newtext = s2[:firstafter] + s + s2[firstafter:] elif site.language() in site.family.categories_last: newtext = s2.replace(marker,'').strip() + site.family.category_text_separator + s else: interwiki = getLanguageLinks(s2) s2 = removeLanguageLinks(s2.replace(marker,'').strip(), site) + site.family.category_text_separator + s newtext = replaceLanguageLinks(s2, interwiki, site) newtext = newtext.replace(marker,'') else: s2 = s2.replace(marker,'') return s2 return newtext.strip() | 0e27dcef428acb649b6158767226d6719ab9240d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/0e27dcef428acb649b6158767226d6719ab9240d/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
4457,
7100,
12,
1673,
955,
16,
394,
16,
2834,
273,
599,
16,
527,
3386,
273,
1083,
4672,
3536,
5729,
326,
3150,
4716,
864,
316,
326,
341,
1766,
305,
408,
864,
316,
1592,
955,
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,
1453,
4457,
7100,
12,
1673,
955,
16,
394,
16,
2834,
273,
599,
16,
527,
3386,
273,
1083,
4672,
3536,
5729,
326,
3150,
4716,
864,
316,
326,
341,
1766,
305,
408,
864,
316,
1592,
955,
635,... |
elif hasattr(t, 'getComponentTypeMap'): return t.getComponentTypeMap() | elif hasattr(t, 'getComponentType'): return t.getComponentType() | def _getAsn1SpecByPosition(self, t, idx): if t.getComponentType() is not None: if hasattr(t, 'getComponentTypeMapNearPosition'): return t.getComponentTypeMapNearPosition(idx) # Sequence elif hasattr(t, 'getComponentTypeMap'): # XXX return t.getComponentTypeMap() # SequenceOf # or no asn1Specs | 53db28a34f5382132ba2ccb277893c9788f2108a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8754/53db28a34f5382132ba2ccb277893c9788f2108a/decoder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
1463,
82,
21,
1990,
858,
2555,
12,
2890,
16,
268,
16,
2067,
4672,
309,
268,
18,
588,
28116,
1435,
353,
486,
599,
30,
309,
3859,
12,
88,
16,
296,
588,
1841,
23968,
24686,
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,
588,
1463,
82,
21,
1990,
858,
2555,
12,
2890,
16,
268,
16,
2067,
4672,
309,
268,
18,
588,
28116,
1435,
353,
486,
599,
30,
309,
3859,
12,
88,
16,
296,
588,
1841,
23968,
24686,
25... |
db.begin_transaction(False) | if not read_only: db.begin_transaction(False) | def __init__(self, ref): # Load the database if isinstance(ref, WritableDatabase): self._db = ref else: uri = get_absolute_reference(ref) if uri.scheme != 'file': raise IOError, ('The file system supported with catalog is ' 'only "file"') path = str(uri.path) self._db = WritableDatabase(path, DB_OPEN) db = self._db | a0530ae1fd5089a729b17c188d75ce7e3a38d812 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/a0530ae1fd5089a729b17c188d75ce7e3a38d812/catalog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1278,
4672,
468,
4444,
326,
2063,
309,
1549,
12,
1734,
16,
14505,
4254,
4672,
365,
6315,
1966,
273,
1278,
469,
30,
2003,
273,
336,
67,
12547,
67,
6180,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1278,
4672,
468,
4444,
326,
2063,
309,
1549,
12,
1734,
16,
14505,
4254,
4672,
365,
6315,
1966,
273,
1278,
469,
30,
2003,
273,
336,
67,
12547,
67,
6180,
1... |
print err | def parse(self): '''Parse options''' ret = {} if self.dogetopt: try: opts, args = getopt.getopt(sys.argv[1:], self.shortopt, self.longopt) except getopt.GetoptError, err: print "%s Usage:" % (self.name) print err print self.helpmsg raise OptionFailure, err if '-h' in sys.argv: print "%s Usage:" % (self.name) print self.helpmsg raise SystemExit, 1 if self.configfile: cf = ConfigParser.ConfigParser() cf.read(self.configfile) for key, (option, envvar, cfpath, default, boolean) in self.optionspec.iteritems(): if self.dogetopt: optinfo = [opt[1] for opt in opts if opt[0] == option[0]] if optinfo: if boolean: ret[key] = True else: ret[key] = optinfo[0] continue if option[0] in sys.argv: if boolean: ret[key] = True else: ret[key] = sys.argv[sys.argv.index(option[0]) + 1] continue elif envvar and os.environ.has_key(envvar): ret[key] = os.environ[envvar] continue elif self.configfile and cfpath: try: value = apply(cf.get, cfpath) ret[key] = value continue except: pass else: ret[key] = default continue return ret | 56ee3aa07a5b245adcee57f69dcb1ec53528cb17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/56ee3aa07a5b245adcee57f69dcb1ec53528cb17/Options.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
4672,
9163,
3201,
702,
26418,
325,
273,
2618,
309,
365,
18,
2896,
588,
3838,
30,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
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,
1109,
12,
2890,
4672,
9163,
3201,
702,
26418,
325,
273,
2618,
309,
365,
18,
2896,
588,
3838,
30,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
3... | |
''' | """ | def hasPermission(self, permission, classname=_marker, property=None, itemid=None): '''Determine if the user has the Permission. | 16a3ebf380b95607b344181655488d818a27791f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1906/16a3ebf380b95607b344181655488d818a27791f/templating.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26097,
12,
2890,
16,
4132,
16,
7479,
33,
67,
11145,
16,
1272,
33,
7036,
16,
16862,
33,
7036,
4672,
9163,
8519,
309,
326,
729,
711,
326,
8509,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26097,
12,
2890,
16,
4132,
16,
7479,
33,
67,
11145,
16,
1272,
33,
7036,
16,
16862,
33,
7036,
4672,
9163,
8519,
309,
326,
729,
711,
326,
8509,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,... |
login = os.getlogin() | login = os.getenv('LOGNAME') | def fill_memory_linux(): """Fill unallocated memory""" # make self primary target for Linux out-of-memory killer path = '/proc/%d/oomadj' % os.getpid() if os.path.exists(path): f = open(path) f.write('15') f.close() # OOM likes nice processes print 'debug: new nice value', os.nice(19) libc = ctypes.cdll.LoadLibrary("libc.so.6") # OOM prefers non-privileged processes try: login = os.getlogin() import pwd uid = pwd.getpwnam(login)[3] if uid > 0: print "debug: dropping privileges of pid %d to uid %d" % \ (os.getpid(), uid) os.seteuid(uid) except: traceback.print_exc() # fill memory def fill_helper(): report_free() allocbytes = int(physical_free() * 0.75) if allocbytes < 1024: return megabytes = allocbytes / (1024**2) print "info: allocating %.2f MB (%d B) memory" % (megabytes, allocbytes) buffer = libc.malloc(allocbytes) if 0 == buffer: print 'debug: malloc() returned', buffer return print "debug: wiping %.2f MB I just allocated" % megabytes libc.memset(buffer, 0x00, allocbytes) fill_helper() print "debug: freeing %.2f MB memory" % megabytes libc.free(buffer) report_free() fill_helper() | e4a7c4ed1df294ce024bc13662ad0791bc4b7bfb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7853/e4a7c4ed1df294ce024bc13662ad0791bc4b7bfb/Memory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
67,
7858,
67,
20132,
13332,
3536,
8026,
640,
28172,
3778,
8395,
468,
1221,
365,
3354,
1018,
364,
13318,
596,
17,
792,
17,
7858,
8673,
264,
589,
273,
1173,
9381,
5258,
72,
19,
4252,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3636,
67,
7858,
67,
20132,
13332,
3536,
8026,
640,
28172,
3778,
8395,
468,
1221,
365,
3354,
1018,
364,
13318,
596,
17,
792,
17,
7858,
8673,
264,
589,
273,
1173,
9381,
5258,
72,
19,
4252,... |
context.show_text(title) | if self.textfix: context.text_path(title) else: context.show_text(title) | def render(self, context, debug=False): debug = debug or self.debug context.save() # Draw the vertical scale, if necessary if self.vertical_scale: major_style = self.style['wavegraph grid#y.major'] minor_style = self.style['wavegraph grid#y.minor'] for linepos, title, ismajor in self.y_scale.get_lines(): if ismajor: this_style = major_style else: this_style = minor_style line_style = this_style.sub('line') label_style = this_style.sub('label') context.select_font_face( label_style.get_font(), label_style.get_cairo_font_style(), label_style.get_cairo_font_weight(), ) context.set_font_size( label_style.get_float("font-size") ) y = linepos * self.plot_height fascent, fdescent, fheight, fxadvance, fyadvance = context.font_extents() x_bearing, y_bearing, width, height = context.text_extents(title)[:4] padding = label_style.get_float("padding") align = label_style.get_align("text-align") context.move_to(0 - padding - (align * width), y + fheight / 2.0 - fdescent) context.set_source_rgba(*label_style.get_color("color")) context.show_text(title) context.set_line_width(line_style.get_float("width", 1)) context.set_source_rgba(*line_style.get_color("color", "#aaa")) context.move_to(0 - line_style.get_float("padding", 0), y) context.line_to(self.width, y) context.stroke() # Render the labels and lines major_style = self.style['wavegraph grid#x.major'] minor_style = self.style['wavegraph grid#x.minor'] for linepos, title, ismajor in self.scale.get_lines(): if ismajor: this_style = major_style else: this_style = minor_style line_style = this_style.sub('line') label_style = this_style.sub('label') context.select_font_face( label_style.get_font(), label_style.get_cairo_font_style(), label_style.get_cairo_font_weight(), ) context.set_font_size( label_style.get_float("font-size") ) x = linepos * self.width fascent, fdescent, fheight, fxadvance, fyadvance = context.font_extents() x_bearing, y_bearing, width, height = context.text_extents(title)[:4] padding = label_style.get_float("padding") align = label_style.get_align("text-align") context.move_to(x - (align * width), self.plot_height + padding + fheight / 2.0 - fdescent) context.set_source_rgba(*label_style.get_color("color")) context.show_text(title) #context.text_path(title) context.set_line_width(line_style.get_float("width", 1)) context.set_source_rgba(*line_style.get_color("color", "#aaa")) context.move_to(x, 0) context.line_to(x, self.plot_height + line_style.get_float("padding", 0)) context.stroke() # Draw the strips smooth = self.style['wavegraph curve'].get_float("smoothness") i = -1 for series in self.series_set: i += 1 # Get the two lists of points tops = self.points[i] bottoms = self.points[i+1] # Draw the tops context.move_to(*tops[0]) for j in range(1, len(tops)): ox, oy = tops[j-1] nx, ny = tops[j] dx = (nx - ox) * smooth context.curve_to(ox+dx, oy, nx-dx, ny, nx, ny) # And the bottoms context.line_to(*bottoms[-1]) for j in range(2, len(bottoms)+1): ox, oy = bottoms[-(j-1)] nx, ny = bottoms[-j] dx = (nx - ox) * smooth context.curve_to(ox+dx, oy, nx-dx, ny, nx, ny) # Close and fill context.set_source_rgba(*series.color_as_rgba()) context.close_path() context.fill() # Draw the on-curve labels if self.label_curves: label_style = self.style['wavegraph curve label'] dimming_top = label_style.get_float('dimming-top', 1) dimming_bottom = label_style.get_float('dimming-bottom', 0) r,g,b,a = label_style.get_color('color', '#fff') context.select_font_face( label_style.get_font(), label_style.get_cairo_font_style(), label_style.get_cairo_font_weight(), ) # Draw the labels for (size, (x1, y1, x2, y2)), title in self.labels: if size > 0: # Set the colour, including dimming if size >= dimming_top: dim = 1 elif size < dimming_bottom: dim = 0 else: dim = (size-dimming_bottom) / float(dimming_top-dimming_bottom) context.set_source_rgba(r,g,b,a*dim) # Position outselves context.set_font_size(size * 0.9) x_bearing, y_bearing, width, height = context.text_extents(title)[:4] context.move_to(((x2+x1)/2.0) - width / 2 - x_bearing, ((y2+y1)/2.0) - height / 2 - y_bearing) # Draw the text. We use text_path because it looks prettier # (on image surfaces, show_text coerces font paths to fit inside pixels) context.show_text(title) #context.text_path(title) context.fill() # If uncommented, will show the used text boxes #self.render_debug(context) # Do we need labels on the bottom? #if self.x_labels_major: #context.save() #context.translate(0, self.cheight) #self.x_labels_major.render(context, #color=self.style['wavegraph:label_color'], #size=self.style['wavegraph:label_size'], #font=self.style['wavegraph:label_font'], #) #context.restore() ## Render the curve labels if needed #if self.curve_labels: #if self.style['wavegraph:debug']: #self.curve_labels.render_debug(context) #self.curve_labels.render(context, #color=self.style['wavegraph:curve_label_color'], #font=self.style['wavegraph:curve_label_font'], #weight=self.style['wavegraph:curve_label_font_weight'], #dimming_top=self.style['wavegraph:dimming_top'], #dimming_bottom=self.style['wavegraph:dimming_bottom'], #) if debug: self.render_debug(context) context.restore() | 065a488418bded58d539a015b45ac5954482640a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4498/065a488418bded58d539a015b45ac5954482640a/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
819,
16,
1198,
33,
8381,
4672,
225,
1198,
273,
1198,
578,
365,
18,
4148,
225,
819,
18,
5688,
1435,
225,
468,
10184,
326,
9768,
3159,
16,
309,
4573,
309,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
819,
16,
1198,
33,
8381,
4672,
225,
1198,
273,
1198,
578,
365,
18,
4148,
225,
819,
18,
5688,
1435,
225,
468,
10184,
326,
9768,
3159,
16,
309,
4573,
309,
365,
18,
... |
prop_details[propname] = {"status": rabbitvcs.vcs.status.status_unchanged, | prop_details[propname] = {"status": rabbitvcs.vcs.status.status_normal, | def propdetails(self, path): """ Each property on a path may be modified in the WC, deleted or added. This method compares the properties on the local path to the base and identifies which. | 38c4ac883ea2d9ce2319f80aa16b53011c791d35 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5119/38c4ac883ea2d9ce2319f80aa16b53011c791d35/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2270,
6395,
12,
2890,
16,
589,
4672,
3536,
8315,
1272,
603,
279,
589,
2026,
506,
4358,
316,
326,
678,
39,
16,
4282,
578,
3096,
18,
1220,
707,
20670,
326,
1790,
603,
326,
1191,
589,
358... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2270,
6395,
12,
2890,
16,
589,
4672,
3536,
8315,
1272,
603,
279,
589,
2026,
506,
4358,
316,
326,
678,
39,
16,
4282,
578,
3096,
18,
1220,
707,
20670,
326,
1790,
603,
326,
1191,
589,
358... |
print '\t\t%s,' % (key) print '\t]' | print >> stream, '\t\t%s,' % (key) print >> stream, '\t]' | def WriteClass(self, generator): generator.checkWriteCoClassBaseClass() doc = self.doc if generator.generate_type == GEN_DEMAND_CHILD: # Some special imports we must setup. referenced_items = [] for ref, flag in self.sources: referenced_items.append(ref) for ref, flag in self.interfaces: referenced_items.append(ref) print "import sys" for ref in referenced_items: print "__import__('%s.%s')" % (generator.base_mod_name, ref.python_name) print "%s = sys.modules['%s.%s'].%s" % (ref.python_name, generator.base_mod_name, ref.python_name, ref.python_name) try: progId = pythoncom.ProgIDFromCLSID(self.clsid) print "# This CoClass is known by the name '%s'" % (progId) except pythoncom.com_error: pass print 'class %s(CoClassBaseClass): # A CoClass' % (self.python_name) if doc and doc[1]: print '\t# ' + doc[1] print '\tCLSID = %r' % (self.clsid,) print '\tcoclass_sources = [' defItem = None for item, flag in self.sources: if flag & pythoncom.IMPLTYPEFLAG_FDEFAULT: defItem = item # check if non-dispatchable - if so no real Python class has been written. Write the iid as a string instead. if item.bIsDispatch: key = item.python_name else: key = repr(str(item.clsid)) # really the iid. print '\t\t%s,' % (key) print '\t]' if defItem: if defItem.bIsDispatch: defName = defItem.python_name else: defName = repr(str(defItem.clsid)) # really the iid. print '\tdefault_source = %s' % (defName,) print '\tcoclass_interfaces = [' defItem = None for item, flag in self.interfaces: if flag & pythoncom.IMPLTYPEFLAG_FDEFAULT: # and dual: defItem = item # check if non-dispatchable - if so no real Python class has been written. Write the iid as a string instead. if item.bIsDispatch: key = item.python_name else: key = repr(str(item.clsid)) # really the iid. print '\t\t%s,' % (key,) print '\t]' if defItem: if defItem.bIsDispatch: defName = defItem.python_name else: defName = repr(str(defItem.clsid)) # really the iid. print '\tdefault_interface = %s' % (defName,) self.bWritten = 1 print | d465d55b4c2e9a03e3b613dd6344bf0290ff0ff6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/d465d55b4c2e9a03e3b613dd6344bf0290ff0ff6/genpy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
797,
12,
2890,
16,
4456,
4672,
4456,
18,
1893,
3067,
4249,
797,
2171,
797,
1435,
997,
273,
365,
18,
2434,
309,
4456,
18,
7163,
67,
723,
422,
611,
1157,
67,
1639,
11712,
67,
27043... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
797,
12,
2890,
16,
4456,
4672,
4456,
18,
1893,
3067,
4249,
797,
2171,
797,
1435,
997,
273,
365,
18,
2434,
309,
4456,
18,
7163,
67,
723,
422,
611,
1157,
67,
1639,
11712,
67,
27043... |
(self.ac_out_buffer is '') and | (self.ac_out_buffer == '') and | def writable (self): "predicate for inclusion in the writable for select()" # return len(self.ac_out_buffer) or len(self.producer_fifo) or (not self.connected) # this is about twice as fast, though not as clear. return not ( (self.ac_out_buffer is '') and self.producer_fifo.is_empty() and self.connected ) | b27ab3d3eafb61e0c7be8190d82b08fb72a1d3af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/b27ab3d3eafb61e0c7be8190d82b08fb72a1d3af/asynchat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9691,
261,
2890,
4672,
315,
18344,
364,
26485,
316,
326,
9691,
364,
2027,
10031,
468,
327,
562,
12,
2890,
18,
1077,
67,
659,
67,
4106,
13,
578,
562,
12,
2890,
18,
11776,
2750,
67,
74,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9691,
261,
2890,
4672,
315,
18344,
364,
26485,
316,
326,
9691,
364,
2027,
10031,
468,
327,
562,
12,
2890,
18,
1077,
67,
659,
67,
4106,
13,
578,
562,
12,
2890,
18,
11776,
2750,
67,
74,
... |
total_game.dump(" ") | total_game.dump(header) | def dump(self, header): game_count = float(self.count) | 819462ea8492fd326468c1b39f1a524098f9c553 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/600/819462ea8492fd326468c1b39f1a524098f9c553/process.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
12,
2890,
16,
1446,
4672,
7920,
67,
1883,
273,
1431,
12,
2890,
18,
1883,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
12,
2890,
16,
1446,
4672,
7920,
67,
1883,
273,
1431,
12,
2890,
18,
1883,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if self.images.nimages > 1 and not button.get_active(): filename += '@' + entry.get_text() elif button.get_active(): filename += '@%d' % self.frame | if self.images.nimages > 1: if button.get_active(): filename += '@%d' % self.frame else: filename += '@' + entry.get_text() | def save(self, action): chooser = gtk.FileChooserDialog( _('Save ...'), None, gtk.FILE_CHOOSER_ACTION_SAVE, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE, gtk.RESPONSE_OK)) | 86c1f5ad924bc3983b91dde5cea65a91cacbb8f0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5572/86c1f5ad924bc3983b91dde5cea65a91cacbb8f0/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
1301,
4672,
5011,
13164,
273,
22718,
18,
812,
17324,
6353,
12,
389,
2668,
4755,
1372,
19899,
599,
16,
22718,
18,
3776,
67,
22213,
51,
2123,
67,
12249,
67,
25242,
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,
1923,
12,
2890,
16,
1301,
4672,
5011,
13164,
273,
22718,
18,
812,
17324,
6353,
12,
389,
2668,
4755,
1372,
19899,
599,
16,
22718,
18,
3776,
67,
22213,
51,
2123,
67,
12249,
67,
25242,
16,
... |
return val, _quote( dumps(val) ) | return val, _quote( dumps(val).decode('latin-1') ) | def value_encode(self, val): if type(val) == type(""): return val, _quote(val) else: return val, _quote( dumps(val) ) | 1a1c2ba2c90cd7efc93d61a9c6617f3aa3090256 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/1a1c2ba2c90cd7efc93d61a9c6617f3aa3090256/Cookie.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
460,
67,
3015,
12,
2890,
16,
1244,
4672,
309,
618,
12,
1125,
13,
422,
618,
2932,
6,
4672,
327,
1244,
16,
389,
6889,
12,
1125,
13,
469,
30,
327,
1244,
16,
389,
6889,
12,
6711,
12,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
460,
67,
3015,
12,
2890,
16,
1244,
4672,
309,
618,
12,
1125,
13,
422,
618,
2932,
6,
4672,
327,
1244,
16,
389,
6889,
12,
1125,
13,
469,
30,
327,
1244,
16,
389,
6889,
12,
6711,
12,
1... |
msg = 'Unknow Errors ... ' | msg = 'Unknown Errors ... ' | def request(uuid, method, url, params={}, headers={},files=[],additions=''): scripts = '' try: if (method == 'POST'): result = _post(url, params, headers, files, additions) else: result = _get(url, params, headers) pass except urllib2.HTTPError, e: msg = 'Unknow Errors ... ' if http_code_msg_table.has_key(e.getcode()): msg = http_code_msg_table[e.getcode()] pass tech_info = 'HTTP Code: %s\\nURL: %s\\nDetails: %s' % (e.getcode(), e.geturl(), str(e)) content = '<p>%s</p><h3>- Technological Info -</h3><div class="dlg_group"><pre>%s</pre></div>' % (msg, tech_info) scripts = ''' ui.MessageDlg.set_text('%s', '%s'); ui.DialogHelper.open(ui.MessageDlg); lib.twitterapi.error_task_table['%s'](''); ''' % ('Ooops, an Error occurred!', content, uuid); pass except urllib2.URLError, e: content = '<p><label>Error Code:</label>%s<br/><label>Reason:</label> %s, %s<br/></p>' % (e.errno, e.reason, e.strerror) scripts = ''' ui.MessageDlg.set_text('%s', '%s'); ui.DialogHelper.open(ui.MessageDlg); lib.twitterapi.error_task_table['%s'](''); ''' % ('Ooops, an Error occurred!', content, uuid); pass else: if uuid != None: if result[0] != '{' and result[0] != '[': scripts = '''lib.twitterapi.success_task_table['%s']('%s'); ''' % (uuid, result) else: scripts = '''lib.twitterapi.success_task_table['%s'](%s); ''' % (uuid, result) pass scripts += '''delete lib.twitterapi.error_task_table['%s']; delete lib.twitterapi.error_task_table['%s']; ''' % (uuid, uuid); gobject.idle_add(webv.execute_script, scripts) pass | 27e5b2974d95db0afe34b35f0e2d7fb12f34ec94 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12179/27e5b2974d95db0afe34b35f0e2d7fb12f34ec94/agent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
12,
7080,
16,
707,
16,
880,
16,
859,
28793,
1607,
28793,
2354,
22850,
6487,
1289,
5029,
2218,
11,
4672,
8873,
273,
875,
775,
30,
309,
261,
2039,
422,
296,
3798,
11,
4672,
563,
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,
590,
12,
7080,
16,
707,
16,
880,
16,
859,
28793,
1607,
28793,
2354,
22850,
6487,
1289,
5029,
2218,
11,
4672,
8873,
273,
875,
775,
30,
309,
261,
2039,
422,
296,
3798,
11,
4672,
563,
273... |
global logger, max_bytes, xmlparser, dbobj, xmlparser, lwtparser, rls | global logger, max_bytes, xmlparser, lwtparser, dbobj, rls global dmt_proc_dict, dmt_seg_def_dict | def shutdown(): global logger, max_bytes, xmlparser, dbobj, xmlparser, lwtparser, rls logger.info("Shutting down server module %s" % __name__ ) if rls: del rls del lwtparser del xmlparser del dbobj del dmt_proc_dict del dmt_seg_def_dict | edd20d77e4dbeaae63697e28dd299839bae3e2bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/edd20d77e4dbeaae63697e28dd299839bae3e2bd/LDBDServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5731,
13332,
2552,
1194,
16,
943,
67,
3890,
16,
2025,
4288,
16,
328,
6046,
4288,
16,
302,
1075,
441,
16,
436,
3251,
2552,
302,
1010,
67,
9381,
67,
1576,
16,
302,
1010,
67,
5680,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5731,
13332,
2552,
1194,
16,
943,
67,
3890,
16,
2025,
4288,
16,
328,
6046,
4288,
16,
302,
1075,
441,
16,
436,
3251,
2552,
302,
1010,
67,
9381,
67,
1576,
16,
302,
1010,
67,
5680,
67,
... |
item = self.songs[self.songs_filter_rownums[path[0]]].file | item = self.songs[self.filter_row_mapping[path[0]]].file | def edit_tags(self, widget, mpdpath=None): if not HAVE_TAGPY: error_dialog = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, _("Taglib and/or tagpy not found, tag editing support disabled.")) error_dialog.set_title(_("Edit Tags")) error_dialog.set_role('editTagsError') error_dialog.connect('response', self.choose_image_dialog_response) error_dialog.show() return if not os.path.isdir(self.musicdir[self.profile_num]): error_dialog = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, _("The path") + " " + self.musicdir[self.profile_num] + " " + _("does not exist. Please specify a valid music directory in preferences.")) error_dialog.set_title(_("Edit Tags")) error_dialog.set_role('editTagsError') error_dialog.connect('response', self.choose_image_dialog_response) error_dialog.show() return self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) self.edit_style_orig = self.searchtext.get_style() while gtk.events_pending(): gtk.main_iteration() files = [] temp_mpdpaths = [] if mpdpath is not None: # Use current file in songinfo: files.append(self.musicdir[self.profile_num] + mpdpath) temp_mpdpaths.append(mpdpath) elif self.notebook.get_current_page() == self.TAB_LIBRARY: # Populates files array with selected library items: items = self.browser_get_selected_items_recursive(False) for item in items: files.append(self.musicdir[self.profile_num] + item) temp_mpdpaths.append(item) elif self.notebook.get_current_page() == self.TAB_CURRENT: # Populates files array with selected current playlist items: model, selected = self.current_selection.get_selected_rows() for path in selected: if not self.filterbox_visible: item = self.songs[path[0]].file else: item = self.songs[self.songs_filter_rownums[path[0]]].file files.append(self.musicdir[self.profile_num] + item) temp_mpdpaths.append(item) # Initialize tags: tags = [] for filenum in range(len(files)): tags.append({'title':'', 'artist':'', 'album':'', 'year':'', 'track':'', 'genre':'', 'comment':'', 'title-changed':False, 'artist-changed':False, 'album-changed':False, 'year-changed':False, 'track-changed':False, 'genre-changed':False, 'comment-changed':False, 'fullpath':files[filenum], 'mpdpath':temp_mpdpaths[filenum]}) self.tagnum = -1 if not os.path.exists(tags[0]['fullpath']): self.change_cursor(None) error_dialog = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, _("File ") + "\"" + tags[0]['fullpath'] + "\"" + _(" not found. Please specify a valid music directory in preferences.")) error_dialog.set_title(_("Edit Tags")) error_dialog.set_role('editTagsError') error_dialog.connect('response', self.choose_image_dialog_response) error_dialog.show() return if self.edit_next_tag(tags) == False: self.change_cursor(None) error_dialog = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, _("No music files with editable tags found.")) error_dialog.set_title(_("Edit Tags")) error_dialog.set_role('editTagsError') error_dialog.connect('response', self.choose_image_dialog_response) error_dialog.show() return if mpdpath is None: editwindow = gtk.Dialog("", self.window, gtk.DIALOG_MODAL) else: editwindow = gtk.Dialog("", self.infowindow, gtk.DIALOG_MODAL) editwindow.set_role('editTags') editwindow.set_size_request(375, -1) editwindow.set_resizable(False) editwindow.set_has_separator(False) table = gtk.Table(9, 2, False) table.set_row_spacings(2) filelabel = gtk.Label() filelabel.set_selectable(True) filelabel.set_line_wrap(True) filelabel.set_alignment(0, 0.5) filehbox = gtk.HBox() sonataicon = gtk.image_new_from_stock('sonata', gtk.ICON_SIZE_DND) sonataicon.set_alignment(1, 0.5) blanklabel = gtk.Label() blanklabel.set_size_request(15, 12) filehbox.pack_start(sonataicon, False, False, 2) filehbox.pack_start(filelabel, True, True, 2) filehbox.pack_start(blanklabel, False, False, 2) titlelabel = gtk.Label(_("Title") + ":") titlelabel.set_alignment(1, 0.5) titleentry = gtk.Entry() titlebutton = gtk.Button() titlebuttonvbox = gtk.VBox() self.editwindow_create_applyall_button(titlebutton, titlebuttonvbox, titleentry) titlehbox = gtk.HBox() titlehbox.pack_start(titlelabel, False, False, 2) titlehbox.pack_start(titleentry, True, True, 2) titlehbox.pack_start(titlebuttonvbox, False, False, 2) artistlabel = gtk.Label(_("Artist") + ":") artistlabel.set_alignment(1, 0.5) artistentry = gtk.Entry() artisthbox = gtk.HBox() artistbutton = gtk.Button() artistbuttonvbox = gtk.VBox() self.editwindow_create_applyall_button(artistbutton, artistbuttonvbox, artistentry) artisthbox.pack_start(artistlabel, False, False, 2) artisthbox.pack_start(artistentry, True, True, 2) artisthbox.pack_start(artistbuttonvbox, False, False, 2) albumlabel = gtk.Label(_("Album") + ":") albumlabel.set_alignment(1, 0.5) albumentry = gtk.Entry() albumhbox = gtk.HBox() albumbutton = gtk.Button() albumbuttonvbox = gtk.VBox() self.editwindow_create_applyall_button(albumbutton, albumbuttonvbox, albumentry) albumhbox.pack_start(albumlabel, False, False, 2) albumhbox.pack_start(albumentry, True, True, 2) albumhbox.pack_start(albumbuttonvbox, False, False, 2) yearlabel = gtk.Label(" " + _("Year") + ":") yearlabel.set_alignment(1, 0.5) yearentry = gtk.Entry() yearentry.set_size_request(50, -1) handlerid = yearentry.connect("insert_text", self.entry_float, True) yearentry.set_data('handlerid', handlerid) tracklabel = gtk.Label(" " + _("Track") + ":") tracklabel.set_alignment(1, 0.5) trackentry = gtk.Entry() trackentry.set_size_request(50, -1) handlerid2 = trackentry.connect("insert_text", self.entry_float, False) trackentry.set_data('handlerid2', handlerid2) yearbutton = gtk.Button() yearbuttonvbox = gtk.VBox() self.editwindow_create_applyall_button(yearbutton, yearbuttonvbox, yearentry) trackbutton = gtk.Button() trackbuttonvbox = gtk.VBox() self.editwindow_create_applyall_button(trackbutton, trackbuttonvbox, trackentry, True) yearandtrackhbox = gtk.HBox() yearandtrackhbox.pack_start(yearlabel, False, False, 2) yearandtrackhbox.pack_start(yearentry, True, True, 2) yearandtrackhbox.pack_start(yearbuttonvbox, False, False, 2) yearandtrackhbox.pack_start(tracklabel, False, False, 2) yearandtrackhbox.pack_start(trackentry, True, True, 2) yearandtrackhbox.pack_start(trackbuttonvbox, False, False, 2) genrelabel = gtk.Label(_("Genre") + ":") genrelabel.set_alignment(1, 0.5) genrecombo = gtk.combo_box_entry_new_text() genrecombo.set_wrap_width(2) self.editwindow_populate_genre_combo(genrecombo) genreentry = genrecombo.get_child() genrehbox = gtk.HBox() genrebutton = gtk.Button() genrebuttonvbox = gtk.VBox() self.editwindow_create_applyall_button(genrebutton, genrebuttonvbox, genreentry) genrehbox.pack_start(genrelabel, False, False, 2) genrehbox.pack_start(genrecombo, True, True, 2) genrehbox.pack_start(genrebuttonvbox, False, False, 2) commentlabel = gtk.Label(_("Comment") + ":") commentlabel.set_alignment(1, 0.5) commententry = gtk.Entry() commenthbox = gtk.HBox() commentbutton = gtk.Button() commentbuttonvbox = gtk.VBox() self.editwindow_create_applyall_button(commentbutton, commentbuttonvbox, commententry) commenthbox.pack_start(commentlabel, False, False, 2) commenthbox.pack_start(commententry, True, True, 2) commenthbox.pack_start(commentbuttonvbox, False, False, 2) self.set_label_widths_equal([titlelabel, artistlabel, albumlabel, yearlabel, genrelabel, commentlabel, sonataicon]) genrecombo.set_size_request(-1, titleentry.size_request()[1]) table.attach(gtk.Label(), 1, 2, 1, 2, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 2, 0) table.attach(filehbox, 1, 2, 2, 3, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 2, 0) table.attach(gtk.Label(), 1, 2, 3, 4, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 2, 0) table.attach(titlehbox, 1, 2, 4, 5, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 2, 0) table.attach(artisthbox, 1, 2, 5, 6, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 2, 0) table.attach(albumhbox, 1, 2, 6, 7, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 2, 0) table.attach(yearandtrackhbox, 1, 2, 7, 8, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 2, 0) table.attach(genrehbox, 1, 2, 8, 9, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 2, 0) table.attach(commenthbox, 1, 2, 9, 10, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 2, 0) table.attach(gtk.Label(), 1, 2, 10, 11, gtk.FILL|gtk.EXPAND, gtk.FILL|gtk.EXPAND, 2, 0) editwindow.vbox.pack_start(table) saveall_button = gtk.Button(_("Save _All")) editwindow.action_area.pack_start(saveall_button) cancelbutton = editwindow.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT) savebutton = editwindow.add_button(gtk.STOCK_SAVE, gtk.RESPONSE_ACCEPT) editwindow.connect('delete_event', self.editwindow_hide, tags) entries = [titleentry, artistentry, albumentry, yearentry, trackentry, genreentry, commententry, filelabel] buttons = [titlebutton, artistbutton, albumbutton, yearbutton, trackbutton, genrebutton, commentbutton] entries_names = ["title", "artist", "album", "year", "track", "genre", "comment"] editwindow.connect('response', self.editwindow_response, tags, entries, entries_names) saveall_button.connect('clicked', self.editwindow_save_all, editwindow, tags, entries, entries_names) for i in range(len(entries)-1): entries[i].connect('changed', self.edit_entry_changed) for i in range(len(buttons)): buttons[i].connect('clicked', self.editwindow_applyall, entries_names[i], tags, entries) self.editwindow_update(editwindow, tags, entries, entries_names) self.change_cursor(None) entries[7].set_size_request(editwindow.size_request()[0] - titlelabel.size_request()[0] - 50, -1) editwindow.show_all() | 0edd2102de649a7465f806846ed54ad3a3a68a86 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2312/0edd2102de649a7465f806846ed54ad3a3a68a86/sonata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
67,
4156,
12,
2890,
16,
3604,
16,
6749,
72,
803,
33,
7036,
4672,
309,
486,
21926,
3412,
67,
7927,
16235,
30,
555,
67,
12730,
273,
22718,
18,
1079,
6353,
12,
2890,
18,
5668,
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,
3874,
67,
4156,
12,
2890,
16,
3604,
16,
6749,
72,
803,
33,
7036,
4672,
309,
486,
21926,
3412,
67,
7927,
16235,
30,
555,
67,
12730,
273,
22718,
18,
1079,
6353,
12,
2890,
18,
5668,
16,
... |
"Parsing operator (%d dicts in current" | "Parsing operator (%d dicts in current " | def parse(self, file, list, restricted=False, prev_indent=-1): """ Read and parse lines from file until a line with an indent level lower than or equal to prev_indent is encountered. | bc08a57e881bd13f6d8149adf4df3a00e4e98a33 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/bc08a57e881bd13f6d8149adf4df3a00e4e98a33/kvm_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
585,
16,
666,
16,
15693,
33,
8381,
16,
2807,
67,
9355,
29711,
21,
4672,
3536,
2720,
471,
1109,
2362,
628,
585,
3180,
279,
980,
598,
392,
3504,
1801,
2612,
2353,
578... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
585,
16,
666,
16,
15693,
33,
8381,
16,
2807,
67,
9355,
29711,
21,
4672,
3536,
2720,
471,
1109,
2362,
628,
585,
3180,
279,
980,
598,
392,
3504,
1801,
2612,
2353,
578... |
main(options, args) | sys.exit(main(options, args)) | def parse_args(args=None): """Provides a default set of command line args. Returns a tuple of options, args from optparse""" # FIXME: All of these options should be stored closer to the code which actually uses them. # FIXME: configuration_options should move to WebKitPort and be shared across all scripts. configuration_options = [ optparse.make_option("-t", "--target", dest="configuration", help="(DEPRECATED)"), # FIXME: --help should display which configuration is default. optparse.make_option('--debug', action='store_const', const='Debug', dest="configuration", help='Set the configuration to Debug'), optparse.make_option('--release', action='store_const', const='Release', dest="configuration", help='Set the configuration to Release'), # old-run-webkit-tests also accepts -c, --configuration CONFIGURATION. ] logging_options = [ optparse.make_option("--log", action="store", default="detailed-progress,unexpected", help="log various types of data. The param should be a comma-separated list of values from: " "actual,config," + LOG_DETAILED_PROGRESS + ",expected,timing," + LOG_UNEXPECTED + " " "(defaults to " + "--log detailed-progress,unexpected)"), optparse.make_option("-v", "--verbose", action="store_true", default=False, help="include debug-level logging"), optparse.make_option("--sources", action="store_true", help="show expected result file path for each test (implies --verbose)"), # old-run-webkit-tests has a --slowest option which just prints the slowest 10. optparse.make_option("--num-slow-tests-to-log", default=50, help="Number of slow tests whose timings to print."), ] # FIXME: These options should move onto the ChromiumPort. chromium_options = [ optparse.make_option("--chromium", action="store_true", default=False, help="use the Chromium port"), optparse.make_option("--startup-dialog", action="store_true", default=False, help="create a dialog on DumpRenderTree startup"), optparse.make_option("--gp-fault-error-box", action="store_true", default=False, help="enable Windows GP fault error box"), optparse.make_option("--nocheck-sys-deps", action="store_true", default=False, help="Don't check the system dependencies (themes)"), ] # Missing Mac options: # FIXME: Need: -g, --guard for guard malloc support on Mac. # FIXME: Need: -l --leaks Enable leaks checking. # FIXME: Need: --[no-]sample-on-timeout Run sample on timeout (default: run) (Mac OS X only) results_options = [ # NEED for bots: --use-remote-links-to-tests Link to test files within the SVN repository in the results. optparse.make_option("-p", "--pixel-tests'", action="store_true", dest="pixel_tests", help="Enable pixel-to-pixel PNG comparisons"), optparse.make_option("--no-pixel-tests", action="store_false", dest="pixel_tests", help="Disable pixel-to-pixel PNG comparisons"), optparse.make_option("--fuzzy-pixel-tests", action="store_true", default=False, help="Also use fuzzy matching to compare pixel test outputs."), # old-run-webkit-tests allows a specific tollerance: --tolerance t Ignore image differences less than this percentage (default: 0.1) optparse.make_option("--results-directory", default="layout-test-results", help="Output results directory source dir, relative to Debug or Release"), optparse.make_option("--new-baseline", action="store_true", default=False, help="Save all generated results as new baselines into the platform directory, overwriting whatever's already there."), # FIXME: --noshow should be --no-show to match the GNU get_opt pattern. optparse.make_option("--noshow-results", action="store_true", default=False, help="Don't launch a browser with results after the tests are done"), # old-run-webkit-tests: --[no-]launch-safari Launch (or do not launch) Safari to display test results (default: launch) optparse.make_option("--full-results-html", action="store_true", default=False, help="Show all failures in results.html, rather than only regressions"), optparse.make_option("--clobber-old-results", action="store_true", default=False, help="Clobbers test results from previous runs."), optparse.make_option("--platform", help="Override the platform for expected results"), # old-run-webkit-tests also has HTTP toggle options: # --[no-]http Run (or do not run) http tests (default: run) # --[no-]wait-for-httpd Wait for httpd if some other test session is using it already (same as WEBKIT_WAIT_FOR_HTTPD=1). (default: 0) ] test_options = [ # old-run-webkit-tests has --valgrind instead of wrapper. optparse.make_option("--wrapper", help="wrapper command to insert before invocations of DumpRenderTree; option is split " "on whitespace before running. (Example: --wrapper='valgrind --smc-check=all')"), # old-run-webkit-tests: -i|--ignore-tests Comma-separated list of directories or tests to ignore optparse.make_option("--test-list", action="append", help="read list of tests to run from file", metavar="FILE"), # old-run-webkit-tests uses --skipped==[default|ignore|only] instead of --force: optparse.make_option("--force", action="store_true", default=False, help="Run all tests, even those marked SKIP in the test list"), optparse.make_option("--use-apache", action="store_true", default=False, help="Whether to use apache instead of lighttpd."), optparse.make_option("--time-out-ms", help="Set the timeout for each test"), # old-run-webkit-tests calls --randomize-order --random: optparse.make_option("--randomize-order", action="store_true", default=False, help=("Run tests in random order (useful for tracking down corruption)")), optparse.make_option("--run-chunk", help=("Run a specified chunk (n:l), the nth of len l, of the layout tests")), optparse.make_option("--run-part", help=("Run a specified part (n:m), the nth of m parts, of the layout tests")), # old-run-webkit-tests calls --batch-size: --nthly n Restart DumpRenderTree every n tests (default: 1000) optparse.make_option("--batch-size", help=("Run a the tests in batches (n), after every n tests, DumpRenderTree is relaunched.")), # old-run-webkit-tests calls --run-singly: -1|--singly Isolate each test case run (implies --nthly 1 --verbose) optparse.make_option("--run-singly", action="store_true", default=False, help="run a separate DumpRenderTree for each test"), optparse.make_option("--child-processes", help="Number of DumpRenderTrees to run in parallel."), # FIXME: Display default. optparse.make_option("--experimental-fully-parallel", action="store_true", default=False, help="run all tests in parallel"), # FIXME: Need --exit-after-n-failures N Exit after the first N failures instead of running all tests # FIXME: consider: --iterations n Number of times to run the set of tests (e.g. ABCABCABC) ] misc_options = [ optparse.make_option("--lint-test-files", action="store_true", default=False, help="Makes sure the test files parse for all configurations. Does not run any tests."), ] # FIXME: Move these into json_results_generator.py results_json_options = [ optparse.make_option("--builder-name", default="DUMMY_BUILDER_NAME", help=("The name of the builder shown on the waterfall running this script e.g. WebKit.")), optparse.make_option("--build-name", default="DUMMY_BUILD_NAME", help=("The name of the builder used in its path, e.g. webkit-rel.")), optparse.make_option("--build-number", default="DUMMY_BUILD_NUMBER", help=("The build number of the builder running this script.")), ] option_list = configuration_options + logging_options + chromium_options + results_options + test_options + misc_options + results_json_options option_parser = optparse.OptionParser(option_list=option_list) return option_parser.parse_args(args) | 9ba715cbbe2db6c1784f8f23f93d63ed616e9784 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/9ba715cbbe2db6c1784f8f23f93d63ed616e9784/run_webkit_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1968,
12,
1968,
33,
7036,
4672,
3536,
17727,
279,
805,
444,
434,
1296,
980,
833,
18,
225,
2860,
279,
3193,
434,
702,
16,
833,
628,
2153,
2670,
8395,
225,
468,
9852,
30,
4826,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1968,
12,
1968,
33,
7036,
4672,
3536,
17727,
279,
805,
444,
434,
1296,
980,
833,
18,
225,
2860,
279,
3193,
434,
702,
16,
833,
628,
2153,
2670,
8395,
225,
468,
9852,
30,
4826,... |
if len(md5s[f]) == 1: continue | duplicates=md5s[f] if len(duplicates) == 1: continue | def check(self, pkg): | 0342a22c778580f12cff4b2d58c4ef7213f13755 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10341/0342a22c778580f12cff4b2d58c4ef7213f13755/DuplicatesCheck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
3475,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
16,
3475,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),viewFile) | fn = os.path.join(os.path.abspath(os.path.dirname(__file__)), viewFile) | def ViewFile(self, viewTitle, viewFile, encoding=None): fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),viewFile) if encoding: import codecs try: textFile = codecs.open(fn, 'r') except IOError: tkMessageBox.showerror(title='File Load Error', message='Unable to load file '+ `fileName`+' .') return else: data = textFile.read() else: data = None textView.TextViewer(self, viewTitle, fn, data=data) | 73453757718f13af156356dabdd0dea7ccc396ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/73453757718f13af156356dabdd0dea7ccc396ba/aboutDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4441,
812,
12,
2890,
16,
1476,
4247,
16,
1476,
812,
16,
2688,
33,
7036,
4672,
2295,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
5113,
803,
12,
538,
18,
803,
18,
12287,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4441,
812,
12,
2890,
16,
1476,
4247,
16,
1476,
812,
16,
2688,
33,
7036,
4672,
2295,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
5113,
803,
12,
538,
18,
803,
18,
12287,
12,
... |
match_list = filter(lambda s: re.search(string, s), open(filename).read().splitlines()) | match_list = [(lineno, line) for lineno, line in enumerate(open(filename).read().splitlines(True)) if re.search(string, line)] | sage: 'divisors' in _search_src_or_doc('src', '^ *def prime', interact=False) | da758fd6e2806c153c3c54e8f34d6748d4878772 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/da758fd6e2806c153c3c54e8f34d6748d4878772/sagedoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
272,
410,
30,
296,
2892,
291,
1383,
11,
316,
389,
3072,
67,
4816,
67,
280,
67,
2434,
2668,
4816,
2187,
10731,
380,
536,
17014,
2187,
16592,
33,
8381,
13,
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,
272,
410,
30,
296,
2892,
291,
1383,
11,
316,
389,
3072,
67,
4816,
67,
280,
67,
2434,
2668,
4816,
2187,
10731,
380,
536,
17014,
2187,
16592,
33,
8381,
13,
2,
-100,
-100,
-100,
-100,
-100,
-10... |
res.update({'subject': str(context.get('subject', case.name) or '')}) | res.update({'subject': ustr(context.get('subject', case.name) or '')}) | def default_get(self, cr, uid, fields, context=None): """ This function gets default values """ if not context: context = {} | 3e195a7ceebfff3a4c72b23f842f60522549e126 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3e195a7ceebfff3a4c72b23f842f60522549e126/crm_send_email.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1466,
16,
819,
33,
7036,
4672,
3536,
1220,
445,
5571,
805,
924,
3536,
309,
486,
819,
30,
819,
273,
2618,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1466,
16,
819,
33,
7036,
4672,
3536,
1220,
445,
5571,
805,
924,
3536,
309,
486,
819,
30,
819,
273,
2618,
2,
-100,
-100,
-100,
-100,
-1... |
''' Render this item, which is a query, as a search form. ''' | """ Render this item, which is a query, as a search form. """ | def renderQueryForm(self): ''' Render this item, which is a query, as a search form. ''' # create a new request and override the specified args req = HTMLRequest(self._client) req.classname = self._klass.get(self._nodeid, 'klass') name = self._klass.get(self._nodeid, 'name') req.updateFromURL(self._klass.get(self._nodeid, 'url') + '&@queryname=%s'%urllib.quote(name)) | 16a3ebf380b95607b344181655488d818a27791f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1906/16a3ebf380b95607b344181655488d818a27791f/templating.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
1138,
1204,
12,
2890,
4672,
3536,
6987,
333,
761,
16,
1492,
353,
279,
843,
16,
487,
279,
1623,
646,
18,
3536,
468,
752,
279,
394,
590,
471,
3849,
326,
1269,
833,
1111,
273,
3982,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
1138,
1204,
12,
2890,
4672,
3536,
6987,
333,
761,
16,
1492,
353,
279,
843,
16,
487,
279,
1623,
646,
18,
3536,
468,
752,
279,
394,
590,
471,
3849,
326,
1269,
833,
1111,
273,
3982,... |
msg = self.errors[number] if args != None: msg = msg % args except KeyError: msg = self.errors[4002] % number print msg | dtd = etree.DTD(open(self.dtd, 'r')) except IOError: warnings.warn('DTD file %s not found.' % (self.dtd), UserWarning) return root = etree.XML(dom.toxml()) if not dtd.validate(root): self.handle_dtd_errors(dtd) def handle_dtd_errors(self, dtd): for err in dtd.error_log: err_str = 'ERROR: %s\n' % (str(err),) sys.stderr.write(err_str) sys.stderr.flush() | def report_error(self, number, args=None): self.errors = xmlproc.errors.english try: msg = self.errors[number] if args != None: msg = msg % args except KeyError: msg = self.errors[4002] % number # Unknown err msg :-) print msg sys.exit(-1) | 0358e60e5eeb0513fd8b2ff43913f28c50a09327 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6195/0358e60e5eeb0513fd8b2ff43913f28c50a09327/xenapi_create.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2605,
67,
1636,
12,
2890,
16,
1300,
16,
833,
33,
7036,
4672,
365,
18,
4324,
273,
2025,
9381,
18,
4324,
18,
275,
13740,
775,
30,
1234,
273,
365,
18,
4324,
63,
2696,
65,
309,
833,
480,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2605,
67,
1636,
12,
2890,
16,
1300,
16,
833,
33,
7036,
4672,
365,
18,
4324,
273,
2025,
9381,
18,
4324,
18,
275,
13740,
775,
30,
1234,
273,
365,
18,
4324,
63,
2696,
65,
309,
833,
480,... |
data = pyqtProperty(Preprocessor_continuize, | data = _pyqtProperty(Preprocessor_continuize, | def setContinuizer(self, continuizer): if isinstance(continuizer, Preprocessor_removeDiscrete): self.contInd = 3 #Ignore all discrete elif isinstance(continuizer,Preprocessor_continuize): self.contInd = self.TREATMENT_TO_IND.get(continuizer.multinomialTreatment, 3) | e07f8cc72f7b3b07eca503cffe3f1edeef0a5948 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6366/e07f8cc72f7b3b07eca503cffe3f1edeef0a5948/OWPreprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
660,
6860,
1824,
12,
2890,
16,
9985,
1824,
4672,
309,
1549,
12,
1213,
6860,
1824,
16,
2962,
8700,
67,
4479,
1669,
6883,
4672,
365,
18,
1213,
3866,
273,
890,
468,
3777,
777,
20035,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
660,
6860,
1824,
12,
2890,
16,
9985,
1824,
4672,
309,
1549,
12,
1213,
6860,
1824,
16,
2962,
8700,
67,
4479,
1669,
6883,
4672,
365,
18,
1213,
3866,
273,
890,
468,
3777,
777,
20035,
... |
From %(email)s %(datestr)s | From %(email)s %(fromdate)s | def url_quote(s): return urllib.quote(s) | 487ff8820286c48a67835b22e19b74d7a5eb0ec2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/487ff8820286c48a67835b22e19b74d7a5eb0ec2/HyperArch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
880,
67,
6889,
12,
87,
4672,
327,
11527,
18,
6889,
12,
87,
13,
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,
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,
880,
67,
6889,
12,
87,
4672,
327,
11527,
18,
6889,
12,
87,
13,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
product_id = data['id'] offer_id=[] pool = pooler.get_pool(cr.dbname) camp_pro_item_ids = pool.get('dm.campaign.proposition.item').search(cr, uid, [('product_id', '=', product_id)]) for item_id in camp_pro_item_ids: item = pool.get('dm.campaign.proposition.item').browse(cr, uid, item_id) if item.offer_step_id and item.offer_step_id.offer_id: offer_id.append(item.offer_step_id.offer_id.id) | cr.execute("""select distinct offer_id from dm_offer_step where id in (select distinct offer_step_id from dm_campaign_proposition_item where product_id =%s and offer_step_id is not null)""", (str(data['id']),) ) | def product_offers(self, cr, uid, data, context): product_id = data['id'] offer_id=[] pool = pooler.get_pool(cr.dbname) camp_pro_item_ids = pool.get('dm.campaign.proposition.item').search(cr, uid, [('product_id', '=', product_id)]) for item_id in camp_pro_item_ids: item = pool.get('dm.campaign.proposition.item').browse(cr, uid, item_id) if item.offer_step_id and item.offer_step_id.offer_id: offer_id.append(item.offer_step_id.offer_id.id) value = { 'domain': [('id', '=', offer_id)], 'name': 'Offers', 'view_type': 'form', 'view_mode': 'tree,form', 'res_model': 'dm.offer', 'context': { }, 'type': 'ir.actions.act_window' } return value | 57194dd1a5759c2e34a457b47329b0d9031d3ef3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/57194dd1a5759c2e34a457b47329b0d9031d3ef3/dm_all_offer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
3674,
414,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
4422,
18,
8837,
2932,
3660,
4025,
10217,
10067,
67,
350,
628,
9113,
67,
23322,
67,
4119,
1625,
612,
316,
261,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3674,
414,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
4422,
18,
8837,
2932,
3660,
4025,
10217,
10067,
67,
350,
628,
9113,
67,
23322,
67,
4119,
1625,
612,
316,
261,... |
self.failUnlessEqual(list(self.g.heuristic_walk(self.A, Heuristic())), [self.B, self.C, self.A, self.B, self.C]) self.failUnlessEqual(list(self.g.heuristic_walk("A", Heuristic())), [self.B, self.C, self.A, self.B, self.C]) self.failUnlessEqual(list(self.g.heuristic_walk(self.A, Heuristic(), reverse=True)), [self.B, self.C, self.A, self.B, self.C].reverse()) self.failUnlessEqual(list(self.g.heuristic_walk("A", Heuristic(), reverse=True)), [self.B, self.C, self.A, self.B, self.C].reverse()) self.failUnlessEqual(list(self.g.heuristic_walk(Node("A"), Heuristic(), reverse=True)), [self.B, self.C, self.A, self.B, self.C].reverse()) | correct_cycle = [self.B, self.C, self.A, self.B, self.C] reverse_cycle = copy.copy(correct_cycle) reverse_cycle.reverse() self.failUnlessEqual(list(self.g.heuristic_walk(self.A, Heuristic())), correct_cycle) self.failUnlessEqual(list(self.g.heuristic_walk("A", Heuristic())), correct_cycle) self.failUnlessEqual(list(self.g.heuristic_walk(self.A, Heuristic(), reverse=True)), reverse_cycle) self.failUnlessEqual(list(self.g.heuristic_walk("A", Heuristic(), reverse=True)), reverse_cycle) self.failUnlessEqual(list(self.g.heuristic_walk(Node("A"), Heuristic(), reverse=True)), reverse_cycle) | def __call__(self, candidates): if self.iterations < self.iter_max: if candidates: self.iterations += 1 return candidates.pop() return None | 01788495565a6fee9033a0d5503bf09f01ab35a7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3401/01788495565a6fee9033a0d5503bf09f01ab35a7/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
7965,
4672,
309,
365,
18,
19330,
411,
365,
18,
2165,
67,
1896,
30,
309,
7965,
30,
365,
18,
19330,
1011,
404,
327,
7965,
18,
5120,
1435,
327,
599,
2,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1991,
972,
12,
2890,
16,
7965,
4672,
309,
365,
18,
19330,
411,
365,
18,
2165,
67,
1896,
30,
309,
7965,
30,
365,
18,
19330,
1011,
404,
327,
7965,
18,
5120,
1435,
327,
599,
2,
-1... |
for key in 'hostname', 'boot_state', 'model', 'node_id': assert unicmp(node[key], locals()[key]) | for key in node_fields: assert unicmp(node[key], node_fields[key]) | def unicmp(a, b, encoding = "utf-8"): """ When connected directly to the DB, values are returned as raw 8-bit strings that may need to be decoded (as UTF-8 by default) in order to compare them against expected Python Unicode strings. """ is8bit = re.compile("[\x80-\xff]").search if isinstance(a, str) and is8bit(a): a = unicode(a, encoding) if isinstance(b, str) and is8bit(b): b = unicode(b, encoding) return a == b | f51dbe12c30f8473b083ea86b3dade41e56f4615 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7598/f51dbe12c30f8473b083ea86b3dade41e56f4615/Test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
335,
1291,
12,
69,
16,
324,
16,
2688,
273,
315,
3158,
17,
28,
6,
4672,
3536,
5203,
5840,
5122,
358,
326,
2383,
16,
924,
854,
2106,
487,
1831,
1725,
17,
3682,
2064,
716,
2026,
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,
640,
335,
1291,
12,
69,
16,
324,
16,
2688,
273,
315,
3158,
17,
28,
6,
4672,
3536,
5203,
5840,
5122,
358,
326,
2383,
16,
924,
854,
2106,
487,
1831,
1725,
17,
3682,
2064,
716,
2026,
16... |
return "test_failed" else: doCopyLog("Tests successful", workingDir, logPath, log) | failed = True return failed def doTests(hardhatScript, mode, workingDir, outputDir, buildVersion, log): print "Testing " + mode log.write(separator) log.write("Testing " + mode + " ...\n") cmd = [pythonProgram, './tools/rt.py', '-Ti', '-m %s' % mode] tests = [ 'u', 'r', 'f' ] if perfMode: tests += [ 'p' ] for test in tests: if runTest(workingDir, log, cmd, test): return "test-failed" doCopyLog("Tests successful", workingDir, logPath, log) | def doTests(hardhatScript, mode, workingDir, outputDir, buildVersion, log): testDir = os.path.join(workingDir, "chandler") logfile = os.path.join(testDir, 'test_profile', 'chandler.log') if os.path.isfile(logfile): os.remove(logfile) os.chdir(testDir) try: print "Testing " + mode log.write(separator) log.write("Testing " + mode + " ...\n") log.write("Logging to %s\n" % logfile) cmd = [pythonProgram, './tools/rt.py', '-Ti', '-urf', '-m %s' % mode] if perfMode: cmd += ['-p'] log.write("cmd: %s\n" % ' '.join(cmd)) outputList = hardhatutil.executeCommandReturnOutput(cmd) log.write("command output:\n") hardhatutil.dumpOutputList(outputList, log) dumpTestLogs(log, logfile) except hardhatutil.ExternalCommandErrorWithOutputList, e: print "tests failed", e.exitCode log.write("***Error during tests***\n") log.write("Test log:\n") hardhatutil.dumpOutputList(e.outputList, log) dumpTestLogs(log, logfile) if e.exitCode == 0: err = '' else: err = '***Error ' log.write("%sexit code=%s\n" % (err, e.exitCode)) log.write("NOTE: If the tests themselves passed but the exit code\n") log.write(" reports failure, it means a shutdown problem.\n") forceBuildNextCycle(log, workingDir) return "test_failed" except Exception, e: print "a testing error", e log.write("***Internal Error during test run: %s\n" % str(e)) doCopyLog("log [" + logPath + "]", workingDir, logPath, log) forceBuildNextCycle(log, workingDir) return "test_failed" else: doCopyLog("Tests successful", workingDir, logPath, log) return "success" # end of doTests( ) | 72bdd10ca28042e5269156e012f2aa6053c5c9d0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/72bdd10ca28042e5269156e012f2aa6053c5c9d0/newchandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
14650,
12,
20379,
11304,
3651,
16,
1965,
16,
5960,
1621,
16,
21412,
16,
1361,
1444,
16,
613,
4672,
1842,
1621,
273,
1140,
18,
803,
18,
5701,
12,
20478,
1621,
16,
315,
343,
464,
74... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
14650,
12,
20379,
11304,
3651,
16,
1965,
16,
5960,
1621,
16,
21412,
16,
1361,
1444,
16,
613,
4672,
1842,
1621,
273,
1140,
18,
803,
18,
5701,
12,
20478,
1621,
16,
315,
343,
464,
74... |
with support.check_warnings(): | with warnings.catch_warnings(): warnings.simplefilter('ignore', BytesWarning) | def test_unquoting(self): # Make sure unquoting of all ASCII values works escape_list = [] for num in range(128): given = hexescape(chr(num)) expect = chr(num) result = urllib.parse.unquote(given) self.assertEqual(expect, result, "using unquote(): %r != %r" % (expect, result)) result = urllib.parse.unquote_plus(given) self.assertEqual(expect, result, "using unquote_plus(): %r != %r" % (expect, result)) escape_list.append(given) escape_string = ''.join(escape_list) del escape_list result = urllib.parse.unquote(escape_string) self.assertEqual(result.count('%'), 1, "using unquote(): not all characters escaped: " "%s" % result) self.assertRaises((TypeError, AttributeError), urllib.parse.unquote, None) self.assertRaises((TypeError, AttributeError), urllib.parse.unquote, ()) with support.check_warnings(): self.assertRaises((TypeError, AttributeError), urllib.parse.unquote, b'') | 181034d7a35a5501def69c51508040cba3708731 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/181034d7a35a5501def69c51508040cba3708731/test_urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
318,
9270,
310,
12,
2890,
4672,
468,
4344,
3071,
640,
9270,
310,
434,
777,
11768,
924,
6330,
4114,
67,
1098,
273,
5378,
364,
818,
316,
1048,
12,
10392,
4672,
864,
273,
3827,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
318,
9270,
310,
12,
2890,
4672,
468,
4344,
3071,
640,
9270,
310,
434,
777,
11768,
924,
6330,
4114,
67,
1098,
273,
5378,
364,
818,
316,
1048,
12,
10392,
4672,
864,
273,
3827,
... |
def query( self, taskId, jobRange='all', queryType='node', runningAttrs=None ): | def query( self, taskId, jobRange='all', queryType='node', runningAttrs=None, strict=True ): | def query( self, taskId, jobRange='all', queryType='node', runningAttrs=None ): """ query status and eventually other scheduler related information - taskId can be both a Task object or the task id - jobRange can be of the form: 'a,b:c,d,e' ['a',b','c'] 'all' - query type can be 'parent' if the status check is meant to be performed via bulk id - all: if False, only jobs with non closed running instances are loaded """ | 94544eb95042e7529e8a7ddf4b42822709aeda0e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/94544eb95042e7529e8a7ddf4b42822709aeda0e/BossLiteAPISched.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
843,
12,
365,
16,
15321,
16,
1719,
2655,
2218,
454,
2187,
843,
559,
2218,
2159,
2187,
3549,
8262,
33,
7036,
16,
5490,
33,
5510,
262,
30,
3536,
843,
1267,
471,
18011,
1308,
8129,
3746,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
843,
12,
365,
16,
15321,
16,
1719,
2655,
2218,
454,
2187,
843,
559,
2218,
2159,
2187,
3549,
8262,
33,
7036,
16,
5490,
33,
5510,
262,
30,
3536,
843,
1267,
471,
18011,
1308,
8129,
3746,
... |
ptype = p.type(include_modifiers = False, include_namespace = True) | ptype = p.type(include_modifiers = False, include_namespace = True, remove_templates = True) qtype = p.type(include_modifiers = False, include_namespace = True) | def builder_function(self, all_classes, dependencies, modifiability_map): text = r'''RETURN_TYPE operator()(<CONST>CLASS_NAME& x) | 0dea07dc66f23d0208483a2e70df382c197c7d9c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1522/0dea07dc66f23d0208483a2e70df382c197c7d9c/mcrl2_classes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2089,
67,
915,
12,
2890,
16,
777,
67,
4701,
16,
5030,
16,
681,
704,
2967,
67,
1458,
4672,
977,
273,
436,
26418,
14033,
67,
2399,
3726,
1435,
12,
32,
26411,
34,
5237,
67,
1985,
10,
61... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2089,
67,
915,
12,
2890,
16,
777,
67,
4701,
16,
5030,
16,
681,
704,
2967,
67,
1458,
4672,
977,
273,
436,
26418,
14033,
67,
2399,
3726,
1435,
12,
32,
26411,
34,
5237,
67,
1985,
10,
61... |
'roundup_user_2=deleted; Max-Age=0; expires=%s; Path=%s;'%(now, self.cookie_path) | '%s=deleted; Max-Age=0; expires=%s; Path=%s;'%(self.cookie_name, now, self.cookie_path) | def logout_action(self): ''' Make us really anonymous - nuke the cookie too ''' # log us out self.make_user_anonymous() | 4d4a6e6ca055528d188bbc7f645ade423a905185 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/4d4a6e6ca055528d188bbc7f645ade423a905185/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12735,
67,
1128,
12,
2890,
4672,
9163,
4344,
584,
8654,
13236,
300,
9244,
4491,
326,
3878,
4885,
9163,
468,
613,
584,
596,
365,
18,
6540,
67,
1355,
67,
19070,
1435,
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,
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,
12735,
67,
1128,
12,
2890,
4672,
9163,
4344,
584,
8654,
13236,
300,
9244,
4491,
326,
3878,
4885,
9163,
468,
613,
584,
596,
365,
18,
6540,
67,
1355,
67,
19070,
1435,
2,
-100,
-100,
-100,
... |
for node in p_nodes: node.add_parent(node) | for node in p_nodes: self.add_parent(node) | def __init__(self,dag,job,cp, opts, coinc, sngl_node_dict, p_nodes=[]): self.ifo_list = ["H1","L1","V1"] #self.already_added_ifo_list = [] | cbd6ac162cb6bf2eb4ad5ce9c3d03753b881f67f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/cbd6ac162cb6bf2eb4ad5ce9c3d03753b881f67f/stfu_pipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
30204,
16,
4688,
16,
4057,
16,
1500,
16,
13170,
71,
16,
272,
3368,
80,
67,
2159,
67,
1576,
16,
293,
67,
4690,
33,
8526,
4672,
365,
18,
20299,
67,
1098,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
30204,
16,
4688,
16,
4057,
16,
1500,
16,
13170,
71,
16,
272,
3368,
80,
67,
2159,
67,
1576,
16,
293,
67,
4690,
33,
8526,
4672,
365,
18,
20299,
67,
1098,... |
log.warn("Session %s is not longer on relay %s, statistics are probably lost" % (session_id, relay_ip)) | log.warn("Session %s is no longer on relay %s, statistics are probably lost" % (session_id, relay_ip)) | def _cb_purge_sessions(self, result, relay_ip): relay_sessions = cjson.decode(result) relay_call_ids = [session["call_id"] for session in relay_sessions] for session_id, session in self.sessions.items(): if session.relay_ip == relay_ip and session_id not in relay_call_ids: log.warn("Session %s is not longer on relay %s, statistics are probably lost" % (session_id, relay_ip)) del self.sessions[session_id] | 4b1120ce3f4c4f1b066361310a6e9895a3ddc3f3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3445/4b1120ce3f4c4f1b066361310a6e9895a3ddc3f3/dispatcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7358,
67,
26422,
67,
16794,
12,
2890,
16,
563,
16,
18874,
67,
625,
4672,
18874,
67,
16794,
273,
276,
1977,
18,
3922,
12,
2088,
13,
18874,
67,
1991,
67,
2232,
273,
306,
3184,
9614,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7358,
67,
26422,
67,
16794,
12,
2890,
16,
563,
16,
18874,
67,
625,
4672,
18874,
67,
16794,
273,
276,
1977,
18,
3922,
12,
2088,
13,
18874,
67,
1991,
67,
2232,
273,
306,
3184,
9614,... |
kwargs['b'] = br | kwargs['b'] = br.name | def add(cls, repo, name, path, url=None, branch=None, no_checkout=False): """Add a new submodule to the given repository. This will alter the index as well as the .gitmodules file, but will not create a new commit. If the submodule already exists, no matter if the configuration differs from the one provided, the existing submodule will be returned. :param repo: Repository instance which should receive the submodule :param name: The name/identifier for the submodule :param path: repository-relative or absolute path at which the submodule should be located It will be created as required during the repository initialization. :param url: git-clone compatible URL, see git-clone reference for more information If None, the repository is assumed to exist, and the url of the first remote is taken instead. This is useful if you want to make an existing repository a submodule of anotherone. :param branch: branch at which the submodule should (later) be checked out. The given branch must exist in the remote repository, and will be checked out locally as a tracking branch. It will only be written into the configuration if it not None, which is when the checked out branch will be the one the remote HEAD pointed to. The result you get in these situation is somewhat fuzzy, and it is recommended to specify at least 'master' here :param no_checkout: if True, and if the repository has to be cloned manually, no checkout will be performed :return: The newly created submodule instance :note: works atomically, such that no change will be done if the repository update fails for instance""" if repo.bare: raise InvalidGitRepositoryError("Cannot add submodules to bare repositories") # END handle bare repos path = to_native_path_linux(path) if path.endswith('/'): path = path[:-1] # END handle trailing slash # assure we never put backslashes into the url, as some operating systems # like it ... if url != None: url = to_native_path_linux(url) #END assure url correctness # INSTANTIATE INTERMEDIATE SM sm = cls(repo, cls.NULL_BIN_SHA, cls.k_default_mode, path, name) if sm.exists(): # reretrieve submodule from tree try: return repo.head.commit.tree[path] except KeyError: # could only be in index index = repo.index entry = index.entries[index.entry_key(path, 0)] sm.binsha = entry.binsha return sm # END handle exceptions # END handle existing br = git.Head.to_full_path(str(branch) or cls.k_head_default) has_module = sm.module_exists() branch_is_default = branch is None if has_module and url is not None: if url not in [r.url for r in sm.module().remotes]: raise ValueError("Specified URL '%s' does not match any remote url of the repository at '%s'" % (url, sm.abspath)) # END check url # END verify urls match mrepo = None if url is None: if not has_module: raise ValueError("A URL was not given and existing repository did not exsit at %s" % path) # END check url mrepo = sm.module() urls = [r.url for r in mrepo.remotes] if not urls: raise ValueError("Didn't find any remote url in repository at %s" % sm.abspath) # END verify we have url url = urls[0] else: # clone new repo kwargs = {'n' : no_checkout} if not branch_is_default: kwargs['b'] = br # END setup checkout-branch mrepo = git.Repo.clone_from(url, path, **kwargs) # END verify url # update configuration and index index = sm.repo.index writer = sm.config_writer(index=index, write=False) writer.set_value('url', url) writer.set_value('path', path) sm._url = url if not branch_is_default: # store full path writer.set_value(cls.k_head_option, br) sm._branch_path = br # END handle path del(writer) # we deliberatly assume that our head matches our index ! pcommit = repo.head.commit sm._parent_commit = pcommit sm.binsha = mrepo.head.commit.binsha index.add([sm], write=True) return sm | 96d003cb2baabd73f2aa0fd9486c13c61415106e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13767/96d003cb2baabd73f2aa0fd9486c13c61415106e/base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
12,
6429,
16,
3538,
16,
508,
16,
589,
16,
880,
33,
7036,
16,
3803,
33,
7036,
16,
1158,
67,
17300,
33,
8381,
4672,
3536,
986,
279,
394,
27314,
358,
326,
864,
3352,
18,
1220,
903,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
12,
6429,
16,
3538,
16,
508,
16,
589,
16,
880,
33,
7036,
16,
3803,
33,
7036,
16,
1158,
67,
17300,
33,
8381,
4672,
3536,
986,
279,
394,
27314,
358,
326,
864,
3352,
18,
1220,
903,... |
def storbinary(self, cmd, fp, blocksize): | def storbinary(self, cmd, fp, blocksize=8192): | def storbinary(self, cmd, fp, blocksize): '''Store a file in binary mode.''' self.voidcmd('TYPE I') conn = self.transfercmd(cmd) while 1: buf = fp.read(blocksize) if not buf: break conn.send(buf) conn.close() return self.voidresp() | ec97fe3bda95a19d6b5087f246477173da4b2d37 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/ec97fe3bda95a19d6b5087f246477173da4b2d37/ftplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19705,
8578,
12,
2890,
16,
1797,
16,
4253,
16,
18440,
33,
28,
15561,
4672,
9163,
2257,
279,
585,
316,
3112,
1965,
1093,
6309,
365,
18,
6459,
4172,
2668,
2399,
467,
6134,
1487,
273,
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,
19705,
8578,
12,
2890,
16,
1797,
16,
4253,
16,
18440,
33,
28,
15561,
4672,
9163,
2257,
279,
585,
316,
3112,
1965,
1093,
6309,
365,
18,
6459,
4172,
2668,
2399,
467,
6134,
1487,
273,
365,
... |
return '%s %d: at %s noNextTo ' % (self.element, id(self), self.sizeStr(False)) | return '%s %d: at %s %d noNextTo ' % (self.element, id(self), self.sizeStr(False), self.level) | def __str__(self): """printable string with tile data""" if self.nextTo is None: return '%s %d: at %s noNextTo ' % (self.element, id(self), self.sizeStr(False)) else: return '%s %d: at %s x=%d y=%d z=%d %s %d (%s) ' % \ (self.element, id(self), self.sizeStr(False), self.xoffset, self.yoffset, self.level, self.nextTo.element, id(self.nextTo), self.nextTo.sizeStr(False)) | 7b224c7daa06c9fecc655bccd2dc116a8deab304 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1679/7b224c7daa06c9fecc655bccd2dc116a8deab304/board.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
3536,
1188,
429,
533,
598,
4769,
501,
8395,
309,
365,
18,
4285,
774,
353,
599,
30,
327,
1995,
87,
738,
72,
30,
622,
738,
87,
738,
72,
1158,
2134,
774,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
701,
972,
12,
2890,
4672,
3536,
1188,
429,
533,
598,
4769,
501,
8395,
309,
365,
18,
4285,
774,
353,
599,
30,
327,
1995,
87,
738,
72,
30,
622,
738,
87,
738,
72,
1158,
2134,
774,... |
file.Write(" EXPECT_EQ(%s::kCmdId, cmd.header.command);\n" % func.name) | file.Write(" EXPECT_EQ(%s::kCmdId ^ cmd.header.command);\n" % func.name) | def WriteImmediateFormatTest(self, func, file): """Overrriden from TypeHandler.""" file.Write("TEST(GLES2FormatTest, %s) {\n" % func.name) file.Write(" int8 buf[256] = { 0, };\n") file.Write(" %s& cmd = *static_cast<%s*>(static_cast<void*>(&buf));\n" % (func.name, func.name)) file.Write(" static const char* const test_str = \"test string\";\n") file.Write(" void* next_cmd = cmd.Set(\n") file.Write(" &cmd") all_but_last_arg = func.GetCmdArgs()[:-1] value = 11 for arg in all_but_last_arg: file.Write(",\n static_cast<%s>(%d)" % (arg.type, value)) value += 1 file.Write(",\n test_str);\n") value = 11 file.Write(" EXPECT_EQ(%s::kCmdId, cmd.header.command);\n" % func.name) file.Write(" EXPECT_EQ(sizeof(cmd) + // NOLINT\n") file.Write(" RoundSizeToMultipleOfEntries(strlen(test_str)),\n") file.Write(" cmd.header.size * 4);\n") for arg in all_but_last_arg: file.Write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" % (arg.type, value, arg.name)) value += 1 file.Write(" // TODO(gman): check that string got copied.\n") file.Write("}\n") file.Write("\n") | d294ef3a7f91afdc1e5f9f570da7b8ef4b5bd8b7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/d294ef3a7f91afdc1e5f9f570da7b8ef4b5bd8b7/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
22651,
1630,
4709,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
2932,
16961,
12,
43,
11386,
22,
1630,
4709,
16,
738,
87,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
22651,
1630,
4709,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
2932,
16961,
12,
43,
11386,
22,
1630,
4709,
16,
738,
87,
13,
... |
FlagsField("flags", 49, 6, "AHLKMR"), | FlagsField("flags", "KHA", 6, "RMKLHA"), | def i2repr(self, pkt, x): return "%d sec" % (4*x) | fabfbc997ca82b7cce3df31169b7872ed4490cee /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7311/fabfbc997ca82b7cce3df31169b7872ed4490cee/inet6.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
277,
22,
12715,
12,
2890,
16,
11536,
16,
619,
4672,
327,
2213,
72,
1428,
6,
738,
261,
24,
14,
92,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
277,
22,
12715,
12,
2890,
16,
11536,
16,
619,
4672,
327,
2213,
72,
1428,
6,
738,
261,
24,
14,
92,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
True returns dict keyed by node labels. | True returns dict keyed by vertex labels. | def cores(self, with_labels=False): """ Returns the core number for each vertex in an ordered list. 'K-cores in graph theory were introduced by Seidman in 1983 and by Bollobas in 1984 as a method of (destructively) simplifying graph topology to aid in analysis and visualization. They have been more recently defined as the following by Batagelj et al: given a graph G with vertices set V and edges set E, the k-core is computed by pruning all the vertices (with their respective edges) with degree less than k. That means that if a vertex u has degree d_u, and it has n neighbors with degree less than k, then the degree of u becomes d_u - n, and it will be also pruned if k > d_u - n. This operation can be useful to filter or to study some properties of the graphs. For instance, when you compute the 2-core of graph G, you are cutting all the vertices which are in a tree part of graph. (A tree is a graph with no loops),' [1]. INPUT: -- with_labels - default False returns list as described above. True returns dict keyed by node labels. REFERENCE: [1] K-core. Wikipedia. (2007). [Online] Available: http://en.wikipedia.org/wiki/K-core [2] Boris Pittel, Joel Spencer and Nicholas Wormald. Sudden Emergence of a Giant k-Core in a Random Graph. (1996). J. Combinatorial Theory. Ser B 67. pages 111-151. [Online] Available: http://cs.nyu.edu/cs/faculty/spencer/papers/k-core.pdf EXAMPLES: sage: (graphs.FruchtGraph()).cores() [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3] sage: (graphs.FruchtGraph()).cores(with_labels=True) {0: 3, 1: 3, 2: 3, 3: 3, 4: 3, 5: 3, 6: 3, 7: 3, 8: 3, 9: 3, 10: 3, 11: 3} """ import networkx.cores return networkx.cores.find_cores(self._nxg, with_labels) | e18c70bce8ce7ee3fa2314ee3c87879177e3b7a1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/e18c70bce8ce7ee3fa2314ee3c87879177e3b7a1/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15355,
12,
2890,
16,
598,
67,
5336,
33,
8381,
4672,
3536,
2860,
326,
2922,
1300,
364,
1517,
5253,
316,
392,
5901,
666,
18,
225,
296,
47,
17,
12906,
316,
2667,
326,
630,
4591,
26339,
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,
15355,
12,
2890,
16,
598,
67,
5336,
33,
8381,
4672,
3536,
2860,
326,
2922,
1300,
364,
1517,
5253,
316,
392,
5901,
666,
18,
225,
296,
47,
17,
12906,
316,
2667,
326,
630,
4591,
26339,
63... |
sfx = error_url and ", details at %s." % error_url or "." result.append("Problem with page retrieval" + sfx) | result.append("Problem with page retrieval.") if error_url: result.append("Details at %s." % error_url) | def validateKeywords(self): """ see interface """ text = self.request.get('text') ts = getToolByName(self.context, 'translation_service') transforms = getUtility(IPortalTransformsTool) portal = getToolByName(self.context, 'portal_url').getPortalObject() isExternal = queryAdapter(portal, ISEOConfigletSchema).external_keywords_test # extract keywords from text enc = getSiteEncoding(self.context) if text.lower().strip(): keywords = filter(None, map(lambda x: safe_unicode(x.strip(), enc), text.lower().strip().split('\n'))) else: return ts.utranslate(domain='quintagroup.seoptimizer', msgid=_(u'Keywords list is empty!'), context=self.context) # Get html page internally or with external request error_url = "" if isExternal: # Not pass timeout option because: # 1. its value get from the global default timeout settings. # 2. timeout option added in python 2.6 (so acceptable only in plone4+) try: try: resp = urllib2.urlopen(self.context.absolute_url()) html = resp.read() finally: if 'resp' in locals().keys(): resp.close() except (urllib2.URLError, urllib2.HTTPError), e: # In case of exceed timeout period or other URL connection errors. info = sys.exc_info() elog = getToolByName(self.context, "error_log") if elog: error_url = elog.raising(info) html = None else: html = unicode(self.context()).encode(enc) | 49f90d8091b9cba0fbdc4e129a33bc75e769021a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10421/49f90d8091b9cba0fbdc4e129a33bc75e769021a/keywords.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
14149,
12,
2890,
4672,
3536,
2621,
1560,
3536,
977,
273,
365,
18,
2293,
18,
588,
2668,
955,
6134,
3742,
273,
336,
6364,
5911,
12,
2890,
18,
2472,
16,
296,
10173,
67,
3278,
6134,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
14149,
12,
2890,
4672,
3536,
2621,
1560,
3536,
977,
273,
365,
18,
2293,
18,
588,
2668,
955,
6134,
3742,
273,
336,
6364,
5911,
12,
2890,
18,
2472,
16,
296,
10173,
67,
3278,
6134,
... |
result = self.initExecution() | result = self.initializeOptimizer() | def execute(self): """ The main agent execution method """ | 9099e5e6e72f36782deab8f2194b57177fde46da /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/9099e5e6e72f36782deab8f2194b57177fde46da/OptimizerModule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
3536,
1021,
2774,
4040,
4588,
707,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
3536,
1021,
2774,
4040,
4588,
707,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
compile_switch = '/compile_only ' | compile_switch = '/compile_only' | def get_flags_linker_so(self): if sys.platform[:5]=='linux': return ['-shared'] return ['-shared','-Wl,-expect_unresolved,*'] | 112824ccfdfab97d98f7939b2d31119d6acb4240 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/112824ccfdfab97d98f7939b2d31119d6acb4240/compaqfcompiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7133,
67,
1232,
264,
67,
2048,
12,
2890,
4672,
309,
2589,
18,
9898,
10531,
25,
65,
18920,
20132,
4278,
327,
10228,
17,
11574,
3546,
327,
10228,
17,
11574,
17023,
17,
59,
80,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7133,
67,
1232,
264,
67,
2048,
12,
2890,
4672,
309,
2589,
18,
9898,
10531,
25,
65,
18920,
20132,
4278,
327,
10228,
17,
11574,
3546,
327,
10228,
17,
11574,
17023,
17,
59,
80,
1... |
mtype = mimetypes.guess_type(file)[0] | mtype = mimetypes.guess_type(filename)[0] | def open_local_file(self, req): import email.utils import mimetypes host = req.get_host() file = req.get_selector() localfile = url2pathname(file) try: stats = os.stat(localfile) size = stats.st_size modified = email.utils.formatdate(stats.st_mtime, usegmt=True) mtype = mimetypes.guess_type(file)[0] headers = mimetools.Message(StringIO( 'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' % (mtype or 'text/plain', size, modified))) if host: host, port = splitport(host) if not host or \ (not port and socket.gethostbyname(host) in self.get_names()): return addinfourl(open(localfile, 'rb'), headers, 'file://'+ host + file) except OSError, msg: # urllib2 users shouldn't expect OSErrors coming from urlopen() raise URLError(msg) raise URLError('file not on local host') | e839aba012a41f8a8de4f50f5b7ee8e99f3ef459 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/e839aba012a41f8a8de4f50f5b7ee8e99f3ef459/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
3729,
67,
768,
12,
2890,
16,
1111,
4672,
1930,
2699,
18,
5471,
1930,
20369,
15180,
1479,
273,
1111,
18,
588,
67,
2564,
1435,
585,
273,
1111,
18,
588,
67,
9663,
1435,
1191,
76... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
3729,
67,
768,
12,
2890,
16,
1111,
4672,
1930,
2699,
18,
5471,
1930,
20369,
15180,
1479,
273,
1111,
18,
588,
67,
2564,
1435,
585,
273,
1111,
18,
588,
67,
9663,
1435,
1191,
76... |
if pdflatex: | if engine == "pdflatex" or engine == "xelatex": | def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't convert the dvi file to png (because of postscript specials or other issues), then dvips is called, and the PS file is converted to a png file. INPUT: - ``filename`` - string: file to process, including full path - ``debug`` - bool (optional, default False): whether to print verbose debugging output - ``density`` - integer (optional, default 150): how big output image is. - ``pdflatex`` - bool (optional, default False): whether to use pdflatex. - ``png`` - bool (optional, default False): whether to produce a png file. - ``do_in_background`` - bool (optional, default False): whether to run in the background. OUTPUT: string, which could be a string starting with 'Error' (if there was a problem), or it could be 'pdf' or 'dvi'. If ``pdflatex`` is False, then a dvi file is created, but if there appear to be problems with it (because of PS special commands, for example), then a pdf file is created instead. The function returns 'dvi' or 'pdf' to indicate which type of file is created. (Detecting problems requires that dvipng be installed; if it is not, then the dvi file is not checked for problems and 'dvi' is returned.) If ``pdflatex`` is True and there are no errors, then 'pdf' is returned. .. warning:: If ``png`` is True, then when using latex (the default), you must have 'dvipng' (or 'dvips' and 'convert') installed on your operating system, or this command won't work. When using pdflatex, you must have 'convert' installed. EXAMPLES:: sage: from sage.misc.latex import _run_latex_, _latex_file_ sage: file = os.path.join(SAGE_TMP, "temp.tex") sage: O = open(file, 'w') sage: O.write(_latex_file_([ZZ[x], RR])); O.close() sage: _run_latex_(file) # random - depends on whether latex is installed 'dvi' """ if pdflatex is None: pdflatex = _Latex_prefs._option["pdflatex"] if not pdflatex and not have_latex(): print "Error: LaTeX does not seem to be installed. Download it from" print "ctan.org and try again." return "Error" if pdflatex and not have_pdflatex(): print "Error: PDFLaTeX does not seem to be installed. Download it from" print "ctan.org and try again." return "Error" # if png output + latex, check to see if dvipng or convert is installed. if png: if not pdflatex and not (have_dvipng() or have_convert()): print "" print "Error: neither dvipng nor convert (from the ImageMagick suite)" print "appear to be installed. Displaying LaTeX or PDFLaTeX output" print "requires at least one of these programs, so please install" print "and try again." print "" print "Go to http://sourceforge.net/projects/dvipng/ and" print "http://www.imagemagick.org to download these programs." return "Error" # if png output + pdflatex, check to see if convert is installed. elif pdflatex and not have_convert(): print "" print "Error: convert (from the ImageMagick suite) does not" print "appear to be installed. Displaying PDFLaTeX output" print "requires this program, so please install and try again." print "" print "Go to http://www.imagemagick.org to download it." return "Error" # check_validity: check to see if the dvi file is okay by trying # to convert to a png file. if this fails, return_suffix will be # set to "pdf". return_suffix is the return value for this # function. # # thus if not png output, check validity of dvi output if dvipng # or convert is installed. else: check_validity = have_dvipng() # set up filenames, other strings: base, filename = os.path.split(filename) filename = os.path.splitext(filename)[0] # get rid of extension if len(filename.split()) > 1: raise ValueError, "filename must contain no spaces" if not debug: redirect=' 2>/dev/null 1>/dev/null ' else: redirect='' if do_in_background: background = ' &' else: background = '' if pdflatex: command = "pdflatex" # 'suffix' is used in the string 'convert' ... suffix = "pdf" return_suffix = "pdf" else: command = "latex" suffix = "ps" return_suffix = "dvi" # Define the commands to be used: lt = 'cd "%s"&& sage-native-execute %s \\\\nonstopmode \\\\input{%s.tex} %s'%(base, command, filename, redirect) # dvipng is run with the 'picky' option: this means that if # there are warnings, no png file is created. dvipng = 'cd "%s"&& sage-native-execute dvipng --picky -q -T tight -D %s %s.dvi -o %s.png'%(base, density, filename, filename) dvips = 'sage-native-execute dvips %s.dvi %s'%(filename, redirect) ps2pdf = 'sage-native-execute ps2pdf %s.ps %s'%(filename, redirect) # We seem to need a larger size when using convert compared to # when using dvipng: density = int(1.4 * density / 1.3) convert = 'sage-native-execute convert -density %sx%s -trim %s.%s %s.png %s '%\ (density,density, filename, suffix, filename, redirect) e = 1 # it is possible to get through the following commands # without running a program, so in that case we force error if pdflatex: if png: cmd = ' && '.join([lt, convert]) else: cmd = lt if debug: print cmd e = os.system(cmd + ' ' + redirect + background) else: # latex, not pdflatex if (png or check_validity): if have_dvipng(): cmd = ' && '.join([lt, dvipng]) if debug: print cmd e = os.system(cmd + ' ' + redirect) dvipng_error = not os.path.exists(base + '/' + filename + '.png') # If there is no png file, then either the latex # process failed or dvipng failed. Assume that dvipng # failed, and try running dvips and convert. (If the # latex process failed, then dvips and convert will # fail also, so we'll still catch the error.) if dvipng_error: if png: if have_convert(): cmd = ' && '.join(['cd "%s"'%(base,), dvips, convert]) if debug: print "'dvipng' failed; trying 'convert' instead..." print cmd e = os.system(cmd + ' ' + redirect + background) else: print "Error: 'dvipng' failed and 'convert' is not installed." return "Error: dvipng failed." else: # not png, i.e., check_validity return_suffix = "pdf" cmd = ' && '.join(['cd "%s"'%(base,), dvips, ps2pdf]) if debug: print "bad dvi file; running dvips and ps2pdf instead..." print cmd e = os.system(cmd) if e: # error running dvips and/or ps2pdf command = "pdflatex" lt = 'cd "%s"&& sage-native-execute %s \\\\nonstopmode \\\\input{%s.tex} %s'%(base, command, filename, redirect) if debug: print "error running dvips and ps2pdf; trying pdflatex instead..." print cmd e = os.system(cmd + background) else: # don't have dvipng, so must have convert. run latex, dvips, convert. cmd = ' && '.join([lt, dvips, convert]) if debug: print cmd e = os.system(cmd + ' ' + redirect + background) if e: print "An error occurred." try: print open(base + '/' + filename + '.log').read() except IOError: pass return "Error latexing slide." return return_suffix | cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2681,
67,
26264,
67,
12,
3459,
16,
1198,
33,
8381,
16,
12142,
33,
23014,
16,
8169,
26264,
33,
7036,
16,
14476,
33,
8381,
16,
741,
67,
267,
67,
9342,
33,
8381,
4672,
3536,
1220,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2681,
67,
26264,
67,
12,
3459,
16,
1198,
33,
8381,
16,
12142,
33,
23014,
16,
8169,
26264,
33,
7036,
16,
14476,
33,
8381,
16,
741,
67,
267,
67,
9342,
33,
8381,
4672,
3536,
1220,
... |
del os | fp = None try: fp = open(TESTFN, 'w+') except IOError: TMP_TESTFN = os.path.join('/tmp', TESTFN) try: fp = open(TMP_TESTFN, 'w+') TESTFN = TMP_TESTFN del TMP_TESTFN except IOError: print ('WARNING: tests will fail, unable to write to: %s or %s' % (TESTFN, TMP_TESTFN)) if fp is not None: fp.close() try: os.unlink(TESTFN) except: pass del os, fp | def fcmp(x, y): # fuzzy comparison function if type(x) == type(0.0) or type(y) == type(0.0): try: x, y = coerce(x, y) fuzz = (abs(x) + abs(y)) * FUZZ if abs(x-y) <= fuzz: return 0 except: pass elif type(x) == type(y) and type(x) in (type(()), type([])): for i in range(min(len(x), len(y))): outcome = fcmp(x[i], y[i]) if outcome != 0: return outcome return cmp(len(x), len(y)) return cmp(x, y) | 694380056fd39811c6f792665efb6d779d20e5e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/694380056fd39811c6f792665efb6d779d20e5e2/test_support.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8036,
1291,
12,
92,
16,
677,
4672,
468,
21315,
5826,
445,
309,
618,
12,
92,
13,
422,
618,
12,
20,
18,
20,
13,
578,
618,
12,
93,
13,
422,
618,
12,
20,
18,
20,
4672,
775,
30,
619,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8036,
1291,
12,
92,
16,
677,
4672,
468,
21315,
5826,
445,
309,
618,
12,
92,
13,
422,
618,
12,
20,
18,
20,
13,
578,
618,
12,
93,
13,
422,
618,
12,
20,
18,
20,
4672,
775,
30,
619,
... |
"""Create a new user. This should be implemented by subclasses to do the actual adding of a user. The 'password' will be the original input password, unencrypted. The implementation of this method is responsible for performing any needed encryption.""" | """ Create a new user. This should be implemented by subclasses to do the actual adding of a user. The 'password' will be the original input password, unencrypted. The implementation of this method is responsible for performing any needed encryption. """ prefix = GRUFFolder.GRUFGroups._group_prefix if name.startswith(prefix): self._doAddGroup(name, roles, groups, **kw) | def _doAddUser(self, name, password, roles, domains, groups = (), **kw): """Create a new user. This should be implemented by subclasses to do the actual adding of a user. The 'password' will be the original input password, unencrypted. The implementation of this method is responsible for performing any needed encryption.""" | bfb32202a037f56a2eff15e0d6ca120ea872cf22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/bfb32202a037f56a2eff15e0d6ca120ea872cf22/GroupUserFolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
986,
1299,
12,
2890,
16,
508,
16,
2201,
16,
4900,
16,
10128,
16,
3252,
273,
1832,
16,
2826,
9987,
4672,
3536,
1684,
279,
394,
729,
18,
1220,
1410,
506,
8249,
635,
15320,
358... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
986,
1299,
12,
2890,
16,
508,
16,
2201,
16,
4900,
16,
10128,
16,
3252,
273,
1832,
16,
2826,
9987,
4672,
3536,
1684,
279,
394,
729,
18,
1220,
1410,
506,
8249,
635,
15320,
358... |
self.dbus_status = 0 print "can't connect to dbus :/" | self.error() | def createView(self): self.guiUpdates = 1 self.stan = "" try: #DBusGMainLoop(set_as_default=True) #bus = dbus.SystemBus() pr_device_obj = self.dbus.get_object( "org.freesmartphone.opreferencesd", "/org/freesmartphone/Preferences" ) self.pr_iface = dbus.Interface(pr_device_obj, "org.freesmartphone.Preferences" ) self.stan = self.pr_iface.GetProfile() self.dbus_status = 1 except: self.dbus_status = 0 print "can't connect to dbus :/" | 9c3cb95486879f5c9a72c2e03af50842b2b8bdfa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11428/9c3cb95486879f5c9a72c2e03af50842b2b8bdfa/shr_profile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15193,
12,
2890,
4672,
365,
18,
20292,
5121,
273,
404,
365,
18,
541,
273,
1408,
225,
775,
30,
468,
2290,
407,
43,
6376,
6452,
12,
542,
67,
345,
67,
1886,
33,
5510,
13,
468,
9274,
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,
15193,
12,
2890,
4672,
365,
18,
20292,
5121,
273,
404,
365,
18,
541,
273,
1408,
225,
775,
30,
468,
2290,
407,
43,
6376,
6452,
12,
542,
67,
345,
67,
1886,
33,
5510,
13,
468,
9274,
273... |
input_api, output_api, sources)) | input_api, output_api, text_files)) | def _CommonChecks(input_api, output_api): results = [] # What does this code do? # It loads the default black list (e.g. third_party, experimental, etc) and # add our black list (breakpad, skia and v8 are still not following # google style and are not really living this repository). # See presubmit_support.py InputApi.FilterSourceFile for the (simple) usage. black_list = input_api.DEFAULT_BLACK_LIST + EXCLUDED_PATHS sources = lambda x: input_api.FilterSourceFile(x, black_list=black_list) results.extend(input_api.canned_checks.CheckLongLines( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoTabs( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckChangeHasBugField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasTestField( input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( input_api, output_api, sources)) results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( input_api, output_api)) results.extend(input_api.canned_checks.CheckLicense( input_api, output_api, _LICENSE_HEADER, sources)) return results | 379e7dd8c93fc59287a73bf801b134e459c2b10b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/379e7dd8c93fc59287a73bf801b134e459c2b10b/PRESUBMIT.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6517,
4081,
12,
2630,
67,
2425,
16,
876,
67,
2425,
4672,
1686,
273,
5378,
468,
18734,
1552,
333,
981,
741,
35,
468,
2597,
6277,
326,
805,
7721,
666,
261,
73,
18,
75,
18,
12126,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6517,
4081,
12,
2630,
67,
2425,
16,
876,
67,
2425,
4672,
1686,
273,
5378,
468,
18734,
1552,
333,
981,
741,
35,
468,
2597,
6277,
326,
805,
7721,
666,
261,
73,
18,
75,
18,
12126,
... |
if BZ_VERSION >= 2180: sql = """SELECT DISTINCT c.name AS name, c.initialowner AS owner FROM components AS c, products AS p WHERE c.product_id = p.id AND""" sql += makeWhereClause('p.name', PRODUCTS) else: sql = "SELECT value AS name, initialowner AS owner FROM components" | if BZ_VERSION >= 2180: sql = """SELECT DISTINCT c.name AS name, c.initialowner AS owner FROM components AS c, products AS p WHERE c.product_id = p.id AND""" sql += makeWhereClause('p.name', PRODUCTS) else: sql = "SELECT value AS name, initialowner AS owner FROM components" | def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla print "Using Bugzilla v%s schema." % BZ_VERSION if BZ_VERSION == 2110: activityFields['removed'] = "oldvalue" activityFields['added'] = "newvalue" # init Bugzilla environment print "Bugzilla MySQL('%s':'%s':'%s':'%s'): connecting..." % \ (_db, _host, _user, ("*" * len(_password))) mysql_con = MySQLdb.connect(host=_host, user=_user, passwd=_password, db=_db, compress=1, cursorclass=MySQLdb.cursors.DictCursor) mysql_cur = mysql_con.cursor() # init Trac environment print "Trac SQLite('%s'): connecting..." % (_env) trac = TracDatabase(_env) # force mode... if _force == 1: print "\nCleaning all tickets..." c = trac.db().cursor() c.execute("DELETE FROM ticket_change") trac.db().commit() c.execute("DELETE FROM ticket") trac.db().commit() c.execute("DELETE FROM attachment") attachments_dir = os.path.join(os.path.normpath(trac.env.path), "attachments") # Straight from the Python documentation. for root, dirs, files in os.walk(attachments_dir, topdown=False): for name in files: os.remove(os.path.join(root, name)) for name in dirs: os.rmdir(os.path.join(root, name)) if not os.stat(attachments_dir): os.mkdir(attachments_dir) trac.db().commit() print "All tickets cleaned..." print "\n0. Filtering products..." mysql_cur.execute("SELECT name FROM products") products = [] for line in mysql_cur.fetchall(): product = line['name'] if PRODUCTS and product not in PRODUCTS: continue if product in IGNORE_PRODUCTS: continue products.append(product) PRODUCTS[:] = products print " Using products", " ".join(PRODUCTS) print "\n1. Import severities..." trac.setSeverityList(SEVERITIES) print "\n2. Import components..." if not COMPONENTS_FROM_PRODUCTS: if BZ_VERSION >= 2180: sql = """SELECT DISTINCT c.name AS name, c.initialowner AS owner FROM components AS c, products AS p WHERE c.product_id = p.id AND""" sql += makeWhereClause('p.name', PRODUCTS) else: sql = "SELECT value AS name, initialowner AS owner FROM components" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) components = mysql_cur.fetchall() for component in components: component['owner'] = trac.getLoginName(mysql_cur, component['owner']) trac.setComponentList(components, 'name') else: sql = """SELECT program AS product, value AS comp, initialowner AS owner FROM components""" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) lines = mysql_cur.fetchall() all_components = {} # product -> components all_owners = {} # product, component -> owner for line in lines: product = line['product'] comp = line['comp'] owner = line['owner'] all_components.setdefault(product, []).append(comp) all_owners[(product, comp)] = owner component_list = [] for product, components in all_components.items(): # find best default owner default = None for comp in DEFAULT_COMPONENTS: if comp in components: default = comp break if default is None: default = components[0] owner = all_owners[(product, default)] owner_name = trac.getLoginName(mysql_cur, owner) component_list.append({'product': product, 'owner': owner_name}) trac.setComponentList(component_list, 'product') print "\n3. Import priorities..." trac.setPriorityList(PRIORITIES) print "\n4. Import versions..." if BZ_VERSION >= 2180: sql = """SELECT DISTINCTROW versions.value AS value FROM products, versions""" sql += " WHERE" + makeWhereClause('products.name', PRODUCTS) else: sql = "SELECT DISTINCTROW value FROM versions" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) versions = mysql_cur.fetchall() trac.setVersionList(versions, 'value') print "\n5. Import milestones..." sql = "SELECT DISTINCT value FROM milestones" sql += " WHERE" + makeWhereClause('value', IGNORE_MILESTONES, negative=True) mysql_cur.execute(sql) milestones = mysql_cur.fetchall() trac.setMilestoneList(milestones, 'value') print "\n6. Retrieving bugs..." sql = """SELECT DISTINCT b.*, c.name AS component, p.name AS product FROM bugs AS b, components AS c, products AS p """ sql += " WHERE (" + makeWhereClause('p.name', PRODUCTS) sql += ") AND b.product_id = p.id" sql += " AND b.component_id = c.id" sql += " ORDER BY b.bug_id" mysql_cur.execute(sql) bugs = mysql_cur.fetchall() print "\n7. Import bugs and bug activity..." for bug in bugs: bugid = bug['bug_id'] ticket = {} keywords = [] ticket['id'] = bugid ticket['time'] = bug['creation_ts'] ticket['changetime'] = bug['delta_ts'] if COMPONENTS_FROM_PRODUCTS: ticket['component'] = bug['product'] else: ticket['component'] = bug['component'] ticket['severity'] = bug['bug_severity'] ticket['priority'] = bug['priority'].lower() ticket['owner'] = trac.getLoginName(mysql_cur, bug['assigned_to']) ticket['reporter'] = trac.getLoginName(mysql_cur, bug['reporter']) mysql_cur.execute("SELECT * FROM cc WHERE bug_id = %s", bugid) cc_records = mysql_cur.fetchall() cc_list = [] for cc in cc_records: cc_list.append(trac.getLoginName(mysql_cur, cc['who'])) cc_list = [cc for cc in cc_list if '@' in cc and cc not in IGNORE_CC] ticket['cc'] = string.join(cc_list, ', ') ticket['version'] = bug['version'] target_milestone = bug['target_milestone'] if target_milestone in IGNORE_MILESTONES: target_milestone = '' ticket['milestone'] = target_milestone bug_status = bug['bug_status'].lower() ticket['status'] = statusXlator[bug_status] ticket['resolution'] = bug['resolution'].lower() # a bit of extra work to do open tickets if bug_status == 'open': if owner != '': ticket['status'] = 'assigned' else: ticket['status'] = 'new' ticket['summary'] = bug['short_desc'] mysql_cur.execute("SELECT * FROM longdescs WHERE bug_id = %s" % bugid) longdescs = list(mysql_cur.fetchall()) # check for empty 'longdescs[0]' field... if len(longdescs) == 0: ticket['description'] = '' else: ticket['description'] = longdescs[0]['thetext'] del longdescs[0] for desc in longdescs: ignore = False for comment in IGNORE_COMMENTS: if re.match(comment, desc['thetext']): ignore = True if ignore: continue trac.addTicketComment(ticket=bugid, time = desc['bug_when'], author=trac.getLoginName(mysql_cur, desc['who']), value = desc['thetext']) mysql_cur.execute("""SELECT * FROM bugs_activity WHERE bug_id = %s ORDER BY bug_when""" % bugid) bugs_activity = mysql_cur.fetchall() resolution = '' ticketChanges = [] keywords = [] for activity in bugs_activity: field_name = trac.getFieldName(mysql_cur, activity['fieldid']).lower() removed = activity[activityFields['removed']] added = activity[activityFields['added']] # statuses and resolutions are in lowercase in trac if field_name == "resolution" or field_name == "bug_status": removed = removed.lower() added = added.lower() # remember most recent resolution, we need this later if field_name == "resolution": resolution = added.lower() add_keywords = [] remove_keywords = [] # convert bugzilla field names... if field_name == "bug_severity": field_name = "severity" elif field_name == "assigned_to": field_name = "owner" elif field_name == "bug_status": field_name = "status" if removed in STATUS_KEYWORDS: remove_keywords.append(STATUS_KEYWORDS[removed]) if added in STATUS_KEYWORDS: add_keywords.append(STATUS_KEYWORDS[added]) added = statusXlator[added] removed = statusXlator[removed] elif field_name == "short_desc": field_name = "summary" elif field_name == "product" and COMPONENTS_FROM_PRODUCTS: field_name = "component" elif ((field_name == "product" and not COMPONENTS_FROM_PRODUCTS) or (field_name == "component" and COMPONENTS_FROM_PRODUCTS)): if MAP_ALL_KEYWORDS or removed in KEYWORDS_MAPPING: kw = KEYWORDS_MAPPING.get(removed, removed) if kw: remove_keywords.append(kw) if MAP_ALL_KEYWORDS or added in KEYWORDS_MAPPING: kw = KEYWORDS_MAPPING.get(added, added) if kw: add_keywords.append(kw) if field_name == "component": # just keep the keyword change added = removed = "" elif field_name == "target_milestone": field_name = "milestone" if added in IGNORE_MILESTONES: added = "" if removed in IGNORE_MILESTONES: removed = "" ticketChange = {} ticketChange['ticket'] = bugid ticketChange['time'] = activity['bug_when'] ticketChange['author'] = trac.getLoginName(mysql_cur, activity['who']) ticketChange['field'] = field_name ticketChange['oldvalue'] = removed ticketChange['newvalue'] = added if add_keywords or remove_keywords: # ensure removed ones are in old old_keywords = keywords + [kw for kw in remove_keywords if kw not in keywords] # remove from new keywords = [kw for kw in keywords if kw not in remove_keywords] # add to new keywords += [kw for kw in add_keywords if kw not in keywords] if old_keywords != keywords: ticketChangeKw = ticketChange.copy() ticketChangeKw['field'] = "keywords" ticketChangeKw['oldvalue'] = ' '.join(old_keywords) ticketChangeKw['newvalue'] = ' '.join(keywords) ticketChanges.append(ticketChangeKw) if field_name in IGNORED_ACTIVITY_FIELDS: continue # Skip changes that have no effect (think translation!). if added == removed: continue # Bugzilla splits large summary changes into two records. for oldChange in ticketChanges: if (field_name == "summary" and oldChange['field'] == ticketChange['field'] and oldChange['time'] == ticketChange['time'] and oldChange['author'] == ticketChange['author']): oldChange['oldvalue'] += " " + ticketChange['oldvalue'] oldChange['newvalue'] += " " + ticketChange['newvalue'] break # cc sometime appear in different activities with same time if (field_name == "cc" \ and oldChange['time'] == ticketChange['time']): oldChange['newvalue'] += ", " + ticketChange['newvalue'] break else: ticketChanges.append (ticketChange) for ticketChange in ticketChanges: trac.addTicketChange (**ticketChange) # For some reason, bugzilla v2.11 seems to clear the resolution # when you mark a bug as closed. Let's remember it and restore # it if the ticket is closed but there's no resolution. if not ticket['resolution'] and ticket['status'] == "closed": ticket['resolution'] = resolution bug_status = bug['bug_status'] if bug_status in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[bug_status] if kw not in keywords: keywords.append(kw) product = bug['product'] if product in KEYWORDS_MAPPING and not COMPONENTS_FROM_PRODUCTS: kw = KEYWORDS_MAPPING.get(product, product) if kw and kw not in keywords: keywords.append(kw) component = bug['component'] if (COMPONENTS_FROM_PRODUCTS and \ (MAP_ALL_KEYWORDS or component in KEYWORDS_MAPPING)): kw = KEYWORDS_MAPPING.get(component, component) if kw and kw not in keywords: keywords.append(kw) ticket['keywords'] = string.join(keywords) ticketid = trac.addTicket(**ticket) mysql_cur.execute("SELECT * FROM attachments WHERE bug_id = %s" % bugid) attachments = mysql_cur.fetchall() for a in attachments: author = trac.getLoginName(mysql_cur, a['submitter_id']) trac.addAttachment(author, a) print "\n8. Importing users and passwords..." if BZ_VERSION >= 2180: mysql_cur.execute("SELECT login_name, cryptpassword FROM profiles") users = mysql_cur.fetchall() htpasswd = file("htpasswd", 'w') for user in users: if LOGIN_MAP.has_key(user['login_name']): login = LOGIN_MAP[user['login_name']] else: login = user['login_name'] htpasswd.write(login + ":" + user['cryptpassword'] + "\n") htpasswd.close() print " Bugzilla users converted to htpasswd format, see 'htpasswd'." print "\nAll tickets converted." | 96cc24322ea11500094f96e7b8dc5b0c7e85d253 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9317/96cc24322ea11500094f96e7b8dc5b0c7e85d253/bugzilla2trac.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
24899,
1966,
16,
389,
2564,
16,
389,
1355,
16,
389,
3664,
16,
389,
3074,
16,
389,
5734,
4672,
5728,
2314,
273,
2286,
12233,
1435,
225,
468,
2236,
364,
12156,
5244,
434,
7934,
15990... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
24899,
1966,
16,
389,
2564,
16,
389,
1355,
16,
389,
3664,
16,
389,
3074,
16,
389,
5734,
4672,
5728,
2314,
273,
2286,
12233,
1435,
225,
468,
2236,
364,
12156,
5244,
434,
7934,
15990... |
if not buffer: time.millisleep(10) else: x = buffer[0] if not x: break del buffer[0] data, t = x vout.writeframe(t, data, None) del data sys.stderr.write('Done writing\n') | x = queue.get() if not x: break data, t = x vout.writeframe(t, data, None) del data sys.stderr.write('Done writing video\n') | def saveframes(vout, buffer): while 1: if not buffer: time.millisleep(10) else: x = buffer[0] if not x: break del buffer[0] data, t = x vout.writeframe(t, data, None) del data sys.stderr.write('Done writing\n') vout.close() | 15728b345d96a6162fd564e1c123ee9961ee23dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/15728b345d96a6162fd564e1c123ee9961ee23dc/Vrec.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
10278,
12,
90,
659,
16,
1613,
4672,
1323,
404,
30,
619,
273,
2389,
18,
588,
1435,
309,
486,
619,
30,
898,
501,
16,
268,
273,
619,
331,
659,
18,
2626,
3789,
12,
88,
16,
501,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
10278,
12,
90,
659,
16,
1613,
4672,
1323,
404,
30,
619,
273,
2389,
18,
588,
1435,
309,
486,
619,
30,
898,
501,
16,
268,
273,
619,
331,
659,
18,
2626,
3789,
12,
88,
16,
501,
1... |
elif os.name == 'nt': startupinfo = subprocess.STARTUPINFO() startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW kwargs["startupinfo"] = startupinfo | def _loop(self): executable = self.get_executable() args = self.get_parameters() self._start_logging(executable, args) if os.path.exists(self.output_path): self._log_progress("Removing existing output file (%s)...\n" % self.output_path) os.remove(self.output_path) | a6fa9d3cf65516e1db1ca13e2d651e12a3f75e1c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/a6fa9d3cf65516e1db1ca13e2d651e12a3f75e1c/videoconversion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6498,
12,
2890,
4672,
9070,
273,
365,
18,
588,
67,
17751,
1435,
833,
273,
365,
18,
588,
67,
3977,
1435,
365,
6315,
1937,
67,
11167,
12,
17751,
16,
833,
13,
225,
309,
1140,
18,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6498,
12,
2890,
4672,
9070,
273,
365,
18,
588,
67,
17751,
1435,
833,
273,
365,
18,
588,
67,
3977,
1435,
365,
6315,
1937,
67,
11167,
12,
17751,
16,
833,
13,
225,
309,
1140,
18,
8... | |
try: advertise_announce(unique_id, myip, DNS_CACHE_TTL) servicelogger.log("[INFO]: Advertised " + str(unique_id) + " which maps to " + myip) except Exception, error: if 'announce error' in str(error): pass else: raise Exception(error) | advertise_success = False while not advertise_success: try: advertise_announce(unique_id, myip, DNS_CACHE_TTL) servicelogger.log("[INFO]: Advertised " + str(unique_id) + " which maps to " + myip) advertise_success = True except Exception, error: if 'announce error' in str(error): advertise_success = True else: advertise_success = False | def advertise_to_DNS(unique_id): """ Advertise unique_id to the zenodotus DNS server. We strip away whatever that follows the NAME_SERVER part of the unique_id. For instance, if our unique_id is abc.NAME_SERVER:1234@xyz, then we only advertise abc.NAME_SERVER. """ # IP that maps to the unique_id myip = emulcomm.getmyip() # Extract the part of unique_id up to the name server, # i.e. xyz.zenodotus.washington.edu, and discard whatever that follows name_server_pos = unique_id.find(NAME_SERVER) if name_server_pos > -1: unique_id = unique_id[0 : name_server_pos + len(NAME_SERVER)] else: raise Exception("Invalid unique_id format: '" + str(unique_id) + "'") try: advertise_announce(unique_id, myip, DNS_CACHE_TTL) servicelogger.log("[INFO]: Advertised " + str(unique_id) + " which maps to " + myip) except Exception, error: if 'announce error' in str(error): # We can confidently drop the exception here. The advertisement service # can sometimes be flaky, yet it can guarantee advertisement of our # key-value pair on at least one of the three components. Thus, we are # printing the error message as a warning here. pass else: raise Exception(error) | 46b33352c8ecef3325c33399ee7d26024e82cd5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7263/46b33352c8ecef3325c33399ee7d26024e82cd5d/nmmain.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31553,
67,
869,
67,
11602,
12,
6270,
67,
350,
4672,
3536,
4052,
25530,
3089,
67,
350,
358,
326,
22759,
369,
352,
407,
8858,
1438,
18,
1660,
2569,
10804,
15098,
716,
13040,
326,
6048,
67,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31553,
67,
869,
67,
11602,
12,
6270,
67,
350,
4672,
3536,
4052,
25530,
3089,
67,
350,
358,
326,
22759,
369,
352,
407,
8858,
1438,
18,
1660,
2569,
10804,
15098,
716,
13040,
326,
6048,
67,... |
version = sys.version[:3] config_dir = os.path.join( sys.exec_prefix, "lib", "python" + version, "config") | def get_makefile_filename(): return os.path.join(sys.exec_prefix, "lib", "python" + sys.version[:3], "config", "Makefile") | def _init_posix(): import os import re import string import sys g = globals() version = sys.version[:3] config_dir = os.path.join( sys.exec_prefix, "lib", "python" + version, "config") # load the installed config.h: define_rx = re.compile("#define ([A-Z][A-Z0-9_]+) (.*)\n") undef_rx = re.compile("/[*] #undef ([A-Z][A-Z0-9_]+) [*]/\n") fp = open(os.path.join(config_dir, "config.h")) while 1: line = fp.readline() if not line: break m = define_rx.match(line) if m: n, v = m.group(1, 2) try: v = string.atoi(v) except ValueError: pass g[n] = v else: m = undef_rx.match(line) if m: g[m.group(1)] = 0 # load the installed Makefile.pre.in: variable_rx = re.compile("([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)\n") done = {} notdone = {} fp = open(os.path.join(config_dir, "Makefile")) while 1: line = fp.readline() if not line: break m = variable_rx.match(line) if m: n, v = m.group(1, 2) v = string.strip(v) if "$" in v: notdone[n] = v else: try: v = string.atoi(v) except ValueError: pass done[n] = v # do variable interpolation here findvar1_rx = re.compile(r"\$\(([A-Za-z][A-Za-z0-9_]*)\)") findvar2_rx = re.compile(r"\${([A-Za-z][A-Za-z0-9_]*)}") while notdone: for name in notdone.keys(): value = notdone[name] m = findvar1_rx.search(value) if not m: m = findvar2_rx.search(value) if m: n = m.group(1) if done.has_key(n): after = value[m.end():] value = value[:m.start()] + done[n] + after if "$" in after: notdone[name] = value else: try: value = string.atoi(value) except ValueError: pass done[name] = string.strip(value) del notdone[name] elif notdone.has_key(n): # get it on a subsequent round pass else: done[n] = "" after = value[m.end():] value = value[:m.start()] + after if "$" in after: notdone[name] = value else: try: value = string.atoi(value) except ValueError: pass done[name] = string.strip(value) del notdone[name] else: # bogus variable reference; just drop it since we can't deal del notdone[name] # save the results in the global dictionary g.update(done) | e9545454036a4d4c7d35ea682dff2265ee555272 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/e9545454036a4d4c7d35ea682dff2265ee555272/sysconfig.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
24463,
13332,
1930,
1140,
1930,
283,
1930,
533,
1930,
2589,
225,
314,
273,
10941,
1435,
225,
1652,
336,
67,
6540,
768,
67,
3459,
13332,
327,
1140,
18,
803,
18,
5701,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
24463,
13332,
1930,
1140,
1930,
283,
1930,
533,
1930,
2589,
225,
314,
273,
10941,
1435,
225,
1652,
336,
67,
6540,
768,
67,
3459,
13332,
327,
1140,
18,
803,
18,
5701,
12,
... |
if release_esema: self.esema.release() self.mutex.release() return item | self.not_empty.release() | def get(self, block=True, timeout=None): """Remove and return an item from the queue. | a3002703c147de35193af30e3a73b4e7695ecc17 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a3002703c147de35193af30e3a73b4e7695ecc17/Queue.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
1203,
33,
5510,
16,
2021,
33,
7036,
4672,
3536,
3288,
471,
327,
392,
761,
628,
326,
2389,
18,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
1203,
33,
5510,
16,
2021,
33,
7036,
4672,
3536,
3288,
471,
327,
392,
761,
628,
326,
2389,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
type = text.text text = text.find('b').text_content() | type = card.find('td/p').text.replace('\n', '') text = html.tostring(card.xpath("//p[@class='ctext']/b")[0]) text = text.replace('<br>', '$') text = html.fromstring(text).text_content() text = re.sub(r'(\w+\s*)\$+(\s*\w+)', r'\1. \2', text) text = text.replace('$', ' ') | def mtg(inp): ".mtg <name> -- gets information about Magic the Gathering card <name>" url = 'http://magiccards.info/query.php?cardname=' url += urllib2.quote(inp, safe='') h = html.parse(url) name = h.find('/body/table/tr/td/table/tr/td/h1') if name is None: return "no cards found" card = name.getparent() text = card.find('p') type = text.text text = text.find('b').text_content() text = re.sub(r'\(.*?\)', '', text) # strip parenthetical explanations text = re.sub(r'\.(\S)', r'. \1', text) # fix spacing printings = card.find('table/tr/td/img').getparent().text_content() printings = re.findall(r'\s*(.+?(?: \([^)]+\))*) \((.*?)\)', ' '.join(printings.split())) printing_out = ', '.join('%s (%s)' % (set_abbrevs.get(x[0], x[0]), rarity_abbrevs.get(x[1], x[1])) for x in printings) name.make_links_absolute() link = name.find('a').attrib['href'] name = name.text_content().strip() type = type.strip() text = ' '.join(text.split()) return ' | '.join((name, type, text, printing_out, link)) | 309bf87202fdaca7c9f661715b29ebd2803bff01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9775/309bf87202fdaca7c9f661715b29ebd2803bff01/mtg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5874,
75,
12,
31647,
4672,
3552,
1010,
75,
411,
529,
34,
1493,
5571,
1779,
2973,
28496,
326,
25868,
310,
5270,
411,
529,
2984,
880,
273,
296,
2505,
2207,
11179,
3327,
87,
18,
1376,
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,
5874,
75,
12,
31647,
4672,
3552,
1010,
75,
411,
529,
34,
1493,
5571,
1779,
2973,
28496,
326,
25868,
310,
5270,
411,
529,
2984,
880,
273,
296,
2505,
2207,
11179,
3327,
87,
18,
1376,
19,
... |
sage: maxima.example('arrays') | sage: maxima.example('arrays') | def example(self, s): """ EXAMPLES: sage: maxima.example('arrays') #not tested a[n]:=n*a[n-1] a := n a n n - 1 a[0]:1 a[5] 120 a[n]:=n a[6] 6 a[4] 24 done | 327892a197ad345f40545c760b7d91fabbe80a24 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/327892a197ad345f40545c760b7d91fabbe80a24/maxima.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3454,
12,
2890,
16,
272,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
943,
13888,
18,
8236,
2668,
16223,
6134,
225,
468,
902,
18432,
279,
63,
82,
14542,
33,
82,
14,
69,
63,
82,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3454,
12,
2890,
16,
272,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
943,
13888,
18,
8236,
2668,
16223,
6134,
225,
468,
902,
18432,
279,
63,
82,
14542,
33,
82,
14,
69,
63,
82,
1... |
self.assertEqual([(u'', u'---------'), (1, u'tester0')], form.fields['owner'].choices) | self.assertEqual( [ (u'', u'---------'), (user.profile.id, u'tester0'), ], form.fields['owner'].choices) | def test_owner_choices_init(self): """ Tests that owner choices are set based on User permissions Verifies: * superusers have all clusterusers as choices * user receives themselves as a choice if they have perms * user receives all groups they are a member of """ # user with no choices form = NewVirtualMachineForm(user, cluster0) self.assertEqual([(u'', u'---------')], form.fields['owner'].choices) # user with perms on self, no groups user.grant('admin', cluster0) form = NewVirtualMachineForm(user, None) self.assertEqual([(u'', u'---------'), (1, u'tester0')], form.fields['owner'].choices) user.set_perms(['create_vm'], cluster0) form = NewVirtualMachineForm(user, None) self.assertEqual([(u'', u'---------'), (1, u'tester0')], form.fields['owner'].choices) # user with perms on self and groups group.user_set.add(user) group.grant('admin', cluster0) form = NewVirtualMachineForm(user, None) self.assertEqual([(u'', u'---------'), (1, u'testing_group'), (1, u'tester0')], form.fields['owner'].choices) user.revoke_all(cluster0) # user with no perms on self, but groups form = NewVirtualMachineForm(user, None) self.assertEqual([(u'', u'---------'),(1, u'testing_group')], form.fields['owner'].choices) group.set_perms(['create_vm'], cluster0) form = NewVirtualMachineForm(user, None) self.assertEqual([(u'', u'---------'), (1, u'testing_group')], form.fields['owner'].choices) group.revoke_all(cluster0) # superuser user.is_superuser = True user.save() form = NewVirtualMachineForm(user, None) self.assertEqual([(u'', u'---------'), (1, u'tester0'), (2, u'tester1'), (3, u'testing_group')], list(form.fields['owner'].choices)) | c24ff4471dfca799ba7ddabc41abb048929bc8fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10509/c24ff4471dfca799ba7ddabc41abb048929bc8fd/virtual_machine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
8443,
67,
11937,
67,
2738,
12,
2890,
4672,
3536,
7766,
87,
716,
3410,
7246,
854,
444,
2511,
603,
2177,
4371,
225,
6160,
5032,
30,
380,
2240,
5577,
1240,
777,
2855,
5577,
487,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8443,
67,
11937,
67,
2738,
12,
2890,
4672,
3536,
7766,
87,
716,
3410,
7246,
854,
444,
2511,
603,
2177,
4371,
225,
6160,
5032,
30,
380,
2240,
5577,
1240,
777,
2855,
5577,
487,
... |
rs = dbh2.fetch() if not rs: return "<%s nosrc=%r" % (pattern.group(1),file_match.group(2)) con_id=rs['con_id'] | rs = dbh2.cursor.fetchone() if not rs: return "<img nosrc=%r" % file_match.group(2) | def find_url(pattern): """ This function queries the database to find the url of the object mentioned in pattern. It then returns a URL that redirects back to HTMLVisualise to view it. pattern is a match object. """ dbh2= self.DBO(query['case']) url = pattern.group(2) | df6a1c1dbc9e3dc633a08cd5e1a4867e22e276d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5568/df6a1c1dbc9e3dc633a08cd5e1a4867e22e276d7/TCPDumpAnalysis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
718,
12,
4951,
4672,
3536,
1220,
445,
6218,
326,
2063,
358,
1104,
326,
880,
434,
326,
733,
27635,
316,
1936,
18,
2597,
1508,
1135,
279,
1976,
716,
18064,
1473,
358,
3982,
25780... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
718,
12,
4951,
4672,
3536,
1220,
445,
6218,
326,
2063,
358,
1104,
326,
880,
434,
326,
733,
27635,
316,
1936,
18,
2597,
1508,
1135,
279,
1976,
716,
18064,
1473,
358,
3982,
25780... |
self.asciiOutputFile) | self.pointerToLgdef = None | daf96b854c8d984912564e56445bdcf7e49937df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8645/daf96b854c8d984912564e56445bdcf7e49937df/Lithomop3d_setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
365,
18,
10437,
774,
48,
75,
536,
273,
599,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
365,
18,
10437,
774,
48,
75,
536,
273,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
if graph: | if options.graph: | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populate() mydb.close() return if args[0] == 'init': if len(args) > 1: raise CommandException mydb.admin() mydb.create() mydb.connect() mydb.populate() mydb.close() return if args[0] == 'clean': if len(args) > 1: raise CommandException mydb.connect() mydb.clean() return raise CommandException import db, info info.source = db.Database() info.source.host = options.host info.source.db = options.db info.source.passwd = options.passwd info.source.user = options.user info.source.connect() info.source.update_dict(globals()) system = info.source.__dict__[options.system] if type(options.get) is str: info.source.get = options.get if options.runs is None: runs = info.source.allRuns else: rx = re.compile(options.runs) runs = [] for run in info.source.allRuns: if rx.match(run.name): runs.append(run) info.display_run = runs[0].run if command == 'runs': user = None opts, args = getopts(args, '-u') if len(args): raise CommandException for o,a in opts: if o == '-u': user = a info.source.listRuns(user) return if command == 'stats': if len(args) == 0: info.source.listStats() elif len(args) == 1: info.source.listStats(args[0]) else: raise CommandException return if command == 'stat': if len(args) != 1: raise CommandException stats = info.source.getStat(args[0]) for stat in stats: if graph: graphdata(runs, stat.name, stat.name, stat) else: print stat.name printdata(runs, stat) return if command == 'bins': if len(args) == 0: info.source.listBins() elif len(args) == 1: info.source.listBins(args[0]) else: raise CommandException return if command == 'formulas': if len(args) == 0: info.source.listFormulas() elif len(args) == 1: info.source.listFormulas(args[0]) else: raise CommandException return if command == 'samples': if len(args): raise CommandException info.source.listTicks(runs) return if len(args): raise CommandException if command == 'usertime': import copy kernel = copy.copy(system.full_cpu.numCycles) kernel.bins = 'kernel' user = copy.copy(system.full_cpu.numCycles) user.bins = 'user' if graph: graphdata(runs, 'usertime', 'User Fraction', user / system.full_cpu.numCycles) else: printdata(runs, user / system.full_cpu.numCycles) return if command == 'ticks': if binned: print 'kernel ticks' system.full_cpu.numCycles.bins = 'kernel' printdata(runs, system.full_cpu.numCycles) print 'idle ticks' system.full_cpu.numCycles.bins = 'idle' printdata(runs, system.full_cpu.numCycles) print 'user ticks' system.full_cpu.numCycles.bins = 'user' printdata(runs, system.full_cpu.numCycles) print 'total ticks' system.full_cpu.numCycles.bins = None printdata(runs, system.full_cpu.numCycles) return if command == 'packets': packets = system.tsunami.nsgige.rxPackets if graph: graphdata(runs, 'packets', 'Packets', packets) else: printdata(runs, packets) return if command == 'ppt' or command == 'tpp': ppt = system.tsunami.nsgige.rxPackets / sim_ticks printdata(runs, ppt, command == 'tpp') return if command == 'pps': pps = system.tsunami.nsgige.rxPackets / sim_seconds if graph: graphdata(runs, 'pps', 'Packets/s', pps) else: printdata(runs, pps) return if command == 'bpt' or command == 'tpb': bytes = system.tsunami.nsgige.rxBytes + system.tsunami.nsgige.txBytes bpt = bytes / sim_ticks * 8 if graph: graphdata(runs, 'bpt', 'bps / Hz', bpt) else: printdata(runs, bpt, command == 'tpb') return if command == 'bptb' or command == 'tpbb': bytes = system.tsunami.nsgige.rxBytes + system.tsunami.nsgige.txBytes print 'kernel stats' bytes.bins = 'kernel' printdata(runs, bytes / ticks) print 'idle stats' bytes.bins = 'idle' printdata(runs, bytes / ticks) print 'user stats' bytes.bins = 'user' printdata(runs, bytes / ticks) return if command == 'bytes': stat = system.tsunami.nsgige.rxBytes + system.tsunami.nsgige.txBytes if binned: print '%s kernel stats' % stat.name stat.bins = 'kernel' printdata(runs, stat) print '%s idle stats' % stat.name stat.bins = 'idle' printdata(runs, stat) print '%s user stats' % stat.name stat.bins = 'user' printdata(runs, stat) print '%s total stats' % stat.name stat.bins = None printdata(runs, stat) return if command == 'rxbps': gbps = system.tsunami.nsgige.rxBandwidth / 1e9 if graph: graphdata(runs, 'rxbps', 'Bandwidth (Gbps)', gbps) else: printdata(runs, gbps) return if command == 'txbps': gbps = system.tsunami.nsgige.txBandwidth / 1e9 if graph: graphdata(runs, 'txbps', 'Bandwidth (Gbps)', gbps) else: printdata(runs, gbps) return if command == 'bps': rxbps = system.tsunami.nsgige.rxBandwidth txbps = system.tsunami.nsgige.txBandwidth gbps = (rxbps + txbps) / 1e9 if graph: graphdata(runs, 'bps', 'Bandwidth (Gbps)', gbps) else: printdata(runs, gbps) return if command == 'misses': stat = system.L3.overall_mshr_misses if binned: print '%s kernel stats' % stat.name stat.bins = 'kernel' printdata(runs, stat) print '%s idle stats' % stat.name stat.bins = 'idle' printdata(runs, stat) print '%s user stats' % stat.name stat.bins = 'user' printdata(runs, stat) print '%s total stats' % stat.name stat.bins = None if graph: graphdata(runs, 'misses', 'Overall MSHR Misses', stat) else: printdata(runs, stat) return if command == 'mpkb': misses = system.L3.overall_mshr_misses rxbytes = system.tsunami.nsgige.rxBytes txbytes = system.tsunami.nsgige.txBytes if binned: print 'mpkb kernel stats' misses.bins = 'kernel' mpkb = misses / ((rxbytes + txbytes) / 1024) printdata(runs, mpkb) print 'mpkb idle stats' misses.bins = 'idle' mpkb = misses / ((rxbytes + txbytes) / 1024) printdata(runs, mpkb) print 'mpkb user stats' misses.bins = 'user' mpkb = misses / ((rxbytes + txbytes) / 1024) printdata(runs, mpkb) print 'mpkb total stats' mpkb = misses / ((rxbytes + txbytes) / 1024) misses.bins = None if graph: graphdata(runs, 'mpkb', 'Misses / KB', mpkb) else: printdata(runs, mpkb) return if command == 'execute': printdata(runs, system.full_cpu.ISSUE__count) return if command == 'commit': printdata(runs, system.full_cpu.COM__count) return if command == 'fetch': printdata(runs, system.full_cpu.FETCH__count) return if command == 'rxbpp': bpp = system.tsunami.nsgige.rxBytes / system.tsunami.nsgige.rxPackets printdata(run, 8 * bpp) return if command == 'txbpp': bpp = system.tsunami.nsgige.txBytes / system.tsunami.nsgige.txPackets printdata(run, 8 * bpp) return raise CommandException | a40715c98d9a53362cc6c6f7ffdedff4e862ba3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/a40715c98d9a53362cc6c6f7ffdedff4e862ba3b/stats.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4364,
12,
2116,
16,
1296,
16,
833,
4672,
309,
1296,
422,
296,
6231,
4278,
309,
562,
12,
1968,
13,
422,
374,
30,
1002,
3498,
503,
225,
1930,
1319,
2738,
3399,
1966,
273,
1319,
2738,
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,
4364,
12,
2116,
16,
1296,
16,
833,
4672,
309,
1296,
422,
296,
6231,
4278,
309,
562,
12,
1968,
13,
422,
374,
30,
1002,
3498,
503,
225,
1930,
1319,
2738,
3399,
1966,
273,
1319,
2738,
18,... |
"""Container for the properties of an event. | """Container for the properties of an event. | def _cnfmerge(cnfs): """Internal function.""" if type(cnfs) is DictionaryType: return cnfs elif type(cnfs) in (NoneType, StringType): return cnfs else: cnf = {} for c in _flatten(cnfs): try: cnf.update(c) except (AttributeError, TypeError), msg: print "_cnfmerge: fallback due to:", msg for k, v in c.items(): cnf[k] = v return cnf | 0a3f7978c40742672a01f3a5ea537e9f45b8b59f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0a3f7978c40742672a01f3a5ea537e9f45b8b59f/Tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10305,
74,
2702,
12,
10305,
2556,
4672,
3536,
3061,
445,
12123,
309,
618,
12,
10305,
2556,
13,
353,
16447,
559,
30,
327,
6227,
2556,
1327,
618,
12,
10305,
2556,
13,
316,
261,
7036,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10305,
74,
2702,
12,
10305,
2556,
4672,
3536,
3061,
445,
12123,
309,
618,
12,
10305,
2556,
13,
353,
16447,
559,
30,
327,
6227,
2556,
1327,
618,
12,
10305,
2556,
13,
316,
261,
7036,
... |
if length.rfind("-") <> 0 or (length.rfind("-") == 0 and length.rfind("+") > -1): | n = length.find("-") if n <> 0 or (n == 0 and (length.rfind("plus") > -1 or length.rfind("minus") > -1)): | def revert_hspace_glue_lengths(document): " Revert HSpace glue lengths to ERT " i = 0 j = 0 while True: i = find_token(document.body, "\\begin_inset space \hspace{}", i) if i == -1: j = find_token(document.body, "\\begin_inset space \hspace*{}", j) if j == -1: break else: star = True i = j else: star = False o = document.body[i+1].find("\\length") if o == -1: document.warning("Error: Cannot find lenght for \\hspace!") break # search for the beginning of the value via the space k = document.body[i+1].find(" ") length = document.body[i+1][k+1:] # only revert when the length contains a plus or minus l = length.find("+") if l == -1: l = length.find("-") if l == -1: break # handle percent lengths length = latex_length(length) # latex_length returns "bool,length" m = length.find(",") length = length[m+1:] # revert the HSpace inset to ERT # allow leading - if length.rfind("-") <> 0 or (length.rfind("-") == 0 and length.rfind("+") > -1): if star == True: subst = [put_cmd_in_ert("\\hspace*{" + length + "}")] else: subst = [put_cmd_in_ert("\\hspace{" + length + "}")] document.body[i:i+3] = subst i = i + 2 j = i | e09862ec152f4ac43cc3d21e63726a0c5ce0539b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7514/e09862ec152f4ac43cc3d21e63726a0c5ce0539b/lyx_2_0.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15226,
67,
76,
2981,
67,
7043,
344,
67,
14907,
12,
5457,
4672,
315,
868,
1097,
670,
3819,
17960,
10917,
358,
4232,
56,
315,
277,
273,
374,
525,
273,
374,
1323,
1053,
30,
277,
273,
1104... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15226,
67,
76,
2981,
67,
7043,
344,
67,
14907,
12,
5457,
4672,
315,
868,
1097,
670,
3819,
17960,
10917,
358,
4232,
56,
315,
277,
273,
374,
525,
273,
374,
1323,
1053,
30,
277,
273,
1104... |
offset, EXISTS ( SELECT * FROM time_slide AS a WHERE a.time_slide_id == time_slide.time_slide_id AND a.offset != 0 ) | offset | def get_time_slides(connection): """ Query the database for the IDs and offsets of all time slides, and return two dictionaries one containing the all-zero time slides and the other containing the not-all-zero time slides. """ zero_lag_time_slides = {} background_time_slides = {} for id, instrument, offset, is_background in connection.cursor().execute(""" | f3c9333bc17cb8cd050d7f5171410146a69ae0d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/f3c9333bc17cb8cd050d7f5171410146a69ae0d9/SnglBurstUtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
957,
67,
2069,
4369,
12,
4071,
4672,
3536,
2770,
326,
2063,
364,
326,
7115,
471,
8738,
434,
777,
813,
30119,
16,
471,
327,
2795,
16176,
1245,
4191,
326,
777,
17,
7124,
813,
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,
336,
67,
957,
67,
2069,
4369,
12,
4071,
4672,
3536,
2770,
326,
2063,
364,
326,
7115,
471,
8738,
434,
777,
813,
30119,
16,
471,
327,
2795,
16176,
1245,
4191,
326,
777,
17,
7124,
813,
30... |
size, prec= numeric.group (1, 2) | prec, size= numeric.group (1, 2) | def field (self, field): fieldName= self.__fieldName__ (field.name) contents= ["'%s'" % fieldName] try: try: relation= field.get_reference () type= 'RToOne' contents+= ["'%s'" % self.__tableName__ (relation.name)] if field.inverse: # contents+= ["inverse='%s'" % self.__pluralFieldName__ (field.inverse)] contents+= ["inverse='%s'" % self.__fieldName__ (field.inverse)] if field.deleteRule: contents+= ["deleteRule='%s'" % field.deleteRule.upper ()] if field.joinSemantic: if field.joinSemantic=='full': js= 0 elif field.joinSemantic=='outer': js= 1 elif field.joinSemantic=='left': js= 2 elif field.joinSemantic=='right': js= 3 contents+= ["joinSemantic=%d" % js] | a2e9bd7c87de6ca04cf9f335dbf993fae8a94d2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2349/a2e9bd7c87de6ca04cf9f335dbf993fae8a94d2c/Mod.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
652,
261,
2890,
16,
652,
4672,
4289,
33,
365,
16186,
16163,
972,
261,
1518,
18,
529,
13,
2939,
33,
306,
5187,
9,
87,
4970,
738,
4289,
65,
775,
30,
775,
30,
2533,
33,
652,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
652,
261,
2890,
16,
652,
4672,
4289,
33,
365,
16186,
16163,
972,
261,
1518,
18,
529,
13,
2939,
33,
306,
5187,
9,
87,
4970,
738,
4289,
65,
775,
30,
775,
30,
2533,
33,
652,
18,
588,
... |
self.nb.SetSelection(2) | def OnSelChanged(self, event): if self.dying: return | 5a7823f5999fdcaec5b43d18c6a5f299654e5492 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/5a7823f5999fdcaec5b43d18c6a5f299654e5492/Main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
1877,
5033,
12,
2890,
16,
871,
4672,
309,
365,
18,
72,
14946,
30,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
1877,
5033,
12,
2890,
16,
871,
4672,
309,
365,
18,
72,
14946,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
cfg.debugExceptions = True sys.excepthook = util.genExcepthook(debug=cfg.debugExceptions, | if hasattr(cfg, 'debugExceptions'): cfg.debugExceptions = True debug = True sys.excepthook = util.genExcepthook(debug=debug, | def main(self, argv=None, debuggerException=Exception, cfg=None, debugAll=False, **kw): """ Process argv and execute commands as specified. """ if argv is None: argv=sys.argv from conary import versions supportedCommands = self._supportedCommands | cc8db27f147755c6650d8c7d5b9b871a8bb72b34 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8747/cc8db27f147755c6650d8c7d5b9b871a8bb72b34/mainhandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2890,
16,
5261,
33,
7036,
16,
19977,
503,
33,
503,
16,
2776,
33,
7036,
16,
1198,
1595,
33,
8381,
16,
2826,
9987,
4672,
3536,
4389,
5261,
471,
1836,
4364,
487,
1269,
18,
3536,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2890,
16,
5261,
33,
7036,
16,
19977,
503,
33,
503,
16,
2776,
33,
7036,
16,
1198,
1595,
33,
8381,
16,
2826,
9987,
4672,
3536,
4389,
5261,
471,
1836,
4364,
487,
1269,
18,
3536,... |
self.r_e.set_value(r*255) self.g_e.set_value(g*255) self.b_e.set_value(b*255) | r = int(r*255) g = int(g*255) b = int(b*255) self.r_e.set_value(r) self.g_e.set_value(g) self.b_e.set_value(b) | def set_color(self, color): self.color = color r,g,b = color self.r_e.set_value(r*255) self.g_e.set_value(g*255) self.b_e.set_value(b*255) | 08d1cd9a9c045cb7c2bb8137147aff4f45427361 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7129/08d1cd9a9c045cb7c2bb8137147aff4f45427361/colorsamplerwindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
3266,
12,
2890,
16,
2036,
4672,
365,
18,
3266,
273,
2036,
436,
16,
75,
16,
70,
273,
2036,
365,
18,
86,
67,
73,
18,
542,
67,
1132,
12,
86,
14,
10395,
13,
365,
18,
75,
67,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
3266,
12,
2890,
16,
2036,
4672,
365,
18,
3266,
273,
2036,
436,
16,
75,
16,
70,
273,
2036,
365,
18,
86,
67,
73,
18,
542,
67,
1132,
12,
86,
14,
10395,
13,
365,
18,
75,
67,... |
self.extensions.append( | self.extensions.extend(( | def run(self): if not check_dependencies_once(): return # Only install the clustering software if Numpy is installed. # Otherwise, it will not compile. if is_Numpy_installed(): self.extensions.append( Extension('Bio.Cluster.cluster', ['Bio/Cluster/clustermodule.c', 'Bio/Cluster/cluster.c', 'Bio/Cluster/ranlib.c', 'Bio/Cluster/com.c', 'Bio/Cluster/linpack.c'], include_dirs=["Bio/Cluster"] ) ) build_ext.run(self) | a573247d8dab5e2102e9fc6281b9cc72d84ab8cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/a573247d8dab5e2102e9fc6281b9cc72d84ab8cd/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
309,
486,
866,
67,
11037,
67,
8243,
13332,
327,
468,
5098,
3799,
326,
18743,
17888,
309,
6805,
2074,
353,
5876,
18,
468,
5272,
16,
518,
903,
486,
4074,
18,
309,
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,
1086,
12,
2890,
4672,
309,
486,
866,
67,
11037,
67,
8243,
13332,
327,
468,
5098,
3799,
326,
18743,
17888,
309,
6805,
2074,
353,
5876,
18,
468,
5272,
16,
518,
903,
486,
4074,
18,
309,
3... |
div } | def render_list(ids, links): states = load_customlink_states() n = 0 for entry in links: n += 1 try: if type(entry[1]) == type(True): idss = ids + [str(n)] if states.get(''.join(idss), entry[1] and 'on' or 'off') == 'on': # open display = "" img = "link_folder_open.gif" else: display = "display: none; " img = "link_folder.gif" html.write('<h3 onclick="toggle_folder(this, \'%s\');" ' % ''.join(idss)) html.write('onmouseover="this.style.cursor=\'pointer\';" ') html.write('onmouseout="this.style.cursor=\'auto\';">') html.write('<img src="images/%s">' % img) html.write("%s</h3>\n" % entry[0]) html.write('<div style="%s" class=sublist>' % display) render_list(idss, entry[2]) html.write('</div>\n') elif type(entry[1]) == str: if len(entry) > 2: html.write('<img src="images/%s">' % entry[2]) else: html.write('<img src="images/link_link.gif">') simplelink(entry[0], entry[1]) else: html.write("Second part of tuple must be list or string, not %s\n" % str(entry[1])) except Exception, e: html.write("invalid entry %s: %s<br>\n" % (entry, e)) | 483aa73e24c9cd13926fa2177e6b93e1db3e7b7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5589/483aa73e24c9cd13926fa2177e6b93e1db3e7b7e/shipped.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
1098,
12,
2232,
16,
4716,
4672,
5493,
273,
1262,
67,
3662,
1232,
67,
7992,
1435,
290,
273,
374,
364,
1241,
316,
4716,
30,
290,
1011,
404,
775,
30,
309,
618,
12,
4099,
63,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
1098,
12,
2232,
16,
4716,
4672,
5493,
273,
1262,
67,
3662,
1232,
67,
7992,
1435,
290,
273,
374,
364,
1241,
316,
4716,
30,
290,
1011,
404,
775,
30,
309,
618,
12,
4099,
63,
2... | |
def testEcho (self): | def test_echo(self): """Basic test of an SSL client connecting to a server""" | def testEcho (self): | 0dd64f6a0e5850fce167a308c0d887027fbc21ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/0dd64f6a0e5850fce167a308c0d887027fbc21ee/test_ssl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
19704,
261,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
19704,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if installed_version == 'x': | if not installed_version or installed_version == 'x': | def update_list(self, cr, uid, context={}): robj = self.pool.get('ir.module.repository') res = [0, 0] # [update, add] | 00067b2e13b43d10b9524f429f6dfb8defd217aa /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/00067b2e13b43d10b9524f429f6dfb8defd217aa/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1098,
12,
2890,
16,
4422,
16,
4555,
16,
819,
12938,
4672,
721,
441,
273,
365,
18,
6011,
18,
588,
2668,
481,
18,
2978,
18,
9071,
6134,
400,
273,
306,
20,
16,
374,
65,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1098,
12,
2890,
16,
4422,
16,
4555,
16,
819,
12938,
4672,
721,
441,
273,
365,
18,
6011,
18,
588,
2668,
481,
18,
2978,
18,
9071,
6134,
400,
273,
306,
20,
16,
374,
65,
468,
... |
verbose=verbose, timeout=timeout, **kargs) | timeout=timeout, filter=filter, verbose=verbose, **kargs) | def traceroute(target, dport=80, minttl=1, maxttl=30, sport=RandShort(), l4 = None, filter=None, timeout=2, verbose=None, **kargs): """Instant TCP traceroute | a1bcf9e1fa9e38978092674054cc8c552dc1f4c5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7311/a1bcf9e1fa9e38978092674054cc8c552dc1f4c5/scapy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1284,
71,
28463,
12,
3299,
16,
302,
655,
33,
3672,
16,
312,
474,
6172,
33,
21,
16,
943,
12546,
33,
5082,
16,
272,
655,
33,
54,
464,
4897,
9334,
328,
24,
273,
599,
16,
1034,
33,
703... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1284,
71,
28463,
12,
3299,
16,
302,
655,
33,
3672,
16,
312,
474,
6172,
33,
21,
16,
943,
12546,
33,
5082,
16,
272,
655,
33,
54,
464,
4897,
9334,
328,
24,
273,
599,
16,
1034,
33,
703... |
filename = RESULTSDIR + "fo-" + kinit + "-" + kend + "-" + deltak + "-" + time.strftime("%H%M%S") + ".hf5" | filename = RESULTSDIR + "fo-" + str(kinit) + "-" + str(kend) + "-" + str(deltak) + "-" + time.strftime("%H%M%S") + ".hf5" | def runfomodel(kinit, kend, deltak, filename=None, foargs=None): """Execute a FOCanonicalTwoStage model and save results. A new instance of FOCanonicalTwoStage is created, with the specified arguments. The model is run and the results are then saved into a file with the specified filename Parameters ---------- kinit : float Start of sequence of mode numbers to run in model. kend : float End of sequence of mode numbers to run in model. deltak : float Step size in sequence of mode numbers to test. filename : String, optional Name of file to save results to. File will be created in the directory specified by `RESULTSDIR` module variable. foargs : dict, optional Dictonary of arguments to be sent to first order class method. If `foargs` contains a key `k` then these mode numbers will be used instead of the sequence generated by `kinit`, `kend` and `deltak`. Returns ------- filename: String Name of the file where results have been saved. Raises ------ Exception Any exception raised during saving of code. """ if foargs is None: foargs = {} if "k" not in foargs: foargs["k"] = stb.seq(kinit, kend, deltak) if "solver" not in foargs: foargs["solver"] = "rkdriver_withks" model = c.FOCanonicalTwoStage(**foargs) try: harness_logger.debug("Starting model run...") model.run(saveresults=False) harness_logger.debug("Model run finished.") except c.ModelError: harness_logger.exception("Something went wrong with model, quitting!") sys.exit(1) if filename is None: filename = RESULTSDIR + "fo-" + kinit + "-" + kend + "-" + deltak + "-" + time.strftime("%H%M%S") + ".hf5" try: harness_logger.debug("Trying to save model data to %s...", filename) ensureresultspath(filename) model.saveallresults(filename=filename) #Success! harness_logger.info("Successfully ran and saved simulation in file %s.", filename) except Exception: harness_logger.exception("IO error, nothing saved!") #Destroy model instance to save memory harness_logger.debug("Destroying model instance...") del model return filename | 2bb9b2dff6931edf5c042e0856421c583a456cbb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7283/2bb9b2dff6931edf5c042e0856421c583a456cbb/harness.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
74,
362,
1009,
12,
79,
2738,
16,
417,
409,
16,
1464,
88,
581,
16,
1544,
33,
7036,
16,
18261,
1968,
33,
7036,
4672,
3536,
5289,
279,
17634,
15512,
11710,
8755,
938,
471,
1923,
168... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
74,
362,
1009,
12,
79,
2738,
16,
417,
409,
16,
1464,
88,
581,
16,
1544,
33,
7036,
16,
18261,
1968,
33,
7036,
4672,
3536,
5289,
279,
17634,
15512,
11710,
8755,
938,
471,
1923,
168... |
for cur_page in range(1, num_pages): | for cur_page in range(1, num_pages + 1): | def fetch_tracks(user, request_delay=0.5): num_pages = 1 url = 'http://last.fm/user/%s/library/recent' % user soup = BeautifulSoup(urllib2.urlopen(url)) num_pages = int(soup.find('a', 'lastpage').contents[0]) + 1 all_data = [] for cur_page in range(1, num_pages): data = parse_page(url + '?page=' + str(cur_page)) all_data += data if cur_page < num_pages: time.sleep(request_delay) return all_data | 6f083c051a1ea3d256a4127363600a88f83ab4a3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6447/6f083c051a1ea3d256a4127363600a88f83ab4a3/lastscrape.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
67,
21499,
12,
1355,
16,
590,
67,
10790,
33,
20,
18,
25,
4672,
818,
67,
7267,
273,
404,
880,
273,
296,
2505,
2207,
2722,
18,
25089,
19,
1355,
5258,
87,
19,
12083,
19,
20872,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
67,
21499,
12,
1355,
16,
590,
67,
10790,
33,
20,
18,
25,
4672,
818,
67,
7267,
273,
404,
880,
273,
296,
2505,
2207,
2722,
18,
25089,
19,
1355,
5258,
87,
19,
12083,
19,
20872,
11... |
total_game = GameData() | game = GameData() | def dump(self, indent): if self.count <= 0: print "%sGame Count: %d" % (header, self.count) return | 95d2d5b715b75d6f5156777ed28f66c0020ab877 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/600/95d2d5b715b75d6f5156777ed28f66c0020ab877/process.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
12,
2890,
16,
3504,
4672,
309,
365,
18,
1883,
1648,
374,
30,
1172,
2213,
87,
12496,
6974,
30,
738,
72,
6,
738,
261,
3374,
16,
365,
18,
1883,
13,
327,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4657,
12,
2890,
16,
3504,
4672,
309,
365,
18,
1883,
1648,
374,
30,
1172,
2213,
87,
12496,
6974,
30,
738,
72,
6,
738,
261,
3374,
16,
365,
18,
1883,
13,
327,
2,
-100,
-100,
-100,
-100,... |
sage: n._easy_vector() | sage: n._easy_vector() | def _easy_vector(self): """ Return a very sparse vector v such that v times the eigenvector matrix has all entries nonzero. | a60f75ff0c4edf5421d2ad1e96bff0ae914ad58b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/a60f75ff0c4edf5421d2ad1e96bff0ae914ad58b/numerical.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
73,
15762,
67,
7737,
12,
2890,
4672,
3536,
2000,
279,
8572,
9387,
3806,
331,
4123,
716,
331,
4124,
326,
11043,
3074,
1229,
3148,
711,
777,
3222,
16966,
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,
389,
73,
15762,
67,
7737,
12,
2890,
4672,
3536,
2000,
279,
8572,
9387,
3806,
331,
4123,
716,
331,
4124,
326,
11043,
3074,
1229,
3148,
711,
777,
3222,
16966,
18,
2,
-100,
-100,
-100,
-100... |
if verbose: print 'unpack list' a, b, c = l if a != 4 or b != 5 or c != 6: raise TestFailed | Unpack implied tuple | def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError | 4f813074150348704b07b2ebfc7dc357e888a6aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/4f813074150348704b07b2ebfc7dc357e888a6aa/test_unpack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
277,
4672,
309,
277,
1545,
374,
471,
277,
411,
890,
30,
327,
277,
1002,
10195,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
277,
4672,
309,
277,
1545,
374,
471,
277,
411,
890,
30,
327,
277,
1002,
10195,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.