rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
real_mtime = os.stat(self.path).st_mtime | real_mtime = os.lstat(self.path).st_mtime | def load_content_if_outdated(self, *a, **k): """ Load the contents of the directory if it's outdated or not done yet """ if self.load_content_once(*a, **k): return True | f430499170204931fdf886da118dc8e4765c925c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5729/f430499170204931fdf886da118dc8e4765c925c/directory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
1745,
67,
430,
67,
659,
12563,
12,
2890,
16,
380,
69,
16,
2826,
79,
4672,
3536,
4444,
326,
2939,
434,
326,
1867,
309,
518,
1807,
25629,
578,
486,
2731,
4671,
3536,
309,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
1745,
67,
430,
67,
659,
12563,
12,
2890,
16,
380,
69,
16,
2826,
79,
4672,
3536,
4444,
326,
2939,
434,
326,
1867,
309,
518,
1807,
25629,
578,
486,
2731,
4671,
3536,
309,
365,
... |
if 1: | if 0: | def handleAvatarControls(self, task): """ Check on the arrow keys and update the avatar. """ if self.wantAvatarPhysicsIndicator: onScreenDebug.append("localToon pos = %s\n"%(toonbase.localToon.getPos().pPrintValues(),)) onScreenDebug.append("localToon h = % 10.4f\n"%(toonbase.localToon.getH(),)) #onScreenDebug.append("localToon name = %s\n"%(toonbase.localToon.getName(),)) onScreenDebug.append("localToon anim = %s\n"%(toonbase.localToon.animFSM.getCurrentState().getName(),)) #assert(self.debugPrint("handleAvatarControls(task=%s)"%(task,))) physObject=self.actorNode.getPhysicsObject() #rotAvatarToPhys=Mat3.rotateMatNormaxis(-self.avatarNodePath.getH(), Vec3.up()) #rotPhysToAvatar=Mat3.rotateMatNormaxis(self.avatarNodePath.getH(), Vec3.up()) contact=self.actorNode.getContactVector() # hack fix for falling through the floor: if contact==Vec3.zero() and self.avatarNodePath.getZ()<-50.0: # reset: # DCR: don't reset X and Y; allow player to move self.avatarNodePath.setZ(50.0) self.resetPhys() | 3e8fcc731aa0a15d72da33dbee7f72128446b809 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/3e8fcc731aa0a15d72da33dbee7f72128446b809/PhysicsWalker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
23999,
16795,
12,
2890,
16,
1562,
4672,
3536,
2073,
603,
326,
12274,
1311,
471,
1089,
326,
16910,
18,
3536,
309,
365,
18,
17369,
23999,
3731,
1900,
2102,
13140,
30,
603,
7956,
2829,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
23999,
16795,
12,
2890,
16,
1562,
4672,
3536,
2073,
603,
326,
12274,
1311,
471,
1089,
326,
16910,
18,
3536,
309,
365,
18,
17369,
23999,
3731,
1900,
2102,
13140,
30,
603,
7956,
2829,
... |
def on_execButton_clicked(self): | def on_actionExecute_triggered(self): | def on_execButton_clicked(self): source = str(self.editorWidget.text()) self.shellWidget.runLines(source.split('\n')) | c9f23b5a1eb80e853e503ac79aa5a89eb9f5c9ea /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3979/c9f23b5a1eb80e853e503ac79aa5a89eb9f5c9ea/extendedshell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
1128,
5289,
67,
10668,
329,
12,
2890,
4672,
1084,
273,
609,
12,
2890,
18,
9177,
4609,
18,
955,
10756,
365,
18,
10304,
4609,
18,
2681,
5763,
12,
3168,
18,
4939,
2668,
64,
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,
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,
603,
67,
1128,
5289,
67,
10668,
329,
12,
2890,
4672,
1084,
273,
609,
12,
2890,
18,
9177,
4609,
18,
955,
10756,
365,
18,
10304,
4609,
18,
2681,
5763,
12,
3168,
18,
4939,
2668,
64,
82,
... |
ldap.SCOPE_ONELEVEL, | ldap.SCOPE_SUBTREE, | def get_or_create_user(self, username): try: user = User.objects.get(username=username) return user except User.DoesNotExist: try: import ldap ldapo = ldap.initialize(settings.LDAP_URI) ldapo.set_option(ldap.OPT_PROTOCOL_VERSION, 3) if settings.LDAP_TLS: ldapo.start_tls_s() if settings.LDAP_ANON_BIND_UID: ldapo.simple_bind_s(settings.LDAP_ANON_BIND_UID, settings.LDAP_ANON_BIND_PASSWD) | 4f6c8bebb7fff2c0b6749dac01dd5864c52ba243 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1600/4f6c8bebb7fff2c0b6749dac01dd5864c52ba243/backends.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
280,
67,
2640,
67,
1355,
12,
2890,
16,
2718,
4672,
775,
30,
729,
273,
2177,
18,
6911,
18,
588,
12,
5053,
33,
5053,
13,
327,
729,
1335,
2177,
18,
15264,
30,
775,
30,
1930,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
280,
67,
2640,
67,
1355,
12,
2890,
16,
2718,
4672,
775,
30,
729,
273,
2177,
18,
6911,
18,
588,
12,
5053,
33,
5053,
13,
327,
729,
1335,
2177,
18,
15264,
30,
775,
30,
1930,
... |
unlim = self._ncid.inq_unlimdim() | if self.isrecord(): unlim = 0 else: unnlim = -1 | def __buildStartCountStride(self, elem): | abd511eb5c4bf88e71bc03e7641007db3d8eafc8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9106/abd511eb5c4bf88e71bc03e7641007db3d8eafc8/pycdf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3510,
1685,
1380,
1585,
831,
12,
2890,
16,
3659,
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,
... | [
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,
1001,
3510,
1685,
1380,
1585,
831,
12,
2890,
16,
3659,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
>>> from numpy.polynomial import legyshev as L | >>> from numpy.polynomial import legendre as L | def legint(cs, m=1, k=[], lbnd=0, scl=1): """ Integrate a Legendre series. Returns a Legendre series that is the Legendre series `cs`, integrated `m` times from `lbnd` to `x`. At each iteration the resulting series is **multiplied** by `scl` and an integration constant, `k`, is added. The scaling factor is for use in a linear change of variable. ("Buyer beware": note that, depending on what one is doing, one may want `scl` to be the reciprocal of what one might expect; for more information, see the Notes section below.) The argument `cs` is a sequence of coefficients, from lowest order Legendre series "term" to highest, e.g., [1,2,3] represents the series :math:`P_0(x) + 2P_1(x) + 3P_2(x)`. Parameters ---------- cs : array_like 1-d array of Legendre series coefficients, ordered from low to high. m : int, optional Order of integration, must be positive. (Default: 1) k : {[], list, scalar}, optional Integration constant(s). The value of the first integral at ``lbnd`` is the first value in the list, the value of the second integral at ``lbnd`` is the second value, etc. If ``k == []`` (the default), all constants are set to zero. If ``m == 1``, a single scalar can be given instead of a list. lbnd : scalar, optional The lower bound of the integral. (Default: 0) scl : scalar, optional Following each integration the result is *multiplied* by `scl` before the integration constant is added. (Default: 1) Returns ------- S : ndarray Legendre series coefficients of the integral. Raises ------ ValueError If ``m < 0``, ``len(k) > m``, ``np.isscalar(lbnd) == False``, or ``np.isscalar(scl) == False``. See Also -------- legder Notes ----- Note that the result of each integration is *multiplied* by `scl`. Why is this important to note? Say one is making a linear change of variable :math:`u = ax + b` in an integral relative to `x`. Then :math:`dx = du/a`, so one will need to set `scl` equal to :math:`1/a` - perhaps not what one would have first thought. Also note that, in general, the result of integrating a C-series needs to be "re-projected" onto the C-series basis set. Thus, typically, the result of this function is "un-intuitive," albeit correct; see Examples section below. Examples -------- >>> from numpy.polynomial import legyshev as L >>> cs = (1,2,3) >>> L.legint(cs) array([ 0.5, -0.5, 0.5, 0.5]) >>> L.legint(cs,3) array([ 0.03125 , -0.1875 , 0.04166667, -0.05208333, 0.01041667, 0.00625 ]) >>> L.legint(cs, k=3) array([ 3.5, -0.5, 0.5, 0.5]) >>> L.legint(cs,lbnd=-2) array([ 8.5, -0.5, 0.5, 0.5]) >>> L.legint(cs,scl=-2) array([-1., 1., -1., -1.]) """ cnt = int(m) if np.isscalar(k) : k = [k] if cnt != m: raise ValueError, "The order of integration must be integer" if cnt < 0 : raise ValueError, "The order of integration must be non-negative" if len(k) > cnt : raise ValueError, "Too many integration constants" # cs is a trimmed copy [cs] = pu.as_series([cs]) if cnt == 0: return cs k = list(k) + [0]*(cnt - len(k)) for i in range(cnt) : n = len(cs) cs *= scl if n == 1 and cs[0] == 0: cs[0] += k[i] else: tmp = np.empty(n + 1, dtype=cs.dtype) tmp[0] = cs[0]*0 tmp[1] = cs[0] for j in range(1, n): t = cs[j]/(2*j + 1) tmp[j + 1] = t tmp[j - 1] -= t tmp[0] += k[i] - legval(lbnd, tmp) cs = tmp return cs | 45020fb87b0558142d0f3ca873839663269cb2fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14925/45020fb87b0558142d0f3ca873839663269cb2fc/legendre.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4553,
474,
12,
2143,
16,
312,
33,
21,
16,
417,
22850,
6487,
7831,
4880,
33,
20,
16,
31648,
33,
21,
4672,
3536,
15285,
340,
279,
17167,
409,
266,
4166,
18,
225,
2860,
279,
17167,
409,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4553,
474,
12,
2143,
16,
312,
33,
21,
16,
417,
22850,
6487,
7831,
4880,
33,
20,
16,
31648,
33,
21,
4672,
3536,
15285,
340,
279,
17167,
409,
266,
4166,
18,
225,
2860,
279,
17167,
409,
... |
warn("Feed '%s' not found (in '%s')" % (feed, source)) | warn("Feed '%s' not found (in '%s')", feed_src, user) | def update_user_overrides(interface): user = basedir.load_first_config(config_site, config_prog, 'user_overrides', escape(interface.uri)) if not user: return doc = minidom.parse(user) root = doc.documentElement last_checked = root.getAttribute('last-checked') if last_checked: interface.last_checked = int(last_checked) stability_policy = root.getAttribute('stability-policy') if stability_policy: interface.set_stability_policy(stability_levels[str(stability_policy)]) for item in root.getElementsByTagNameNS(XMLNS_IFACE, 'implementation'): id = item.getAttribute('id') assert id is not None if id.startswith('/') or id.startswith('.'): impl = interface.get_impl(os.path.abspath(os.path.join(iface_dir, id))) else: assert '=' in id impl = interface.get_impl(id) user_stability = item.getAttribute('user-stability') if user_stability: impl.user_stability = stability_levels[str(user_stability)] for feed in root.getElementsByTagNameNS(XMLNS_IFACE, 'feed'): feed_src = feed.getAttribute('src') if not feed_src: raise InvalidInterface('Missing "src" attribute in <feed>') interface.feeds.append(feed_src) for feed in interface.feeds: debug("Merging information from feed '%s' into interface '%s'" % (feed, interface)) if feed.startswith('/'): if os.path.isfile(feed): update(interface, feed, local = True) else: warn("Feed '%s' not found (in '%s')" % (feed, source)) else: raise InvalidInterface('Only local feed sources are currently supported ' '(not %s)' % feed) | 3f97f163d2082a6f4cd4904b131fd817b307d91b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10543/3f97f163d2082a6f4cd4904b131fd817b307d91b/reader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1355,
67,
19775,
12,
5831,
4672,
729,
273,
15573,
18,
945,
67,
3645,
67,
1425,
12,
1425,
67,
4256,
16,
642,
67,
14654,
16,
296,
1355,
67,
19775,
2187,
4114,
12,
5831,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1355,
67,
19775,
12,
5831,
4672,
729,
273,
15573,
18,
945,
67,
3645,
67,
1425,
12,
1425,
67,
4256,
16,
642,
67,
14654,
16,
296,
1355,
67,
19775,
2187,
4114,
12,
5831,
18,
1... |
pass | if self.recording: trash = self.mdw.stop_recording() print 'Discarded', len(trash), 'bytes of stroke data.' self.mdw.start_recording() self.recording = True | def record_stroke_cb(self, action): pass | c606bc2b10bba42f92c95d94f8d273a34380dcd8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7129/c606bc2b10bba42f92c95d94f8d273a34380dcd8/drawwindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1409,
67,
16181,
67,
7358,
12,
2890,
16,
1301,
4672,
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,
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,
1409,
67,
16181,
67,
7358,
12,
2890,
16,
1301,
4672,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self[qsize.value].count = len(chunk) self[qsize.value].buffer[:len(chunk)] = chunk.tolist() | self[qsize.value].count = count self[qsize.value].buffer[:count] = chunk.tolist() | def put(self, (fn, b)): # split buffer into chunks chunks = [array('B', b[i:i+262144]) for i in range(0, len(b), 262144)] while True: self.acquire() if qsize.value + len(chunks) > len(self): self.release() time.sleep(0.01) else: break for chunk in chunks: self[qsize.value].fn = fn self[qsize.value].count = len(chunk) self[qsize.value].buffer[:len(chunk)] = chunk.tolist() # print (self[qsize.value].buffer == b) qsize.value += 1 self.release() | 0d51deb44c49226d83af37f7a9b4114bcb1b2b06 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2504/0d51deb44c49226d83af37f7a9b4114bcb1b2b06/asyncserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
12,
2890,
16,
261,
4293,
16,
324,
3719,
30,
468,
1416,
1613,
1368,
6055,
6055,
273,
306,
1126,
2668,
38,
2187,
324,
63,
77,
30,
77,
15,
5558,
22,
25339,
5717,
364,
277,
316,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
12,
2890,
16,
261,
4293,
16,
324,
3719,
30,
468,
1416,
1613,
1368,
6055,
6055,
273,
306,
1126,
2668,
38,
2187,
324,
63,
77,
30,
77,
15,
5558,
22,
25339,
5717,
364,
277,
316,
10... |
s += c | s += prepare_string_for_xml(c) | def __unicode__(self): s = u'' open_containers = collections.deque() for c in self.content: if isinstance(c, basestring): s += c elif c is None: if open_containers: p = open_containers.pop() s += u'</%s>'%(p.name,) else: s += unicode(c) if not c.self_closing: open_containers.append(c) | f4bbf10ee348fb7f998c20301073c7fadf0dac99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/f4bbf10ee348fb7f998c20301073c7fadf0dac99/objects.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9124,
972,
12,
2890,
4672,
272,
273,
582,
6309,
1696,
67,
20596,
273,
6980,
18,
323,
1857,
1435,
364,
276,
316,
365,
18,
1745,
30,
309,
1549,
12,
71,
16,
10699,
4672,
272,
1011,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9124,
972,
12,
2890,
4672,
272,
273,
582,
6309,
1696,
67,
20596,
273,
6980,
18,
323,
1857,
1435,
364,
276,
316,
365,
18,
1745,
30,
309,
1549,
12,
71,
16,
10699,
4672,
272,
1011,
... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.DoubleField.__init__(self, 614) else quickfix.DoubleField.__init__(self, 614, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
5265,
974,
16186,
2738,
972,
12,
2890,
16,
1666,
3461,
13,
469,
9549,
904,
18,
5265,
974,
16186,
2738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
5265,
974,
16186,
2738,
972,
12,
2890,
16,
1666,
3461,
13,
469,
9549,
904,
18,
5265,
974,
16186,
2738,
... |
if isVarChar(expr[lastOccurence+1]) and expr[lastOccurence+1] != '(': | if isVarChar(expr[lastOccurence + len(op.text)]) or expr[lastOccurence + len(op.text)] == '(': | def buildCleanExpr(self, expr): expr = expr.replace(" ", "") print("buildCleanExpr: " + expr) # For every operator level for opLevel in self.operatorLevels: # For every operator in the current level for op in opLevel.operators: lastOccurence = expr.find(op.text) while lastOccurence is not -1: if lastOccurence == len(expr) - 1: raise CompilerException("Missing operand") if isVarChar(expr[lastOccurence+1]) and expr[lastOccurence+1] != '(': if op.type == Operator.BINARY: # Left operand start = lastOccurence - 1 while start >= 0 and (isVarChar(expr[start]) or (expr[start] == ')' and start == lastOccurence - 1)): if expr[start] == ')': bracketCounter = 1 else: bracketCounter = 0 # Move to last part of the bracket while bracketCounter > 0 and start > 0: start -= 1 if expr[start] == ')': bracketCounter += 1 elif expr[start] == '(': bracketCounter -= 1 start -= 1 operandLeft = expr[start+1:lastOccurence]; # Right operand end = lastOccurence + op.textLen while end < len(expr) and (isVarChar(expr[end]) or (expr[end] == '(' and end == lastOccurence + 1)): if expr[end] == '(' and end == lastOccurence + 1: bracketCounter = 1 else: bracketCounter = 0 # Move to last part of the bracket while bracketCounter > 0 and end < len(expr)-1: end += 1 if expr[end] == '(': bracketCounter += 1 elif expr[end] == ')': bracketCounter -= 1 end += 1 operandRight = expr[lastOccurence+op.textLen:end]; print(operandLeft + " [" + op.text + "] " + operandRight) # Bind #======================================================= # if start >= 0: # print("START[" + str(start) + "]: " + expr[start]) # else: # print("START: " + "OUT OF STRING") # # if end < exprLen: # print("END[" + str(end) + "]: " + expr[end]) # else: # print("END: " + "OUT OF STRING") #======================================================= if (start < 0 or expr[start] != '(') or (end >= len(expr) or expr[end] != ')'): expr = expr[:lastOccurence - len(operandLeft)] + "(" + operandLeft + op.text + operandRight + ")" + expr[lastOccurence + len(op.text) + len(operandRight):] print("EX.BINARY: " + expr) elif op.type == Operator.UNARY: # Right operand end = lastOccurence + op.textLen while end < len(expr) and (isVarChar(expr[end]) or (expr[end] == '(' and end == lastOccurence + 1)): if expr[end] == '(' and end == lastOccurence + 1: bracketCounter = 1 else: bracketCounter = 0 # Move to last part of the bracket while bracketCounter > 0 and end < len(expr)-1: end += 1 if expr[end] == '(': bracketCounter += 1 elif expr[end] == ')': bracketCounter -= 1 end += 1 operandRight = expr[lastOccurence+op.textLen:end]; print("[" + op.text + "] " + operandRight) start = lastOccurence - 1 if (start < 0 or expr[start] != '(') or (end >= len(expr) or expr[end] != ')'): expr = expr[:lastOccurence] + "(" + op.text + operandRight + ")" + expr[lastOccurence + len(op.text) + len(operandRight):] print("EX.UNARY: " + expr) lastOccurence = expr.find(op.text, lastOccurence + len(op.text) + 1) # +1 for the additional left bracket return expr | 35599008e6b7ca74065439dff467c0e5bb5c18da /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14498/35599008e6b7ca74065439dff467c0e5bb5c18da/ExpressionParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
7605,
4742,
12,
2890,
16,
3065,
4672,
3065,
273,
3065,
18,
2079,
2932,
3104,
1408,
13,
225,
1172,
2932,
3510,
7605,
4742,
30,
315,
397,
3065,
13,
225,
468,
2457,
3614,
3726,
1801,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
7605,
4742,
12,
2890,
16,
3065,
4672,
3065,
273,
3065,
18,
2079,
2932,
3104,
1408,
13,
225,
1172,
2932,
3510,
7605,
4742,
30,
315,
397,
3065,
13,
225,
468,
2457,
3614,
3726,
1801,
... |
y_shift = int((self.available_image_height() - height)/2) | y_shift = int((self.available_image_height() - self.currimg_height)/2) | def center_image(self, width, height): if width == 0: width = self.imageview.size_request()[0] if height == 0: height = self.imageview.size_request()[1] while gtk.events_pending(): gtk.main_iteration() x_shift = int((self.available_image_width() - width)/2) if x_shift < 0: x_shift = 0 y_shift = int((self.available_image_height() - height)/2) if y_shift < 0: y_shift = 0 print x_shift, y_shift self.layout.move(self.imageview, x_shift, y_shift) | 76a2283830945fb2f62193dae50ef08730d10a74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/76a2283830945fb2f62193dae50ef08730d10a74/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4617,
67,
2730,
12,
2890,
16,
1835,
16,
2072,
4672,
309,
1835,
422,
374,
30,
1835,
273,
365,
18,
2730,
1945,
18,
1467,
67,
2293,
1435,
63,
20,
65,
309,
2072,
422,
374,
30,
2072,
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,
4617,
67,
2730,
12,
2890,
16,
1835,
16,
2072,
4672,
309,
1835,
422,
374,
30,
1835,
273,
365,
18,
2730,
1945,
18,
1467,
67,
2293,
1435,
63,
20,
65,
309,
2072,
422,
374,
30,
2072,
273,... |
print "Need to resize file" diff = (data - available) | diff = (len(data) - available) | def save(self, filename=None): if filename is None: filename = self.filename try: f = open(filename, 'rb+') except IOError, err: from errno import ENOENT if err.errno != ENOENT: raise f = open(filename, 'ab') # create, then reopen f = open(filename, 'rb+') | 3fe489e26a9a29350adfacac2b5ec6dde6fda951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1845/3fe489e26a9a29350adfacac2b5ec6dde6fda951/flac.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
1544,
33,
7036,
4672,
309,
1544,
353,
599,
30,
1544,
273,
365,
18,
3459,
775,
30,
284,
273,
1696,
12,
3459,
16,
296,
6731,
15,
6134,
1335,
8340,
16,
393,
30,
628,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
1544,
33,
7036,
4672,
309,
1544,
353,
599,
30,
1544,
273,
365,
18,
3459,
775,
30,
284,
273,
1696,
12,
3459,
16,
296,
6731,
15,
6134,
1335,
8340,
16,
393,
30,
628,... |
class CommonsDelinker(object): | class CommonsDelinker(object): | def do(self, args): try: if len(args) == 3: self.log_replacement(*args) else: self.log_result(*args) except: # Something unexpected happened. Report and die. output('An exception occured in %s' % self, False) traceback.print_exc(file = sys.stderr) self.exit() self.CommonsDelinker.thread_died() | 27019b4a716efb14641fbaaa6683d8e1987dcf1c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/27019b4a716efb14641fbaaa6683d8e1987dcf1c/delinker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
12,
2890,
16,
833,
4672,
775,
30,
309,
562,
12,
1968,
13,
422,
890,
30,
365,
18,
1330,
67,
24394,
30857,
1968,
13,
469,
30,
365,
18,
1330,
67,
2088,
30857,
1968,
13,
1335,
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,
741,
12,
2890,
16,
833,
4672,
775,
30,
309,
562,
12,
1968,
13,
422,
890,
30,
365,
18,
1330,
67,
24394,
30857,
1968,
13,
469,
30,
365,
18,
1330,
67,
2088,
30857,
1968,
13,
1335,
30,
... |
return () | return [] | def items(self, parent): if self.player and self.player.is_playing(): self.show_item.parent = parent return [ self.show_item ] return () | 9fccded0dc51a3e574d38a6a227bb68b2f60ca15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/9fccded0dc51a3e574d38a6a227bb68b2f60ca15/detach.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1516,
12,
2890,
16,
982,
4672,
309,
365,
18,
14872,
471,
365,
18,
14872,
18,
291,
67,
1601,
310,
13332,
365,
18,
4500,
67,
1726,
18,
2938,
273,
982,
327,
306,
365,
18,
4500,
67,
1726... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1516,
12,
2890,
16,
982,
4672,
309,
365,
18,
14872,
471,
365,
18,
14872,
18,
291,
67,
1601,
310,
13332,
365,
18,
4500,
67,
1726,
18,
2938,
273,
982,
327,
306,
365,
18,
4500,
67,
1726... |
if re.match('200[6789]', date): | if int(date[0:4]) >= 2006: | def parse_day(self, fp, text, date): self.date = date | 1ec6296a46167213bb6f45ed3597d45a932046b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8428/1ec6296a46167213bb6f45ed3597d45a932046b4/parse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
2881,
12,
2890,
16,
4253,
16,
977,
16,
1509,
4672,
365,
18,
712,
273,
1509,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
2881,
12,
2890,
16,
4253,
16,
977,
16,
1509,
4672,
365,
18,
712,
273,
1509,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
name = re.findall('^([\w:]*)', self.str)[0] name = name.lower() | name = re.findall('^([\w\-:]*)', self.str)[0] name = name.lower().replace('-', ':') | def _init_element(self): """Initializes. Only called if the token is an element token. [Private] """ | eba8aea8a482fe051c685f54ec87e6e49dd8041e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10890/eba8aea8a482fe051c685f54ec87e6e49dd8041e/sparkup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
2956,
12,
2890,
4672,
3536,
9685,
18,
5098,
2566,
309,
326,
1147,
353,
392,
930,
1147,
18,
306,
6014,
65,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
2956,
12,
2890,
4672,
3536,
9685,
18,
5098,
2566,
309,
326,
1147,
353,
392,
930,
1147,
18,
306,
6014,
65,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self._superquadric.Update() | def executeModule(self): self._superquadric.Update() self._superquadricSource.Update() | f4babca9c8fce9028f07c6f02fed74d1b4f302a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4494/f4babca9c8fce9028f07c6f02fed74d1b4f302a9/superQuadric.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
3120,
12,
2890,
4672,
365,
6315,
9565,
21733,
1512,
1830,
18,
1891,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1836,
3120,
12,
2890,
4672,
365,
6315,
9565,
21733,
1512,
1830,
18,
1891,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
""" fl_popup_entry_get_by_label(p1, p2) -> popup_entry ref. | """ fl_popup_entry_get_by_label(p1, p2) -> popup_entry | def fl_popup_entry_get_by_label(p1, p2): """ fl_popup_entry_get_by_label(p1, p2) -> popup_entry ref. """ retval = _fl_popup_entry_get_by_label(p1, p2) return retval | 8765c710f695de392f6fc7c664c746ec98668b1d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/8765c710f695de392f6fc7c664c746ec98668b1d/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
16086,
67,
4099,
67,
588,
67,
1637,
67,
1925,
12,
84,
21,
16,
293,
22,
4672,
3536,
1183,
67,
16086,
67,
4099,
67,
588,
67,
1637,
67,
1925,
12,
84,
21,
16,
293,
22,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
16086,
67,
4099,
67,
588,
67,
1637,
67,
1925,
12,
84,
21,
16,
293,
22,
4672,
3536,
1183,
67,
16086,
67,
4099,
67,
588,
67,
1637,
67,
1925,
12,
84,
21,
16,
293,
22,
13,
... |
def ClusterSnglBurstTable(sngl_burst_table, testfunc, clusterfunc, bailoutfunc = None): | def ClusterSnglBurstTable(sngl_burst_table, testfunc, clusterfunc, sortfunc = None, bailoutfunc = None): | def ClusterSnglBurstTable(sngl_burst_table, testfunc, clusterfunc, bailoutfunc = None): """ Cluster the candidates in the sngl_burst table. testfunc will be passed a pair in random order, and must return 0 (or False) if they should be clustered. clusterfunc will be passed a pair of candidates in random order, and must modify the contents of the first so as to be a "cluster" of the two. If bailoutfunc is not None, the candidates will be sorted into "increasing" order using testfunc as a comparison operator, and then only pairs of candidates for which bailoutfunc returns 0 (or False) will be considered for clustering. When used this way, testfunc must return a numeric result indicating the sort order of the two candidates it has been passed: >0 if the first is "greater" than the second, <0 if the first is "less" than the second, and 0 if the order does not matter (like a subtraction operator). The return value is True if the sngl_burst table was modified, and False if it was not. """ table_changed = False outer_did_cluster = True while outer_did_cluster: outer_did_cluster = False if bailoutfunc is not None: sngl_burst_table.sort(testfunc) i = 0 while i < len(sngl_burst_table): a = sngl_burst_table[i] j = i + 1 inner_did_cluster = False while j < len(sngl_burst_table): b = sngl_burst_table[j] if not testfunc(a, b): clusterfunc(a, sngl_burst_table.pop(j)) table_changed = outer_did_cluster = inner_did_cluster = True elif bailoutfunc is not None and bailoutfunc(a, b): break else: j += 1 if not inner_did_cluster: i += 1 return table_changed | 78bc9afbf1c89d333828b2a9b94e9f3a3b63de57 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/78bc9afbf1c89d333828b2a9b94e9f3a3b63de57/ligolw_bucluster.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5584,
55,
3368,
80,
38,
18593,
1388,
12,
87,
3368,
80,
67,
70,
18593,
67,
2121,
16,
1842,
644,
16,
2855,
644,
16,
1524,
644,
273,
599,
16,
18422,
659,
644,
273,
599,
4672,
3536,
5584... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5584,
55,
3368,
80,
38,
18593,
1388,
12,
87,
3368,
80,
67,
70,
18593,
67,
2121,
16,
1842,
644,
16,
2855,
644,
16,
1524,
644,
273,
599,
16,
18422,
659,
644,
273,
599,
4672,
3536,
5584... |
class Stat_special_char(Char): def __init__(self, text): self.text = text.upper().swapcase() | def test_french_very_sort(self): text = u"""Les dclarations du prsident Vladimir Poutine""" p = oracle.Language(text) print ('test_french_very_sort', p.percent()) | def __init__(self, language, lexeme=''): self.language = language self.lexeme = lexeme | 01cf89725c399f39f6264ce34c9f6a329f12087d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/01cf89725c399f39f6264ce34c9f6a329f12087d/test_oracle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2653,
16,
5275,
4698,
2218,
11,
4672,
365,
18,
4923,
273,
2653,
365,
18,
4149,
4698,
273,
5275,
4698,
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,
0,
0,
0,
0,
0,
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,
2653,
16,
5275,
4698,
2218,
11,
4672,
365,
18,
4923,
273,
2653,
365,
18,
4149,
4698,
273,
5275,
4698,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for obj in arrayList: if obj.shape != shape: raise ValueError, "array has different shape" | def fromarrays(arrayList, dtype=None, shape=None, formats=None, names=None, titles=None, aligned=False, byteorder=None): """ create a record array from a (flat) list of arrays >>> x1=array([1,2,3,4]) >>> x2=array(['a','dd','xyz','12']) >>> x3=array([1.1,2,3,4]) >>> r=fromarrays([x1,x2,x3],names='a,b,c') >>> print r[1] (2, 'dd', 2.0) >>> x1[1]=34 >>> r.a array([1, 2, 3, 4]) """ arrayList = [sb.asarray(x) for x in arrayList] if shape is None or shape == 0: shape = arrayList[0].shape if isinstance(shape, int): shape = (shape,) if formats is None and dtype is None: # go through each object in the list to see if it is an ndarray # and determine the formats. formats = '' for obj in arrayList: if not isinstance(obj, sb.ndarray): raise ValueError, "item in the array list must be an ndarray." formats += _typestr[obj.dtype.type] if issubclass(obj.dtype.type, nt.flexible): formats += `obj.itemsize` formats += ',' formats=formats[:-1] for obj in arrayList: if obj.shape != shape: raise ValueError, "array has different shape" if dtype is not None: descr = sb.dtype(dtype) _names = descr.names else: parsed = format_parser(formats, names, titles, aligned, byteorder) _names = parsed._names descr = parsed._descr _array = recarray(shape, descr) # populate the record array (makes a copy) for i in range(len(arrayList)): _array[_names[i]] = arrayList[i] return _array | 31016a0dee1512b12a56779f47bc03ac375d0736 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/31016a0dee1512b12a56779f47bc03ac375d0736/records.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
16223,
12,
1126,
682,
16,
3182,
33,
7036,
16,
2179,
33,
7036,
16,
6449,
33,
7036,
16,
1257,
33,
7036,
16,
14693,
33,
7036,
16,
13939,
33,
8381,
16,
1160,
1019,
33,
7036,
4672,
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,
628,
16223,
12,
1126,
682,
16,
3182,
33,
7036,
16,
2179,
33,
7036,
16,
6449,
33,
7036,
16,
1257,
33,
7036,
16,
14693,
33,
7036,
16,
13939,
33,
8381,
16,
1160,
1019,
33,
7036,
4672,
3... | |
"""The weight lattice. EXAMPLES: WeylCharacterRing(['E',8]).lattice() Ambient lattice of the root system of type ['E', 8] | """ Returns the weight lattice associated to self. EXAMPLES: sage: WeylCharacterRing(['E',8]).lattice() Ambient lattice of the root system of type ['E', 8] | def lattice(self): """The weight lattice. EXAMPLES: WeylCharacterRing(['E',8]).lattice() Ambient lattice of the root system of type ['E', 8] """ return self._lattice | 0a30ee9b10542e4dc66149f6ffe87504cb679b84 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/0a30ee9b10542e4dc66149f6ffe87504cb679b84/weyl_characters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16690,
12,
2890,
4672,
3536,
2860,
326,
3119,
16690,
3627,
358,
365,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
678,
402,
80,
7069,
10369,
12,
3292,
41,
2187,
28,
65,
2934,
80,
2496... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16690,
12,
2890,
4672,
3536,
2860,
326,
3119,
16690,
3627,
358,
365,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
678,
402,
80,
7069,
10369,
12,
3292,
41,
2187,
28,
65,
2934,
80,
2496... |
""" Returns true if this key exists in session """ | def isSession(self, key): """ Returns true if this key exists in session """ return self.__isSession(key) | b6814cb28711448b190a372eecb914aba076854a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3287/b6814cb28711448b190a372eecb914aba076854a/session_manager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
2157,
12,
2890,
16,
498,
4672,
327,
365,
16186,
291,
2157,
12,
856,
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,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
2157,
12,
2890,
16,
498,
4672,
327,
365,
16186,
291,
2157,
12,
856,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
result = result + self.heading( | result = self.heading( | def docmodule(self, object): """Produce HTML documentation for a module object.""" name = object.__name__ result = '' head = '<br><big><big><strong> %s</strong></big></big>' % name try: path = os.path.abspath(inspect.getfile(object)) filelink = '<a href="file:%s">%s</a>' % (path, path) except TypeError: filelink = '(built-in)' info = [] if hasattr(object, '__version__'): version = str(object.__version__) if version[:11] == '$' + 'Revision: ' and version[-1:] == '$': version = strip(version[11:-1]) info.append('version %s' % self.escape(version)) if hasattr(object, '__date__'): info.append(self.escape(str(object.__date__))) if info: head = head + ' (%s)' % join(info, ', ') result = result + self.heading( head, '#ffffff', '#7799ee', '<a href=".">index</a><br>' + filelink) | 66efbc74811f153a02728942adbbfc549bf10398 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66efbc74811f153a02728942adbbfc549bf10398/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
2978,
12,
2890,
16,
733,
4672,
3536,
25884,
3982,
7323,
364,
279,
1605,
733,
12123,
508,
273,
733,
16186,
529,
972,
563,
273,
875,
910,
273,
2368,
2848,
4438,
14002,
4438,
14002,
44... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
2978,
12,
2890,
16,
733,
4672,
3536,
25884,
3982,
7323,
364,
279,
1605,
733,
12123,
508,
273,
733,
16186,
529,
972,
563,
273,
875,
910,
273,
2368,
2848,
4438,
14002,
4438,
14002,
44... |
return S_OK(resultDict) def __parseJobStatus(self,output): | return S_OK( resultDict ) def __parseJobStatus( self, output ): | def getJobStatus(self,jobIDList): """ Get the status information for the given list of jobs """ workingDirectory = self.ceParameters['WorkingDirectory'] fd, idFileName = tempfile.mkstemp( suffix = '.ids', prefix = 'CREAM_', dir = workingDirectory ) idFile = os.fdopen( fd, 'w' ) idFile.write('##CREAMJOBS##') for id in jobIDList: idFile.write('\n'+id) idFile.close() cmd = ['glite-ce-job-status','-n','-i','%s' % idFileName ] result = executeGridCommand(self.proxy,cmd,self.gridEnv) os.unlink(idFileName) resultDict = {} if result['Value'][1]: resultDict = self.__parseJobStatus(result['Value'][1]) | 45afa08b7552c5b79d1cfd9cac53e65115f5e15a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/45afa08b7552c5b79d1cfd9cac53e65115f5e15a/CREAMComputingElement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13024,
1482,
12,
2890,
16,
4688,
24583,
4672,
3536,
968,
326,
1267,
1779,
364,
326,
864,
666,
434,
6550,
3536,
225,
5960,
2853,
273,
365,
18,
311,
2402,
3292,
14836,
2853,
3546,
5194,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13024,
1482,
12,
2890,
16,
4688,
24583,
4672,
3536,
968,
326,
1267,
1779,
364,
326,
864,
666,
434,
6550,
3536,
225,
5960,
2853,
273,
365,
18,
311,
2402,
3292,
14836,
2853,
3546,
5194,
16... |
os.dup2(2, 1) | os.dup2(fdcopy, 1) os.close(r) os.close(fdcopy) | def tee_redirect(self, filename): """Tee output to the specified file | 2e742abf9fe525fe32232ab63277b815d9f89b82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12268/2e742abf9fe525fe32232ab63277b815d9f89b82/autotest_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
1340,
67,
7590,
12,
2890,
16,
1544,
4672,
3536,
56,
1340,
876,
358,
326,
1269,
585,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
1340,
67,
7590,
12,
2890,
16,
1544,
4672,
3536,
56,
1340,
876,
358,
326,
1269,
585,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if self.config.html_out_suffix: | if self.config.html_file_suffix: | def init(self): """Load templates.""" self.init_templates() self.init_translator_class() if self.config.html_out_suffix: self.out_suffix = self.config.html_file_suffix | ae0ce1ceff59f0e6c8428da958a3c7a26f1bcb9c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7032/ae0ce1ceff59f0e6c8428da958a3c7a26f1bcb9c/builder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
4672,
3536,
2563,
5539,
12123,
365,
18,
2738,
67,
8502,
1435,
365,
18,
2738,
67,
17879,
67,
1106,
1435,
309,
365,
18,
1425,
18,
2620,
67,
768,
67,
8477,
30,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
4672,
3536,
2563,
5539,
12123,
365,
18,
2738,
67,
8502,
1435,
365,
18,
2738,
67,
17879,
67,
1106,
1435,
309,
365,
18,
1425,
18,
2620,
67,
768,
67,
8477,
30,
365,
18,
... |
index = 0 | def UpdateProfiles (self, default = _("Default")): self.Context.Read () self.Context.UpdateProfiles () | 10e380f7f49357446aa3996369d9a008a48afe8e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7062/10e380f7f49357446aa3996369d9a008a48afe8e/Pages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2315,
12450,
261,
2890,
16,
805,
273,
389,
2932,
1868,
6,
3719,
30,
365,
18,
1042,
18,
1994,
1832,
365,
18,
1042,
18,
1891,
12450,
1832,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2315,
12450,
261,
2890,
16,
805,
273,
389,
2932,
1868,
6,
3719,
30,
365,
18,
1042,
18,
1994,
1832,
365,
18,
1042,
18,
1891,
12450,
1832,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
If the `object` implements `ILocation`, but not `IContained`, set it's | If the `object` implements `ILocation`, but not `IContained`, set its | def containedEvent(object, container, name=None): """Establish the containment of the object in the container The object and necessary event are returned. The object may be a `ContainedProxy` around the original object. The event is an added event, a moved event, or None. If the object implements `IContained`, simply set its `__parent__` and `__name__` attributes: >>> container = {} >>> item = Contained() >>> x, event = containedEvent(item, container, u'foo') >>> x is item True >>> item.__parent__ is container True >>> item.__name__ u'foo' We have an added event: >>> event.__class__.__name__ 'ObjectAddedEvent' >>> event.object is item True >>> event.newParent is container True >>> event.newName u'foo' >>> event.oldParent >>> event.oldName Now if we call contained again: >>> x2, event = containedEvent(item, container, u'foo') >>> x2 is item True >>> item.__parent__ is container True >>> item.__name__ u'foo' We don't get a new added event: >>> event If the object already had a parent but the parent or name was different, we get a moved event: >>> x, event = containedEvent(item, container, u'foo2') >>> event.__class__.__name__ 'ObjectMovedEvent' >>> event.object is item True >>> event.newParent is container True >>> event.newName u'foo2' >>> event.oldParent is container True >>> event.oldName u'foo' If the `object` implements `ILocation`, but not `IContained`, set it's `__parent__` and `__name__` attributes *and* declare that it implements `IContained`: >>> from zope.location import Location >>> item = Location() >>> IContained.providedBy(item) False >>> x, event = containedEvent(item, container, 'foo') >>> x is item True >>> item.__parent__ is container True >>> item.__name__ 'foo' >>> IContained.providedBy(item) True If the `object` doesn't even implement `ILocation`, put a `ContainedProxy` around it: >>> item = [] >>> x, event = containedEvent(item, container, 'foo') >>> x is item False >>> x.__parent__ is container True >>> x.__name__ 'foo' Make sure we don't lose existing directly provided interfaces. >>> from zope.interface import Interface, directlyProvides >>> class IOther(Interface): ... pass >>> from zope.location import Location >>> item = Location() >>> directlyProvides(item, IOther) >>> IOther.providedBy(item) True >>> x, event = containedEvent(item, container, 'foo') >>> IOther.providedBy(item) True """ if not IContained.providedBy(object): if ILocation.providedBy(object): zope.interface.directlyProvides( object, IContained, zope.interface.directlyProvidedBy(object)) else: object = ContainedProxy(object) oldparent = object.__parent__ oldname = object.__name__ if oldparent is container and oldname == name: # No events return object, None object.__parent__ = container object.__name__ = name if oldparent is None or oldname is None: event = ObjectAddedEvent(object, container, name) else: event = ObjectMovedEvent(object, oldparent, oldname, container, name) return object, event | 984738d8f021fe7cf44b66d310c4be7399e35f24 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9826/984738d8f021fe7cf44b66d310c4be7399e35f24/contained.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7542,
1133,
12,
1612,
16,
1478,
16,
508,
33,
7036,
4672,
3536,
9122,
23385,
326,
912,
475,
434,
326,
733,
316,
326,
1478,
225,
1021,
733,
471,
4573,
871,
854,
2106,
18,
1021,
733,
2026... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7542,
1133,
12,
1612,
16,
1478,
16,
508,
33,
7036,
4672,
3536,
9122,
23385,
326,
912,
475,
434,
326,
733,
316,
326,
1478,
225,
1021,
733,
471,
4573,
871,
854,
2106,
18,
1021,
733,
2026... |
mode = kwargs.get("filemode", "a") | mode = kwargs.get("filemode", 'a') | def basicConfig(**kwargs): """ Do basic configuration for the logging system. This function does nothing if the root logger already has handlers configured. It is a convenience method intended for use by simple scripts to do one-shot configuration of the logging package. The default behaviour is to create a StreamHandler which writes to sys.stderr, set a formatter using the BASIC_FORMAT format string, and add the handler to the root logger. A number of optional keyword arguments may be specified, which can alter the default behaviour. filename Specifies that a FileHandler be created, using the specified filename, rather than a StreamHandler. filemode Specifies the mode to open the file, if filename is specified (if filemode is unspecified, it defaults to "a"). format Use the specified format string for the handler. datefmt Use the specified date/time format. level Set the root logger level to the specified level. stream Use the specified stream to initialize the StreamHandler. Note that this argument is incompatible with 'filename' - if both are present, 'stream' is ignored. Note that you could specify a stream created using open(filename, mode) rather than passing the filename and mode in. However, it should be remembered that StreamHandler does not close its stream (since it may be using sys.stdout or sys.stderr), whereas FileHandler closes its stream when the handler is closed. """ if len(root.handlers) == 0: filename = kwargs.get("filename") if filename: mode = kwargs.get("filemode", "a") hdlr = FileHandler(filename, mode) else: stream = kwargs.get("stream") hdlr = StreamHandler(stream) fs = kwargs.get("format", BASIC_FORMAT) dfs = kwargs.get("datefmt", None) fmt = Formatter(fs, dfs) hdlr.setFormatter(fmt) root.addHandler(hdlr) level = kwargs.get("level") if level: root.setLevel(level) | 4bb8eae26a4ae91b2e577fd600684ff2cc2a952a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/4bb8eae26a4ae91b2e577fd600684ff2cc2a952a/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30736,
12,
636,
4333,
4672,
3536,
2256,
5337,
1664,
364,
326,
2907,
2619,
18,
225,
1220,
445,
1552,
5083,
309,
326,
1365,
1194,
1818,
711,
4919,
4351,
18,
2597,
353,
279,
13553,
707,
126... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30736,
12,
636,
4333,
4672,
3536,
2256,
5337,
1664,
364,
326,
2907,
2619,
18,
225,
1220,
445,
1552,
5083,
309,
326,
1365,
1194,
1818,
711,
4919,
4351,
18,
2597,
353,
279,
13553,
707,
126... |
{'action': 'store_true', 'validator': validate_boolean}), | {'action': 'store_true', 'validator': frontend.validate_boolean}), | def find_theme(name): # Where else to look for a theme? # Check working dir? Destination dir? Config dir? Plugins dir? path = os.path.join(themes_dir_path, name) if not os.path.isdir(path): raise docutils.ApplicationError( 'Theme directory not found: %r (path: %r)' % (name, path)) return path | 7d862072e50a384b2e8471e4c0fed52ace512455 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/7d862072e50a384b2e8471e4c0fed52ace512455/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
7997,
12,
529,
4672,
468,
12177,
469,
358,
2324,
364,
279,
5006,
35,
468,
2073,
5960,
1577,
35,
225,
10691,
1577,
35,
225,
1903,
1577,
35,
225,
26849,
1577,
35,
589,
273,
114... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7997,
12,
529,
4672,
468,
12177,
469,
358,
2324,
364,
279,
5006,
35,
468,
2073,
5960,
1577,
35,
225,
10691,
1577,
35,
225,
1903,
1577,
35,
225,
26849,
1577,
35,
589,
273,
114... |
self.assertEquals(os.path.join(os.path.dirname(base), 'parentdir.txt'), | self.assertEquals(os.path.realpath(os.path.join(os.path.dirname(base), 'parentdir.txt')), | def test_getpath(self): base = os.path.dirname(self.filename) config = self._read() config.set('a', 'path_a', os.path.join(base, 'here', 'absolute.txt')) config.set('a', 'path_b', 'thisdir.txt') config.set('a', 'path_c', os.path.join(os.pardir, 'parentdir.txt')) self.assertEquals(os.path.join(base, 'here', 'absolute.txt'), config.getpath('a', 'path_a')) self.assertEquals(os.path.join(base, 'thisdir.txt'), config.getpath('a', 'path_b')) self.assertEquals(os.path.join(os.path.dirname(base), 'parentdir.txt'), config.getpath('a', 'path_c')) | c51b5d8d3f5708f9fc63173f475f84ad6fdbf3c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c51b5d8d3f5708f9fc63173f475f84ad6fdbf3c6/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
803,
12,
2890,
4672,
1026,
273,
1140,
18,
803,
18,
12287,
12,
2890,
18,
3459,
13,
642,
273,
365,
6315,
896,
1435,
642,
18,
542,
2668,
69,
2187,
296,
803,
67,
69,
2187,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
588,
803,
12,
2890,
4672,
1026,
273,
1140,
18,
803,
18,
12287,
12,
2890,
18,
3459,
13,
642,
273,
365,
6315,
896,
1435,
642,
18,
542,
2668,
69,
2187,
296,
803,
67,
69,
2187,... |
slots = getattr(cls, '__slots__', ()) if not slots: names.update(obj.__dict__.iterkeys()) | try: slots = getattr(cls, '__slots__') except AttributeError: names.update(getattr(obj, '__dict__', {}).iterkeys()) | # End def #}}} | 66b4da71da21b7bfe67acddd796ab1d696395aa2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2635/66b4da71da21b7bfe67acddd796ab1d696395aa2/attrdict.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
4403,
1652,
468,
9090,
97,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
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,
468,
4403,
1652,
468,
9090,
97,
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,
-10... |
for i in xrange(n_iter): | for i in xrange(n_train): | def run_nnet(use_gpu, n_batch=60, n_in=1024, n_hid=2048, n_out=10, n_iter=100): if use_gpu: w = tcn.shared_constructor(0.01*(my_rand(n_in,n_hid)-0.5), 'w') b = tcn.shared_constructor(my_zeros(n_hid), 'b') v = tcn.shared_constructor(my_zeros((n_hid, n_out)), 'c') c = tcn.shared_constructor(my_zeros(n_out), 'c') else: w = shared(0.01*(my_rand(n_in,n_hid)-0.5), 'w') b = shared(my_zeros(n_hid), 'b') v = shared(my_zeros((n_hid, n_out)), 'c') c = shared(my_zeros(n_out), 'c') x = tensor.fmatrix('x') y = tensor.fmatrix('y') lr = tensor.fscalar('lr') hid = tensor.tanh(tensor.dot(x, w)+b) out = tensor.tanh(tensor.dot(hid, v)+c) loss = tensor.sum(0.5 * (out-y)**2 * lr) if 0: print 'loss type', loss.type params = [w, b, v, c] gparams = tensor.grad(loss, params) mode = get_mode(use_gpu) print 'building pfunc ...' train = pfunc([x,y,lr], [loss], mode=mode, updates=[(p, p-g) for p,g in zip(params, gparams)]) if 0: for i, n in enumerate(train.maker.env.toposort()): print i, n xval = my_rand(n_batch, n_in) yval = my_rand(n_batch, n_out) lr = theano._asarray(0.01, dtype='float32') t0 = time.time() rval = [] for i in xrange(n_iter): rval.append(train(xval, yval, lr)) dt = time.time() - t0 print_mode(mode) return numpy.asarray(rval), dt | 096c375fd2a3d51b589713ec856194dfefacf58c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/096c375fd2a3d51b589713ec856194dfefacf58c/test_nnet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
82,
2758,
12,
1202,
67,
23162,
16,
290,
67,
5303,
33,
4848,
16,
290,
67,
267,
33,
2163,
3247,
16,
290,
67,
76,
350,
33,
21573,
28,
16,
290,
67,
659,
33,
2163,
16,
290,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
82,
2758,
12,
1202,
67,
23162,
16,
290,
67,
5303,
33,
4848,
16,
290,
67,
267,
33,
2163,
3247,
16,
290,
67,
76,
350,
33,
21573,
28,
16,
290,
67,
659,
33,
2163,
16,
290,
... |
sparse representation, so if the graph is simple, |E| <= |V|^2 and n <= |V|, this construction runs in O(|V|^3) time. | sparse representation, so if the graph is simple, `|E| \leq |V|^2` and `n <= |V|`, this construction runs in `O(|V|^3)` time. | def all_graph_colorings(G,n,count_only=False): """ Computes all n-colorings of the graph G by casting the graph coloring problem into an exact cover problem, and passing this into an implementation of the Dancing Links algorithm described by Knuth (who attributes the idea to Hitotumatu and Noshita). The construction works as follows: (columns) * The first |V| columns correspond to a vertex -- a 1 in this column indicates that that vertex has a color. * After those |V| columns, we add n*|E| columns -- a 1 in these columns indicate that a particular edge is incident to a vertex with a certain color. (rows) * For each vertex, add n rows; one for each color c. Place a 1 in the column corresponding to the vertex, and a 1 in the appropriate column for each edge incident to the vertex, indicating that that edge is incident to the color c. * If n > 2, the above construction cannot be exactly covered since each edge will be incident to only two vertices (and hence two colors) - so we add n*|E| rows, each one containing a 1 for each of the n*|E| columns. These get added to the cover solutions "for free" during the backtracking. Note that this construction results in n*|V| + 2*n*|E| + n*|E| entries in the matrix. The Dancing Links algorithm uses a sparse representation, so if the graph is simple, |E| <= |V|^2 and n <= |V|, this construction runs in O(|V|^3) time. Back-conversion to a coloring solution is a simple scan of the solutions, which will contain |V| + (n-2)*|E| entries, so runs in O(|V|^3) time also. For most graphs, the conversion will be much faster -- for example, a planar graph will be transformed for 4-coloring in linear time since |E| = O(|V|). REFERENCES: http://www-cs-staff.stanford.edu/~uno/papers/dancing-color.ps.gz EXAMPLES: sage: from sage.graphs.graph_coloring import all_graph_colorings sage: G = Graph({0:[1,2,3],1:[2]}) sage: n = 0 sage: for C in all_graph_colorings(G,3): ... parts = [C[k] for k in C] ... for P in parts: ... l = len(P) ... for i in range(l): ... for j in range(i+1,l): ... if G.has_edge(P[i],P[j]): ... raise RuntimeError, "Coloring Failed." ... n+=1 sage: print "G has %s 3-colorings."%n G has 12 3-colorings. TESTS: sage: G = Graph({0:[1,2,3],1:[2]}) sage: for C in all_graph_colorings(G,0): print C sage: for C in all_graph_colorings(G,-1): print C Traceback (most recent call last): ... ValueError: n must be non-negative. """ if n == 0: return if n < 0: raise ValueError, "n must be non-negative." V = G.vertices() E = G.edges() nV=len(V) nE=len(E) ones = [] N = xrange(n) Vd= {} colormap = {} k = 0 for i in range(nV): v = V[i] Vd[v] = i for c in N: ones.append([k, [i]]) colormap[k] = (v,c) k+=1 kk = nV for e in E: for c in N: v0 = n*Vd[e[0]]+c v1 = n*Vd[e[1]]+c ones[v0][1].append(kk+c) ones[v1][1].append(kk+c) kk+=n if n > 2: for i in range(n*nE): ones.append([k+i, [nV+i]]) colors = rainbow(n) for i in range(len(ones)): ones[i] = ones[i][1] try: for a in DLXCPP(ones): if count_only: yield 1 continue coloring = {} for x in a: if colormap.has_key(x): v,c = colormap[x] if coloring.has_key(colors[c]): coloring[colors[c]].append(v) else: coloring[colors[c]] = [v] yield coloring except RuntimeError: raise RuntimeError, "Too much recursion! Graph coloring failed." | 7056b61dfa30c6705aab69c7fdf3017463c8aae2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/7056b61dfa30c6705aab69c7fdf3017463c8aae2/graph_coloring.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
777,
67,
4660,
67,
3266,
899,
12,
43,
16,
82,
16,
1883,
67,
3700,
33,
8381,
4672,
3536,
14169,
281,
777,
290,
17,
3266,
899,
434,
326,
2667,
611,
635,
27660,
326,
2667,
2036,
310,
61... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
777,
67,
4660,
67,
3266,
899,
12,
43,
16,
82,
16,
1883,
67,
3700,
33,
8381,
4672,
3536,
14169,
281,
777,
290,
17,
3266,
899,
434,
326,
2667,
611,
635,
27660,
326,
2667,
2036,
310,
61... |
""" if _debug: print "\t%s: Called setLabel() in Plot()" % rendererName | @type label: string """ if _debug: print "\t%s: Called Plot.setLabel()" % rendererName | def setLabel(self,axis,label): """ Set the label of a given axis | 705588e48e70a8dec0e8286968b0077d85e8602e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8476/705588e48e70a8dec0e8286968b0077d85e8602e/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16558,
12,
2890,
16,
4890,
16,
1925,
4672,
3536,
1000,
326,
1433,
434,
279,
864,
2654,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
16558,
12,
2890,
16,
4890,
16,
1925,
4672,
3536,
1000,
326,
1433,
434,
279,
864,
2654,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if created: | if created: | def update_db_from_files(self): print "Update DB From Files" | 0a0fa6735a34622421f1f704f96dc354387e7dad /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1866/0a0fa6735a34622421f1f704f96dc354387e7dad/syncdata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1966,
67,
2080,
67,
2354,
12,
2890,
4672,
1172,
315,
1891,
2383,
6338,
6471,
6,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1966,
67,
2080,
67,
2354,
12,
2890,
4672,
1172,
315,
1891,
2383,
6338,
6471,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
previousValue[platformkey] = dateitem[k_hours[p-2]][0][DP_AVERAGE] | previousValue[platformkey] = dateitem[k_hours[p-1]][0][DP_AVERAGE] | def generateSummaryPage(self, pagename, tests, startdate, enddate): # tests { testname: { build: { date: { hour: [ (testname, itemDateTime, delta.days, buildname, hour, revision, runs, total, average) ] }}}} | 6ca03008b42d901c177ff2525dde9878781faeee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/6ca03008b42d901c177ff2525dde9878781faeee/perf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
4733,
1964,
12,
2890,
16,
4262,
1069,
16,
7434,
16,
787,
712,
16,
679,
712,
4672,
468,
7434,
288,
1842,
529,
30,
288,
1361,
30,
288,
1509,
30,
288,
6126,
30,
306,
261,
3813,
52... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
4733,
1964,
12,
2890,
16,
4262,
1069,
16,
7434,
16,
787,
712,
16,
679,
712,
4672,
468,
7434,
288,
1842,
529,
30,
288,
1361,
30,
288,
1509,
30,
288,
6126,
30,
306,
261,
3813,
52... |
is given, an empty, valid element "()" is created. Throws | is given, an empty, valid element "()" is created. Raises | def __init__(self, string = None): """Create using an optional string of code. If no string is given, an empty, valid element "()" is created. Throws ValueError if there is a problem with the passed string.""" if string == None: return | 19e2a3fa16d7c2269ac1ad9a96e45f49b9adb63a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7008/19e2a3fa16d7c2269ac1ad9a96e45f49b9adb63a/GGP.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
533,
273,
599,
4672,
3536,
1684,
1450,
392,
3129,
533,
434,
981,
18,
971,
1158,
533,
353,
864,
16,
392,
1008,
16,
923,
930,
315,
10031,
353,
2522,
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,
1001,
2738,
972,
12,
2890,
16,
533,
273,
599,
4672,
3536,
1684,
1450,
392,
3129,
533,
434,
981,
18,
971,
1158,
533,
353,
864,
16,
392,
1008,
16,
923,
930,
315,
10031,
353,
2522,
18,
... |
self._stream_write("\n") | self._stream_write(ustr("\n")) | def __call__ (self): assert self.level == 0 assert self.scopeLevel == 0 assert self.i18nContext.parent is None self.interpret(self.program) assert self.level == 0 assert self.scopeLevel == 0 assert self.i18nContext.parent is None if self.col > 0: self._stream_write("\n") self.col = 0 | 3f548bdca83b8fedf51512208159a3f254ddddbd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/3f548bdca83b8fedf51512208159a3f254ddddbd/TALInterpreter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
261,
2890,
4672,
1815,
365,
18,
2815,
422,
374,
1815,
365,
18,
4887,
2355,
422,
374,
1815,
365,
18,
77,
2643,
82,
1042,
18,
2938,
353,
599,
365,
18,
24713,
12,
2890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
261,
2890,
4672,
1815,
365,
18,
2815,
422,
374,
1815,
365,
18,
4887,
2355,
422,
374,
1815,
365,
18,
77,
2643,
82,
1042,
18,
2938,
353,
599,
365,
18,
24713,
12,
2890,
... |
dlg.set_current_folder_uri("file://" + self.app.config['save_dir']) | def on_action_open(self, action): dlg = FileChooserDialog(parent=self.widget, action=gtk.FILE_CHOOSER_ACTION_OPEN) dlg.set_current_folder_uri("file://" + self.app.config['save_dir']) | 0303fc8beffe8497b1ab21adbd97113219046476 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14744/0303fc8beffe8497b1ab21adbd97113219046476/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
1128,
67,
3190,
12,
2890,
16,
1301,
4672,
25840,
273,
1387,
17324,
6353,
12,
2938,
33,
2890,
18,
6587,
16,
1301,
33,
4521,
79,
18,
3776,
67,
22213,
51,
2123,
67,
12249,
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,
603,
67,
1128,
67,
3190,
12,
2890,
16,
1301,
4672,
25840,
273,
1387,
17324,
6353,
12,
2938,
33,
2890,
18,
6587,
16,
1301,
33,
4521,
79,
18,
3776,
67,
22213,
51,
2123,
67,
12249,
67,
... | |
ll1,ll2=fromlang[0].split("-",1) | ll1,ll2=fromlang[0] | def featuredWithInterwiki(fromsite, tosite): if not fromsite.lang in cache: cache[fromsite.lang]={} if not tosite.lang in cache[fromsite.lang]: cache[fromsite.lang][tosite.lang]={} cc=cache[fromsite.lang][tosite.lang] if nocache: cc={} findtemplate = wikipedia.translate(wikipedia.getSite(), template) re_Link_FA=re.compile(ur"\{\{%s\|%s\}\}" % (findtemplate, fromsite.lang), re.IGNORECASE) re_this_iw=re.compile(ur"\[\[%s:[^]]+\]\]" % fromsite.lang) arts=featuredArticles(fromsite) pairs=[] for a in arts: if a.title()<afterpage: continue if u"/" in a.title(): wikipedia.output(u"%s is a subpage" % a.title()) continue if a.title() in cc: wikipedia.output(u"(cached) %s -> %s"%(a.title(), cc[a.title()])) continue if a.isRedirectPage(): a=a.getRedirectTarget() try: if not a.exists(): wikipedia.output(u"source page doesn't exist: %s" % a.title()) continue atrans=findTranslated(a,tosite) if atrans: text=atrans.get() m=re_Link_FA.search(text) if m: wikipedia.output(u"(already done)") else: # insert just before interwiki if (not interactive or wikipedia.input(u'Connecting %s -> %s. Proceed? [Y/N]'%(a.title(), atrans.title())) in ['Y','y'] ): m=re_this_iw.search(text) if not m: wikipedia.output(u"no interwiki record, very strange") continue comment = wikipedia.setAction(wikipedia.translate(wikipedia.getSite(), msg) % (fromsite.lang, a.title())) text=wikipedia.replaceCategoryLinks(text+(u"{{%s|%s}}"%(findtemplate, fromsite.lang)), atrans.categories()) atrans.put(text, comment) cc[a.title()]=atrans.title() except wikipedia.PageNotSaved, e: wikipedia.output(u"Page not saved") | c2017f2a03952af19e9eba23be0030a30f23f1dd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/c2017f2a03952af19e9eba23be0030a30f23f1dd/featured.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2572,
72,
1190,
2465,
13044,
12,
2080,
4256,
16,
358,
4256,
4672,
309,
486,
628,
4256,
18,
4936,
316,
1247,
30,
1247,
63,
2080,
4256,
18,
4936,
65,
12938,
309,
486,
358,
4256,
18,
4936... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2572,
72,
1190,
2465,
13044,
12,
2080,
4256,
16,
358,
4256,
4672,
309,
486,
628,
4256,
18,
4936,
316,
1247,
30,
1247,
63,
2080,
4256,
18,
4936,
65,
12938,
309,
486,
358,
4256,
18,
4936... |
return xmldoc, log_data, detectors | return xmldoc, log_data, detectors, cid | def populate_burst_tables(datafile, UID, set_keys = Omega_set_keys, \ process_id = 'process:process_id:0', \ coinc_event_id_base=BurstCoincIdBase): """ """ #initialize xml document xmldoc = ligolw.Document() xmldoc.appendChild(ligolw.LIGO_LW()) #extract the data from the intial Omega file f = open(datafile, 'r') vars = [] for line in f.readlines(): if '#' in line: var = line.lstrip('#').strip() if var in omega_vars: vars.append(var) elif 'file://' in line: dataDir = line.strip() elif ('H1' in line or 'L1' in line or 'V1' in line)\ and not 'H1L1V1' in line: detectors = line.strip().split() elif 'https://' in line: dataLink = line.strip() else: vals = line.strip().split() if len(vars) > len(vals): raise ValueError, "More variables than values specified" elif len(vars) < len(vals): raise ValueError, "More values than variables specified" else: omega_data = dict(zip(vars,vals)) f.close() #create the content for the event.log file log_data = '\n***Omega Online Event***\n' for var in omega_vars: log_data += var + ': ' + omega_data[var] + '\n' log_data += 'network: ' for ifo in detectors: log_data += ifo + ' ' log_data += '\n' log_data += 'event web URL: ' + dataLink + '\n' log_data += '\n' log_data += 'segment location: ' + dataDir + '\n' #fill the MutliBurstTable coinc_event_id = coinc_event_id_base + str(UID) mb_table = lsctables.New(lsctables.MultiBurstTable) xmldoc.childNodes[0].appendChild(mb_table) row = mb_table.RowType() row.process_id = 'process:process_id:0' row.set_ifos(detectors) st, st_ns = omega_data['time'].split('.') row.start_time = int(st) row.start_time_ns = int(st_ns) row.duration = None row.confidence = -log(float(omega_data['probGlitch'])) row.coinc_event_id = coinc_event_id for key in mb_table.validcolumns.keys(): if key not in set_keys: setattr(row,key,None) mb_table.append(row) return xmldoc, log_data, detectors | af257218e83ac728902869fa75f174902babf41f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/af257218e83ac728902869fa75f174902babf41f/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
67,
70,
18593,
67,
9373,
12,
892,
768,
16,
10034,
16,
444,
67,
2452,
273,
25645,
11061,
67,
542,
67,
2452,
16,
521,
1207,
67,
350,
273,
296,
2567,
30,
2567,
67,
350,
30,
20,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
67,
70,
18593,
67,
9373,
12,
892,
768,
16,
10034,
16,
444,
67,
2452,
273,
25645,
11061,
67,
542,
67,
2452,
16,
521,
1207,
67,
350,
273,
296,
2567,
30,
2567,
67,
350,
30,
20,
... |
resDict = {'Failed':failed,'Successful':successful} return S_OK(resDict) | resDict = {'Failed':failed, 'Successful':successful} return S_OK( resDict ) | def removeLink(self,link): res = self.__checkArgumentFormat(link) if not res['OK']: return res links = res['Value'] # If we have less than three lfns to query a session doesn't make sense created = False if len(links) > 2: created = self.__openSession() failed = {} successful = {} for link in links.keys(): res = self.__unlinkPath(link) if not res['OK']: failed[link] = res['Message'] else: successful[link] = True if created: self.__closeSession() resDict = {'Failed':failed,'Successful':successful} return S_OK(resDict) | 6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
2098,
12,
2890,
16,
1232,
4672,
400,
273,
365,
16186,
1893,
1379,
1630,
12,
1232,
13,
309,
486,
400,
3292,
3141,
3546,
30,
327,
400,
4716,
273,
400,
3292,
620,
3546,
468,
971,
73... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
2098,
12,
2890,
16,
1232,
4672,
400,
273,
365,
16186,
1893,
1379,
1630,
12,
1232,
13,
309,
486,
400,
3292,
3141,
3546,
30,
327,
400,
4716,
273,
400,
3292,
620,
3546,
468,
971,
73... |
if len(archlist) > 1: | if len(archlist) > 0: log(3, 'Multiple available archs for pkg %s - %s' % (name, arch)) | def getupdatedhdrlist(headernevral, rpmnevral): "returns (name, arch) tuples of updated and uninstalled pkgs" uplist = [] newlist = [] uplist_archdict = {} for (name, arch) in headernevral.NAkeys(): # this is all hard and goofy to deal with pkgs changing arch # if we have the package installed # check to see if we have that specific arch # if so compare that name,arch vs the bestarch in the rpmdb # this deals with us having 2.4.9-31.i686 kernels installed AND 2.4.18-4.athlon kernels installed # b/c a 2.4.18-4.i686 would constantly showed up on an athlon # if its newer then mark it as updateable # if we don't have that specific arch, then if its the best arch in the headernevral, compare # it to what we have, if its newer then mark it as updateable if rpmnevral.exists(name): archlist = archwork.availablearchs(rpmnevral, name) finalarch = archlist.pop() if len(archlist) > 1: log(4, 'multiple archs in rpmdb for pkg: %s' % name) for otherarch in archlist: rc = compareEVR(rpmnevral.evr(name, finalarch), rpmnevral.evr(name, otherarch)) if rc > 0: pass elif rc < 0: finalarch = otherarch elif rc == 0: log(5, 'Deeply odd, two pkgs of same arch and same version %s - %s' % (name, currentarch)) # at this point we know that name+finalarch is the highest version of the pkgname on the system # we compare this best version vs the best version and bestarch in the headernevral # if the headernevral one is newer then we mark it as updateable # the rpmnevral one is newer or the same version then we move along archlist = archwork.availablearchs(headernevral, name) hdr_finalarch = archlist.pop() if len(archlist) > 1: for otherarch in archlist: rc = compareEVR(headernevral.evr(name, hdr_finalarch), headernevral.evr(name, otherarch)) if rc > 0: pass elif rc < 0: hdr_finalarch = otherarch elif rc == 0: log(5, 'Deeply odd, two pkgs of same arch and same version %s - %s' % (name, currentarch)) # we can continue though, b/c if they are same we have an odd state but the same version info # right now we know that name+hdr_finalarch is the best version of the bestarch available in the headerinfo rc = compareEVR(headernevral.evr(name, hdr_finalarch), rpmnevral.evr(name, finalarch) # so we do the comparison to the best we have on the system if (rc > 0): #look it's newer and we don't have it - add it to the list and finish if not uplist_archdict.has_key(name): uplist_archdict[name]=hdr_finalarch #it's newer and we already have one so lets compare them in arch and ver else: rc = compareEVR(headernevral.evr(name, hdr_finalarch), headernevral.evr(name, uplist_archdict[name])) if (rc > 0): updating_finalarch = archwork.bestarch([hdr_finalarch, uplist_archdict[name]]) if updating_finalarch == hdr_finalarch: uplist_archdict[name]=hdr_finalarch else: newlist.append((name, arch)) for name in uplist_archdict.keys(): uplist.append((name,uplist_archdict[name])) nulist=uplist+newlist return (uplist, newlist, nulist) | 9c902b18c74b251a7435b4fb3c9f0b3db4a01184 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/9c902b18c74b251a7435b4fb3c9f0b3db4a01184/clientStuff.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
7007,
16587,
1098,
12,
3374,
4644,
18090,
287,
16,
25228,
4644,
18090,
287,
4672,
315,
6154,
261,
529,
16,
6637,
13,
10384,
434,
3526,
471,
640,
13435,
16922,
6,
582,
17842,
273,
53... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7007,
16587,
1098,
12,
3374,
4644,
18090,
287,
16,
25228,
4644,
18090,
287,
4672,
315,
6154,
261,
529,
16,
6637,
13,
10384,
434,
3526,
471,
640,
13435,
16922,
6,
582,
17842,
273,
53... |
- ``E2`` - an elliptic curve in short wWeierstrass form. | - ``E2`` - an elliptic curve in short Weierstrass form. | def compute_isogeny_kernel_polynomial(E1, E2, ell, algorithm="starks"): r""" Computes the degree ``ell`` isogeny between ``E1`` and ``E2``. There must be a degree ``ell``, separable, normalized isogeny from ``E1`` to ``E2``. If no algorithm is specified, this function determines the best algorithm to use. INPUT: - ``E1`` - an elliptic curve in short Weierstrass form. - ``E2`` - an elliptic curve in short wWeierstrass form. - ``ell`` - the degree of the isogeny from ``E1`` to ``E2``. - ``algorithm`` - string (default:"starks") if None, this function automatically determines best algorithm to use. Otherwise uses the algorithm specified by the string. Valid values are "starks" or "fastElkies" OUTPUT: polynomial -- over the field of definition of ``E1``, ``E2``, that is the kernel polynomial of the isogeny from ``E1`` to ``E2``. .. note:: When using Stark's algorithm, occasionally the fast pe computation fails, so we retry with the quadratic algorithm, which works in all cases (for valid inputs.) EXAMPLES:: sage: from sage.schemes.elliptic_curves.ell_curve_isogeny import compute_isogeny_kernel_polynomial sage: E = EllipticCurve(GF(37), [0,0,0,1,8]) sage: R.<x> = GF(37)[] sage: f = (x + 14) * (x + 30) sage: phi = EllipticCurveIsogeny(E, f) sage: E2 = phi.codomain() sage: compute_isogeny_kernel_polynomial(E, E2, 5) z^2 + 7*z + 13 sage: f x^2 + 7*x + 13 sage: R.<x> = QQ[] sage: K.<i> = NumberField(x^2 + 1) sage: E = EllipticCurve(K, [0,0,0,1,0]) sage: E2 = EllipticCurve(K, [0,0,0,16,0]) sage: compute_isogeny_kernel_polynomial(E, E2, 4) z^3 + z """ if ("starks"==algorithm): ker_poly = compute_isogeny_starks(E1, E2, ell) elif ("fastElkies"==algorithm): raise NotImplementedError else: raise ValueError, "algorithm parameter was for an unknown algorithm." # # Everything that follows here is how we get the kernel polynomial in the form we want # i.e. a separable polynomial (no repeated roots.) # ker_poly = split_kernel_polynomial(E1, ker_poly, ell) # in case we catastrophically failed using the fast pe algorithm fall back to quadratic algorithm # this is a bug and should be fixed, but this is a work around for now if (ker_poly.degree() < ell/2) and ("starks"==algorithm): ker_poly = compute_isogeny_starks(E1, E2, ell, pe_algorithm="quadratic") ker_poly = split_kernel_polynomial(E1, ker_poly, ell) return ker_poly | fe0a08530cec058e66aba9b8e7e9c1acb5ef1b35 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/fe0a08530cec058e66aba9b8e7e9c1acb5ef1b35/ell_curve_isogeny.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
67,
291,
19409,
93,
67,
8111,
67,
3915,
13602,
12,
41,
21,
16,
512,
22,
16,
415,
80,
16,
4886,
1546,
334,
27943,
6,
4672,
436,
8395,
14169,
281,
326,
10782,
12176,
1165,
10335,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
67,
291,
19409,
93,
67,
8111,
67,
3915,
13602,
12,
41,
21,
16,
512,
22,
16,
415,
80,
16,
4886,
1546,
334,
27943,
6,
4672,
436,
8395,
14169,
281,
326,
10782,
12176,
1165,
10335,
... |
last = last + 1 | last = min(self.maxx, last+1) | def _end_of_line(self, y): "Go to the location of the first blank on the given line." last = self.maxx while 1: if ascii.ascii(self.win.inch(y, last)) != ascii.SP: last = last + 1 break elif last == 0: break last = last - 1 return last | d691e9705384a4d98b3c53cd30c562be71061565 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/d691e9705384a4d98b3c53cd30c562be71061565/textpad.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
409,
67,
792,
67,
1369,
12,
2890,
16,
677,
4672,
315,
5741,
358,
326,
2117,
434,
326,
1122,
7052,
603,
326,
864,
980,
1199,
1142,
273,
365,
18,
1896,
92,
1323,
404,
30,
309,
113... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
409,
67,
792,
67,
1369,
12,
2890,
16,
677,
4672,
315,
5741,
358,
326,
2117,
434,
326,
1122,
7052,
603,
326,
864,
980,
1199,
1142,
273,
365,
18,
1896,
92,
1323,
404,
30,
309,
113... |
r""" Bipartite graph. INPUT: 1. Empty: creates a zero vertex bipartite graph. sage: B = BipartiteGraph() sage: type(B) <class 'sage.graphs.bipartite_graph.BipartiteGraph'> sage: B.order() 0 2. From a graph: without any more information, finds a bipartition. sage: B = BipartiteGraph( graphs.CycleGraph(4) ) sage: B = BipartiteGraph( graphs.CycleGraph(5) ) Traceback (most recent call last): ... TypeError: Input graph is not bipartite! 3. From a NetworkX bipartite graph. sage: import networkx sage: G = graphs.OctahedralGraph() sage: N = networkx.cliques.make_clique_bipartite(G.networkx_graph()) sage: B = BipartiteGraph(N) 4. From a graph and a partition. Note that if the input graph is not bipartite, then Sage will raise an error. However, if one specifies check = False, the offending edges are simply deleted (along with those vertices not appearing in either list). sage: P = graphs.PetersenGraph() sage: partition = [range(5), range(5,10)] sage: B = BipartiteGraph(P, partition) Traceback (most recent call last): ... TypeError: Input graph is not bipartite with respect to the given partition! sage: B = BipartiteGraph(P, partition, check=False) sage: B.left [0, 1, 2, 3, 4] sage: B.show() EXAMPLES: Test for arbitrary argument handled by Graph class sage: B = BipartiteGraph(None) sage: B Bipartite graph on 0 vertices Copy constructor sage: G = Graph({0:[5,6], 1:[4,5], 2:[4,6], 3:[4,5,6]}) sage: B = BipartiteGraph(G) sage: B2 = BipartiteGraph(B) sage: B == B2 True sage: B3 = BipartiteGraph(G, range(4), range(4,7)) sage: B3 Bipartite graph on 7 vertices sage: B3 == B2 True Make sure "copy constructor" returns the same partition for no edges sage: G = Graph({0:[], 1:[], 2:[]}) sage: part = (range(2), [2]) sage: B = BipartiteGraph(G, part) sage: B2 = BipartiteGraph(B) sage: B == B2 True """ | def __init__(self, *args, **kwds): r""" Bipartite graph. | 25c94c95d5e68a7a61813a2b7d891729d9a5e86f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/25c94c95d5e68a7a61813a2b7d891729d9a5e86f/bipartite_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
605,
5762,
1137,
2667,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
605,
5762,
1137,
2667,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
vars += self.projects[target].patch.vars | def endParse(self): # !!! Debugging Prints !!! # print "* endParse:" # print " includes: " + str(self.includePats) # print " excludes: " + str(self.excludePats) # print " levels: " + str(self.levels) # print " missings: " + str(self.missings) | a32fd692dd1e30de835cd0c6d09d9bec8f3ccf92 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1360/a32fd692dd1e30de835cd0c6d09d9bec8f3ccf92/dws.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
3201,
12,
2890,
4672,
468,
401,
8548,
4015,
1998,
3038,
87,
401,
8548,
468,
1172,
15902,
679,
3201,
2773,
468,
1172,
315,
377,
6104,
30,
315,
397,
609,
12,
2890,
18,
6702,
52,
232... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
3201,
12,
2890,
4672,
468,
401,
8548,
4015,
1998,
3038,
87,
401,
8548,
468,
1172,
15902,
679,
3201,
2773,
468,
1172,
315,
377,
6104,
30,
315,
397,
609,
12,
2890,
18,
6702,
52,
232... | |
with open(path, 'w') as f: | with open(path, 'wb') as f: | def extract_content(self, output_dir=os.getcwdu()): output_dir = os.path.abspath(output_dir) try: opf_path = os.path.splitext( os.path.basename(self._stream.name))[0] + '.opf' except AttributeError: opf_path = 'content.opf' opf_path = os.path.join(output_dir, opf_path) self._ensure_dir(opf_path) with open(opf_path, 'w') as f: f.write(self.meta.encode('utf-8')) for entry in self.manifest.values(): path = os.path.join(output_dir, entry.path) self._ensure_dir(path) with open(path, 'w') as f: if 'spine' in entry.state: name = '/'.join(('/data', entry.internal, 'content')) f.write(self.get_markup_file(name).encode('utf-8')) else: name = '/'.join(('/data', entry.internal)) f.write(self.get_file(name)) | 318de321f133b5547cbdee54ded6c50890155c04 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/318de321f133b5547cbdee54ded6c50890155c04/reader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
1745,
12,
2890,
16,
876,
67,
1214,
33,
538,
18,
588,
71,
91,
2544,
1435,
4672,
876,
67,
1214,
273,
1140,
18,
803,
18,
5113,
803,
12,
2844,
67,
1214,
13,
775,
30,
1061,
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,
2608,
67,
1745,
12,
2890,
16,
876,
67,
1214,
33,
538,
18,
588,
71,
91,
2544,
1435,
4672,
876,
67,
1214,
273,
1140,
18,
803,
18,
5113,
803,
12,
2844,
67,
1214,
13,
775,
30,
1061,
74... |
raise BadPropertyError('primitiveTypeDefinition only defined for atomic types') | raise BadPropertyError('[%s] primitiveTypeDefinition only defined for atomic types' % (self.ncName(), self.variety())) | def primitiveTypeDefinition (self): if self.variety() != self.VARIETY_atomic: raise BadPropertyError('primitiveTypeDefinition only defined for atomic types') if self.__primitiveTypeDefinition is None: raise LogicError('Expected primitive type') return self.__primitiveTypeDefinition | a898384e612aa56c517f5a6a9a709cda64ca2e35 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7171/a898384e612aa56c517f5a6a9a709cda64ca2e35/structures.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8225,
559,
1852,
261,
2890,
4672,
309,
365,
18,
4093,
14369,
1435,
480,
365,
18,
29744,
1584,
61,
67,
27718,
30,
1002,
6107,
1396,
668,
2668,
14451,
87,
65,
8225,
559,
1852,
1338,
2553,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8225,
559,
1852,
261,
2890,
4672,
309,
365,
18,
4093,
14369,
1435,
480,
365,
18,
29744,
1584,
61,
67,
27718,
30,
1002,
6107,
1396,
668,
2668,
14451,
87,
65,
8225,
559,
1852,
1338,
2553,
... |
if XML_ILLEGAL_CHAR_PATTERN.search(new_string): | if XML_ILLEGAL_CHAR_PATTERN.search(characters): | def removeIllegalChars(characters): if XML_ILLEGAL_CHAR_PATTERN.search(new_string): characters = XML_ILLEGAL_CHAR_PATTERN.subn( lambda m: '&#%i;' % ord(m.group()), characters)[0] return characters | c8953520bc847c68b06af885b50624acffe8fb87 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12946/c8953520bc847c68b06af885b50624acffe8fb87/escaping.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
12195,
7803,
12,
20558,
4672,
309,
3167,
67,
2627,
19384,
1013,
67,
7305,
67,
10831,
18,
3072,
12,
20558,
4672,
3949,
273,
3167,
67,
2627,
19384,
1013,
67,
7305,
67,
10831,
18,
171... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
12195,
7803,
12,
20558,
4672,
309,
3167,
67,
2627,
19384,
1013,
67,
7305,
67,
10831,
18,
3072,
12,
20558,
4672,
3949,
273,
3167,
67,
2627,
19384,
1013,
67,
7305,
67,
10831,
18,
171... |
ext = qstring_to_unicode(fileinfo.extension(True)).lower() key = [i for i in icons.keys() if i in ext] key = key[0] if key else 'default' if key: key = key[0] | ext = qstring_to_unicode(fileinfo.completeSuffix()).lower() key = ext if ext in self.icons.keys() else 'default' if key == 'default' and ext.count('.') > 0: ext = ext.rpartition('.')[2] key = ext if ext in self.icons.keys() else 'default' | def pixmap(self, fileinfo): key = 'default' icons = self.icons if fileinfo.isSymlink(): if not fileinfo.exists(): return icons['zero'] fileinfo = QFileInfo(fileinfo.readLink()) if fileinfo.isDir(): key = 'dir' else: ext = qstring_to_unicode(fileinfo.extension(True)).lower() key = [i for i in icons.keys() if i in ext] key = key[0] if key else 'default' if key: key = key[0] candidate = icons[key] if isinstance(candidate, QPixmap): return candidate pixmap = QPixmap(candidate) icons[key] = pixmap return pixmap | 618cfd9772fa47114243a0b9559ba14117b3c911 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9125/618cfd9772fa47114243a0b9559ba14117b3c911/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11871,
1458,
12,
2890,
16,
25253,
4672,
498,
273,
296,
1886,
11,
17455,
273,
365,
18,
14516,
309,
25253,
18,
291,
18475,
13332,
309,
486,
25253,
18,
1808,
13332,
327,
17455,
3292,
7124,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11871,
1458,
12,
2890,
16,
25253,
4672,
498,
273,
296,
1886,
11,
17455,
273,
365,
18,
14516,
309,
25253,
18,
291,
18475,
13332,
309,
486,
25253,
18,
1808,
13332,
327,
17455,
3292,
7124,
... |
component_name = vectorstring(component.offset_vector) print >>fileobj, "\t\"%s\" -> \"%s\";" % (component_name, node_name) | print >>fileobj, "\t\"%s\" -> \"%s\";" % (vectorstring(component.offset_vector), node_name) | def write(self, fileobj): """ Write a DOT graph representation of the time slide graph to fileobj. """ vectorstring = lambda offset_vector: ",".join("%s=%g" % (instrument, offset) for instrument, offset in sorted(offset_vector.items())) | bfab42c01f1e0508c22c8926333d7f59d535fe1c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/bfab42c01f1e0508c22c8926333d7f59d535fe1c/snglcoinc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
17041,
4672,
3536,
2598,
279,
15772,
2667,
4335,
434,
326,
813,
12701,
2667,
358,
17041,
18,
3536,
3806,
1080,
273,
3195,
1384,
67,
7737,
30,
5753,
18,
5701,
27188,
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,
1045,
12,
2890,
16,
17041,
4672,
3536,
2598,
279,
15772,
2667,
4335,
434,
326,
813,
12701,
2667,
358,
17041,
18,
3536,
3806,
1080,
273,
3195,
1384,
67,
7737,
30,
5753,
18,
5701,
27188,
8... |
if (monitor == None) or (monitor == False) or (monitor == "no"): | if (monitor == None) or (monitor == False) or (monitor == "no") or (monitor == "0"): | def pop_ip(self, attrs): addr = attrs["address"] self.ip.setAddrFromString(addr) monitor = attrs["monitor_link"] if (monitor == None) or (monitor == False) or (monitor == "no"): self.monitor_link.set_active(False) else: self.monitor_link.set_active(True) | 6a1905388889a7e6b1e9e40355ef1bfc43b2e1e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3879/6a1905388889a7e6b1e9e40355ef1bfc43b2e1e9/ResourceHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1843,
67,
625,
12,
2890,
16,
3422,
4672,
3091,
273,
3422,
9614,
2867,
11929,
365,
18,
625,
18,
542,
3178,
9193,
12,
4793,
13,
6438,
273,
3422,
9614,
10259,
67,
1232,
11929,
309,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1843,
67,
625,
12,
2890,
16,
3422,
4672,
3091,
273,
3422,
9614,
2867,
11929,
365,
18,
625,
18,
542,
3178,
9193,
12,
4793,
13,
6438,
273,
3422,
9614,
10259,
67,
1232,
11929,
309,
261,
1... |
if debug_prints: print "continue testing" | def nextAddress(self): if debug_prints: print "continue testing" self.removeBreakpoint() try: self.current_target = self.iter.next() if debug_prints: print "next target is %s" % HexDump.address(self.current_target) if self.options.output: print "Trying: %s" % HexDump.address(self.current_target) except StopIteration: self.stopTesting() return self.restoreSnapshot() self.changeExceptionHandler() self.setBreakpoint() | 6d6079c7bcc0ba519b666a5d46e251aede9525d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7261/6d6079c7bcc0ba519b666a5d46e251aede9525d0/sehtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
1887,
12,
2890,
4672,
365,
18,
4479,
20552,
1435,
775,
30,
365,
18,
2972,
67,
3299,
273,
365,
18,
2165,
18,
4285,
1435,
309,
1198,
67,
1188,
87,
30,
1172,
315,
4285,
1018,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
1887,
12,
2890,
4672,
365,
18,
4479,
20552,
1435,
775,
30,
365,
18,
2972,
67,
3299,
273,
365,
18,
2165,
18,
4285,
1435,
309,
1198,
67,
1188,
87,
30,
1172,
315,
4285,
1018,
353,
... | |
win = env.mainWindow() | if debug_flags.atom_debug: print "fyi: getting %r from %r" % (key, self) win = env.mainwindow() | def __getitem__(self, key): # get the "current glpane" and its graphicsMode # (for purposes of determining modes & prefs) # (how we do it is not necessarily a kluge, given that this is being # used to define a constant value for use when a better one was # not passed) win = env.mainWindow() glpane = win.glpane graphicsMode = glpane.graphicsMode # let the graphicsMode interpret the prefs key, # in case it wants to override it with a local pref # (or conceivably, someday, track it in a different way) # (note, ThumbView has no graphicsMode, but that doesn't # affect this code since it uses main glpane even when # drawing into a ThumbView. [bruce 080606 comment]) try: res = graphicsMode.get_prefs_value(key) except: msg = "bug: exception in %r.get_prefs_value(%r), %s" % \ (graphicsMode, key, "falling back to env.prefs") print_compact_traceback(msg + ": ") res = env.prefs[key] return res | 9d2851bd983c6c849797bcb67be4a848b87d43d4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/9d2851bd983c6c849797bcb67be4a848b87d43d4/special_drawing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
498,
4672,
468,
336,
326,
315,
2972,
5118,
29009,
6,
471,
2097,
17313,
2309,
468,
261,
1884,
13694,
434,
23789,
12382,
473,
15503,
13,
468,
261,
13606,
73... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
498,
4672,
468,
336,
326,
315,
2972,
5118,
29009,
6,
471,
2097,
17313,
2309,
468,
261,
1884,
13694,
434,
23789,
12382,
473,
15503,
13,
468,
261,
13606,
73... |
self.libraries = ['f90', 'F77', 'M77', 'sunmath', 'm'] | self.ver_cmd = self.f90_compiler + ' -V' self.libraries = ['fsu', 'F77', 'M77', 'sunmath', 'm'] | def __init__(self, fc = None, f90c = None): fortran_compiler_base.__init__(self) if fc is None: fc = 'f77' if f90c is None: f90c = 'f90' | b539116e300999ded6f418730cce709d9cf1f028 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/b539116e300999ded6f418730cce709d9cf1f028/build_flib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8036,
273,
599,
16,
284,
9349,
71,
273,
599,
4672,
364,
13171,
67,
9576,
67,
1969,
16186,
2738,
972,
12,
2890,
13,
309,
8036,
353,
599,
30,
8036,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8036,
273,
599,
16,
284,
9349,
71,
273,
599,
4672,
364,
13171,
67,
9576,
67,
1969,
16186,
2738,
972,
12,
2890,
13,
309,
8036,
353,
599,
30,
8036,
273,
... |
print "vfs_get_file_info", uri, file_info, options, context | print "vfs_get_file_info", uri, options, context | def vfs_get_file_info(self, uri, file_info, options, context): print "vfs_get_file_info", uri, file_info, options, context | d9972c47e5ea086a6442f92d1a8b4286d89ab02b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2587/d9972c47e5ea086a6442f92d1a8b4286d89ab02b/bluetooth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20682,
67,
588,
67,
768,
67,
1376,
12,
2890,
16,
2003,
16,
585,
67,
1376,
16,
702,
16,
819,
4672,
1172,
315,
90,
2556,
67,
588,
67,
768,
67,
1376,
3113,
2003,
16,
585,
67,
1376,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20682,
67,
588,
67,
768,
67,
1376,
12,
2890,
16,
2003,
16,
585,
67,
1376,
16,
702,
16,
819,
4672,
1172,
315,
90,
2556,
67,
588,
67,
768,
67,
1376,
3113,
2003,
16,
585,
67,
1376,
16... |
self._policy._now = self._now = int(time.time()) cookies = self._cookies_for_request(request) attrs = self._cookie_attrs(cookies) if attrs: if not request.has_header("Cookie"): request.add_unredirected_header( "Cookie", "; ".join(attrs)) if (self._policy.rfc2965 and not self._policy.hide_cookie2 and not request.has_header("Cookie2")): for cookie in cookies: if cookie.version != 1: request.add_unredirected_header("Cookie2", '$Version="1"') break self._cookies_lock.release() | try: self._policy._now = self._now = int(time.time()) cookies = self._cookies_for_request(request) attrs = self._cookie_attrs(cookies) if attrs: if not request.has_header("Cookie"): request.add_unredirected_header( "Cookie", "; ".join(attrs)) if (self._policy.rfc2965 and not self._policy.hide_cookie2 and not request.has_header("Cookie2")): for cookie in cookies: if cookie.version != 1: request.add_unredirected_header("Cookie2", '$Version="1"') break finally: self._cookies_lock.release() | def add_cookie_header(self, request): """Add correct Cookie: header to request (urllib2.Request object). | 7ad53bfd99e2b82b856b3e4809283230957deb42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7ad53bfd99e2b82b856b3e4809283230957deb42/cookielib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
8417,
67,
3374,
12,
2890,
16,
590,
4672,
3536,
986,
3434,
10201,
30,
1446,
358,
590,
261,
718,
2941,
22,
18,
691,
733,
2934,
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,
527,
67,
8417,
67,
3374,
12,
2890,
16,
590,
4672,
3536,
986,
3434,
10201,
30,
1446,
358,
590,
261,
718,
2941,
22,
18,
691,
733,
2934,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
elif additionalResidue < sorted(self.structurePrediction.chainself.structurePrediction.getSelection())[0]: addedRange=range( additionalResidue, sorted(self.structurePrediction.chain.gself.structurePredictionetSelection())[0]) | elif additionalResidue < sorted(self.structurePrediction.chain.getSelection())[0]: addedRange=range( additionalResidue, sorted(self.structurePrediction.chain.getSelection())[0]) | def mousePressEvent(self, mouseEvent): | 0b98879759461d60ff610ca7c29a2a30398a86d1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4399/0b98879759461d60ff610ca7c29a2a30398a86d1/SequenceView.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7644,
11840,
1133,
12,
2890,
16,
7644,
1133,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7644,
11840,
1133,
12,
2890,
16,
7644,
1133,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
str = strip(string.translate(str, commatospace)) | str = strip(string.translate(as_latin1(str), commatospace)) | def parse_path(self, str): paths = self.paths path = self.path trafo = self.trafo str = strip(string.translate(str, commatospace)) last_quad = None last_cmd = cmd = None f13 = 1.0 / 3.0; f23 = 2.0 / 3.0 #print '*', str while 1: match = rx_command.match(str) #print match if match: last_cmd = cmd cmd = str[0] str = str[match.end():] #print '*', str points = match.group(1) #print '**', points if points: # use tokenize_line to parse the arguments so that # we deal with signed numbers following another # number without intervening whitespace other # characters properls. # FIXME: tokenize_line works but is not the best way # to do it because it accepts input that wouldn't be # valid here. points = filter(operator.isNumberType, skread.tokenize_line(points)) #print cmd, points if cmd in 'mM': path = CreatePath() paths.append(path) if cmd == 'M' or len(paths) == 1: path.AppendLine(trafo(points[0], points[1])) else: p = trafo.DTransform(points[0], points[1]) path.AppendLine(paths[-2].Node(-1) + p) if len(points) > 2: if cmd == 'm': for i in range(2, len(points), 2): p = trafo.DTransform(points[i], points[i + 1]) path.AppendLine(path.Node(-1) + p) else: for i in range(2, len(points), 2): path.AppendLine(trafo(points[i], points[i+1])) elif cmd == 'l': for i in range(0, len(points), 2): p = trafo.DTransform(points[i], points[i + 1]) path.AppendLine(path.Node(-1) + p) elif cmd == 'L': for i in range(0, len(points), 2): path.AppendLine(trafo(points[i], points[i+1])) elif cmd =='H': for num in points: path.AppendLine(Point(num, path.Node(-1).y)) elif cmd =='h': for num in points: x, y = path.Node(-1) dx, dy = trafo.DTransform(num, 0) path.AppendLine(Point(x + dx, y + dy)) elif cmd =='V': for num in points: path.AppendLine(Point(path.Node(-1).x, num)) elif cmd =='v': for num in points: x, y = path.Node(-1) dx, dy = trafo.DTransform(0, num) path.AppendLine(Point(x + dx, y + dy)) elif cmd == 'C': if len(points) % 6 != 0: self.loader.add_message("number of parameters of 'C'"\ "must be multiple of 6") else: for i in range(0, len(points), 6): p1 = trafo(points[i], points[i + 1]) p2 = trafo(points[i + 2], points[i + 3]) p3 = trafo(points[i + 4], points[i + 5]) path.AppendBezier(p1, p2, p3) elif cmd == 'c': if len(points) % 6 != 0: self.loader.add_message("number of parameters of 'c'"\ "must be multiple of 6") else: for i in range(0, len(points), 6): p = path.Node(-1) p1 = p + trafo.DTransform(points[i], points[i + 1]) p2 = p + trafo.DTransform(points[i+2], points[i+3]) p3 = p + trafo.DTransform(points[i+4], points[i+5]) path.AppendBezier(p1, p2, p3) elif cmd == 'S': if len(points) % 4 != 0: self.loader.add_message("number of parameters of 'S'"\ "must be multiple of 4") else: for i in range(0, len(points), 4): type, controls, p, cont = path.Segment(-1) if type == Bezier: q = controls[1] else: q = p p1 = 2 * p - q p2 = trafo(points[i], points[i + 1]) p3 = trafo(points[i + 2], points[i + 3]) path.AppendBezier(p1, p2, p3) elif cmd == 's': if len(points) % 4 != 0: self.loader.add_message("number of parameters of 's'"\ "must be multiple of 4") else: for i in range(0, len(points), 4): type, controls, p, cont = path.Segment(-1) if type == Bezier: q = controls[1] else: q = p p1 = 2 * p - q p2 = p + trafo.DTransform(points[i], points[i + 1]) p3 = p + trafo.DTransform(points[i+2], points[i+3]) path.AppendBezier(p1, p2, p3) elif cmd == 'Q': if len(points) % 4 != 0: self.loader.add_message("number of parameters of 'Q'"\ "must be multiple of 4") else: for i in range(0, len(points), 4): q = trafo(points[i], points[i + 1]) p3 = trafo(points[i + 2], points[i + 3]) p1 = f13 * path.Node(-1) + f23 * q p2 = f13 * p3 + f23 * q path.AppendBezier(p1, p2, p3) last_quad = q elif cmd == 'q': if len(points) % 4 != 0: self.loader.add_message("number of parameters of 'q'"\ "must be multiple of 4") else: for i in range(0, len(points), 4): p = path.Node(-1) q = p + trafo.DTransform(points[i], points[i + 1]) p3 = p + trafo.DTransform(points[i+2], points[i+3]) p1 = f13 * p + f23 * q p2 = f13 * p3 + f23 * q path.AppendBezier(p1, p2, p3) last_quad = q elif cmd == 'T': if len(points) % 2 != 0: self.loader.add_message("number of parameters of 'T'"\ "must be multiple of 4") else: if last_cmd not in 'QqTt' or last_quad is None: last_quad = path.Node(-1) for i in range(0, len(points), 2): p = path.Node(-1) q = 2 * p - last_quad p3 = trafo(points[i], points[i + 1]) p1 = f13 * p + f23 * q p2 = f13 * p3 + f23 * q path.AppendBezier(p1, p2, p3) last_quad = q elif cmd == 't': if len(points) % 2 != 0: self.loader.add_message("number of parameters of 't'"\ "must be multiple of 4") else: if last_cmd not in 'QqTt' or last_quad is None: last_quad = path.Node(-1) for i in range(0, len(points), 2): p = path.Node(-1) q = 2 * p - last_quad p3 = p + trafo.DTransform(points[i], points[i + 1]) p1 = f13 * p + f23 * q p2 = f13 * p3 + f23 * q path.AppendBezier(p1, p2, p3) last_quad = q | a31675f79ae27fada0eef18d280c6f1c55a842f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3123/a31675f79ae27fada0eef18d280c6f1c55a842f1/svgloader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
803,
12,
2890,
16,
609,
4672,
2953,
273,
365,
18,
4481,
589,
273,
365,
18,
803,
1284,
617,
273,
365,
18,
2033,
617,
609,
273,
2569,
12,
1080,
18,
13929,
12,
345,
67,
26578,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
803,
12,
2890,
16,
609,
4672,
2953,
273,
365,
18,
4481,
589,
273,
365,
18,
803,
1284,
617,
273,
365,
18,
2033,
617,
609,
273,
2569,
12,
1080,
18,
13929,
12,
345,
67,
26578,... |
self.start() | del self.sage | def kill_sage(self): try: pid = self.sage.pid() cmd = 'kill -9 -%s'%pid os.system(cmd) self.start() except Exception, msg: self.start() | 24e96da265978e450e8d89068efd3326da5ed2b8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/24e96da265978e450e8d89068efd3326da5ed2b8/dsage_worker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
67,
87,
410,
12,
2890,
4672,
775,
30,
4231,
273,
365,
18,
87,
410,
18,
6610,
1435,
1797,
273,
296,
16418,
300,
29,
300,
9,
87,
11,
9,
6610,
1140,
18,
4299,
12,
4172,
13,
1464... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
67,
87,
410,
12,
2890,
4672,
775,
30,
4231,
273,
365,
18,
87,
410,
18,
6610,
1435,
1797,
273,
296,
16418,
300,
29,
300,
9,
87,
11,
9,
6610,
1140,
18,
4299,
12,
4172,
13,
1464... |
item[key] = l | new_item[key] = l return new_item | def update_item(self, item): for key, value in item.iteritems(): if isinstance(value, basestring) and value.startswith('*'): id = value[1:] item[key] = self._references.get(id, item[key]) if isinstance(value, list): l = [] for i in value: if isinstance(i, basestring) and i.startswith('*'): id = i[1:] l.append(self._references.get(id, i)) item[key] = l | 7a0e1082b17826471c7b72d748108aa256530f50 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5449/7a0e1082b17826471c7b72d748108aa256530f50/loader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1726,
12,
2890,
16,
761,
4672,
364,
498,
16,
460,
316,
761,
18,
2165,
3319,
13332,
309,
1549,
12,
1132,
16,
10699,
13,
471,
460,
18,
17514,
1918,
2668,
4035,
4672,
612,
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,
1089,
67,
1726,
12,
2890,
16,
761,
4672,
364,
498,
16,
460,
316,
761,
18,
2165,
3319,
13332,
309,
1549,
12,
1132,
16,
10699,
13,
471,
460,
18,
17514,
1918,
2668,
4035,
4672,
612,
273,
... |
print "\tcoclass_clsid = None" | print >> stream, "\tcoclass_clsid = None" | def WriteClassHeader(self, generator): generator.checkWriteDispatchBaseClass() doc = self.doc print 'class ' + self.python_name + '(DispatchBaseClass):' if doc[1]: print '\t' + build._safeQuotedString(doc[1]) try: progId = pythoncom.ProgIDFromCLSID(self.clsid) print "\t# This class is creatable by the name '%s'" % (progId) except pythoncom.com_error: pass print "\tCLSID = " + repr(self.clsid) if self.coclass_clsid is None: print "\tcoclass_clsid = None" else: print "\tcoclass_clsid = " + repr(self.coclass_clsid) print self.bWritten = 1 | 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,
1864,
12,
2890,
16,
4456,
4672,
4456,
18,
1893,
3067,
5325,
2171,
797,
1435,
997,
273,
365,
18,
2434,
1172,
296,
1106,
296,
397,
365,
18,
8103,
67,
529,
397,
7747,
5325,
217... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1864,
12,
2890,
16,
4456,
4672,
4456,
18,
1893,
3067,
5325,
2171,
797,
1435,
997,
273,
365,
18,
2434,
1172,
296,
1106,
296,
397,
365,
18,
8103,
67,
529,
397,
7747,
5325,
217... |
return Folder.manage_main(self, client, REQUEST, **kw) | m = Folder.manage_main.__of__(self) return m(self, client, REQUEST, **kw) | def manage_main(self, client=None, REQUEST=None, **kw): ''' ''' kw['management_view'] = 'Scripts' return Folder.manage_main(self, client, REQUEST, **kw) | d2b5451766b45f827a3295a6d6b116ec75e0deaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/d2b5451766b45f827a3295a6d6b116ec75e0deaa/Scripts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
5254,
12,
2890,
16,
1004,
33,
7036,
16,
12492,
33,
7036,
16,
2826,
9987,
4672,
9163,
9163,
5323,
3292,
17381,
67,
1945,
3546,
273,
296,
15041,
11,
327,
12623,
18,
12633,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
5254,
12,
2890,
16,
1004,
33,
7036,
16,
12492,
33,
7036,
16,
2826,
9987,
4672,
9163,
9163,
5323,
3292,
17381,
67,
1945,
3546,
273,
296,
15041,
11,
327,
12623,
18,
12633,
67,
... |
node = self.document.createTextNode(chars[start:start + length]) | node = self.document.createTextNode(chars) | def ignorableWhitespace(self, chars): node = self.document.createTextNode(chars[start:start + length]) parent = self.curNode node.parentNode = parent self.lastEvent[1] = [(IGNORABLE_WHITESPACE, node), None] self.lastEvent = self.lastEvent[1] #self.events.append((IGNORABLE_WHITESPACE, node)) | 87e48ef0a12be7fca2480ca8f7557916899a9bb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/87e48ef0a12be7fca2480ca8f7557916899a9bb6/pulldom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9750,
15514,
9431,
12,
2890,
16,
5230,
4672,
756,
273,
365,
18,
5457,
18,
2640,
17299,
12,
7549,
13,
982,
273,
365,
18,
1397,
907,
756,
18,
2938,
907,
273,
982,
365,
18,
2722,
1133,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9750,
15514,
9431,
12,
2890,
16,
5230,
4672,
756,
273,
365,
18,
5457,
18,
2640,
17299,
12,
7549,
13,
982,
273,
365,
18,
1397,
907,
756,
18,
2938,
907,
273,
982,
365,
18,
2722,
1133,
... |
def _cache(cls, f, key, args=None, kwargs=None, timeout=None): key = '.'.join(['molly', cls.conf.local_name, key]) | def _cache(self, f, key, args=None, kwargs=None, timeout=None): key = '.'.join(['molly', self.conf.local_name, key]) | def _cache(cls, f, key, args=None, kwargs=None, timeout=None): key = '.'.join(['molly', cls.conf.local_name, key]) value = cache.get(key) if value is None: print "Fetching" value = f(*(args or ()), **(kwargs or {})) cache.set(key, value, timeout) return value | d63c57c064371aee50b0de9116c8b39e9347aa76 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14173/d63c57c064371aee50b0de9116c8b39e9347aa76/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2493,
12,
2890,
16,
284,
16,
498,
16,
833,
33,
7036,
16,
1205,
33,
7036,
16,
2021,
33,
7036,
4672,
498,
273,
2611,
18,
5701,
12,
3292,
21260,
715,
2187,
365,
18,
3923,
18,
3729,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2493,
12,
2890,
16,
284,
16,
498,
16,
833,
33,
7036,
16,
1205,
33,
7036,
16,
2021,
33,
7036,
4672,
498,
273,
2611,
18,
5701,
12,
3292,
21260,
715,
2187,
365,
18,
3923,
18,
3729,... |
""" Should return same object for any other object """ | """ Should return same object for any other object. """ | def test_returns_object_for_object(self): """ Should return same object for any other object """ instance = self.test_instance target = object() expect_result = target result = instance._make_signal_handler(target) self.failUnlessEqual(expect_result, result) | 33a5bfc655a6417210c5c80d9f942714bf596533 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4939/33a5bfc655a6417210c5c80d9f942714bf596533/test_daemon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
6154,
67,
1612,
67,
1884,
67,
1612,
12,
2890,
4672,
3536,
9363,
327,
1967,
733,
364,
1281,
1308,
733,
18,
3536,
791,
273,
365,
18,
3813,
67,
1336,
1018,
273,
733,
1435,
4489,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6154,
67,
1612,
67,
1884,
67,
1612,
12,
2890,
4672,
3536,
9363,
327,
1967,
733,
364,
1281,
1308,
733,
18,
3536,
791,
273,
365,
18,
3813,
67,
1336,
1018,
273,
733,
1435,
4489,... |
print "No relative accessabilities calculated when using other prob radius then 1.4 A" | T.flushPrint("\nNo relative accessabilities calculated when using a prob radius other than 1.4 A or not using the Richards vdw radii set.") def failed( self ): """ Called if external program failed, Overrides Executor method. In some very rare cases SurfaceRacer round off error cause the program to terminate. The simplest remedy to this problem is to increase the probe radii with a very small number and rerun the calculation. """ self.probe = self.probe + 0.001 self.run() | def finish( self ): """ Overrides Executor method """ Executor.finish( self ) self.result = self.parse_result( self.output ) if self.probe == 1.4: self.__relExposure('MS') self.__relExposure('AS') else: print "No relative accessabilities calculated when using other prob radius then 1.4 A" | 9a53b9023dc0694e199f5b1532e9cb9d0dd06a03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/482/9a53b9023dc0694e199f5b1532e9cb9d0dd06a03/SurfaceRacer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
12,
365,
262,
30,
3536,
531,
9857,
13146,
707,
3536,
13146,
18,
13749,
12,
365,
262,
365,
18,
2088,
273,
365,
18,
2670,
67,
2088,
12,
365,
18,
2844,
262,
309,
365,
18,
27230,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4076,
12,
365,
262,
30,
3536,
531,
9857,
13146,
707,
3536,
13146,
18,
13749,
12,
365,
262,
365,
18,
2088,
273,
365,
18,
2670,
67,
2088,
12,
365,
18,
2844,
262,
309,
365,
18,
27230,
4... |
text=datetime.datetime.today().strftime("%I:%M %p, %A %B %d %Y") | text=unicode(datetime.datetime.today().strftime("%I:%M %p, %A %B %d %Y"), errors="replace", encoding=locale.getlocale()[1]) | def script_dateTime(self,keyPress,nextScript): text=datetime.datetime.today().strftime("%I:%M %p, %A %B %d %Y") if text[0]=='0': text=text[1:] speech.speakMessage(text) | c077416465e0472edb3fa3ef174bf033c947d97c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9340/c077416465e0472edb3fa3ef174bf033c947d97c/_default.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2728,
67,
712,
950,
12,
2890,
16,
856,
11840,
16,
4285,
3651,
4672,
977,
33,
9124,
12,
6585,
18,
6585,
18,
30064,
7675,
701,
9982,
27188,
45,
5319,
49,
738,
84,
16,
738,
37,
738,
38,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2728,
67,
712,
950,
12,
2890,
16,
856,
11840,
16,
4285,
3651,
4672,
977,
33,
9124,
12,
6585,
18,
6585,
18,
30064,
7675,
701,
9982,
27188,
45,
5319,
49,
738,
84,
16,
738,
37,
738,
38,... |
values['factor'] != round(1/values['rate'], 6): factor = round(1/values['rate'], 6) | values['factor'] != round(1.0/values['rate'], 6): factor = round(1.0/values['rate'], 6) | def check_factor_and_rate(values): factor = None rate = None | 4df7058a1bfea50026f1f02f1638f1b380528843 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/533/4df7058a1bfea50026f1f02f1638f1b380528843/uom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
6812,
67,
464,
67,
5141,
12,
2372,
4672,
5578,
273,
599,
4993,
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,
... | [
1,
1,
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,
866,
67,
6812,
67,
464,
67,
5141,
12,
2372,
4672,
5578,
273,
599,
4993,
273,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
""" | Permission -- Always available """ | def Day_(): """ | b8c350cc5b36f5ce907db3ed0e2c54460ed7de1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b8c350cc5b36f5ce907db3ed0e2c54460ed7de1c/DateTime.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13735,
67,
13332,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13735,
67,
13332,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print option test(p["testDir"], option[1]) | test(p["testDir"], option[1], debug_level) | def create_pydocs(): sys.path.append(os.getcwd() + "/src") import springpython if not os.path.exists("target/docs/pydoc"): os.mkdir("target/docs/pydoc") cur = os.getcwd() os.chdir("target/docs/pydoc") pydoc.writedoc("springpython") pydoc.writedoc("springpython.aop") pydoc.writedoc("springpython.aop.utils") pydoc.writedoc("springpython.config") pydoc.writedoc("springpython.config.decorator") pydoc.writedoc("springpython.container") pydoc.writedoc("springpython.context") pydoc.writedoc("springpython.context.scope") pydoc.writedoc("springpython.database") pydoc.writedoc("springpython.database.core") pydoc.writedoc("springpython.database.factory") pydoc.writedoc("springpython.database.transaction") pydoc.writedoc("springpython.factory") pydoc.writedoc("springpython.remoting") pydoc.writedoc("springpython.remoting.hessian") pydoc.writedoc("springpython.remoting.hessian.hessianlib") pydoc.writedoc("springpython.remoting.pyro") pydoc.writedoc("springpython.remoting.pyro.PyroDaemonHolder") pydoc.writedoc("springpython.security") pydoc.writedoc("springpython.security.cherrypy31") pydoc.writedoc("springpython.security.intercept") pydoc.writedoc("springpython.security.context") pydoc.writedoc("springpython.security.context.SecurityContextHolder") pydoc.writedoc("springpython.security.providers") pydoc.writedoc("springpython.security.providers.dao") pydoc.writedoc("springpython.security.providers.encoding") pydoc.writedoc("springpython.security.userdetails") pydoc.writedoc("springpython.security.userdetails.dao") pydoc.writedoc("springpython.security.web") top_color = "#7799ee" pkg_color = "#aa55cc" class_color = "#ee77aa" class_highlight = "#ffc8d8" function_color = "#eeaa77" data_color = "#55aa55" for file in os.listdir("."): if "springpython" not in file: continue print "Altering appearance of %s" % file file_input = open(file).read() file_input = re.compile(top_color).sub("GREEN", file_input) file_input = re.compile(pkg_color).sub("GREEN", file_input) file_input = re.compile(class_color).sub("GREEN", file_input) file_input = re.compile(class_highlight).sub("LIGHTGREEN", file_input) file_input = re.compile(function_color).sub("LIGHTGREEN", file_input) file_input = re.compile(data_color).sub("LIGHTGREEN", file_input) file_output = open(file, "w") file_output.write(file_input) file_output.close() os.chdir(cur) | 170dd39b88ceef35d0bd055f76db990772aa994f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7713/170dd39b88ceef35d0bd055f76db990772aa994f/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2074,
8532,
13332,
2589,
18,
803,
18,
6923,
12,
538,
18,
588,
11089,
1435,
397,
2206,
4816,
7923,
1930,
25974,
8103,
225,
309,
486,
1140,
18,
803,
18,
1808,
2932,
3299,
19,
85... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2074,
8532,
13332,
2589,
18,
803,
18,
6923,
12,
538,
18,
588,
11089,
1435,
397,
2206,
4816,
7923,
1930,
25974,
8103,
225,
309,
486,
1140,
18,
803,
18,
1808,
2932,
3299,
19,
85... |
self.poll_timer.start(1000) | self.poll_timer.start(update_interval) | def __init__(self, service_source = None, frontend_source = None): Source.__init__(self) self.service_source = service_source self.frontend_source = frontend_source self.invalidate() self.poll_timer = eTimer() self.poll_timer.timeout.get().append(self.updateFrontendStatus) self.poll_timer.start(1000) | 02522d3c5a29ea1a3109931efe9d88bc15762120 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6652/02522d3c5a29ea1a3109931efe9d88bc15762120/FrontendStatus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1156,
67,
3168,
273,
599,
16,
15442,
67,
3168,
273,
599,
4672,
4998,
16186,
2738,
972,
12,
2890,
13,
365,
18,
3278,
67,
3168,
273,
1156,
67,
3168,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1156,
67,
3168,
273,
599,
16,
15442,
67,
3168,
273,
599,
4672,
4998,
16186,
2738,
972,
12,
2890,
13,
365,
18,
3278,
67,
3168,
273,
1156,
67,
3168,
365,
... |
def get_children(self,uri, filters=None): | def get_childs(self,uri, filters=None): | def get_children(self,uri, filters=None): """ return the child objects as self.baseuris for the given URI """ self.parent.log_message('get children: %s' % uri) cr, uid, pool, dbname, uri2 = self.get_cr(uri, allow_last=True) | f25e5da78726c2efe93b2d140e3ab87a37baf7f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f25e5da78726c2efe93b2d140e3ab87a37baf7f4/dav_fs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3624,
87,
12,
2890,
16,
1650,
16,
3415,
33,
7036,
4672,
3536,
327,
326,
1151,
2184,
487,
365,
18,
1969,
23510,
364,
326,
864,
3699,
3536,
365,
18,
2938,
18,
1330,
67,
2150,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3624,
87,
12,
2890,
16,
1650,
16,
3415,
33,
7036,
4672,
3536,
327,
326,
1151,
2184,
487,
365,
18,
1969,
23510,
364,
326,
864,
3699,
3536,
365,
18,
2938,
18,
1330,
67,
2150,
... |
actions.append([id, proc, runtime, status, progress]) | actions.append([id, proc, runtime, (status !="" and status or ''), (progress !="" and progress or '')]) | def perform_runwebcoll(colID, ln, confirm=0, callback='yes'): """form to delete an output format not in use. colID - the collection id of the current collection. fmtID - the format id to delete.""" subtitle = """<a name="11"></a>Webcoll Status""" output = "" colID = int(colID) col_dict = dict(get_def_name('', "collection")) output += """<br><b>Last updates:</b><br>""" collection_table_update_time = "" collection_web_update_time = "" res = run_sql("SHOW TABLE STATUS LIKE 'collection'") if res: collection_table_update_time = str(res[0][11])[0:len(collection_table_update_time) - 3] output += "Collection table last updated: %s<br>" % collection_table_update_time try: file = open("%s/collections/1/last-updated-ln=en.html" % cachedir) collection_web_update_time = str(file.readline()) output += "Collection webpage last updated: %s<br>" % collection_web_update_time file.close() except StandardError, e: pass import datetime import time tabletime = time.strptime(collection_table_update_time, "%Y-%m-%d %H:%M:%S") webtime = time.strptime(collection_web_update_time, "%d %b %Y %H:%M:%S %Z") if tabletime > webtime: output += """<br><b><span class="info">Warning: The collections has been modified since last time Webcoll was executed, to process the changes, Webcoll must be executed.</span></b><br>""" header = ['ID', 'Name', 'Time', 'Status', 'Progress'] actions = [] output += """<br><b>Last BibSched tasks:</b><br>""" res = run_sql("select id, proc, host, user, runtime, sleeptime, arguments, status, progress from schTASK where proc='webcoll' and runtime< now() ORDER by runtime") if len(res) > 0: (id, proc, host, user, runtime, sleeptime, arguments, status, progress) = res[len(res) - 1] webcoll__update_time = runtime actions.append([id, proc, runtime, status, progress]) else: actions.append(['', 'webcoll', '', '', 'Not executed yet']) res = run_sql("select id, proc, host, user, runtime, sleeptime, arguments, status, progress from schTASK where proc='bibindex' and runtime< now() ORDER by runtime") if len(res) > 0: (id, proc, host, user, runtime, sleeptime, arguments, status, progress) = res[len(res) - 1] actions.append([id, proc, runtime, status, progress]) else: actions.append(['', 'bibindex', '', '', 'Not executed yet']) output += tupletotable(header=header, tuple=actions) output += """<br><b>Next scheduled BibSched run:</b><br>""" actions = [] res = run_sql("select id, proc, host, user, runtime, sleeptime, arguments, status, progress from schTASK where proc='webcoll' and runtime > now() ORDER by runtime") webcoll_future = "" if len(res) > 0: (id, proc, host, user, runtime, sleeptime, arguments, status, progress) = res[0] webcoll__update_time = runtime actions.append([id, proc, runtime, status, progress]) webcoll_future = "yes" else: actions.append(['', 'webcoll', '', '', 'Not scheduled']) res = run_sql("select id, proc, host, user, runtime, sleeptime, arguments, status, progress from schTASK where proc='bibindex' and runtime > now() ORDER by runtime") bibindex_future = "" if len(res) > 0: (id, proc, host, user, runtime, sleeptime, arguments, status, progress) = res[0] actions.append([id, proc, runtime, status, progress]) bibindex_future = "yes" else: actions.append(['', 'bibindex', '', '', 'Not scheduled']) output += tupletotable(header=header, tuple=actions) if webcoll_future == "": output += """<br><b><span class="info">Warning: Webcoll is not scheduled for a future run by bibsched, any updates to the collection will not be processed.</span></b><br>""" if bibindex_future == "": output += """<br><b><span class="info">Warning: Bibindex is not scheduled for a future run by bibsched, any updates to the records will not be processed.</span></b><br>""" try: body = [output, extra] except NameError: body = [output] if callback: return perform_index(colID, ln, "perform_runwebcoll", addadminbox(subtitle, body)) else: return addadminbox(subtitle, body) | 4985d89e7a07aff3641519d5acb862533a5cecdc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/4985d89e7a07aff3641519d5acb862533a5cecdc/websearchadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2681,
4875,
12910,
12,
1293,
734,
16,
7211,
16,
6932,
33,
20,
16,
1348,
2218,
9707,
11,
4672,
3536,
687,
358,
1430,
392,
876,
740,
486,
316,
999,
18,
645,
734,
300,
326,
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,
3073,
67,
2681,
4875,
12910,
12,
1293,
734,
16,
7211,
16,
6932,
33,
20,
16,
1348,
2218,
9707,
11,
4672,
3536,
687,
358,
1430,
392,
876,
740,
486,
316,
999,
18,
645,
734,
300,
326,
18... |
returns a standard tableau of length less than or equal to 2 with the size the same as the length of the list the standard tableau will be rectangular iff ``self`` is a complete Dyck word | Returns a standard tableau of length less than or equal to 2 with the size the same as the length of the list. The standard tableau will be rectangular iff ``self`` is a complete Dyck word. | def to_tableau(self): r""" returns a standard tableau of length less than or equal to 2 with the size the same as the length of the list the standard tableau will be rectangular iff ``self`` is a complete Dyck word | 58987736f0b32e9cfa39285a2b0af054cbaf4453 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/58987736f0b32e9cfa39285a2b0af054cbaf4453/dyck_word.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
2121,
8377,
12,
2890,
4672,
436,
8395,
1135,
279,
4529,
1014,
8377,
434,
769,
5242,
2353,
578,
3959,
358,
576,
598,
326,
963,
326,
1967,
487,
326,
769,
434,
326,
666,
326,
452... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
2121,
8377,
12,
2890,
4672,
436,
8395,
1135,
279,
4529,
1014,
8377,
434,
769,
5242,
2353,
578,
3959,
358,
576,
598,
326,
963,
326,
1967,
487,
326,
769,
434,
326,
666,
326,
452... |
"""Read a tetgen surface from a .node/.smesh file pair. | """Read a tetgen surface from a .node/.face file pair. | def readSurface(fn): """Read a tetgen surface from a .node/.smesh file pair. The given filename is either the .node or .smesh file. Returns a tuple of (nodes,elems). """ nodes,numbers = readNodes(changeExt(fn,'.node')) print "Read %s nodes" % nodes.shape[0] elems = readSmesh(changeExt(fn,'.smesh')) print "Read %s elems" % elems.shape[0] if numbers[0] == 1: elems -= 1 return nodes,elems | 4fdeae810a44a31b51c2e97754696757979479b4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2499/4fdeae810a44a31b51c2e97754696757979479b4/tetgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
11508,
12,
4293,
4672,
3536,
1994,
279,
268,
278,
4507,
9034,
628,
279,
263,
2159,
15865,
865,
585,
3082,
18,
225,
1021,
864,
1544,
353,
3344,
326,
263,
2159,
578,
263,
4808,
4607,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
11508,
12,
4293,
4672,
3536,
1994,
279,
268,
278,
4507,
9034,
628,
279,
263,
2159,
15865,
865,
585,
3082,
18,
225,
1021,
864,
1544,
353,
3344,
326,
263,
2159,
578,
263,
4808,
4607,
... |
message = "builder '" + builder.__name__ \ | message = "Builder '" + builder.__name__ \ | def build(self, tables): """ Builds the given tables. | e8e9b1566ed97c2e61c03da42d88ea3809b5a0f1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11128/e8e9b1566ed97c2e61c03da42d88ea3809b5a0f1/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
2890,
16,
4606,
4672,
3536,
3998,
87,
326,
864,
4606,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1361,
12,
2890,
16,
4606,
4672,
3536,
3998,
87,
326,
864,
4606,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
env['XPCOM_DEBUG_BREAK'] = 'stack' | if 'XPCOM_DEBUG_BREAK' not in env: env['XPCOM_DEBUG_BREAK'] = 'stack' | def __init__(self, *args, **kwargs): kwargs['env'] = env = dict(os.environ) # note, we do NOT want to set NO_EM_RESTART or jsbridge wouldn't work # avoid dialogs on windows if 'NO_EM_RESTART' in env: del env['NO_EM_RESTART'] env['XPCOM_DEBUG_BREAK'] = 'stack' # do not reuse an existing instance env['MOZ_NO_REMOTE'] = '1' mozrunner.Runner.__init__(self, *args, **kwargs) | 799ae494936bca60f65b5eb1d2d909fedf893f29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11044/799ae494936bca60f65b5eb1d2d909fedf893f29/runtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
1205,
3292,
3074,
3546,
273,
1550,
273,
2065,
12,
538,
18,
28684,
13,
468,
4721,
16,
732,
741,
4269,
2545,
358,
444,
374... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
380,
1968,
16,
2826,
4333,
4672,
1205,
3292,
3074,
3546,
273,
1550,
273,
2065,
12,
538,
18,
28684,
13,
468,
4721,
16,
732,
741,
4269,
2545,
358,
444,
374... |
t.set_daemon(True) | t.daemon = True | def deadlock_detection() : while not deadlock_detection.end : deadlock_detection.count = \ self.env.lock_detect(db.DB_LOCK_EXPIRE) if deadlock_detection.count : while not deadlock_detection.end : pass break time.sleep(0.01) | a514d2f0c0661e50d7f55cf277178b5dc636cb51 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/a514d2f0c0661e50d7f55cf277178b5dc636cb51/test_lock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8363,
739,
67,
27515,
1435,
294,
1323,
486,
8363,
739,
67,
27515,
18,
409,
294,
8363,
739,
67,
27515,
18,
1883,
273,
521,
365,
18,
3074,
18,
739,
67,
16518,
12,
1966,
18,
2290,
67,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8363,
739,
67,
27515,
1435,
294,
1323,
486,
8363,
739,
67,
27515,
18,
409,
294,
8363,
739,
67,
27515,
18,
1883,
273,
521,
365,
18,
3074,
18,
739,
67,
16518,
12,
1966,
18,
2290,
67,
6... |
in order to re-mount the bindmounts after modifying the underyling | in order to re-mount the bindmounts after modifying the underlying | def _do_bindmounts(self): """Mount various system directories onto _instroot. | 6149c09920aaf5c53bd8e31013c0f4a5de206141 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9342/6149c09920aaf5c53bd8e31013c0f4a5de206141/creator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
4376,
4778,
87,
12,
2890,
4672,
3536,
8725,
11191,
2619,
6402,
10170,
389,
8591,
3085,
18,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
2896,
67,
4376,
4778,
87,
12,
2890,
4672,
3536,
8725,
11191,
2619,
6402,
10170,
389,
8591,
3085,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for filename in os.listdir(self.srcdir): | names = os.listdir(self.srcdir) for filename in names: | def getSourcePath(self, path): """Get a path to a source file that equals file stored in path. | 2461edb721f0b5bf89e5b8436fe87c9d8141e25e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9481/2461edb721f0b5bf89e5b8436fe87c9d8141e25e/cachemanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7889,
743,
12,
2890,
16,
589,
4672,
3536,
967,
279,
589,
358,
279,
1084,
585,
716,
1606,
585,
4041,
316,
589,
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,
7889,
743,
12,
2890,
16,
589,
4672,
3536,
967,
279,
589,
358,
279,
1084,
585,
716,
1606,
585,
4041,
316,
589,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
print 'x_in =', x_in print 'x_in.type =', x_in.type print 'x_in.broadcastable =', x_in.broadcastable | def local_softmax_with_bias(node): """Try to turn softmax(sum_of_stuff) -> softmax_w_bias(matrix, bias) """ if node.op == softmax: x, = node.inputs if x.owner and x.owner.op == tensor.add: vectors = [] non_vectors = [] for x_in in x.owner.inputs: print 'x_in =', x_in print 'x_in.type =', x_in.type print 'x_in.broadcastable =', x_in.broadcastable if list(x_in.type.broadcastable) == [True, False]: # print isinstance(x_in.owner.op, tensor.DimShuffle) #since specialization comes relatively late in optimization, # we don't want to put in extra DimShuffles un-necessarily. if x_in.owner and isinstance(x_in.owner.op, tensor.DimShuffle)\ and list(x_in.owner.inputs[0].type.broadcastable)==[False]: # cut out the DimShuffle that was broadcasting a vector vectors.append(x_in.owner.inputs[0]) else: # insert an extra DimShuffle to correct the old one vectors.append(tensor.DimShuffle((True, False), (1,))(x_in)) else: non_vectors.append(x_in) # If all the inputs were vectors or broadcasted vectors, # we broadcast one of them to be used as a matrix if len(non_vectors) == 0: assert len(vectors) > 0 # we should have at least 1 input... promoted_vector = vectors.pop() non_vectors.append(tensor.shape_padleft(promoted_vector)) assert non_vectors #not empty if vectors: #we're in business... if len(vectors)>1: vector_sum = tensor.add(*vectors) else: vector_sum = vectors[0] if len(non_vectors)>1: non_vector_sum = tensor.add(*non_vectors) else: non_vector_sum = non_vectors[0] try: sm_bias = softmax_with_bias(non_vector_sum, vector_sum) except: #if our arguments have the wrong types, then forget about it return return [sm_bias] | 525825280bc03fc30d0864c9a31e225489f8d18e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/525825280bc03fc30d0864c9a31e225489f8d18e/nnet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
9269,
1896,
67,
1918,
67,
13931,
12,
2159,
4672,
3536,
7833,
358,
7005,
31823,
12,
1364,
67,
792,
67,
334,
3809,
13,
317,
31823,
67,
91,
67,
13931,
12,
5667,
16,
12005,
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,
1191,
67,
9269,
1896,
67,
1918,
67,
13931,
12,
2159,
4672,
3536,
7833,
358,
7005,
31823,
12,
1364,
67,
792,
67,
334,
3809,
13,
317,
31823,
67,
91,
67,
13931,
12,
5667,
16,
12005,
13,
... | |
mt = self.lookup(mstr)[0] | _mt = self.lookup(mstr) if len(_mt) > 0: mt = _mt[0] | def classify(self, data, mimetype=None, filename=None): """Classify works as follows: 1) you tell me the rfc-2046 name and I give you an IMimetype object 2) the filename includes an extension from which we can guess the mimetype 3) we can optionally introspect the data 4) default to self.defaultMimetype if no data was provided else to application/octet-stream of no filename was provided, else to text/plain | bd3728578cfa43f26ec9b46c371ccc870b4cde86 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12163/bd3728578cfa43f26ec9b46c371ccc870b4cde86/MimeTypesRegistry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19974,
12,
2890,
16,
501,
16,
12595,
33,
7036,
16,
1544,
33,
7036,
4672,
3536,
797,
1164,
6330,
487,
13040,
30,
404,
13,
1846,
9276,
1791,
326,
16590,
17,
21573,
26,
508,
471,
467,
849... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19974,
12,
2890,
16,
501,
16,
12595,
33,
7036,
16,
1544,
33,
7036,
4672,
3536,
797,
1164,
6330,
487,
13040,
30,
404,
13,
1846,
9276,
1791,
326,
16590,
17,
21573,
26,
508,
471,
467,
849... |
game.dist = coord(deltax, deltay).distance() game.direc = coord(deltax, deltay).course() | game.dist = math.sqrt(deltax*deltax + deltay*deltay) game.direc = math.atan2(deltax, deltay)*1.90985932 | def getcourse(isprobe, akey): # get course and distance key = 0 dquad = copy.copy(game.quadrant) navmode = "unspecified" itemp = "curt" dsect = coord() iprompt = False if game.landed and not isprobe: prout(_("Dummy! You can't leave standard orbit until you")) proutn(_("are back aboard the ship.")) scanner.chew() return False while navmode == "unspecified": if damaged(DNAVSYS): if isprobe: prout(_("Computer damaged; manual navigation only")) else: prout(_("Computer damaged; manual movement only")) scanner.chew() navmode = "manual" key = IHEOL break if isprobe and akey != -1: # For probe launch, use pre-scanned value first time key = akey akey = -1 else: key = scanner.next() if key == IHEOL: proutn(_("Manual or automatic- ")) iprompt = True scanner.chew() elif key == IHALPHA: if scanner.sees("manual"): navmode = "manual" key = scanner.next() break elif scanner.sees("automatic"): navmode = "automatic" key = scanner.next() break else: huh() scanner.chew() return False else: # numeric if isprobe: prout(_("(Manual navigation assumed.)")) else: prout(_("(Manual movement assumed.)")) navmode = "manual" break if navmode == "automatic": while key == IHEOL: if isprobe: proutn(_("Target quadrant or quadrant§or- ")) else: proutn(_("Destination sector or quadrant§or- ")) scanner.chew() iprompt = True key = scanner.next() if key != IHREAL: huh() return False xi = int(round(scanner.real))-1 key = scanner.next() if key != IHREAL: huh() return False xj = int(round(scanner.real))-1 key = scanner.next() if key == IHREAL: # both quadrant and sector specified xk = int(round(scanner.real))-1 key = scanner.next() if key != IHREAL: huh() return False xl = int(round(scanner.real))-1 dquad.x = xi dquad.y = xj dsect.y = xk dsect.x = xl else: # only one pair of numbers was specified if isprobe: # only quadrant specified -- go to center of dest quad dquad.x = xi dquad.y = xj dsect.y = dsect.x = 4 # preserves 1-origin behavior else: # only sector specified dsect.y = xi dsect.x = xj itemp = "normal" if not VALID_QUADRANT(dquad.y,dquad.x) or not VALID_SECTOR(dsect.x,dsect.y): huh() return False skip(1) if not isprobe: if itemp > "curt": if iprompt: prout(_("Helmsman Sulu- \"Course locked in for Sector %s.\"") % dsect) else: prout(_("Ensign Chekov- \"Course laid in, Captain.\"")) # the actual deltas get computed here deltax = dquad.y-game.quadrant.y + 0.1*(dsect.x-game.sector.y) deltay = game.quadrant.x-dquad.x + 0.1*(game.sector.x-dsect.y) else: # manual while key == IHEOL: proutn(_("X and Y displacements- ")) scanner.chew() iprompt = True key = scanner.next() itemp = "verbose" if key != IHREAL: huh() return False deltax = scanner.real key = scanner.next() if key != IHREAL: huh() return False deltay = scanner.real # Check for zero movement if deltax == 0 and deltay == 0: scanner.chew() return False if itemp == "verbose" and not isprobe: skip(1) prout(_("Helmsman Sulu- \"Aye, Sir.\"")) # Course actually laid in. game.dist = coord(deltax, deltay).distance() game.direc = coord(deltax, deltay).course() if game.direc < 0.0: game.direc += 12.0 scanner.chew() return True | ab4d7f5dd82fc30c4db6597dd6dd68b4dc33f98b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/ab4d7f5dd82fc30c4db6597dd6dd68b4dc33f98b/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
5566,
12,
291,
27230,
16,
279,
856,
4672,
468,
336,
4362,
471,
3888,
498,
273,
374,
302,
21733,
273,
1610,
18,
3530,
12,
13957,
18,
21733,
6890,
13,
8775,
3188,
273,
315,
318,
138... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5566,
12,
291,
27230,
16,
279,
856,
4672,
468,
336,
4362,
471,
3888,
498,
273,
374,
302,
21733,
273,
1610,
18,
3530,
12,
13957,
18,
21733,
6890,
13,
8775,
3188,
273,
315,
318,
138... |
exts.append( Extension('_AE', ['ae/_AEmodule.c'], | exts.append( Extension('MacOS', ['macosmodule.c'], | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 05ced6aa761bab7348e95a479b6f791e636ceae7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/05ced6aa761bab7348e95a479b6f791e636ceae7/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... |
passblack = 1 | def lcgInfo(self, tags, seList=None, blacklist=None, whitelist=None, full=False): """ execute a resources discovery through bdii returns a list of resulting sites """ | 7999c9439cec5d3f4f34d1b6842d20c652401c13 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/7999c9439cec5d3f4f34d1b6842d20c652401c13/SchedulerGLiteAPI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9109,
75,
966,
12,
2890,
16,
2342,
16,
695,
682,
33,
7036,
16,
11709,
33,
7036,
16,
10734,
33,
7036,
16,
1983,
33,
8381,
4672,
3536,
1836,
279,
2703,
11030,
3059,
13837,
2835,
1135,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9109,
75,
966,
12,
2890,
16,
2342,
16,
695,
682,
33,
7036,
16,
11709,
33,
7036,
16,
10734,
33,
7036,
16,
1983,
33,
8381,
4672,
3536,
1836,
279,
2703,
11030,
3059,
13837,
2835,
1135,
27... | |
self._verify_debug_msg(self.logger.msgs[0], 'keyword') | self._verify_debug_msg(self.logger.msgs[0], 'Keyword') | def test_customized_message(self): for msgcols in [ ['mymessage'], ['My','message','in','5','cols'] ]: self.logger.msgs = [] tout = KeywordTimeout('1s', *msgcols) tout.start() tout.run(passing, logger=self.logger) self._verify_debug_msg(self.logger.msgs[0], 'keyword') tout.secs = 0.01 assert_raises_with_msg(TimeoutError, ' '.join(msgcols), tout.run, sleeping, (1,), {}, self.logger) self._verify_debug_msg(self.logger.msgs[1], 'keyword') | 20f1d32274de6fa6196fa9f173f85428ac750675 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6988/20f1d32274de6fa6196fa9f173f85428ac750675/test_timeouts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3662,
1235,
67,
2150,
12,
2890,
4672,
364,
1234,
6842,
316,
306,
10228,
4811,
2150,
17337,
10228,
12062,
17023,
2150,
17023,
267,
17023,
25,
17023,
6842,
3546,
308,
30,
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,
1842,
67,
3662,
1235,
67,
2150,
12,
2890,
4672,
364,
1234,
6842,
316,
306,
10228,
4811,
2150,
17337,
10228,
12062,
17023,
2150,
17023,
267,
17023,
25,
17023,
6842,
3546,
308,
30,
365,
18,
... |
formcomponent.experiment_id = self.inventory.id | formcomponent.inventory.experiment_id = self.inventory.id | def sample_preparation(self, director): try: page = director.retrieveSecurePage( 'neutronexperimentwizard' ) except AuthenticationError, err: return err.page | e9fbac8f71b9f6b8c6aa9f36455c6a2d106f7f16 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/578/e9fbac8f71b9f6b8c6aa9f36455c6a2d106f7f16/NeutronExperimentWizard.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3296,
67,
1484,
20961,
12,
2890,
16,
2657,
280,
4672,
775,
30,
1363,
273,
2657,
280,
18,
17466,
12834,
1964,
12,
296,
4644,
14566,
265,
18142,
31837,
11,
262,
1335,
8665,
668,
16,
393,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3296,
67,
1484,
20961,
12,
2890,
16,
2657,
280,
4672,
775,
30,
1363,
273,
2657,
280,
18,
17466,
12834,
1964,
12,
296,
4644,
14566,
265,
18142,
31837,
11,
262,
1335,
8665,
668,
16,
393,
... |
def getInstalledVersions(application): from Ganga.Utility.Shell import Shell name = application.__class__.__name__ platform = application.platform release_area = '%s_release_area' % name user_release_area = application.user_release_area script = """ unalias -a unset CMTPROJECTPATH export CMTCONFIG="%(PLATFORM)s" export User_release_area="%(USER_RELEASE_AREA)s" . $LHCBHOME/scripts/setenvProject.sh %(PROJECT)s --list-versions """ % {'PLATFORM':platform,'USER_RELEASE_AREA':user_release_area,'PROJECT':name} import tempfile, os, sys shName = tempfile.mktemp('.sh') outfile = file(shName,'w') try: outfile.write(script) finally: outfile.close() os.chmod(shName,0777) shell = Shell() rc, output, m = shell.cmd1(shName) if rc == 0: os.unlink(shName) installedVersions = [] release_area_dir = os.environ[release_area] for l in output.split('\n'): tokens = l.split(' ') if len(tokens) == 3 and tokens[1] == 'in' and tokens[2] == release_area_dir: installedVersions.append(tokens[0]) return installedVersions | def getInstalledVersions(application): from Ganga.Utility.Shell import Shell name = application.__class__.__name__ platform = application.platform release_area = '%s_release_area' % name user_release_area = application.user_release_area script = """#!/bin/sh | b21198beb1803c4b3aa6ed8151675bcfe7974b9f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1488/b21198beb1803c4b3aa6ed8151675bcfe7974b9f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7854,
334,
4502,
5940,
12,
3685,
4672,
225,
628,
611,
539,
69,
18,
6497,
18,
13220,
1930,
19433,
225,
508,
273,
2521,
16186,
1106,
972,
16186,
529,
972,
4072,
273,
2521,
18,
9898,
3992,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7854,
334,
4502,
5940,
12,
3685,
4672,
225,
628,
611,
539,
69,
18,
6497,
18,
13220,
1930,
19433,
225,
508,
273,
2521,
16186,
1106,
972,
16186,
529,
972,
4072,
273,
2521,
18,
9898,
3992,
... | |
print "ENTERING CHILD FSM:" + str(fsm) print str(self) | def __enterChildren(self, argList): """__enterChildren(self, argList) Enter all child FSMs""" for fsm in self.__FSMList: print "ENTERING CHILD FSM:" + str(fsm) print str(self) # Check to see if the child fsm is already in a state # if it is, politely request the initial state if fsm.getCurrentState(): fsm.request((fsm.getInitialState()).getName()) # If it has no current state, I assume this means it # has never entered the initial state, so enter it # explicitly else: fsm.enterInitialState() | 18e0cff8448fd5c5db43c9b0e17b921847194934 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/18e0cff8448fd5c5db43c9b0e17b921847194934/State.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2328,
4212,
12,
2890,
16,
1501,
682,
4672,
3536,
972,
2328,
4212,
12,
2890,
16,
1501,
682,
13,
15439,
777,
1151,
9247,
6947,
8395,
364,
26957,
316,
365,
16186,
4931,
49,
682,
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,
1001,
2328,
4212,
12,
2890,
16,
1501,
682,
4672,
3536,
972,
2328,
4212,
12,
2890,
16,
1501,
682,
13,
15439,
777,
1151,
9247,
6947,
8395,
364,
26957,
316,
365,
16186,
4931,
49,
682,
30,
... | |
@param horiz_sep a string that is repeated in order to produce a separator row between the title and the body (if needed) @param max_col the maximum number of coulmns used by the box (including indentation) @param tab_str a string to represent indentation @param tab_num the number of leveles of indentations @param border a tuple of 8 element in the form (tl, t, tr, l, r, bl, b, br) of strings that represent the different corners and sides of the box @param prefix a prefix string added before the box @param suffix a suffix string added after the box @param force_horiz True in order to print the horizontal line even when there is no title @param style the name of one of the style in CFG_WRAP_STYLES. By default | @param style_name the name of one of the style in CFG_WRAP_STYLES. By default | def wrap_text_in_a_box(body='', title='', **args): """Return a nicely formatted text box: e.g. ****************** ** title ** **--------------** ** body ** ****************** Indentation and newline are respected. @param body the main text @param title an optional title @param horiz_sep a string that is repeated in order to produce a separator row between the title and the body (if needed) @param max_col the maximum number of coulmns used by the box (including indentation) @param tab_str a string to represent indentation @param tab_num the number of leveles of indentations @param border a tuple of 8 element in the form (tl, t, tr, l, r, bl, b, br) of strings that represent the different corners and sides of the box @param prefix a prefix string added before the box @param suffix a suffix string added after the box @param force_horiz True in order to print the horizontal line even when there is no title @param style the name of one of the style in CFG_WRAP_STYLES. By default is set to DEFAULT. a part from body and title, if you don't specify anything, the DEFAULT style is applied. If style is specified it overwrite the DEFAULT one. If any other parameter is specified it will overwrite the specific parameter of the chosen style. e.g.: print wrap_text_in_a_box(title='prova', body=' 123 prova.\n Vediamo come si indenta', horiz_sep='-', style='no_border', max_col=20, tab_num=1) prova ---------------- 123 prova. Vediamo come si indenta """ def wrap_row(row, max_col): """Wrap a single row""" spaces = _beginning_space_re.match(row).group() row = row[len(spaces):] return wrap(row, initial_indent=spaces, subsequent_indent=spaces, width=max_col) style = CFG_WRAP_STYLES['DEFAULT'] if args.has_key('style'): style.update(CFG_WRAP_STYLES[args['style']]) style.update(args) horiz_sep = style['horiz_sep'] border = style['border'] tab_str = style['tab_str'] * style['tab_num'] max_col = style['max_col'] - len(border[3]) - len(border[4]) - len(tab_str) prefix = style['prefix'] suffix = style['suffix'] force_horiz = style['force_horiz'] tmp_rows = [wrap_row(row, max_col) for row in body.split('\n')] body_rows = [] for rows in tmp_rows: body_rows += rows tmp_rows = [wrap_row(row, max_col) for row in title.split('\n')] title_rows = [] for rows in tmp_rows: title_rows += rows max_col = max([len(row) for row in body_rows + title_rows]) mid_top_border_len = max_col + len(border[3]) + len(border[4]) - len(border[0]) - len(border[2]) mid_bottom_border_len = max_col + len(border[3]) + len(border[4]) - len(border[5]) - len(border[7]) top_border = border[0] + (border[1] * mid_top_border_len)[:mid_top_border_len] + border[2] bottom_border = border[5] + (border[6] * mid_bottom_border_len)[:mid_bottom_border_len] + border[7] horiz_line = border[3] + (horiz_sep * max_col)[:max_col] + border[4] title_rows = [tab_str + border[3] + row + ' ' * (max_col - len(row)) + border[4] for row in title_rows] body_rows = [tab_str + border[3] + row + ' ' * (max_col - len(row)) + border[4] for row in body_rows] ret = '' if top_border: ret += [tab_str + top_border] ret += title_rows if title_rows or force_horiz: ret += [tab_str + horiz_line] ret += body_rows if bottom_border: ret += [tab_str + bottom_border] return prefix + '\n'.join(ret) + suffix | c818eff17ec025c2e1950e8684d0304f821201bb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/c818eff17ec025c2e1950e8684d0304f821201bb/textutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
67,
955,
67,
267,
67,
69,
67,
2147,
12,
3432,
2218,
2187,
2077,
2218,
2187,
2826,
1968,
4672,
3536,
990,
279,
11562,
2357,
4955,
977,
3919,
30,
425,
18,
75,
18,
380,
2751,
14,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2193,
67,
955,
67,
267,
67,
69,
67,
2147,
12,
3432,
2218,
2187,
2077,
2218,
2187,
2826,
1968,
4672,
3536,
990,
279,
11562,
2357,
4955,
977,
3919,
30,
425,
18,
75,
18,
380,
2751,
14,
... |
import random | def data_gen(path): import random return "Gutta cavat cavat capidem\n" * 100 | 67859fcd95d995a2033c35d54406ea52040e2fd3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/373/67859fcd95d995a2033c35d54406ea52040e2fd3/test_50k.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
67,
4507,
12,
803,
4672,
327,
315,
43,
322,
2351,
276,
842,
270,
276,
842,
270,
3523,
831,
81,
64,
82,
6,
380,
2130,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
501,
67,
4507,
12,
803,
4672,
327,
315,
43,
322,
2351,
276,
842,
270,
276,
842,
270,
3523,
831,
81,
64,
82,
6,
380,
2130,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
sorter = ColumnSorter(colIndex) req.hdf[k] = 1 rows.sort(sorter.sort) | asc = 1 req.hdf[k] = asc def sortkey(row): val = row[colIndex] if isinstance(val, basestring): val = val.lower() return val rows = sorted(rows, key=sortkey, reverse=(not asc)) | def _render_view(self, req, db, id): """ uses a user specified sql query to extract some information from the database and presents it as a html table. """ actions = {'create': 'REPORT_CREATE', 'delete': 'REPORT_DELETE', 'modify': 'REPORT_MODIFY'} for action in [k for k,v in actions.items() if req.perm.has_permission(v)]: req.hdf['report.can_' + action] = True req.hdf['report.href'] = self.env.href.report(id) | ce961a02b4f002eab5e17181d20d3142ed654bd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/ce961a02b4f002eab5e17181d20d3142ed654bd6/report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
1945,
12,
2890,
16,
1111,
16,
1319,
16,
612,
4672,
3536,
4692,
279,
729,
1269,
1847,
843,
358,
2608,
2690,
1779,
628,
326,
2063,
471,
3430,
87,
518,
487,
279,
1729,
1014... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
1945,
12,
2890,
16,
1111,
16,
1319,
16,
612,
4672,
3536,
4692,
279,
729,
1269,
1847,
843,
358,
2608,
2690,
1779,
628,
326,
2063,
471,
3430,
87,
518,
487,
279,
1729,
1014... |
transName = gConfig.getValue(self.section+'/Transformation','All') | transName = self.am_getOption('Transformation','All') | def getTransformations(self): # Obtain the transformations to be executed transName = gConfig.getValue(self.section+'/Transformation','All') if transName == 'All': gLogger.info("%s.getTransformations: Initializing general purpose agent." % AGENT_NAME) res = self.transDB.getTransformationWithStatus(['Active','Flush']) if not res['OK']: gLogger.error("%s.getTransformations: Failed to get transformations." % AGENT_NAME, res['Message']) return res transformations = res['Value'] gLogger.info("%s.getTransformations: Obtained %d transformations to process" % (AGENT_NAME,len(transformations))) else: gLogger.info("%s.getTransformations: Initializing for transformation %s." % (AGENT_NAME,transName)) res = self.transDB.getTransformation(transName) if not res['OK']: gLogger.error("%s.getTransformations: Failed to get transformation." % AGENT_NAME, res['Message']) return res transformations = [res['Value']] return S_OK(transformations) | 6ebf5272629cc51038fc8c36b6107d4be259d871 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/6ebf5272629cc51038fc8c36b6107d4be259d871/TransformationAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
4059,
1012,
12,
2890,
4672,
468,
24850,
326,
19245,
358,
506,
7120,
906,
461,
273,
365,
18,
301,
67,
588,
1895,
2668,
15292,
17023,
1595,
6134,
309,
906,
461,
422,
296,
1595,
4278,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4059,
1012,
12,
2890,
4672,
468,
24850,
326,
19245,
358,
506,
7120,
906,
461,
273,
365,
18,
301,
67,
588,
1895,
2668,
15292,
17023,
1595,
6134,
309,
906,
461,
422,
296,
1595,
4278,
... |
eventOn, eventOff = eventPair | def _ignore(self, token): """ Undo a watch(). Don't call this directly, call release() on the token that watch() returned. """ inputSource = self._token2inputSource.pop(token) eventPair = self._watching[inputSource].pop(token) token.invalidate() eventOn, eventOff = eventPair DirectObject.DirectObject.ignore(self, eventOn) DirectObject.DirectObject.ignore(self, eventOff) if len(self._watching[inputSource]) == 0: del self._watching[inputSource] self.set(name, False, inputSource) | b8adfe5ae221cc5444ecfeefd4c5c35b187f102a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/b8adfe5ae221cc5444ecfeefd4c5c35b187f102a/InputState.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6185,
12,
2890,
16,
1147,
4672,
3536,
1351,
2896,
279,
4267,
7675,
7615,
1404,
745,
333,
5122,
16,
745,
3992,
1435,
603,
326,
1147,
716,
4267,
1435,
2106,
18,
3536,
810,
1830,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6185,
12,
2890,
16,
1147,
4672,
3536,
1351,
2896,
279,
4267,
7675,
7615,
1404,
745,
333,
5122,
16,
745,
3992,
1435,
603,
326,
1147,
716,
4267,
1435,
2106,
18,
3536,
810,
1830,
273,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.