rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
1.0000000000*I
1.0000000*I
def sqrt(self): """ EXAMPLES: sage: C, i = ComplexField(30).objgen() sage: i.sqrt() 0.70710678119 + 0.70710678119*I sage: (1+i).sqrt() 1.0986841135 + 0.45508986060*I sage: (C(-1)).sqrt() 1.0000000000*I sage: i = ComplexField(200).0 sage: i.sqrt() 0.70710678118654752440084436210484903928483593768847403658833981 + 0.70710678118654752440084436210484903928483593768847403658833981*I # 32-bit 0.70710678118654752440084436210484903928483593768847403658833981 + 0.70710678118654752440084436210484903928483593768847403658833981*I # 64-bit
0f85c81e959512e75d1c3f66db056b379125ea81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/0f85c81e959512e75d1c3f66db056b379125ea81/complex_number.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5700, 12, 2890, 4672, 3536, 5675, 8900, 11386, 30, 272, 410, 30, 385, 16, 277, 273, 16060, 974, 12, 5082, 2934, 2603, 4507, 1435, 272, 410, 30, 277, 18, 24492, 1435, 374, 18, 7301, 27,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5700, 12, 2890, 4672, 3536, 5675, 8900, 11386, 30, 272, 410, 30, 385, 16, 277, 273, 16060, 974, 12, 5082, 2934, 2603, 4507, 1435, 272, 410, 30, 277, 18, 24492, 1435, 374, 18, 7301, 27,...
msg = msg + " List reduced from %r to %r due to restriction <%r>\n" % ( len(list), len(new_list), sel)
msg += " List reduced from %r to %r due to restriction <%r>\n" % ( len(list), len(new_list), sel)
def eval_print_amount(self, sel, list, msg): new_list = list if type(sel) == type(""): new_list = [] for func in list: if re.search(sel, func_std_string(func)): new_list.append(func) else: count = len(list) if type(sel) == type(1.0) and 0.0 <= sel < 1.0: count = int(count * sel + .5) new_list = list[:count] elif type(sel) == type(1) and 0 <= sel < count: count = sel new_list = list[:count] if len(list) != len(new_list): msg = msg + " List reduced from %r to %r due to restriction <%r>\n" % ( len(list), len(new_list), sel)
401c4c60c38ffdcfe94d253cbc3c890a8ec5830d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/401c4c60c38ffdcfe94d253cbc3c890a8ec5830d/pstats.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5302, 67, 1188, 67, 8949, 12, 2890, 16, 357, 16, 666, 16, 1234, 4672, 394, 67, 1098, 273, 666, 309, 618, 12, 1786, 13, 422, 618, 2932, 6, 4672, 394, 67, 1098, 273, 5378, 364, 1326, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5302, 67, 1188, 67, 8949, 12, 2890, 16, 357, 16, 666, 16, 1234, 4672, 394, 67, 1098, 273, 666, 309, 618, 12, 1786, 13, 422, 618, 2932, 6, 4672, 394, 67, 1098, 273, 5378, 364, 1326, ...
sqlStr = """UPDATE rc_site SET is_active="false";""" Session.execute(sqlStr) return
sqlStr = """UPDATE rc_site SET is_active="false" WHERE site_name = "%s";""" % siteName Session.execute(sqlStr) return
def deactivate(self, siteName): """ _deactivate_
cc72b31eb57750d07bd97c4477de1aaa915f0478 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8887/cc72b31eb57750d07bd97c4477de1aaa915f0478/ResourceControlDB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18790, 12, 2890, 16, 27712, 4672, 3536, 389, 323, 10014, 67, 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, 18790, 12, 2890, 16, 27712, 4672, 3536, 389, 323, 10014, 67, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
[x^2 + x + 1, [0, 1], -3, 1, [Mat([1, -0.50000000000000000000000000000000000000 + 0.86602540378443864676372317075293618347*I]), [1, 0.36602540378443864676372317075293618347; 1, -1.3660254037844386467637231707529361835], 0, [2, -1; -1, -1], [3, 2; 0, 1], [1, -1; -1, -2], [3, [2, -1; 1, 1]]], [-0.50000000000000000000000000000000000000 + 0.86602540378443864676372317075293618347*I], [1, x], [1, 0; 0, 1], [1, 0, 0, -1; 0, 1, 1, -1]]
[x^2 + x + 1, [0, 1], -3, 1, ... [1, x], [1, 0; 0, 1], [1, 0, 0, -1; 0, 1, 1, -1]]
def _pari_init_(self): """ Needed for conversion of number field to PARI. EXAMPLES: sage: k = NumberField(x^2 + x + 1, 'a') sage: k._pari_init_() 'nfinit(x^2 + x + 1)' sage: k._pari_() [x^2 + x + 1, [0, 1], -3, 1, [Mat([1, -0.50000000000000000000000000000000000000 + 0.86602540378443864676372317075293618347*I]), [1, 0.36602540378443864676372317075293618347; 1, -1.3660254037844386467637231707529361835], 0, [2, -1; -1, -1], [3, 2; 0, 1], [1, -1; -1, -2], [3, [2, -1; 1, 1]]], [-0.50000000000000000000000000000000000000 + 0.86602540378443864676372317075293618347*I], [1, x], [1, 0; 0, 1], [1, 0, 0, -1; 0, 1, 1, -1]] sage: pari(k) [x^2 + x + 1, [0, 1], -3, 1, [Mat([1, -0.50000000000000000000000000000000000000 + 0.86602540378443864676372317075293618347*I]), [1, 0.36602540378443864676372317075293618347; 1, -1.3660254037844386467637231707529361835], 0, [2, -1; -1, -1], [3, 2; 0, 1], [1, -1; -1, -2], [3, [2, -1; 1, 1]]], [-0.50000000000000000000000000000000000000 + 0.86602540378443864676372317075293618347*I], [1, x], [1, 0; 0, 1], [1, 0, 0, -1; 0, 1, 1, -1]] """ return 'nfinit(%s)'%self.pari_polynomial()
9a0a1023ff0ef803d398570b31bd9868dddcbc52 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/9a0a1023ff0ef803d398570b31bd9868dddcbc52/number_field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1065, 77, 67, 2738, 67, 12, 2890, 4672, 3536, 26480, 364, 4105, 434, 1300, 652, 358, 3939, 45, 18, 225, 5675, 8900, 11386, 30, 272, 410, 30, 417, 273, 3588, 974, 12, 92, 66, 22,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1065, 77, 67, 2738, 67, 12, 2890, 4672, 3536, 26480, 364, 4105, 434, 1300, 652, 358, 3939, 45, 18, 225, 5675, 8900, 11386, 30, 272, 410, 30, 417, 273, 3588, 974, 12, 92, 66, 22,...
_call_seattlegeni_func(client.renew_vessels, vesselhandle_list)
_call_seattlegeni_func(client.renew_resources, vesselhandle_list)
def seattlegeni_renew_vessels(identity, vesselhandle_list): """ <Purpose> Renew vessels previously acquired from SeattleGENI. <Arguments> identity The identity to use for communicating with SeattleGENI. vesselhandle_list The vessels to be renewed. <Exceptions> The common SeattleGENI exceptions described in the module comments, as well as: SeattleGENINotEnoughCredits If the account is currently over its vessel credit limit, then vessels cannot be renewed until the account is no longer over its credit limit. <Side Effects> The expiration time of the vessels is is reset to the maximum. <Returns> None """ _validate_vesselhandle_list(vesselhandle_list) client = _get_seattlegeni_client(identity) _call_seattlegeni_func(client.renew_vessels, vesselhandle_list)
d178e43b24d57a152e73594bccc5aba379bf33bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7263/d178e43b24d57a152e73594bccc5aba379bf33bb/experimentlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 695, 4558, 1935, 275, 77, 67, 1187, 359, 67, 90, 403, 10558, 12, 10781, 16, 331, 403, 292, 4110, 67, 1098, 4672, 3536, 411, 10262, 4150, 34, 25921, 359, 331, 403, 10558, 7243, 20598, 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, 695, 4558, 1935, 275, 77, 67, 1187, 359, 67, 90, 403, 10558, 12, 10781, 16, 331, 403, 292, 4110, 67, 1098, 4672, 3536, 411, 10262, 4150, 34, 25921, 359, 331, 403, 10558, 7243, 20598, 6...
then = datetime.utcfromtimestamp(time)
then = datetime.fromtimestamp(time)
def ago(self, time): then = datetime.utcfromtimestamp(time) delta = datetime.now() - then ago = '' if delta.days / 365: ago = '%s years' % (delta.days / 365) elif delta.days / 30: ago = '%s months' % (delta.days / 30) elif delta.days: ago = '%s days' % delta.days elif delta.seconds / 3600: ago = '%s hours' % (delta.seconds / 3600) elif delta.seconds / 60: ago = '%s minutes' % (delta.seconds / 60) else: ago = '%s seconds' % delta.seconds return ago
5cc236749cf5c92c539251575dcea135b4889320 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12048/5cc236749cf5c92c539251575dcea135b4889320/bzr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20325, 12, 2890, 16, 813, 4672, 1508, 273, 3314, 18, 2080, 5508, 12, 957, 13, 3622, 273, 3314, 18, 3338, 1435, 300, 1508, 20325, 273, 875, 309, 3622, 18, 9810, 342, 21382, 30, 20325, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20325, 12, 2890, 16, 813, 4672, 1508, 273, 3314, 18, 2080, 5508, 12, 957, 13, 3622, 273, 3314, 18, 3338, 1435, 300, 1508, 20325, 273, 875, 309, 3622, 18, 9810, 342, 21382, 30, 20325, 2...
typename = u''.join(n.astext() for n in types[fieldarg])
def make_field(self, types, domain, items): fieldname = nodes.field_name('', self.label) listnode = self.list_type() for fieldarg, content in items: par = nodes.paragraph() par += self.make_xref(self.rolename, domain, fieldarg, nodes.strong) if fieldarg in types: typename = u''.join(n.astext() for n in types[fieldarg]) par += nodes.Text(' (') par += self.make_xref(self.typerolename, domain, typename) par += nodes.Text(')') par += nodes.Text(' -- ') par += content listnode += nodes.list_item('', par) fieldbody = nodes.field_body('', listnode) return nodes.field('', fieldname, fieldbody)
87487752ab19c216ac9c6cfce03c69081be094d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/87487752ab19c216ac9c6cfce03c69081be094d8/docfields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 1518, 12, 2890, 16, 1953, 16, 2461, 16, 1516, 4672, 14680, 273, 2199, 18, 1518, 67, 529, 2668, 2187, 365, 18, 1925, 13, 666, 2159, 273, 365, 18, 1098, 67, 723, 1435, 364, 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, 1221, 67, 1518, 12, 2890, 16, 1953, 16, 2461, 16, 1516, 4672, 14680, 273, 2199, 18, 1518, 67, 529, 2668, 2187, 365, 18, 1925, 13, 666, 2159, 273, 365, 18, 1098, 67, 723, 1435, 364, 6...
`Example`::
**Example**:
def cmp(_self, other): if _self.msgid > other.msgid: return 1 elif _self.msgid < other.msgid: return -1 else: return 0
d8198b8084c69bfb0e84293dcc1b4bcf7ead9311 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9209/d8198b8084c69bfb0e84293dcc1b4bcf7ead9311/polib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9411, 24899, 2890, 16, 1308, 4672, 309, 389, 2890, 18, 3576, 350, 405, 1308, 18, 3576, 350, 30, 327, 404, 1327, 389, 2890, 18, 3576, 350, 411, 1308, 18, 3576, 350, 30, 327, 300, 21, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9411, 24899, 2890, 16, 1308, 4672, 309, 389, 2890, 18, 3576, 350, 405, 1308, 18, 3576, 350, 30, 327, 404, 1327, 389, 2890, 18, 3576, 350, 411, 1308, 18, 3576, 350, 30, 327, 300, 21, ...
Fixture.__init__(self)
AspyFixture.__init__(self)
def __init__(self): Fixture.__init__(self) self.title = "Music tests"
43a0f8d3d71fafa93f66b7de5c6311692b8b2ccd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5169/43a0f8d3d71fafa93f66b7de5c6311692b8b2ccd/aspyplayer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 432, 30884, 26392, 16186, 2738, 972, 12, 2890, 13, 365, 18, 2649, 273, 315, 49, 14894, 7434, 6, 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, 0, 0, 0, 0, 0, 0, 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, 4672, 432, 30884, 26392, 16186, 2738, 972, 12, 2890, 13, 365, 18, 2649, 273, 315, 49, 14894, 7434, 6, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
f.close()
if f: f.close()
def copy_scripts (self): """Copy each script listed in 'self.scripts'; if it's marked as a Python script in the Unix way (first line matches 'first_line_re', ie. starts with "\#!" and contains "python"), then adjust the first line to refer to the current Python interpreter as we copy. """ self.mkpath(self.build_dir) outfiles = [] for script in self.scripts: adjust = 0 script = convert_path(script) outfile = os.path.join(self.build_dir, os.path.basename(script)) outfiles.append(outfile)
27edd829d7673a642cf5b37c3011454ec33cb715 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/27edd829d7673a642cf5b37c3011454ec33cb715/build_scripts.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1610, 67, 12827, 261, 2890, 4672, 3536, 2951, 1517, 2728, 12889, 316, 296, 2890, 18, 12827, 13506, 309, 518, 1807, 9350, 487, 279, 6600, 2728, 316, 326, 9480, 4031, 261, 3645, 980, 1885, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1610, 67, 12827, 261, 2890, 4672, 3536, 2951, 1517, 2728, 12889, 316, 296, 2890, 18, 12827, 13506, 309, 518, 1807, 9350, 487, 279, 6600, 2728, 316, 326, 9480, 4031, 261, 3645, 980, 1885, ...
oldChange['oldvalue'] += " " + ticketChange['oldvalue']
oldChange['oldvalue'] += " " + ticketChange['oldvalue']
def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla print "Using Bugzilla v%s schema." % BZ_VERSION if BZ_VERSION == 2110: activityFields['removed'] = "oldvalue" activityFields['added'] = "newvalue" # init Bugzilla environment print "Bugzilla MySQL('%s':'%s':'%s':'%s'): connecting..." % \ (_db, _host, _user, ("*" * len(_password))) mysql_con = MySQLdb.connect(host=_host, user=_user, passwd=_password, db=_db, compress=1, cursorclass=MySQLdb.cursors.DictCursor) mysql_cur = mysql_con.cursor() # init Trac environment print "Trac SQLite('%s'): connecting..." % (_env) trac = TracDatabase(_env) # force mode... if _force == 1: print "\nCleaning all tickets..." c = trac.db().cursor() c.execute("DELETE FROM ticket_change") trac.db().commit() c.execute("DELETE FROM ticket") trac.db().commit() c.execute("DELETE FROM attachment") attachments_dir = os.path.join(os.path.normpath(trac.env.path), "attachments") # Straight from the Python documentation. for root, dirs, files in os.walk(attachments_dir, topdown=False): for name in files: os.remove(os.path.join(root, name)) for name in dirs: os.rmdir(os.path.join(root, name)) if not os.stat(attachments_dir): os.mkdir(attachments_dir) trac.db().commit() print "All tickets cleaned..." print "\n0. Filtering products..." mysql_cur.execute("SELECT name FROM products") products = [] for line in mysql_cur.fetchall(): product = line['name'] if PRODUCTS and product not in PRODUCTS: continue if product in IGNORE_PRODUCTS: continue products.append(product) PRODUCTS[:] = products print " Using products", " ".join(PRODUCTS) print "\n1. Import severities..." trac.setSeverityList(SEVERITIES) print "\n2. Import components..." if not COMPONENTS_FROM_PRODUCTS: if BZ_VERSION >= 2180: sql = """SELECT DISTINCT c.name AS name, c.initialowner AS owner FROM components AS c, products AS p WHERE c.product_id = p.id AND""" sql += makeWhereClause('p.name', PRODUCTS) else: sql = "SELECT value AS name, initialowner AS owner FROM components" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) components = mysql_cur.fetchall() for component in components: component['owner'] = trac.getLoginName(mysql_cur, component['owner']) trac.setComponentList(components, 'name') else: sql = """SELECT program AS product, value AS comp, initialowner AS owner FROM components""" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) lines = mysql_cur.fetchall() all_components = {} # product -> components all_owners = {} # product, component -> owner for line in lines: product = line['product'] comp = line['comp'] owner = line['owner'] all_components.setdefault(product, []).append(comp) all_owners[(product, comp)] = owner component_list = [] for product, components in all_components.items(): # find best default owner default = None for comp in DEFAULT_COMPONENTS: if comp in components: default = comp break if default is None: default = components[0] owner = all_owners[(product, default)] owner_name = trac.getLoginName(mysql_cur, owner) component_list.append({'product': product, 'owner': owner_name}) trac.setComponentList(component_list, 'product') print "\n3. Import priorities..." trac.setPriorityList(PRIORITIES) print "\n4. Import versions..." if BZ_VERSION >= 2180: sql = """SELECT DISTINCTROW versions.value AS value FROM products, versions""" sql += " WHERE" + makeWhereClause('products.name', PRODUCTS) else: sql = "SELECT DISTINCTROW value FROM versions" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) versions = mysql_cur.fetchall() trac.setVersionList(versions, 'value') print "\n5. Import milestones..." sql = "SELECT DISTINCT value FROM milestones" sql += " WHERE" + makeWhereClause('value', IGNORE_MILESTONES, negative=True) mysql_cur.execute(sql) milestones = mysql_cur.fetchall() trac.setMilestoneList(milestones, 'value') print "\n6. Retrieving bugs..." sql = """SELECT DISTINCT b.*, c.name AS component, p.name AS product FROM bugs AS b, components AS c, products AS p """ sql += " WHERE (" + makeWhereClause('p.name', PRODUCTS) sql += ") AND b.product_id = p.id" sql += " AND b.component_id = c.id" sql += " ORDER BY b.bug_id" mysql_cur.execute(sql) bugs = mysql_cur.fetchall() print "\n7. Import bugs and bug activity..." for bug in bugs: bugid = bug['bug_id'] ticket = {} keywords = [] ticket['id'] = bugid ticket['time'] = bug['creation_ts'] ticket['changetime'] = bug['delta_ts'] if COMPONENTS_FROM_PRODUCTS: ticket['component'] = bug['product'] else: ticket['component'] = bug['component'] ticket['severity'] = bug['bug_severity'] ticket['priority'] = bug['priority'].lower() ticket['owner'] = trac.getLoginName(mysql_cur, bug['assigned_to']) ticket['reporter'] = trac.getLoginName(mysql_cur, bug['reporter']) mysql_cur.execute("SELECT * FROM cc WHERE bug_id = %s", bugid) cc_records = mysql_cur.fetchall() cc_list = [] for cc in cc_records: cc_list.append(trac.getLoginName(mysql_cur, cc['who'])) cc_list = [cc for cc in cc_list if '@' in cc and cc not in IGNORE_CC] ticket['cc'] = string.join(cc_list, ', ') ticket['version'] = bug['version'] target_milestone = bug['target_milestone'] if target_milestone in IGNORE_MILESTONES: target_milestone = '' ticket['milestone'] = target_milestone bug_status = bug['bug_status'].lower() ticket['status'] = statusXlator[bug_status] ticket['resolution'] = bug['resolution'].lower() # a bit of extra work to do open tickets if bug_status == 'open': if owner != '': ticket['status'] = 'assigned' else: ticket['status'] = 'new' ticket['summary'] = bug['short_desc'] mysql_cur.execute("SELECT * FROM longdescs WHERE bug_id = %s" % bugid) longdescs = list(mysql_cur.fetchall()) # check for empty 'longdescs[0]' field... if len(longdescs) == 0: ticket['description'] = '' else: ticket['description'] = longdescs[0]['thetext'] del longdescs[0] for desc in longdescs: ignore = False for comment in IGNORE_COMMENTS: if re.match(comment, desc['thetext']): ignore = True if ignore: continue trac.addTicketComment(ticket=bugid, time = desc['bug_when'], author=trac.getLoginName(mysql_cur, desc['who']), value = desc['thetext']) mysql_cur.execute("""SELECT * FROM bugs_activity WHERE bug_id = %s ORDER BY bug_when""" % bugid) bugs_activity = mysql_cur.fetchall() resolution = '' ticketChanges = [] keywords = [] for activity in bugs_activity: field_name = trac.getFieldName(mysql_cur, activity['fieldid']).lower() removed = activity[activityFields['removed']] added = activity[activityFields['added']] # statuses and resolutions are in lowercase in trac if field_name == "resolution" or field_name == "bug_status": removed = removed.lower() added = added.lower() # remember most recent resolution, we need this later if field_name == "resolution": resolution = added.lower() add_keywords = [] remove_keywords = [] # convert bugzilla field names... if field_name == "bug_severity": field_name = "severity" elif field_name == "assigned_to": field_name = "owner" elif field_name == "bug_status": field_name = "status" if removed in STATUS_KEYWORDS: remove_keywords.append(STATUS_KEYWORDS[removed]) if added in STATUS_KEYWORDS: add_keywords.append(STATUS_KEYWORDS[added]) added = statusXlator[added] removed = statusXlator[removed] elif field_name == "short_desc": field_name = "summary" elif field_name == "product" and COMPONENTS_FROM_PRODUCTS: field_name = "component" elif ((field_name == "product" and not COMPONENTS_FROM_PRODUCTS) or (field_name == "component" and COMPONENTS_FROM_PRODUCTS)): if MAP_ALL_KEYWORDS or removed in KEYWORDS_MAPPING: kw = KEYWORDS_MAPPING.get(removed, removed) if kw: remove_keywords.append(kw) if MAP_ALL_KEYWORDS or added in KEYWORDS_MAPPING: kw = KEYWORDS_MAPPING.get(added, added) if kw: add_keywords.append(kw) if field_name == "component": # just keep the keyword change added = removed = "" elif field_name == "target_milestone": field_name = "milestone" if added in IGNORE_MILESTONES: added = "" if removed in IGNORE_MILESTONES: removed = "" ticketChange = {} ticketChange['ticket'] = bugid ticketChange['time'] = activity['bug_when'] ticketChange['author'] = trac.getLoginName(mysql_cur, activity['who']) ticketChange['field'] = field_name ticketChange['oldvalue'] = removed ticketChange['newvalue'] = added if add_keywords or remove_keywords: # ensure removed ones are in old old_keywords = keywords + [kw for kw in remove_keywords if kw not in keywords] # remove from new keywords = [kw for kw in keywords if kw not in remove_keywords] # add to new keywords += [kw for kw in add_keywords if kw not in keywords] if old_keywords != keywords: ticketChangeKw = ticketChange.copy() ticketChangeKw['field'] = "keywords" ticketChangeKw['oldvalue'] = ' '.join(old_keywords) ticketChangeKw['newvalue'] = ' '.join(keywords) ticketChanges.append(ticketChangeKw) if field_name in IGNORED_ACTIVITY_FIELDS: continue # Skip changes that have no effect (think translation!). if added == removed: continue # Bugzilla splits large summary changes into two records. for oldChange in ticketChanges: if (field_name == "summary" and oldChange['field'] == ticketChange['field'] and oldChange['time'] == ticketChange['time'] and oldChange['author'] == ticketChange['author']): oldChange['oldvalue'] += " " + ticketChange['oldvalue'] oldChange['newvalue'] += " " + ticketChange['newvalue'] break # cc sometime appear in different activities with same time if (field_name == "cc" \ and oldChange['time'] == ticketChange['time']): oldChange['newvalue'] += ", " + ticketChange['newvalue'] break else: ticketChanges.append (ticketChange) for ticketChange in ticketChanges: trac.addTicketChange (**ticketChange) # For some reason, bugzilla v2.11 seems to clear the resolution # when you mark a bug as closed. Let's remember it and restore # it if the ticket is closed but there's no resolution. if not ticket['resolution'] and ticket['status'] == "closed": ticket['resolution'] = resolution bug_status = bug['bug_status'] if bug_status in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[bug_status] if kw not in keywords: keywords.append(kw) product = bug['product'] if product in KEYWORDS_MAPPING and not COMPONENTS_FROM_PRODUCTS: kw = KEYWORDS_MAPPING.get(product, product) if kw and kw not in keywords: keywords.append(kw) component = bug['component'] if (COMPONENTS_FROM_PRODUCTS and \ (MAP_ALL_KEYWORDS or component in KEYWORDS_MAPPING)): kw = KEYWORDS_MAPPING.get(component, component) if kw and kw not in keywords: keywords.append(kw) ticket['keywords'] = string.join(keywords) ticketid = trac.addTicket(**ticket) mysql_cur.execute("SELECT * FROM attachments WHERE bug_id = %s" % bugid) attachments = mysql_cur.fetchall() for a in attachments: author = trac.getLoginName(mysql_cur, a['submitter_id']) trac.addAttachment(author, a) print "\n8. Importing users and passwords..." if BZ_VERSION >= 2180: mysql_cur.execute("SELECT login_name, cryptpassword FROM profiles") users = mysql_cur.fetchall() htpasswd = file("htpasswd", 'w') for user in users: if LOGIN_MAP.has_key(user['login_name']): login = LOGIN_MAP[user['login_name']] else: login = user['login_name'] htpasswd.write(login + ":" + user['cryptpassword'] + "\n") htpasswd.close() print " Bugzilla users converted to htpasswd format, see 'htpasswd'." print "\nAll tickets converted."
c27a48bc7d3e33e259dbb1bfcf7789acafcc80b3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2831/c27a48bc7d3e33e259dbb1bfcf7789acafcc80b3/bugzilla2trac.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 24899, 1966, 16, 389, 2564, 16, 389, 1355, 16, 389, 3664, 16, 389, 3074, 16, 389, 5734, 4672, 5728, 2314, 273, 2286, 12233, 1435, 225, 468, 2236, 364, 12156, 5244, 434, 7934, 15990...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 24899, 1966, 16, 389, 2564, 16, 389, 1355, 16, 389, 3664, 16, 389, 3074, 16, 389, 5734, 4672, 5728, 2314, 273, 2286, 12233, 1435, 225, 468, 2236, 364, 12156, 5244, 434, 7934, 15990...
subsubgroup = Group(descr='desrc of subsubgroup', schema=[ Var(name='a', descr='descr a', default=3 ) ])
subsubgroup = Group(desc='desrc of subsubgroup', schema=[ Var(name='a', desc='desc a', default=3 ) ])
def load(self, filename): self._filename = filename regexp = re.compile('(([a-zA-Z0-9_]+)|(\[.*?\]))') f = open(filename) for line in f.readlines(): if line.find('#') >= 0: line = line[:line.find('#')] line = line.strip() if not line: continue if line.count('=') != 1: error = ('Unable to parse the line', line) if not error in self._bad_lines: self._bad_lines.append(error) continue key, value = line.split('=') try: keylist = [x[0] for x in regexp.findall(key.strip()) if x[0] ] object = self while len(keylist) > 1: key = keylist.pop(0) if key.startswith('['): object = object[key[1:-1]] else: object = getattr(object, key) key = keylist[0] value = value.strip() setattr(object, key, value) except Exception, e: error = (str(e), line) if not error in self._bad_lines: self._bad_lines.append(error) f.close() return len(self._bad_lines) == 0
513f97ca83b44ea792b8e169cb28ed0b3e8c402e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11722/513f97ca83b44ea792b8e169cb28ed0b3e8c402e/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 12, 2890, 16, 1544, 4672, 365, 6315, 3459, 273, 1544, 7195, 273, 283, 18, 11100, 2668, 12, 3816, 69, 17, 9600, 17, 62, 20, 17, 29, 67, 7941, 96, 4713, 63, 4509, 10936, 5717, 25...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 12, 2890, 16, 1544, 4672, 365, 6315, 3459, 273, 1544, 7195, 273, 283, 18, 11100, 2668, 12, 3816, 69, 17, 9600, 17, 62, 20, 17, 29, 67, 7941, 96, 4713, 63, 4509, 10936, 5717, 25...
def wrpcap(filename, pkt): f=open(filename,"w") if isinstance(pkt,Packet): linktype = LLNumTypes.get(pkt.__class__,1) else: linktype = LLNumTypes.get(pkt[0].__class__,1) f.write(struct.pack("IHHIIII", 0xa1b2c3d4L, 2, 4, 0, 0, MTU, linktype)) for p in pkt: s = str(p) l = len(s) sec = int(p.time) usec = int((p.time-sec)*1000000) f.write(struct.pack("IIII", sec, usec, l, l)) f.write(s) f.close()
def wrpcap(filename, pkt, *args, **kargs): PcapWriter(filename, *args, **kargs).write(pkt)
def wrpcap(filename, pkt): f=open(filename,"w") if isinstance(pkt,Packet): linktype = LLNumTypes.get(pkt.__class__,1) else: linktype = LLNumTypes.get(pkt[0].__class__,1) f.write(struct.pack("IHHIIII", 0xa1b2c3d4L, 2, 4, 0, 0, MTU, linktype)) for p in pkt: s = str(p) l = len(s) sec = int(p.time) usec = int((p.time-sec)*1000000) f.write(struct.pack("IIII", sec, usec, l, l)) f.write(s) f.close()
c8bb4ffbf1fe5b0fc994675b25b0d3a55bdab83d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/c8bb4ffbf1fe5b0fc994675b25b0d3a55bdab83d/scapy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 341, 7452, 438, 12, 3459, 16, 11536, 16, 380, 1968, 16, 2826, 79, 1968, 4672, 453, 5909, 2289, 12, 3459, 16, 380, 1968, 16, 2826, 79, 1968, 2934, 2626, 12, 5465, 88, 13, 225, 2, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 341, 7452, 438, 12, 3459, 16, 11536, 16, 380, 1968, 16, 2826, 79, 1968, 4672, 453, 5909, 2289, 12, 3459, 16, 380, 1968, 16, 2826, 79, 1968, 2934, 2626, 12, 5465, 88, 13, 225, 2, -100...
def __init__(self, p):
def __init__(self, p, max_entry=None):
def __init__(self, p): """ TESTS::
37d130246c10e7b0112af26e2825fcf33c637b30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37d130246c10e7b0112af26e2825fcf33c637b30/tableau.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 293, 16, 943, 67, 4099, 33, 7036, 4672, 3536, 22130, 55, 2866, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 293, 16, 943, 67, 4099, 33, 7036, 4672, 3536, 22130, 55, 2866, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
self._writer.whole_element('th', name, {'class': 'col_status'}) self._writer.end_element('tr')
self._writer.element('th', name, {'class': 'col_status'}) self._writer.end('tr')
def _write_headers(self): self._writer.start_element('table') self._writer.start_element('tr') self._writer.whole_element('th', 'Name', {'class': 'col_name'}) for name in self.column_names: name = name.replace(self._get_prefix(self.column_names), '') self._writer.whole_element('th', name, {'class': 'col_status'}) self._writer.end_element('tr')
0020c6e16b761a9decca59b321b6f814057f5d3f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6988/0020c6e16b761a9decca59b321b6f814057f5d3f/robotdiff.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 67, 2485, 12, 2890, 4672, 365, 6315, 6299, 18, 1937, 67, 2956, 2668, 2121, 6134, 365, 6315, 6299, 18, 1937, 67, 2956, 2668, 313, 6134, 365, 6315, 6299, 18, 3350, 790, 67, 29...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2626, 67, 2485, 12, 2890, 4672, 365, 6315, 6299, 18, 1937, 67, 2956, 2668, 2121, 6134, 365, 6315, 6299, 18, 1937, 67, 2956, 2668, 313, 6134, 365, 6315, 6299, 18, 3350, 790, 67, 29...
def _checkquote(self, arg): if len(arg) >= 2 and (arg[0],arg[-1]) in (('(',')'),('"','"')): return arg if arg and self.mustquote.search(arg) is None: return arg return self._quote(arg)
def _new_tag(self):
3c9922f74849aad29d3c45e4c5972761e07825b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/3c9922f74849aad29d3c45e4c5972761e07825b9/imaplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2704, 67, 2692, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2704, 67, 2692, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
"render:float:patch_minlevel:none":["Patch Min Level:", 1],
"render:float:patch_minlevel:none":["Patch Min Level:", 1, 1],
def loadProperties(self, xml): xmlTypes = { "int" : int, "str" : str, "list" : list, "dict": dict, "float" : float, "bool": bool } xmlProperties = xml.getElementsByTagName("property") # what I should really do is move the properties from the object's UI to the object adapter, since that's really where I control the data. for xmlProperty in xmlProperties: # each of these is a property element propertyName = xmlProperty.getAttribute("name").encode("ascii") xmlType = xmlProperty.getAttribute("type").encode("ascii") xmlValue= xmlProperty.getAttribute("value").encode("ascii") if xmlType == "bool": propertyValue = xmlTypes[xmlType](eval(xmlValue)) elif xmlType == "list": # print "Property Name: ", propertyName propertyValue = [float(eval(xmlProperty.getAttribute("red").encode("ascii"))), float(eval(xmlProperty.getAttribute("green").encode("ascii"))), float(eval(xmlProperty.getAttribute("blue").encode("ascii")))] # rebuild a pretty color! # print "Property Value: ", propertyValue else: propertyValue = xmlTypes[xmlType](xmlValue) self.editors[propertyName].setValue(propertyValue)
695ebc94fcea97afa089a3eef4f68b45fabfce6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11560/695ebc94fcea97afa089a3eef4f68b45fabfce6c/BtoRMain.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 2297, 12, 2890, 16, 2025, 4672, 2025, 2016, 273, 288, 315, 474, 6, 294, 509, 16, 315, 701, 6, 294, 609, 16, 315, 1098, 6, 294, 666, 16, 315, 1576, 6877, 2065, 16, 315, 5659, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 2297, 12, 2890, 16, 2025, 4672, 2025, 2016, 273, 288, 315, 474, 6, 294, 509, 16, 315, 701, 6, 294, 609, 16, 315, 1098, 6, 294, 666, 16, 315, 1576, 6877, 2065, 16, 315, 5659, ...
nlp_ipopt.opt_sim_ipopt_solve()
nlp_ipopt.opt_coll_ipopt_solve()
def compute_stationary(Tc_stat): init_model.set('Tc',Tc_stat) # Solve the DAE initialization system with Ipopt init_nlp_ipopt.init_opt_ipopt_solve() return (init_model.get('c'),init_model.get('T'))
f15e580d2bae75943c8377bebc2a954c73f27a0d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7711/f15e580d2bae75943c8377bebc2a954c73f27a0d/cstr_mpc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3671, 67, 17894, 814, 12, 56, 71, 67, 5642, 4672, 1208, 67, 2284, 18, 542, 2668, 56, 71, 2187, 56, 71, 67, 5642, 13, 468, 348, 5390, 326, 463, 16985, 10313, 2619, 598, 467, 1631, 337...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 17894, 814, 12, 56, 71, 67, 5642, 4672, 1208, 67, 2284, 18, 542, 2668, 56, 71, 2187, 56, 71, 67, 5642, 13, 468, 348, 5390, 326, 463, 16985, 10313, 2619, 598, 467, 1631, 337...
self.threadHighWater = 50
self.threadHighWater = 130
def __init__(self, query): self.queryStr = query.strip()# Pull trailing whitespace # Force semicolon to facilitate worker-side splitting if self.queryStr[-1] != ";": # Add terminal semicolon self.queryStr += ";" self.queryMunger = None ## sqlparser.QueryMunger() self.db = Persistence() self.running = {} self.resultLock = threading.Lock() self.finished = {} self.threadHighWater = 50 pass
f8e07b73274f1980951622393154f7ae4a9b8230 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6510/f8e07b73274f1980951622393154f7ae4a9b8230/app.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 843, 4672, 365, 18, 2271, 1585, 273, 843, 18, 6406, 1435, 7, 14899, 7341, 7983, 468, 11889, 23682, 358, 5853, 330, 305, 340, 4322, 17, 5564, 20347, 309, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 843, 4672, 365, 18, 2271, 1585, 273, 843, 18, 6406, 1435, 7, 14899, 7341, 7983, 468, 11889, 23682, 358, 5853, 330, 305, 340, 4322, 17, 5564, 20347, 309, ...
friends = dict([(f.key().id(),1) for f in volunteer.friends()]) followers = dict([(f.key().id(),1) for f in volunteer.followers()]) following = dict([(f.key().id(),1) for f in volunteer.following()]) attendees_anonymous = [] attendees_friends = [] attendees_followers = [] attendees_following = [] attendees_unknown = [] for v in event.volunteers(): id = v.key().id() if id == volunteer.key().id(): continue if v.event_access(volunteer = volunteer): if id in friends: attendees_friends.append(v) elif id in followers: attendees_followers.append(v) elif id in following: attendees_following.append(v) else: attendees_unknown.append(v) else: attendees_anonymous.append(v)
friends = dict([(f.key().id(),1) for f in volunteer.friends()]) followers = dict([(f.key().id(),1) for f in volunteer.followers()]) following = dict([(f.key().id(),1) for f in volunteer.following()]) for v in event.volunteers(): id = v.key().id() if id == volunteer.key().id(): continue if v.event_access(volunteer = volunteer): if id in friends: attendees_friends.append(v) elif id in followers: attendees_followers.append(v) elif id in following: attendees_following.append(v) else: attendees_unknown.append(v) else: attendees_anonymous.append(v)
def show(self, event_id): volunteer = Authorize.login(self)
8b9cfac2f75f5caf615168de7e830d3b876d5a2c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5139/8b9cfac2f75f5caf615168de7e830d3b876d5a2c/events.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 12, 2890, 16, 871, 67, 350, 4672, 6626, 318, 736, 264, 273, 23859, 18, 5819, 12, 2890, 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,...
[ 1, 1, 1, 1, 1, 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, 2405, 12, 2890, 16, 871, 67, 350, 4672, 6626, 318, 736, 264, 273, 23859, 18, 5819, 12, 2890, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
def _make_invoice(self, cr, uid, order, lines):
def _make_invoice(self, cr, uid, order, lines, context={}):
def _make_invoice(self, cr, uid, order, lines): a = order.partner_id.property_account_receivable.id if order.payment_term: pay_term = order.payment_term.id else: pay_term = False for preinv in order.invoice_ids: if preinv.state in ('open','paid','proforma'): for preline in preinv.invoice_line: inv_line_id = self.pool.get('account.invoice.line').copy(cr, uid, preline.id, {'invoice_id':False, 'price_unit':-preline.price_unit}) lines.append(inv_line_id) inv = { 'name': order.client_order_ref or order.name, 'origin': order.name, 'type': 'out_invoice', 'reference': "P%dSO%d"%(order.partner_id.id,order.id), 'account_id': a, 'partner_id': order.partner_id.id, 'address_invoice_id': order.partner_invoice_id.id, 'address_contact_id': order.partner_invoice_id.id, 'invoice_line': [(6,0,lines)], 'currency_id' : order.pricelist_id.currency_id.id, 'comment': order.note, 'payment_term': pay_term, } inv_obj = self.pool.get('account.invoice') inv.update(self._inv_get(cr, uid, order)) inv_id = inv_obj.create(cr, uid, inv) data = inv_obj.onchange_payment_term_date_invoice(cr, uid, [inv_id], pay_term,time.strftime('%Y-%m-%d')) if data.get('value',False): inv_obj.write(cr, uid, [inv_id], inv.update(data['value']), context=context) inv_obj.button_compute(cr, uid, [inv_id]) return inv_id
6c58c27ae54d6d246eaf3ccd86d55dcf0ec0d3bd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/6c58c27ae54d6d246eaf3ccd86d55dcf0ec0d3bd/sale.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6540, 67, 16119, 12, 2890, 16, 4422, 16, 4555, 16, 1353, 16, 2362, 16, 819, 12938, 4672, 279, 273, 1353, 18, 31993, 67, 350, 18, 4468, 67, 4631, 67, 8606, 427, 429, 18, 350, 309...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6540, 67, 16119, 12, 2890, 16, 4422, 16, 4555, 16, 1353, 16, 2362, 16, 819, 12938, 4672, 279, 273, 1353, 18, 31993, 67, 350, 18, 4468, 67, 4631, 67, 8606, 427, 429, 18, 350, 309...
print "IP Address is: " + wiface.GetIP(fast=True)
print "IP Address is: " + str(wiface.GetIP(fast=True))
def run(self): """ The main function of the connection thread.
9662012feff3ea47d11f20ce5eb10ca5bf6f6ff0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12280/9662012feff3ea47d11f20ce5eb10ca5bf6f6ff0/networking.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 3536, 1021, 2774, 445, 434, 326, 1459, 2650, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 3536, 1021, 2774, 445, 434, 326, 1459, 2650, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
handy.sendmail(msg)
sendmail(msg)
def sendError(self): SITE_MAIL = self.eng.globals["SITE_MAIL"] SITE_NAME = self.eng.globals["SITE_NAME"] assert SITE_MAIL is not None, "must define SITE_MAIL first!" hr = "-" * 50 + "\n" msg = trim( """ To: %s From: cgi <%s> Subject: uncaught exception in %s
520c8335a5a62f4c262820dd35143fd7894e9fca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8821/520c8335a5a62f4c262820dd35143fd7894e9fca/OutputDecorator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17538, 12, 2890, 4672, 23832, 67, 18191, 273, 365, 18, 24688, 18, 16227, 9614, 20609, 67, 18191, 11929, 23832, 67, 1985, 273, 365, 18, 24688, 18, 16227, 9614, 20609, 67, 1985, 11929, 1815,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17538, 12, 2890, 4672, 23832, 67, 18191, 273, 365, 18, 24688, 18, 16227, 9614, 20609, 67, 18191, 11929, 23832, 67, 1985, 273, 365, 18, 24688, 18, 16227, 9614, 20609, 67, 1985, 11929, 1815,...
from mapnik import DatasourceCache DatasourceCache.instance().register_datasources('%s' % inputpluginspath) from mapnik import FontEngine from glob import glob fonts = glob('%s/*.ttf' % fontscollectionpath) if len( fonts ) == 0: print " else: map(FontEngine.instance().register_font, fonts)
def register_plugins(path=inputpluginspath): """Register plugins located by specified path""" DatasourceCache.instance().register_datasources(path) def register_fonts(path=fontscollectionpath): """Recursively register fonts using path argument as base directory""" for dirpath, _, filenames in os.walk(path): for filename in filenames: if os.path.splitext(filename)[1] == '.ttf': FontEngine.instance().register_font(os.path.join(dirpath, filename)) register_plugins() register_fonts()
def mapnik_version_string(): """Return the Mapnik version as a string.""" version = mapnik_version() patch_level = version % 100 minor_version = version / 100 % 1000 major_version = version / 100000 return '%s.%s.%s' % ( major_version, minor_version,patch_level)
476838d259fd9cf9eac46924354c61c0a33077cf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12100/476838d259fd9cf9eac46924354c61c0a33077cf/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 852, 82, 1766, 67, 1589, 67, 1080, 13332, 3536, 990, 326, 1635, 82, 1766, 1177, 487, 279, 533, 12123, 1177, 273, 852, 82, 1766, 67, 1589, 1435, 4729, 67, 2815, 273, 1177, 738, 2130, 84...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 852, 82, 1766, 67, 1589, 67, 1080, 13332, 3536, 990, 326, 1635, 82, 1766, 1177, 487, 279, 533, 12123, 1177, 273, 852, 82, 1766, 67, 1589, 1435, 4729, 67, 2815, 273, 1177, 738, 2130, 84...
def SetFont( self, value ) : assert not value or isinstance( value, Font )
def SetFont(self, value): assert not value or isinstance(value, Font)
def SetFont( self, value ) : assert not value or isinstance( value, Font ) self.Font = value return self
13865299ef9bc077be9a5eaa4326b7a30307d828 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3330/13865299ef9bc077be9a5eaa4326b7a30307d828/PropertySets.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1000, 5711, 12, 2890, 16, 460, 4672, 1815, 486, 460, 578, 1549, 12, 1132, 16, 10063, 13, 365, 18, 5711, 273, 460, 327, 365, 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, 1000, 5711, 12, 2890, 16, 460, 4672, 1815, 486, 460, 578, 1549, 12, 1132, 16, 10063, 13, 365, 18, 5711, 273, 460, 327, 365, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
if ret&0xff00:
if ret: self.compile_error = 1 if not os.path.isfile("abc.swf"):
def compile(self): ret,output = runcmd("./parser",[self.file],"/tmp/abctest.txt",wait=60) self.compile_error = 0 self.compile_output = output if ret&0xff00: self.compile_error = 1
62204b16ee0d3d7f0876471668a68b9382d332bb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5722/62204b16ee0d3d7f0876471668a68b9382d332bb/runtests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4074, 12, 2890, 4672, 325, 16, 2844, 273, 436, 551, 1264, 2932, 18, 19, 4288, 3113, 63, 2890, 18, 768, 6487, 6, 19, 5645, 19, 378, 299, 395, 18, 5830, 3113, 7048, 33, 4848, 13, 365, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4074, 12, 2890, 4672, 325, 16, 2844, 273, 436, 551, 1264, 2932, 18, 19, 4288, 3113, 63, 2890, 18, 768, 6487, 6, 19, 5645, 19, 378, 299, 395, 18, 5830, 3113, 7048, 33, 4848, 13, 365, ...
def characters (self, event, string):
def characters(self, event, string):
def characters (self, event, string): event.addresponse(human_join('U+%(code)s %(name)s' % self.info(c) for c in string))
8dac83005f048fe77ba0896fa6e27bc3611b49ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12048/8dac83005f048fe77ba0896fa6e27bc3611b49ba/conversions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3949, 12, 2890, 16, 871, 16, 533, 4672, 871, 18, 1289, 2740, 12, 24270, 67, 5701, 2668, 57, 15, 17105, 710, 13, 87, 8975, 529, 13, 87, 11, 738, 365, 18, 1376, 12, 71, 13, 364, 276,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3949, 12, 2890, 16, 871, 16, 533, 4672, 871, 18, 1289, 2740, 12, 24270, 67, 5701, 2668, 57, 15, 17105, 710, 13, 87, 8975, 529, 13, 87, 11, 738, 365, 18, 1376, 12, 71, 13, 364, 276,...
lists = os.listdir(mm_cfg.LIST_DATA_DIR)
lists = Utils.list_names()
def ProcessListsCmd(self, args, cmd, mail):
5551c37235c9c603bd7ae608093198c4c4d929f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/5551c37235c9c603bd7ae608093198c4c4d929f5/MailCommandHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4389, 7432, 5931, 12, 2890, 16, 833, 16, 1797, 16, 4791, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4389, 7432, 5931, 12, 2890, 16, 833, 16, 1797, 16, 4791, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
All frames will share the same list, which makes sense since the debugging is controlled by class attributes.
This is a global plugin that is used to turn on or off debug printing for all the classes that subclass from L{debugmixin}.
def action(self, index=-1, multiplier=1): assert self.dprint("id=%x name=%s index=%s" % (id(self),self.name,str(index))) # force collection print "\nGARBAGE:" gc.collect()
56ac591d312ea693f3992735f261bc9a7c0cde45 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11522/56ac591d312ea693f3992735f261bc9a7c0cde45/debug_classes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 12, 2890, 16, 770, 29711, 21, 16, 15027, 33, 21, 4672, 1815, 365, 18, 72, 1188, 2932, 350, 5095, 92, 508, 5095, 87, 770, 5095, 87, 6, 738, 261, 350, 12, 2890, 3631, 2890, 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, 1301, 12, 2890, 16, 770, 29711, 21, 16, 15027, 33, 21, 4672, 1815, 365, 18, 72, 1188, 2932, 350, 5095, 92, 508, 5095, 87, 770, 5095, 87, 6, 738, 261, 350, 12, 2890, 3631, 2890, 18, ...
self.widget = widget
def __init__(self, widget, parent, graph, autoSend = 0, buttons = (1, 4, 5, 0, 6, 7, 8)): QHButtonGroup.__init__(self, "Zoom / Select", parent) self.graph = graph # save graph. used to send signals self.functions = [type(f) == int and self.builtinFunctions[f] or f for f in buttons] for b, f in enumerate(self.functions): if not f: self.addSpace(10) else: button = createButton(self, f[0], lambda x=b: self.action(x), f[3], toggle = f[5]) setattr(self, f[1], button) if f[1] == "buttonSendSelections": button.setEnabled(not autoSend)
9a1fa34d647cd2978edc2ada5022d2478fe27fd1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/9a1fa34d647cd2978edc2ada5022d2478fe27fd1/OWToolbars.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 3604, 16, 982, 16, 2667, 16, 3656, 3826, 273, 374, 16, 9502, 273, 261, 21, 16, 1059, 16, 1381, 16, 374, 16, 1666, 16, 2371, 16, 1725, 3719, 30, 2238, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3604, 16, 982, 16, 2667, 16, 3656, 3826, 273, 374, 16, 9502, 273, 261, 21, 16, 1059, 16, 1381, 16, 374, 16, 1666, 16, 2371, 16, 1725, 3719, 30, 2238, ...
assert (self._module_key_map.has_key(baseClass), ("Missing base class %s" % baseClass.__name__))
if not self._module_key_map.has_key(baseClass) : raise self.MissingBaseClass(baseClass)
def fetch(name, default): r = kwargs.get(name, default) try: del kwargs[name] except KeyError: pass return r
56525f791f78a6674194ae3bf8bac173f05ded8e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6341/56525f791f78a6674194ae3bf8bac173f05ded8e/module_registry.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2158, 12, 529, 16, 805, 4672, 436, 273, 1205, 18, 588, 12, 529, 16, 805, 13, 775, 30, 1464, 1205, 63, 529, 65, 1335, 4999, 30, 1342, 327, 436, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2158, 12, 529, 16, 805, 4672, 436, 273, 1205, 18, 588, 12, 529, 16, 805, 13, 775, 30, 1464, 1205, 63, 529, 65, 1335, 4999, 30, 1342, 327, 436, 2, -100, -100, -100, -100, -100, -100, ...
self.hboxlayout20.addWidget(self.bond_stretch_color_btn) self.gridlayout16.addLayout(self.hboxlayout20,2,1,1,1) self.hboxlayout21 = QtGui.QHBoxLayout() self.hboxlayout21.setMargin(0) self.hboxlayout21.setSpacing(6) self.hboxlayout21.setObjectName("hboxlayout21")
self.hboxlayout23.addWidget(self.bond_stretch_color_btn) self.gridlayout16.addLayout(self.hboxlayout23,2,1,1,1) self.hboxlayout24 = QtGui.QHBoxLayout() self.hboxlayout24.setMargin(0) self.hboxlayout24.setSpacing(6) self.hboxlayout24.setObjectName("hboxlayout24")
def setupUi(self, UserPrefsDialog): UserPrefsDialog.setObjectName("UserPrefsDialog") UserPrefsDialog.resize(QtCore.QSize(QtCore.QRect(0,0,609,642).size()).expandedTo(UserPrefsDialog.minimumSizeHint()))
30deb2219e016847d91b37e801c50b75fbd1c3cf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/30deb2219e016847d91b37e801c50b75fbd1c3cf/UserPrefsDialog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 13943, 12, 2890, 16, 2177, 1386, 2556, 6353, 4672, 2177, 1386, 2556, 6353, 18, 542, 16707, 2932, 1299, 1386, 2556, 6353, 7923, 2177, 1386, 2556, 6353, 18, 15169, 12, 23310, 4670, 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, 3875, 13943, 12, 2890, 16, 2177, 1386, 2556, 6353, 4672, 2177, 1386, 2556, 6353, 18, 542, 16707, 2932, 1299, 1386, 2556, 6353, 7923, 2177, 1386, 2556, 6353, 18, 15169, 12, 23310, 4670, 18,...
why = os.strerror(err.errno)
why = _strerror(err)
def ftp_LIST(self, line): """Return a list of files in the specified directory to the client. Defaults to the current working directory. """ if line: # some FTP clients (like Konqueror or Nautilus) erroneously issue # /bin/ls-like LIST formats (e.g. "LIST -l", "LIST -al" and so # on...) instead of passing a directory as the argument. If we # receive such a command, just LIST the current working directory. if line.lower() in ("-a", "-l", "-al", "-la"): path = self.fs.translate(self.fs.cwd) line = self.fs.cwd # otherwise we assume the arg is a directory name else: path = self.fs.translate(line) line = self.fs.normalize(line) # no argument, fall back on cwd as default else: path = self.fs.translate(self.fs.cwd) line = self.fs.cwd
e155be2e9b3e40d9bd92788d2569c640df5f0b57 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7236/e155be2e9b3e40d9bd92788d2569c640df5f0b57/ftpserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13487, 67, 7085, 12, 2890, 16, 980, 4672, 3536, 990, 279, 666, 434, 1390, 316, 326, 1269, 1867, 358, 326, 1004, 18, 14159, 358, 326, 783, 5960, 1867, 18, 3536, 309, 980, 30, 468, 2690,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13487, 67, 7085, 12, 2890, 16, 980, 4672, 3536, 990, 279, 666, 434, 1390, 316, 326, 1269, 1867, 358, 326, 1004, 18, 14159, 358, 326, 783, 5960, 1867, 18, 3536, 309, 980, 30, 468, 2690,...
debug('result handler got %s -- exiting', exc.__class__.__name__)
debug('result handler got %r -- exiting' % (exc, ))
def run(self): get = self.get outqueue = self.outqueue cache = self.cache putlock = self.putlock
409811c9c25cd86bffb6fbec5abbd7fce80b765f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2024/409811c9c25cd86bffb6fbec5abbd7fce80b765f/pool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 336, 273, 365, 18, 588, 596, 4000, 273, 365, 18, 659, 4000, 1247, 273, 365, 18, 2493, 1378, 739, 273, 365, 18, 458, 739, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 336, 273, 365, 18, 588, 596, 4000, 273, 365, 18, 659, 4000, 1247, 273, 365, 18, 2493, 1378, 739, 273, 365, 18, 458, 739, 2, -100, -100, -100, -100, -100, -100, ...
print fsize print config['BoundSandboxLimit']
def __check_and_prestage_inputfile__(self, file): '''Checks the given input file size and if it's size is over "BoundSandboxLimit", prestage it to a grid SE.
271ead6ffa5606f07c3482b129971b53f8f7312f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/271ead6ffa5606f07c3482b129971b53f8f7312f/CREAM.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1893, 67, 464, 67, 1484, 12869, 67, 2630, 768, 972, 12, 2890, 16, 585, 4672, 9163, 4081, 326, 864, 810, 585, 963, 471, 309, 518, 1807, 963, 353, 1879, 315, 3499, 17881, 3039, 311...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1893, 67, 464, 67, 1484, 12869, 67, 2630, 768, 972, 12, 2890, 16, 585, 4672, 9163, 4081, 326, 864, 810, 585, 963, 471, 309, 518, 1807, 963, 353, 1879, 315, 3499, 17881, 3039, 311...
Format SAGE documentation for viewing with IPython.
Format Sage documentation ``s`` for viewing with IPython. This calls ``detex`` on ``s`` to convert LaTeX commands to plain text, and if ``s`` contains a string of the form "<<<obj>>>", then it replaces it with the docstring for "obj". INPUT: ``s`` - string OUTPUT: string EXAMPLES:: sage: from sage.misc.sagedoc import format sage: identity_matrix(2).rook_vector.__doc__[115:184] 'Let `A` be a general `m` by `n`\n (0,1)-matrix with `m \\le n`. ' sage: format(identity_matrix(2).rook_vector.__doc__[115:184]) 'Let `A` be a general `m` by `n`\n (0,1)-matrix with `m <= n`. ' If the first line of the string is 'nodetex', don't modify any TeX commands:: sage: format("nodetex\n`x \\geq y`") 'nodetex\n`x \\geq y`' Testing a string enclosed in triple angle brackets:: sage: format('<<<identity_matrix') '<<<identity_matrix' sage: format('identity_matrix>>>') 'identity_matrix>>>' sage: format('<<<identity_matrix>>>')[:28] '\nDefinition: identity_matrix'
def format(s): """ Format SAGE documentation for viewing with IPython. """ if not isinstance(s, str): raise TypeError, "s must be a string" # parse directives at beginning of docstring # currently, only 'nodetex' is supported # eventually, 'nodoctest' might be supported first_newline = s.find('\n') if first_newline > -1: first_line = s[:first_newline] else: first_line = s directives = [ d.lower() for d in first_line.split(',') ] import sage.all import sage.server.support docs = set([]) while True: i = s.find("<<<") if i == -1: break j = s[i+3:].find('>>>') if j == -1: break obj = s[i+3:i+3+j] if obj in docs: t = '' else: x = eval('sage.all.%s'%obj, locals()) t0 = sage.server.support.get_def(x, obj) t1 = my_getdoc(x) t = 'Definition: ' + t0 + '\n\n' + t1 docs.add(obj) s = s[:i] + '\n' + t + s[i+6+j:] if 'nodetex' not in directives: s = detex(s) return s
dcebe748f1ef8b1b2487c34467d71b3d3e2fcf7d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/dcebe748f1ef8b1b2487c34467d71b3d3e2fcf7d/sagedoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 12, 87, 4672, 3536, 4077, 348, 410, 7323, 12176, 87, 10335, 364, 1476, 310, 598, 26085, 18, 225, 1220, 4097, 12176, 8238, 338, 10335, 603, 12176, 87, 10335, 358, 1765, 21072, 21575, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 12, 87, 4672, 3536, 4077, 348, 410, 7323, 12176, 87, 10335, 364, 1476, 310, 598, 26085, 18, 225, 1220, 4097, 12176, 8238, 338, 10335, 603, 12176, 87, 10335, 358, 1765, 21072, 21575, ...
text = findAbout(path)
text = getAboutUTF8(path)
def open(reference, mode=None): path = str(reference.path) #dprint(str(reference)) text = findAbout(path) if text is None: raise IOError("[Errno 2] No such file or directory: '%s'" % reference) recurse_count = 100 mimetype = findMime(path) if mimetype.startswith("text") and text.find("%(") >= 0: updateDynamicSubstitutes() while text.find("%(") >= 0 and recurse_count>0: text = text % substitutes recurse_count -= 1 text = text.encode('utf-8') # FIXME: display error when recurse count is triggered??? fh=StringIO() fh.write(text) fh.seek(0)
16972011369bee6f6e5e388df682403af7d576ab /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11522/16972011369bee6f6e5e388df682403af7d576ab/about.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 12, 6180, 16, 1965, 33, 7036, 4672, 589, 273, 609, 12, 6180, 18, 803, 13, 468, 72, 1188, 12, 701, 12, 6180, 3719, 977, 273, 4506, 70, 659, 5159, 28, 12, 803, 13, 309, 977, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 12, 6180, 16, 1965, 33, 7036, 4672, 589, 273, 609, 12, 6180, 18, 803, 13, 468, 72, 1188, 12, 701, 12, 6180, 3719, 977, 273, 4506, 70, 659, 5159, 28, 12, 803, 13, 309, 977, 35...
count=0
count = 0
def check_assign(self, cr, uid, ids, context={}): done = [] count=0 pickings = {} for move in self.browse(cr, uid, ids): if move.product_id.type == 'consu': if move.state in ('confirmed', 'waiting'): done.append(move.id) pickings[move.picking_id.id] = 1 continue if move.state in ('confirmed','waiting'): res = self.pool.get('stock.location')._product_reserve(cr, uid, [move.location_id.id], move.product_id.id, move.product_qty, {'uom': move.product_uom.id}) if res: done.append(move.id) pickings[move.picking_id.id] = 1 r = res.pop(0) cr.execute('update stock_move set location_id=%s, product_qty=%s where id=%s', (r[1],r[0], move.id))
369221b47101072e094ad2d02fe2edd2b47690aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/369221b47101072e094ad2d02fe2edd2b47690aa/stock.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 6145, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 12938, 4672, 2731, 273, 5378, 1056, 273, 374, 6002, 899, 273, 2618, 364, 3635, 316, 365, 18, 25731, 12, 3353, 16, 4555, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 6145, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 12938, 4672, 2731, 273, 5378, 1056, 273, 374, 6002, 899, 273, 2618, 364, 3635, 316, 365, 18, 25731, 12, 3353, 16, 4555, ...
workflow = output[-5].strip().split()[1]
index = FindIndex(output,'Created') if index == -1 : print "No workflow was created by createProductionWorkflow_CSAi08Hack.py" sys.exit(1) workflow = output[index].split()[1].strip()
def main(argv) : """ prepareRelValworkflows prepare workflows for chained processing of RelVal samples - parse file holding cmsDriver commands for 1st and 2nd steps - prepare workflows - prepare WorkflowInjector:Input script - prepare ForceMerge script - prepare DBSMigrationToGlobal script - prepare PhEDExInjection script - prepare local DBS query script required parameters --samples <textfile> : list of RelVal sample parameter-sets in plain text file, one sample per line, # marks comment --version <processing version> : processing version (v1, v2, ... ) --DBSURL <URL> : URL of the local DBS (http://cmsdbsprod.cern.ch/cms_dbs_prod_local_07/servlet/DBSServlet, http://cmssrv46.fnal.gov:8080/DBS126/servlet/DBSServlet) optional parameters : --lumi <number> : initial run for generation (default: 666666), set it to 777777 for high statistics samples --event <number> : initial event number --help (-h) : help --debug (-d) : debug statements """ # default try: version = os.environ.get("CMSSW_VERSION") except: print '' print 'CMSSW version cannot be determined from $CMSSW_VERSION' sys.exit(2) try: architecture = os.environ.get("SCRAM_ARCH") except: print '' print 'CMSSW architecture cannot be determined from $SCRAM_ARCH' sys.exit(2) samples = None processing_version = None initial_run = "666666" initial_event = None debug = 0 DBSURL = None try: opts, args = getopt.getopt(argv, "", ["help", "debug", "samples=", "version=", "DBSURL=", "event=", "lumi="]) except getopt.GetoptError: print main.__doc__ sys.exit(2) # check command line parameter for opt, arg in opts : if opt == "--help" : print main.__doc__ sys.exit() elif opt == "--debug" : debug = 1 elif opt == "--samples" : samples = arg elif opt == "--version" : processing_version = arg
47397be0ad25e900c8367cb1b05a7d6e187b915f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/47397be0ad25e900c8367cb1b05a7d6e187b915f/prepareRelValWorkflows.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 13, 294, 3536, 225, 2911, 1971, 3053, 13815, 87, 225, 2911, 31738, 364, 20269, 4929, 434, 4275, 3053, 5216, 225, 300, 1109, 585, 19918, 6166, 4668, 4364, 364, 404, 334, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 13, 294, 3536, 225, 2911, 1971, 3053, 13815, 87, 225, 2911, 31738, 364, 20269, 4929, 434, 4275, 3053, 5216, 225, 300, 1109, 585, 19918, 6166, 4668, 4364, 364, 404, 334, ...
start = start + 1
def skip_leading_nodes(children, start, i): i = min(i, len(children)) while i > start: # skip over leading comments and whitespace: try: child = children[start] except IndexError: sys.stderr.write( "skip_leading_nodes() failed at index %d\n" % start) raise nodeType = child.nodeType if nodeType == xml.dom.core.COMMENT: start = start + 1 elif nodeType == xml.dom.core.TEXT: data = child.data shortened = string.lstrip(data) if shortened: if data != shortened: # break into two nodes: whitespace and non-whitespace child.splitText(len(data) - len(shortened)) return start + 1, i + 1 break # all whitespace, just skip start = start + 1 elif nodeType == xml.dom.core.ELEMENT: if child.tagName in PARA_LEVEL_ELEMENTS + PARA_LEVEL_PRECEEDERS: start = start + 1 else: break else: break return start, i
7dab6affba271fd9784c15fa0e867a8e91a45e83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7dab6affba271fd9784c15fa0e867a8e91a45e83/docfixer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2488, 67, 27200, 67, 4690, 12, 5906, 16, 787, 16, 277, 4672, 277, 273, 1131, 12, 77, 16, 562, 12, 5906, 3719, 1323, 277, 405, 787, 30, 468, 2488, 1879, 7676, 5678, 471, 7983, 30, 775...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2488, 67, 27200, 67, 4690, 12, 5906, 16, 787, 16, 277, 4672, 277, 273, 1131, 12, 77, 16, 562, 12, 5906, 3719, 1323, 277, 405, 787, 30, 468, 2488, 1879, 7676, 5678, 471, 7983, 30, 775...
make_classes('../../lps/include/mcrl2/modal_formula/state_formula.h', STATE_FORMULA_CLASSES, 'state_formula', generate_is_functions = True, superclass_aterm = 'StateFrm')
make_classes('../../lps/include/mcrl2/modal_formula/state_formula.h', STATE_FORMULA_CLASSES, 'state_formula', generate_is_functions = True)
def make_is_functions(filename, class_text, classname, namespace = 'core'): TERM_TRAITS_TEXT = r''' /// \\brief Test for a %s expression /// \\param t A term /// \\return True if it is a %s expression inline bool is_%s(const %s& t) { return %s::detail::gsIs%s(t); }
2811c4b39f217fa487af021799a1127a5407fc49 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1522/2811c4b39f217fa487af021799a1127a5407fc49/generate_classes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 291, 67, 10722, 12, 3459, 16, 667, 67, 955, 16, 7479, 16, 1981, 273, 296, 3644, 11, 4672, 20772, 49, 67, 20060, 10158, 67, 5151, 273, 436, 26418, 18378, 1736, 25888, 7766, 36...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 291, 67, 10722, 12, 3459, 16, 667, 67, 955, 16, 7479, 16, 1981, 273, 296, 3644, 11, 4672, 20772, 49, 67, 20060, 10158, 67, 5151, 273, 436, 26418, 18378, 1736, 25888, 7766, 36...
record['nat'] = 0
def connectback_result(self, result, downloadid, peerid, ip, port): record = self.downloads.get(downloadid, {}).get(peerid) if record is None or record['ip'] != ip or record['port'] != port: return if not record.has_key('nat'): record['nat'] = int(not result) if result: record['nat'] = 0 self.becache1.setdefault(downloadid,{})[peerid] = Bencached(bencode({'ip': ip, 'port': port, 'peer id': myid})) self.becache2.setdefault(downloadid,{})[peerid] = Bencached(bencode({'ip': ip, 'port': port}))
648808943e7e2648e1b386c8a3eac45606fd5987 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/648808943e7e2648e1b386c8a3eac45606fd5987/track.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3077, 823, 67, 2088, 12, 2890, 16, 563, 16, 4224, 350, 16, 4261, 350, 16, 2359, 16, 1756, 4672, 1409, 273, 365, 18, 7813, 87, 18, 588, 12, 7813, 350, 16, 2618, 2934, 588, 12, 12210, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3077, 823, 67, 2088, 12, 2890, 16, 563, 16, 4224, 350, 16, 4261, 350, 16, 2359, 16, 1756, 4672, 1409, 273, 365, 18, 7813, 87, 18, 588, 12, 7813, 350, 16, 2618, 2934, 588, 12, 12210, ...
offset = pa - bank.startaddr
if self.isSwitched(pa): offset = pa - bank.startaddr if self.isErasable(pa): offset += 01400 else: offset += 02000 else: offset = pa
def pseudoToSegmented(self, pa): retval = (None, None) if pa != None: bank = self._findBank(pa) if bank: offset = pa - bank.startaddr retval = (bank.banknum, offset) else: print >>sys.stderr, "Error, invalid pseudo address %06o" % pa return retval
4173d65e712f3cfe2f21ba1d06547791a8a51854 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8152/4173d65e712f3cfe2f21ba1d06547791a8a51854/memory.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12454, 774, 4131, 329, 12, 2890, 16, 6790, 4672, 5221, 273, 261, 7036, 16, 599, 13, 309, 6790, 480, 599, 30, 11218, 273, 365, 6315, 4720, 16040, 12, 8774, 13, 309, 11218, 30, 309, 365,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12454, 774, 4131, 329, 12, 2890, 16, 6790, 4672, 5221, 273, 261, 7036, 16, 599, 13, 309, 6790, 480, 599, 30, 11218, 273, 365, 6315, 4720, 16040, 12, 8774, 13, 309, 11218, 30, 309, 365,...
return []
return (FALSE, 'no search string')
def findMatches(self, find=None): global guide
63bfc3ce0c1fe8f1831e173d6b472945a6f9c376 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/63bfc3ce0c1fe8f1831e173d6b472945a6f9c376/recordserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 6869, 12, 2890, 16, 1104, 33, 7036, 4672, 2552, 7343, 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, 1104, 6869, 12, 2890, 16, 1104, 33, 7036, 4672, 2552, 7343, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
def prefs_hostentry_changed(self, entry, profile_combo): prefs_profile_num = profile_combo.get_active() self.config.host[prefs_profile_num] = entry.get_text()
def _hostentry_changed(self, entry, profile_combo): profile_num = profile_combo.get_active() self.config.host[profile_num] = entry.get_text()
def prefs_hostentry_changed(self, entry, profile_combo): prefs_profile_num = profile_combo.get_active() self.config.host[prefs_profile_num] = entry.get_text()
7d41f2105c0d58643150b6472b6b9676150f38e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2312/7d41f2105c0d58643150b6472b6b9676150f38e3/preferences.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2564, 4099, 67, 6703, 12, 2890, 16, 1241, 16, 3042, 67, 25053, 4672, 3042, 67, 2107, 273, 3042, 67, 25053, 18, 588, 67, 3535, 1435, 365, 18, 1425, 18, 2564, 63, 5040, 67, 2107, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2564, 4099, 67, 6703, 12, 2890, 16, 1241, 16, 3042, 67, 25053, 4672, 3042, 67, 2107, 273, 3042, 67, 25053, 18, 588, 67, 3535, 1435, 365, 18, 1425, 18, 2564, 63, 5040, 67, 2107, ...
self.pm = pm
def __init__(self, directories, permissions, handler, flags, pm):
cbf8ac7bd84b3bb262816fb16af2d4e9a7f5263e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10458/cbf8ac7bd84b3bb262816fb16af2d4e9a7f5263e/server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 6402, 16, 4371, 16, 1838, 16, 2943, 16, 7430, 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,...
[ 1, 1, 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, 1001, 2738, 972, 12, 2890, 16, 6402, 16, 4371, 16, 1838, 16, 2943, 16, 7430, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
if holelists is not None: assert len(holelists) == len(facets)
if facet_holestarts is not None: assert len(facet_holestarts) == len(facets)
def set_facets_ex(self, facets, markers=None, holelists=None): """Set a list of complicated factes. Unlike L{set_facets}, C{set_facets_ex()} allows holes and multiple polygons per facet.
3ced297c55913885e4b6094b0c0e25c20e66ad10 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11985/3ced297c55913885e4b6094b0c0e25c20e66ad10/tet.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 11639, 2413, 67, 338, 12, 2890, 16, 21681, 16, 11754, 33, 7036, 16, 366, 355, 292, 1486, 33, 7036, 4672, 3536, 694, 279, 666, 434, 31312, 5410, 281, 18, 25448, 511, 95, 542, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 11639, 2413, 67, 338, 12, 2890, 16, 21681, 16, 11754, 33, 7036, 16, 366, 355, 292, 1486, 33, 7036, 4672, 3536, 694, 279, 666, 434, 31312, 5410, 281, 18, 25448, 511, 95, 542, ...
if len(sys.argv) >= 2 and sys.argv[1] == '-m'::
if len(sys.argv) >= 2 and sys.argv[1] == '-m':
def main(): """ <Purpose> Ping all the machines to see if they are up <Exceptions> none <Side Effects> Prints the ping result <Returns> None. """ # setup the gmail user/password to use when sending email success,explanation_str = send_gmail.init_gmail() if not success: log(explanation_str) sys.exit(0) log("pinging critical machines") #list of machines thats getting pinged pinglist = [] #list that contains all the ping results result_queue = [] #create a thread for each machine and ping them for host in machine_list: current_machine = ping(str(host), result_queue) pinglist.append(current_machine) current_machine.start() #join all the threads for ping_host in pinglist: ping_host.join() #variable that keeps track if any machines are down ALL_MACHINES_RUNNING = True error_message="WARNING: Seattle machines are down! Seattle developers please check on the machines.\n" error_message+="Displaying ping result:\n" #check to see if all the results were successful #on failures notify the admins and send a message to the irc for (success, result) in result_queue: if not success: ALL_MACHINES_RUNNING = False error_message += result+"\n" #if all machines were pinged successfully, notify on irc if option -m was used to run ping_machines.py if ALL_MACHINES_RUNNING: if len(sys.argv) >= 2 and sys.argv[1] == '-m':: irc_seattlebot.send_msg("The machines: "+str(machine_list)+" were pinged successfully") else: handle_exception(error_message) irc_seattlebot.send_msg(error_message) print time.ctime() + " : Done pinging all machiens." print "--------------------------------------------"
827decb1c668ba0009f1d951a832b6f658926972 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/827decb1c668ba0009f1d951a832b6f658926972/ping_machines.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3536, 411, 10262, 4150, 34, 18214, 777, 326, 15942, 358, 2621, 309, 2898, 854, 731, 225, 411, 11416, 34, 6555, 225, 411, 8895, 30755, 87, 34, 3038, 87, 326, 10087, 563, 225,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3536, 411, 10262, 4150, 34, 18214, 777, 326, 15942, 358, 2621, 309, 2898, 854, 731, 225, 411, 11416, 34, 6555, 225, 411, 8895, 30755, 87, 34, 3038, 87, 326, 10087, 563, 225,...
if parametric or polar:
if parametric:
def _plot(funcs, xrange, parametric=False, polar=False, fill=None, label='', randomize=True, **options): if not is_fast_float(funcs): funcs = fast_float(funcs, expect_one_var=True) #parametric_plot will be a list or tuple of two functions (f,g) #and will plotted as (f(x), g(x)) for all x in the given range if parametric: f, g = funcs #or we have only a single function to be plotted: else: f = funcs # xrange has to be either of the form (var, xmin, xmax) or (xmin, xmax) if not isinstance(xrange, (tuple, list)): raise TypeError, "xrange must be a tuple or list" if len(xrange) == 3: xmin, xmax = xrange[1], xrange[2] elif len(xrange) == 2: xmin, xmax = xrange[0], xrange[1] else: raise ValueError, "parametric value range must be a list or tuple of length 2 or 3." #check to see if funcs is a list of functions that will #be all plotted together. if isinstance(funcs, (list, tuple)) and not parametric: rainbow_colors = rainbow(len(funcs)) G = Graphics() for i, h in enumerate(funcs): if isinstance(fill, dict): if i in fill: fill_entry = fill[i] if isinstance(fill_entry, list): if fill_entry[0] < len(funcs): fill_temp = funcs[fill_entry[0]] else: fill_temp = None else: fill_temp = fill_entry else: fill_temp = None else: fill_temp = fill options_temp = options.copy() fillcolor_temp = options_temp.pop('fillcolor', 'automatic') if fillcolor_temp == 'automatic': fillcolor_temp = rainbow_colors[i] G += plot(h, (xmin, xmax), polar = polar, fill = fill_temp, \ fillcolor = fillcolor_temp, **options_temp) return G adaptive_tolerance = options.pop('adaptive_tolerance') adaptive_recursion = options.pop('adaptive_recursion') plot_points = int(options.pop('plot_points')) data = generate_plot_points(f, xrange, plot_points, adaptive_tolerance, adaptive_recursion, randomize) if parametric: data = [(fdata, g(x)) for x, fdata in data] G = Graphics() fillcolor = options.pop('fillcolor', 'automatic') fillalpha = options.pop('fillalpha', 0.5) # TODO: Use matplotlib's fill and fill_between commands. if fill is not None: if parametric or polar: filldata = data else: if fill == 'axis' or fill is True: base_level = 0 elif fill == 'min': base_level = min(t[1] for t in data) elif fill == 'max': base_level = max(t[1] for t in data) elif hasattr(fill, '__call__'): if fill == max or fill == min: if fill == max: fstr = 'max' else: fstr = 'min' msg = "WARNING: You use the built-in function %s for filling. You probably wanted the string '%s'." % (fstr, fstr) sage.misc.misc.verbose(msg, level=0) if not is_fast_float(fill): fill_f = fast_float(fill, expect_one_var=True) else: fill_f = fill filldata = generate_plot_points(fill_f, xrange, plot_points, adaptive_tolerance, \ adaptive_recursion, randomize) filldata.reverse() filldata += data else: try: base_level = float(fill) except TypeError: base_level = 0 if not hasattr(fill, '__call__') and polar: filldata = generate_plot_points(lambda x: base_level, xrange, plot_points, adaptive_tolerance, \ adaptive_recursion, randomize) filldata.reverse() filldata += data if not hasattr(fill, '__call__') and not polar: filldata = [(data[0][0], base_level)] + data + [(data[-1][0], base_level)] if fillcolor == 'automatic': fillcolor = (0.5, 0.5, 0.5) fill_options = {} fill_options['rgbcolor'] = fillcolor fill_options['alpha'] = fillalpha fill_options['thickness'] = 0 if polar: filldata = [(y*cos(x), y*sin(x)) for x, y in filldata] G += polygon(filldata, **fill_options) if polar: data = [(y*cos(x), y*sin(x)) for x, y in data] from sage.plot.all import line, text detect_poles = options.pop('detect_poles', False) if not (polar or parametric) and detect_poles != False: from sage.rings.all import RDF epsilon = 0.0001 startIndex = 0 pole_options = {} pole_options['linestyle'] = '--' pole_options['thickness'] = 1 pole_options['rgbcolor'] = '#ccc' for i in range(len(data)-1): x0, y0 = data[i] x1, y1 = data[i+1] if (y1 > 0 and y0 < 0) or (y1 < 0 and y0 > 0): # calculate the slope of the line segment dy = abs(y1-y0) dx = x1 - x0 alpha = (RDF(dy)/RDF(dx)).arctan() if alpha >= RDF(pi/2) - epsilon: G += line(data[startIndex:i], **options) if detect_poles == 'show': # draw a vertical asymptote G += line([(x0, y0), (x1, y1)], **pole_options) startIndex = i+2 G += line(data[startIndex:], **options) else: G += line(data, **options) # Label? if label: label = ' '+str(label) G += text(label, data[-1], horizontal_alignment='left', vertical_alignment='center') return G
8a7ee9547b531fbb172c26840ea7df4251b06f7a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/8a7ee9547b531fbb172c26840ea7df4251b06f7a/plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4032, 12, 17728, 16, 12314, 16, 579, 1591, 33, 8381, 16, 24244, 33, 8381, 16, 3636, 33, 7036, 16, 1433, 2218, 2187, 2744, 554, 33, 5510, 16, 2826, 2116, 4672, 309, 486, 353, 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, 389, 4032, 12, 17728, 16, 12314, 16, 579, 1591, 33, 8381, 16, 24244, 33, 8381, 16, 3636, 33, 7036, 16, 1433, 2218, 2187, 2744, 554, 33, 5510, 16, 2826, 2116, 4672, 309, 486, 353, 67, ...
insert_connection = atom.service.AtomService._CreateConnection(self, uri,
insert_connection = self.handler._CreateConnection(self, uri,
def Post(self, data, uri, extra_headers=None, url_params=None, escape_params=True, redirects_remaining=4, media_source=None, converter=None): """Insert data into a GData service at the given URI.
2fc3c8b5e04f49e7854d86afdf5c528572665ee2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6580/2fc3c8b5e04f49e7854d86afdf5c528572665ee2/service.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5616, 12, 2890, 16, 501, 16, 2003, 16, 2870, 67, 2485, 33, 7036, 16, 880, 67, 2010, 33, 7036, 16, 4114, 67, 2010, 33, 5510, 16, 18064, 67, 17956, 33, 24, 16, 3539, 67, 3168, 33, 70...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5616, 12, 2890, 16, 501, 16, 2003, 16, 2870, 67, 2485, 33, 7036, 16, 880, 67, 2010, 33, 7036, 16, 4114, 67, 2010, 33, 5510, 16, 18064, 67, 17956, 33, 24, 16, 3539, 67, 3168, 33, 70...
TESTS: We make sure that the trivial group gets handled correctly. ::
TESTS: We make sure that the trivial group gets handled correctly::
def gens(self): """ Return tuple of generators of this group. These need not be minimal, as they are the generators used in defining this group. EXAMPLES:: sage: G = PermutationGroup([[(1,2,3)], [(1,2)]]) sage: G.gens() [(1,2), (1,2,3)] Note that the generators need not be minimal though duplicates are removed. :: sage: G = PermutationGroup([[(1,2)], [(1,3)], [(2,3)], [(1,2)]]) sage: G.gens() [(2,3), (1,2), (1,3)] :: sage: G = PermutationGroup([[(1,2,3,4), (5,6)], [(1,2)]]) sage: g = G.gens() sage: g[0] (1,2) sage: g[1] (1,2,3,4)(5,6) TESTS: We make sure that the trivial group gets handled correctly. :: sage: SymmetricGroup(1).gens() [()] """ return self._gens
6ac30ecf5071d4fb909072e90d2311932d8c2165 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/6ac30ecf5071d4fb909072e90d2311932d8c2165/permgroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 314, 773, 12, 2890, 4672, 3536, 2000, 3193, 434, 13327, 434, 333, 1041, 18, 8646, 1608, 486, 506, 16745, 16, 487, 2898, 854, 326, 13327, 1399, 316, 9364, 333, 1041, 18, 225, 5675, 8900, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 314, 773, 12, 2890, 4672, 3536, 2000, 3193, 434, 13327, 434, 333, 1041, 18, 8646, 1608, 486, 506, 16745, 16, 487, 2898, 854, 326, 13327, 1399, 316, 9364, 333, 1041, 18, 225, 5675, 8900, ...
class BuildError(StandardError):
class BuildError(Exception):
def merge_strings(*args, **kwds): """Returns non empty string joined by sep The default separator is an empty string. """ sep = kwds.get('sep', '') return sep.join([s for s in args if s])
5ed962a58a84830cbe0f649aee7072426feb4c22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1298/5ed962a58a84830cbe0f649aee7072426feb4c22/msys_link_VC_2008_dlls.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2691, 67, 10219, 30857, 1968, 16, 2826, 25577, 4672, 3536, 1356, 1661, 1008, 533, 12114, 635, 5478, 225, 1021, 805, 4182, 353, 392, 1008, 533, 18, 3536, 225, 5478, 273, 17149, 18, 588, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2691, 67, 10219, 30857, 1968, 16, 2826, 25577, 4672, 3536, 1356, 1661, 1008, 533, 12114, 635, 5478, 225, 1021, 805, 4182, 353, 392, 1008, 533, 18, 3536, 225, 5478, 273, 17149, 18, 588, 2...
self.cursor.execute(sql,(self.process_id,self.lfn_id,lfn,start,end))
self.cursor.execute(sql,(self.process_id,self.lfn_id[0],lfn,start,end))
def register_lfn(self,lfn,start=None,end=None): """ Start publishing state information for a new logical file name
1071b2ee9f2d46ed87b8bdc8bd346b42c1f9e524 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3589/1071b2ee9f2d46ed87b8bdc8bd346b42c1f9e524/statedb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1744, 67, 80, 4293, 12, 2890, 16, 80, 4293, 16, 1937, 33, 7036, 16, 409, 33, 7036, 4672, 3536, 3603, 23636, 919, 1779, 364, 279, 394, 6374, 585, 508, 2, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 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, 1744, 67, 80, 4293, 12, 2890, 16, 80, 4293, 16, 1937, 33, 7036, 16, 409, 33, 7036, 4672, 3536, 3603, 23636, 919, 1779, 364, 279, 394, 6374, 585, 508, 2, -100, -100, -100, -100, -100, ...
except RuntimeError:
except (RuntimeError, MacOS.Error):
def _mac_ver_lookup(selectors,default=None): from gestalt import gestalt l = [] append = l.append for selector in selectors: try: append(gestalt(selector)) except RuntimeError: append(default) return l
09d60c3702c7dda56f51eaa1bf12bf2d8b2bd88a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09d60c3702c7dda56f51eaa1bf12bf2d8b2bd88a/platform.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5821, 67, 502, 67, 8664, 12, 29829, 16, 1886, 33, 7036, 4672, 225, 628, 314, 395, 2390, 1930, 314, 395, 2390, 328, 273, 5378, 714, 273, 328, 18, 6923, 364, 3451, 316, 11424, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5821, 67, 502, 67, 8664, 12, 29829, 16, 1886, 33, 7036, 4672, 225, 628, 314, 395, 2390, 1930, 314, 395, 2390, 328, 273, 5378, 714, 273, 328, 18, 6923, 364, 3451, 316, 11424, 30, ...
'''Store the content of the file in the database. The property may be
"""Store the content of the file in the database. The property may be
def storefile(self, classname, nodeid, property, content): '''Store the content of the file in the database. The property may be None, in which case the filename does not indicate which property is being saved. ''' # determine the name of the file to write to name = self.filename(classname, nodeid, property, create=1)
98d1077c4d91289eb72b2804a276c6206419fa5c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1906/98d1077c4d91289eb72b2804a276c6206419fa5c/blobfiles.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1707, 768, 12, 2890, 16, 7479, 16, 756, 350, 16, 1272, 16, 913, 4672, 3536, 2257, 326, 913, 434, 326, 585, 316, 326, 2063, 18, 1021, 1272, 2026, 506, 599, 16, 316, 1492, 648, 326, 15...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1707, 768, 12, 2890, 16, 7479, 16, 756, 350, 16, 1272, 16, 913, 4672, 3536, 2257, 326, 913, 434, 326, 585, 316, 326, 2063, 18, 1021, 1272, 2026, 506, 599, 16, 316, 1492, 648, 326, 15...
self.UpdateImage(base_image_path)
self._UpdateImageReportError(image_path)
def PrepareBase(self): """Auto-update to base image to prepare for test.""" self.UpdateImage(base_image_path)
969a67304525cae2d03af218137f445591964072 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/969a67304525cae2d03af218137f445591964072/cros_au_test_harness.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7730, 2171, 12, 2890, 4672, 3536, 4965, 17, 2725, 358, 1026, 1316, 358, 2911, 364, 1842, 12123, 365, 18, 1891, 2040, 12, 1969, 67, 2730, 67, 803, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7730, 2171, 12, 2890, 4672, 3536, 4965, 17, 2725, 358, 1026, 1316, 358, 2911, 364, 1842, 12123, 365, 18, 1891, 2040, 12, 1969, 67, 2730, 67, 803, 13, 2, -100, -100, -100, -100, -100, -...
file = unquote(file)
def open_local_file(self, url): import mimetypes, mimetools, StringIO mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( 'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) if not host: return addinfourl( open(url2pathname(file), 'rb'), headers, 'file:'+file) host, port = splitport(host) if not port and socket.gethostbyname(host) in ( localhost(), thishost()): file = unquote(file) return addinfourl( open(url2pathname(file), 'rb'), headers, 'file:'+file) raise IOError, ('local file error', 'not on local host')
90a3c0dd22d2ec83a9d90b50083d2d67c509c335 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/90a3c0dd22d2ec83a9d90b50083d2d67c509c335/urllib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 3729, 67, 768, 12, 2890, 16, 880, 4672, 1930, 20369, 15180, 16, 20369, 278, 8192, 16, 15777, 22189, 273, 20369, 15180, 18, 20885, 67, 723, 12, 718, 25146, 20, 65, 1607, 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, 1696, 67, 3729, 67, 768, 12, 2890, 16, 880, 4672, 1930, 20369, 15180, 16, 20369, 278, 8192, 16, 15777, 22189, 273, 20369, 15180, 18, 20885, 67, 723, 12, 718, 25146, 20, 65, 1607, 273, ...
cputime = quotainfo[0] systime = quotainfo[1] childcputime = quotainfo[2] childsystime = quotainfo[3] clocktime = quotainfo[4] currenttime = quotainfo[5]
cputime = info[0] systime = info[1] childcputime = info[2] childsystime = info[3] clocktime = info[4] currenttime = info[5]
def get_time_and_cpu_percent(readfobj): global lastenforcedata global junkfirst cpudata = readfobj.readline().strip() # the child must have exited, I'll return so I can wait on them... if not cpudata: return (0.0, 0.0) quotainfo = eval(cpudata) # Give them a free pass the first time if not lastenforcedata: lastenforcedata = quotainfo junkfirst = quotainfo[4] return (0.0, 0.0) # The os.times() info is: (cpu, sys, child cpu, child sys, current time) # I think it makes the most sense to use the combined cpu/sys time as well # as the current time... cputime = quotainfo[0] systime = quotainfo[1] childcputime = quotainfo[2] childsystime = quotainfo[3] clocktime = quotainfo[4] # processor time (it's in the wrong units...) currenttime = quotainfo[5] usertime = cputime + systime # How can they have a child? if childcputime != 0.0 or childsystime != 0.0: raise Exception, "Non zero child time!: Cpu time '"+str(childcputime)+"' > Sys time '"+str(childsystime)+"'" oldusertime = lastenforcedata[0] + lastenforcedata[1] oldclocktime = lastenforcedata[4] oldcurrenttime = lastenforcedata[5] # NOTE: Processor time is going backwards... Is this possible? # Should do something nicer like ignore quota? if clocktime < oldclocktime: raise Exception, "Elapsed time '"+str(currenttime)+"' less than previous '"+str(oldcurrenttime)+"'" # user time is going backwards... I don't think this is possible if usertime < oldusertime: raise Exception, "User time '"+str(usertime)+"' at '"+str(currenttime)+"' less than user time '"+str(oldusertime)+"' at '"+str(oldcurrenttime)+"'" percentused = (usertime - oldusertime) / (clocktime - oldclocktime) lastenforcedata = quotainfo #print (usertime) / (clocktime - junkfirst), percentused, usertime, time.time() - junkstart #print percentused, usertime, oldusertime, clocktime, oldclocktime, clocktime-oldclocktime sys.stdout.flush() return (currenttime - oldcurrenttime, percentused)
da5157d89e6ffa97b6c3efbb3b8f84e5a8c9fbd7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7272/da5157d89e6ffa97b6c3efbb3b8f84e5a8c9fbd7/nonportable.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 957, 67, 464, 67, 11447, 67, 8849, 12, 896, 27936, 4672, 2552, 1142, 275, 5734, 892, 2552, 525, 1683, 3645, 225, 8326, 892, 273, 855, 27936, 18, 896, 1369, 7675, 6406, 1435, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 957, 67, 464, 67, 11447, 67, 8849, 12, 896, 27936, 4672, 2552, 1142, 275, 5734, 892, 2552, 525, 1683, 3645, 225, 8326, 892, 273, 855, 27936, 18, 896, 1369, 7675, 6406, 1435, 2...
""" Form for student profiles """
""" Form for teacher profiles """
def __init__(self, *args, **kwargs): self.base_fields['year_finished'].widget.attrs['size'] = 4 self.base_fields['year_finished'].widget.attrs['maxlength'] = 4 self.base_fields['num_kids'].widget.attrs['size'] = 3 self.base_fields['num_kids'].widget.attrs['maxlength'] = 16 super(GuardianInfoForm, self).__init__(*args, **kwargs)
f6b42492073be7baa4b609cb9655e44bc2582d87 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12041/f6b42492073be7baa4b609cb9655e44bc2582d87/user_profile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 16, 2826, 4333, 4672, 365, 18, 1969, 67, 2821, 3292, 6874, 67, 13527, 29489, 6587, 18, 7039, 3292, 1467, 3546, 273, 1059, 365, 18, 1969, 67, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 16, 2826, 4333, 4672, 365, 18, 1969, 67, 2821, 3292, 6874, 67, 13527, 29489, 6587, 18, 7039, 3292, 1467, 3546, 273, 1059, 365, 18, 1969, 67, 2...
_assertNumbersAre = lambda seq: self.assertNumbersAre(tdm, seq)
_assertNumbersAre = lambda seq: self.assertNumbersAre(tdm, seq)
def testLeafing(self): tdm = tdb.TabularDataModel(self.store, X, [X.number, X.textNumber, X.phoneticDigits], itemsPerPage=15) _assertNumbersAre = lambda seq: self.assertNumbersAre(tdm, seq) _assertNumbersAre(range(15)) tdm.nextPage() _assertNumbersAre(range(15, 30)) tdm.prevPage() _assertNumbersAre(range(15)) tdm.lastPage() # This next assert is kind of weak, because it is valid to have only a # few results on the last page, but right now the strategy is to # always keep the page full of results. No matter what though, the # last page should contain the last value. self.assertEquals(list(tdm.currentPage())[-1]['number'], 106) tdm.firstPage() _assertNumbersAre(range(15))
f503b031aca5d4d527623508220761db1ee30d2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6980/f503b031aca5d4d527623508220761db1ee30d2b/test_tdb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 9858, 310, 12, 2890, 4672, 6655, 81, 273, 268, 1966, 18, 5661, 2490, 26349, 12, 2890, 18, 2233, 16, 1139, 16, 306, 60, 18, 2696, 16, 1139, 18, 955, 1854, 16, 1139, 18, 844, 265...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9858, 310, 12, 2890, 4672, 6655, 81, 273, 268, 1966, 18, 5661, 2490, 26349, 12, 2890, 18, 2233, 16, 1139, 16, 306, 60, 18, 2696, 16, 1139, 18, 955, 1854, 16, 1139, 18, 844, 265...
print check_split_str("1,2,3,4,5:7,27,28:32,32:30") x = reduce_split_str("1") print x y= expand_split_str("1,2,3:7,27:33") print y
print check_split_str("1,2,3,4,5:7,27,28:32,32:30") x = reduce_split_str("1") print x y= expand_split_str("1,2,3:7,27:33") print y
def main(): print check_split_str("1,2,3,4,5:7,27,28:32,32:30") x = reduce_split_str("1") print x y= expand_split_str("1,2,3:7,27:33") print y
76bd12c9f0f970ec39e56fe35c8c6964ae612c86 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12567/76bd12c9f0f970ec39e56fe35c8c6964ae612c86/indexsplit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 1172, 866, 67, 4939, 67, 701, 2932, 21, 16, 22, 16, 23, 16, 24, 16, 25, 30, 27, 16, 5324, 16, 6030, 30, 1578, 16, 1578, 30, 5082, 7923, 619, 273, 5459, 67, 4939, 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, 2774, 13332, 1172, 866, 67, 4939, 67, 701, 2932, 21, 16, 22, 16, 23, 16, 24, 16, 25, 30, 27, 16, 5324, 16, 6030, 30, 1578, 16, 1578, 30, 5082, 7923, 619, 273, 5459, 67, 4939, 67, ...
user = _validate_and_get_geniuser(request)
try: user = _validate_and_get_geniuser(request) except LoggedInButFailedGetGeniUserError: return _show_failed_get_geniuser_page(request)
def get_resources(request): user = _validate_and_get_geniuser(request) # the request must be via POST. if not, bounce user back to My Vessels page if not request.method == 'POST': return myvessels(request) # try and grab form from POST. if it can't, bounce user back to My Vessels page get_form = forms.gen_get_form(user, request.POST) if get_form is None: return myvessels(request) action_summary = "" action_detail = "" if get_form.is_valid(): vessel_num = get_form.cleaned_data['num'] vessel_type = get_form.cleaned_data['env'] try: acquired_vessels = interface.acquire_vessels(user, vessel_num, vessel_type) except UnableToAcquireResourcesError, err: action_summary = "Couldn't acquire resources at this time." action_detail += str(err) except InsufficientUserResourcesError: action_summary = "You do not have enough vessel credits to fufill this request." # return a My Vessels page with the updated vessels/vessel acquire details/errors return myvessels(request, get_form, action_summary=action_summary, action_detail=action_detail)
e5569e220af41a91014bb58366ca4d59400c0284 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/e5569e220af41a91014bb58366ca4d59400c0284/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 4683, 12, 2293, 4672, 775, 30, 729, 273, 389, 5662, 67, 464, 67, 588, 67, 4507, 77, 1355, 12, 2293, 13, 1335, 1827, 2423, 382, 31167, 2925, 967, 7642, 77, 1299, 668, 30, 327...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4683, 12, 2293, 4672, 775, 30, 729, 273, 389, 5662, 67, 464, 67, 588, 67, 4507, 77, 1355, 12, 2293, 13, 1335, 1827, 2423, 382, 31167, 2925, 967, 7642, 77, 1299, 668, 30, 327...
sbox += self.inversion_polynomials(xi,wi,r*c*e) sbox += self.field_polynomials("x",i) sbox += self.field_polynomials("w",i)
sbox += self.inversion_polynomials(xi, wi, r*c*e) sbox += self.field_polynomials("x", i) sbox += self.field_polynomials("w", i)
def round_polynomials(self, i, plaintext = None, ciphertext = None): r""" Return list of polynomials for a given round $i$.
26b5b14a2a46b23848ccefac3b41425cf353e86a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/26b5b14a2a46b23848ccefac3b41425cf353e86a/sr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3643, 67, 3915, 13602, 87, 12, 2890, 16, 277, 16, 11917, 273, 599, 16, 12657, 273, 599, 4672, 436, 8395, 2000, 666, 434, 16991, 87, 364, 279, 864, 3643, 271, 77, 8, 18, 2, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3643, 67, 3915, 13602, 87, 12, 2890, 16, 277, 16, 11917, 273, 599, 16, 12657, 273, 599, 4672, 436, 8395, 2000, 666, 434, 16991, 87, 364, 279, 864, 3643, 271, 77, 8, 18, 2, -100, -100...
raise PBPUsageError("do " + rest)
raise error.PBPUsageError("do " + rest)
def do_do(self, rest): """do <python_callable> [arguments...] Call Python code loaded with pyload. Arguments will be passed to the callable as function arguments. """ args = shlex_split(rest) try: name = args.pop(0) except IndexError: raise PBPUsageError("do " + rest) ret = self._resolvePyloadedName(name, *args) if ret is not None: self.tprintln(str(ret))
82a69cd8cb3fd75cfc003a6997b2926265fad80c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2493/82a69cd8cb3fd75cfc003a6997b2926265fad80c/pbpscript.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 2896, 12, 2890, 16, 3127, 4672, 3536, 2896, 411, 8103, 67, 7293, 34, 306, 7099, 2777, 65, 3049, 6600, 981, 4203, 598, 2395, 945, 18, 225, 13599, 903, 506, 2275, 358, 326, 4140...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 2896, 12, 2890, 16, 3127, 4672, 3536, 2896, 411, 8103, 67, 7293, 34, 306, 7099, 2777, 65, 3049, 6600, 981, 4203, 598, 2395, 945, 18, 225, 13599, 903, 506, 2275, 358, 326, 4140...
_ip.magic('run -i "%s"'%preparse_file_named(F))
_ip.runlines('%%run -i "%s"'%preparse_file_named(F))
def do_prefilter_paste(line, continuation): """ Alternate prefilter for input. INPUT: line -- a single line; must *not* have any newlines in it continuation -- whether the input line is really part of the previous line, because of open parens or backslash. """ if '\n' in line: raise RuntimeError, "bug in function that calls do_prefilter_paste -- there can be no newlines in the input" global attached # This is so it's OK to have lots of blank space at the # beginning of any non-continuation line. if continuation: # strip ...'s that appear in examples L = line.lstrip() if L[:3] == '...': line = L[3:] else: line = line.lstrip() line = line.rstrip() if not line.startswith('attach ') and not line.startswith('load '): for F in attached.keys(): tm = attached[F] if os.path.exists(F) and os.path.getmtime(F) > tm: # Reload F. try: if F.endswith('.py'): _ip.magic('run -i "%s"'%F) elif F.endswith('.sage'): _ip.magic('run -i "%s"'%preparse_file_named(F)) elif F.endswith('.spyx') or F.endswith('.pyx'): X = load_cython(F) __IPYTHON__.push(X) else: line = 'load("%s")'%F t = os.path.getmtime(F) attached[F] = t except IOError: del attached[F] # Get rid of leading sage: so that pasting of examples from the documentation # works. This is like MAGMA's SetLinePrompt(false). for prompt in ['sage:', '>>>']: if not continuation: while True: strip = False if line[:3] == prompt: line = line[3:].lstrip() strip = True elif line[:5] == prompt: line = line[5:].lstrip() strip = True if not strip: break else: line = line.lstrip() # 'quit' alone on a line to quit. if line.lower() in ['quit', 'exit', 'quit;', 'exit;']: line = '%quit' ################################################################# # An interactive load command, like iload in MAGMA. ################################################################# if line[:6] == 'iload ': try: name = str(eval(line[6:])) except: name = str(line[6:].strip()) try: F = open(name) except IOError: raise ImportError, 'Could not open file "%s"'%name print 'Interactively loading "%s"'%name n = len(__IPYTHON__.input_hist) for L in F.readlines(): L = L.rstrip() Llstrip = L.lstrip() raw_input('sage: %s'%L.rstrip()) __IPYTHON__.input_hist_raw.append(L) if Llstrip[:5] == 'load ' or Llstrip[:7] == 'attach ' \ or Llstrip[:6] == 'iload ': log.offset -= 1 L = do_prefilter_paste(L, False) if len(L.strip()) > 0: _ip.magic(L) L = '' else: L = preparser_ipython.preparse_ipython(L, not continuation) __IPYTHON__.input_hist.append(L) __IPYTHON__.push(L) log.offset += 1 return '' ################################################################# # A "load" command, like \r file in PARI or load "file" in MAGMA ################################################################# if line[:5] == 'load ': # The -i so the file is run with the same environment, # e.g., including the "from sage import *" try: name = str(eval(line[5:])).strip() except: name = str(line[5:].strip()) if name.lower().startswith('http://'): name = remote_file.get_remote_file(name) if isinstance(name, str): if not os.path.exists(name): raise ImportError, "File '%s' not found (be sure to give .sage, .py, or .pyx extension)"%name elif name.endswith('.py'): try: line = '%run -i "' + name + '"' except IOError, s: print s raise ImportError, "Error loading '%s'"%name elif name.endswith('.sage'): try: line = '%run -i "' + preparse_file_named(name) + '"' except IOError, s: print s raise ImportError, "Error loading '%s'"%name line = "" elif name.endswith('.spyx') or name.endswith('.pyx'): line = load_cython(name) else: line = 'load("%s")'%name #raise ImportError, "Loading of '%s' not implemented (load .py, .pyx, and .sage files)"%name #line = '' elif line[:13] == 'save_session(': line = 'save_session(locals(), %s'%line[13:] elif line[:14] == 'save_session (': line = 'save_session (locals(), %s'%line[14:] elif line[:13] == 'load_session(': line = 'load_session(locals(), %s'%line[13:] elif line[:14] == 'load_session (': line = 'load_session (locals(), %s'%line[14:] elif ''.join(line.split()) == 'show_identifiers()': line = 'show_identifiers(locals())' # This is an attach command like in MAGMA. The file to attach is # any file that could be loaded. At attach time it is loaded as # above. It is put in a list that is a variable with scope this # interpreter.py file. Each time prefilter_paste is called and # continuation is False, check all attached file names and if any # have changed, compile the file, then use %run to load them again # as above. This is like the MAGMA attach, but in some ways # better. It is very nice for interactive code development. if line.startswith('attach '): # The -i so the file is run with the same environment, # e.g., including the "from sage import *" try: name = str(eval(line[7:])) except: name = str(line[7:].strip()) name = os.path.abspath(name) if not os.path.exists(name): raise ImportError, "File '%s' not found (be sure to give .sage, .py, or .pyx extension)."%name elif name.endswith('.py'): try: line = '%run -i "' + name + '"' attached[name] = os.path.getmtime(name) except IOError, OSError: raise ImportError, "File '%s' not found."%name elif name.endswith('.sage'): try: line = '%run -i "' + preparse_file_named(name) + '"' attached[name] = os.path.getmtime(name) except IOError, OSError: raise ImportError, "File '%s' not found."%name elif name.endswith('.pyx') or name.endswith('.spyx'): try: line = load_cython(name) attached[name] = os.path.getmtime(name) except IOError, OSError: raise ImportError, "File '%s' not found."%name line = '' else: #line = 'load("%s")'%name raise ImportError, "Attaching of '%s' not implemented (load .py, .pyx, and .sage files)"%name if len(line) > 0: line = preparser_ipython.preparse_ipython(line, not continuation) return line
99f1da1fd55b783a5e3c315a8be1e30a4bbcf883 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/99f1da1fd55b783a5e3c315a8be1e30a4bbcf883/interpreter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 1484, 2188, 67, 29795, 12, 1369, 16, 17378, 4672, 3536, 21498, 340, 675, 2188, 364, 810, 18, 225, 12943, 30, 980, 1493, 279, 2202, 980, 31, 1297, 380, 902, 14, 1240, 1281, 191...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 1484, 2188, 67, 29795, 12, 1369, 16, 17378, 4672, 3536, 21498, 340, 675, 2188, 364, 810, 18, 225, 12943, 30, 980, 1493, 279, 2202, 980, 31, 1297, 380, 902, 14, 1240, 1281, 191...
properties = [p for p in properties if p.target().cls() == container.uid()]
cuid = container.uid() properties = [p for p in properties if p.target().cls() == cuid]
def _write_property_details(self, public, private, container, properties, heading='Variable Details'): """ Write HTML code for a properties details dection. This is used by L{_write_class} to describe the properties in a class. @param public: The output stream for the public version of the page. @param private: The output stream for the private version of the page. @param container: The or class that contains the properties. C{container} is used to group the functions. @param properties: The properties that should be included in the section. """ # Filter out properties that we have no docs for; these are # just listed in the summary table. docmap = self._docmap properties = [p for p in properties if docmap.has_key(p.target())]
b57986399a2595e7095d7d67227b7bcda199a18b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/b57986399a2595e7095d7d67227b7bcda199a18b/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 67, 4468, 67, 6395, 12, 2890, 16, 1071, 16, 3238, 16, 1478, 16, 1790, 16, 11053, 2218, 3092, 21897, 11, 4672, 3536, 2598, 3982, 981, 364, 279, 1790, 3189, 443, 349, 18, 225,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 67, 4468, 67, 6395, 12, 2890, 16, 1071, 16, 3238, 16, 1478, 16, 1790, 16, 11053, 2218, 3092, 21897, 11, 4672, 3536, 2598, 3982, 981, 364, 279, 1790, 3189, 443, 349, 18, 225,...
actions.action_help()
actions.action_help()
def show_help(): print """Usage: benchmark.py [OPTION]... [PROJECT]...
c3b1836ef0182f28706671e776a50bdd03b5c845 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4521/c3b1836ef0182f28706671e776a50bdd03b5c845/benchmark.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 67, 5201, 13332, 1172, 3536, 5357, 30, 14128, 18, 2074, 306, 7425, 65, 2777, 306, 17147, 65, 2777, 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, 2405, 67, 5201, 13332, 1172, 3536, 5357, 30, 14128, 18, 2074, 306, 7425, 65, 2777, 306, 17147, 65, 2777, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
will_read = num_frames_left if num_frames_left < frames_to_read else frames_to_read
def read_frames(self, frames_to_read): if self.has_broken_header and self.seekpoint + frames_to_read > self.num_frames / 2: raise IOError()
a7848c2fefe929b851b1aeb0a3462028d913cf20 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12043/a7848c2fefe929b851b1aeb0a3462028d913cf20/wav2png.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 10278, 12, 2890, 16, 7793, 67, 869, 67, 896, 4672, 309, 365, 18, 5332, 67, 70, 19906, 67, 3374, 471, 365, 18, 16508, 1153, 397, 7793, 67, 869, 67, 896, 405, 365, 18, 2107, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 855, 67, 10278, 12, 2890, 16, 7793, 67, 869, 67, 896, 4672, 309, 365, 18, 5332, 67, 70, 19906, 67, 3374, 471, 365, 18, 16508, 1153, 397, 7793, 67, 869, 67, 896, 405, 365, 18, 2107, ...
else: pass
def _waiter(self): while True: job, result, throw_args = self._queue.wait() if throw_args is None: job.event.send(result) else: if self._killerror is None: type = throw_args[0] self._killerror = JobGroupExit('Killed because of %s in the group' % type.__name__) self.kill_all(self._killerror) job.event.send_exception(*throw_args) # cannot exit here, as I need to deliver GreenExits else: # another exception, ignore it pass
2ea50a175781db413892ace970a0e6314607e240 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10078/2ea50a175781db413892ace970a0e6314607e240/coros.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 7048, 264, 12, 2890, 4672, 1323, 1053, 30, 1719, 16, 563, 16, 604, 67, 1968, 273, 365, 6315, 4000, 18, 7048, 1435, 309, 604, 67, 1968, 353, 599, 30, 1719, 18, 2575, 18, 4661, 12...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 7048, 264, 12, 2890, 4672, 1323, 1053, 30, 1719, 16, 563, 16, 604, 67, 1968, 273, 365, 6315, 4000, 18, 7048, 1435, 309, 604, 67, 1968, 353, 599, 30, 1719, 18, 2575, 18, 4661, 12...
EnqueueCxx(ipath=IPATH, opts=['BUILDING_PPYTHONW'], src='ppython.cxx', obj='ppythonw.obj') EnqueueLink(opts=['WINUSER'], dll='ppythonw.exe', obj=['ppythonw.obj'])
def CreatePandaVersionFiles(): version1=int(VERSION.split(".")[0]) version2=int(VERSION.split(".")[1]) version3=int(VERSION.split(".")[2]) nversion=version1*1000000+version2*1000+version3 pandaversion_h = PANDAVERSION_H.replace("VERSION1",str(version1)) pandaversion_h = pandaversion_h.replace("VERSION2",str(version2)) pandaversion_h = pandaversion_h.replace("VERSION3",str(version3)) pandaversion_h = pandaversion_h.replace("NVERSION",str(nversion)) checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("VERSION1",str(version1)) checkpandaversion_cxx = checkpandaversion_cxx.replace("VERSION2",str(version2)) checkpandaversion_cxx = checkpandaversion_cxx.replace("VERSION3",str(version3)) checkpandaversion_cxx = checkpandaversion_cxx.replace("NVERSION",str(nversion)) checkpandaversion_h = CHECKPANDAVERSION_H.replace("VERSION1",str(version1)) checkpandaversion_h = checkpandaversion_h.replace("VERSION2",str(version2)) checkpandaversion_h = checkpandaversion_h.replace("VERSION3",str(version3)) checkpandaversion_h = checkpandaversion_h.replace("NVERSION",str(nversion)) ConditionalWriteFile('built/include/pandaVersion.h', pandaversion_h) ConditionalWriteFile('built/include/checkPandaVersion.cxx', checkpandaversion_cxx) ConditionalWriteFile('built/include/checkPandaVersion.h', checkpandaversion_h) if (OMIT.count("PYTHON")==0): ConditionalWriteFile("built/tmp/pythonversion", os.path.basename(PYTHONSDK)) ConditionalWriteFile("built/tmp/null.cxx","")
2e83eec6a5713df32f1cb4136016d899f0f7f37c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/2e83eec6a5713df32f1cb4136016d899f0f7f37c/makepanda.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1788, 52, 464, 69, 1444, 2697, 13332, 1177, 21, 33, 474, 12, 5757, 18, 4939, 2932, 1199, 25146, 20, 5717, 1177, 22, 33, 474, 12, 5757, 18, 4939, 2932, 1199, 25146, 21, 5717, 1177, 23, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1788, 52, 464, 69, 1444, 2697, 13332, 1177, 21, 33, 474, 12, 5757, 18, 4939, 2932, 1199, 25146, 20, 5717, 1177, 22, 33, 474, 12, 5757, 18, 4939, 2932, 1199, 25146, 21, 5717, 1177, 23, ...
filetag.tag().track = filetagnum - self.filetagnum + 1
filetag.tag().track = filetagnum - self.filetagnum
def editwindow_applyall(self, button, item, filetags, tag_changed, entries): filetagnum = 0 for filetag in filetags: filetagnum = filetagnum + 1 tag_changed[filetagnum-1][item] = True if item == "title": filetag.tag().title = entries[0].get_text() elif item == "album": filetag.tag().album = entries[2].get_text() elif item == "artist": filetag.tag().artist = entries[1].get_text() elif item == "year": if len(entries[3].get_text()) > 0: filetag.tag().year = int(entries[3].get_text()) else: filetag.tag().year = 0 elif item == "track": if filetagnum >= self.filetagnum: # Start the current song at track 1, as opposed to the first # song in the list. filetag.tag().track = filetagnum - self.filetagnum + 1 else: filetag.tag().track = 0 elif item == "genre": filetag.tag().genre = entries[5].get_text() elif item == "comment": filetag.tag().comment = entries[6].get_text() if item == "track": # Update the entry for the current song: entries[4].set_text(str(filetags[self.filetagnum].tag().track))
2e003d337e9f66a38f8a36b1d0af5904ec35cfa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2312/2e003d337e9f66a38f8a36b1d0af5904ec35cfa8/sonata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3874, 5668, 67, 9010, 454, 12, 2890, 16, 3568, 16, 761, 16, 661, 278, 1341, 16, 1047, 67, 6703, 16, 3222, 4672, 661, 20788, 2107, 273, 374, 364, 661, 20788, 316, 661, 278, 1341, 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, 3874, 5668, 67, 9010, 454, 12, 2890, 16, 3568, 16, 761, 16, 661, 278, 1341, 16, 1047, 67, 6703, 16, 3222, 4672, 661, 20788, 2107, 273, 374, 364, 661, 20788, 316, 661, 278, 1341, 30, ...
def get_tag_value_by_about (self, about, tag): """Gets the value of a tag on an object having the given about tag. Returns returns a 2-tuple, in which the first component is the status, and the second is either the tag value, if the return stats is STATUS.OK, or None otherwise. """ o = self.create_object (about=about) if type (o) == types.IntType: return o return self.get_tag_value_by_id (o.id, tag)
get_tag_value_by_about = by_about(get_tag_value_by_id)
def get_tag_value_by_about (self, about, tag): """Gets the value of a tag on an object having the given about tag.
a258ae866ad40d7092b84a6b1737df504976b56c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12637/a258ae866ad40d7092b84a6b1737df504976b56c/fdb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2692, 67, 1132, 67, 1637, 67, 21071, 261, 2890, 16, 2973, 16, 1047, 4672, 3536, 3002, 326, 460, 434, 279, 1047, 603, 392, 733, 7999, 326, 864, 2973, 1047, 18, 2, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2692, 67, 1132, 67, 1637, 67, 21071, 261, 2890, 16, 2973, 16, 1047, 4672, 3536, 3002, 326, 460, 434, 279, 1047, 603, 392, 733, 7999, 326, 864, 2973, 1047, 18, 2, -100, -100, ...
if hasattr(self, '_assoc'): G._assoc = {} for v in self._assoc: try: G._assoc[v] = self._assoc[v].copy() except: G._assoc[v] = copy(self._assoc[v]) if hasattr(self, '_embedding'): G._embedding = self._embedding
attributes_to_copy = ('_assoc', '_embedding') for attr in attributes_to_copy: if hasattr(self, attr): copy_attr = {} old_attr = getattr(self, attr) if isinstance(old_attr, dict): for v,value in old_attr.iteritems(): try: copy_attr[v] = value.copy() except AttributeError: copy_attr[v] = copy(value) setattr(G, attr, copy_attr) else: setattr(G, attr, copy(old_attr))
def copy(self, implementation='networkx', sparse=True): """ Creates a copy of the graph.
c3afb61f9d1def8f80a547062b5fe32e541084ab /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/c3afb61f9d1def8f80a547062b5fe32e541084ab/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1610, 12, 2890, 16, 4471, 2218, 5185, 92, 2187, 9387, 33, 5510, 4672, 3536, 10210, 279, 1610, 434, 326, 2667, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1610, 12, 2890, 16, 4471, 2218, 5185, 92, 2187, 9387, 33, 5510, 4672, 3536, 10210, 279, 1610, 434, 326, 2667, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
units_qs = unit.store.units
filter = request.GET.get('filter', DEFAULT_FILTER) units_qs = _filter_queryset(unit.store.units, filter)
def get_edit_unit(request, pootle_path, uid): """ Given a store path C{pootle_path} and unit id C{uid}, gathers all the necessary information to build the editing widget. @return: A templatised editing widget is returned within the C{editor} variable and paging information is also returned if the page number has changed. """ if pootle_path[0] != '/': pootle_path = '/' + pootle_path unit = get_object_or_404(Unit, id=uid, store__pootle_path=pootle_path) translation_project = unit.store.translation_project language = translation_project.language form_class = unit_form_factory(language, len(unit.source.strings)) form = form_class(instance=unit) store = unit.store directory = store.parent profile = get_profile(request.user) alt_src_langs = get_alt_src_langs(request, profile, translation_project) project = translation_project.project template_vars = {'unit': unit, 'form': form, 'store': store, 'profile': profile, 'user': request.user, 'language': language, 'source_language': translation_project.project.source_language, 'cantranslate': check_profile_permission(profile, "translate", directory), 'cansuggest': check_profile_permission(profile, "suggest", directory), 'canreview': check_profile_permission(profile, "review", directory), 'altsrcs': find_altsrcs(unit, alt_src_langs, store=store, project=project), 'suggestions': get_sugg_list(unit)} t = loader.get_template('unit/edit.html') c = RequestContext(request, template_vars) json = {'success': True, 'editor': t.render(c)} current_page = 'page' in request.GET and request.GET['page'] or 1 # TODO: Adapt units_qs once we allow filtering units_qs = unit.store.units unit_rows = profile.get_unit_rows() preceding = units_qs.filter(index__lt=unit.index).count() page = preceding / unit_rows + 1 if page != current_page: pager = paginate(request, units_qs, items=unit_rows, page=page) json["pager"] = _build_pager_dict(pager) response = simplejson.dumps(json) return HttpResponse(response, mimetype="application/json")
9f3ce7792a374c47521821bbf169d3f084c085c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11388/9f3ce7792a374c47521821bbf169d3f084c085c7/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 4619, 67, 4873, 12, 2293, 16, 293, 1632, 298, 67, 803, 16, 4555, 4672, 3536, 16803, 279, 1707, 589, 385, 95, 1631, 352, 298, 67, 803, 97, 471, 2836, 612, 385, 95, 1911, 5779...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4619, 67, 4873, 12, 2293, 16, 293, 1632, 298, 67, 803, 16, 4555, 4672, 3536, 16803, 279, 1707, 589, 385, 95, 1631, 352, 298, 67, 803, 97, 471, 2836, 612, 385, 95, 1911, 5779...
def fl_get_object_gravity(ob, nw, se): """ fl_get_object_gravity(ob, nw, se) """ _fl_get_object_gravity(ob, nw, se)
def fl_get_object_gravity(pObject, nw, se): """ fl_get_object_gravity(pObject, nw, se) """ _fl_get_object_gravity(pObject, nw, se)
def fl_get_object_gravity(ob, nw, se): """ fl_get_object_gravity(ob, nw, se) """ _fl_get_object_gravity(ob, nw, se)
9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 588, 67, 1612, 67, 2752, 16438, 12, 84, 921, 16, 14376, 16, 695, 4672, 3536, 1183, 67, 588, 67, 1612, 67, 2752, 16438, 12, 84, 921, 16, 14376, 16, 695, 13, 3536, 225, 389, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 588, 67, 1612, 67, 2752, 16438, 12, 84, 921, 16, 14376, 16, 695, 4672, 3536, 1183, 67, 588, 67, 1612, 67, 2752, 16438, 12, 84, 921, 16, 14376, 16, 695, 13, 3536, 225, 389, ...
""" assigns values given by a list to our attributes """
""" Assigns values given by a list to our attributes. """
def setValues(self, vallist): """ assigns values given by a list to our attributes """ attributes = ["quality", "siglevel", "nlevel", "updated"] assert len(vallist) == 4 for i in range(len(vallist)): setattr(self, attributes[i], vallist[i])
05b40a3d0b9e46299ea3a7ddfd32be4a1e2ba258 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3159/05b40a3d0b9e46299ea3a7ddfd32be4a1e2ba258/iwlibs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 27466, 12, 2890, 16, 331, 454, 376, 4672, 3536, 12093, 87, 924, 864, 635, 279, 666, 358, 3134, 1677, 18, 3536, 1677, 273, 8247, 16495, 3113, 315, 7340, 2815, 3113, 315, 82, 2815, 3113, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 27466, 12, 2890, 16, 331, 454, 376, 4672, 3536, 12093, 87, 924, 864, 635, 279, 666, 358, 3134, 1677, 18, 3536, 1677, 273, 8247, 16495, 3113, 315, 7340, 2815, 3113, 315, 82, 2815, 3113, ...
err_fields.append(fields[i])
err_fields.append((fields[i], expected_out[i], real_out[i]))
def do_test(inp, expected_out, testno, binary): fninp = make_tempname("cpuidin") fnoutp = make_tempname("cpuidout") f = open(fninp, "wt") f.writelines(map(lambda s: s + "\n", inp)) f.close() cmd = "%s --load=%s --outfile=%s %s" % (binary, fninp, fnoutp, " ".join(map(lambda s: "--" + s, fields))) os.system(cmd) os.unlink(fninp) real_out = [] try: f = open(fnoutp, "rt") real_out = map(lambda s: s.strip(), f.readlines()) f.close() os.unlink(fnoutp) except IOError: return "Exception" if len(real_out) != len(expected_out) or len(real_out) != len(fields): return "Unexpected number of records returned" err_fields = [] for i in range(len(real_out)): if real_out[i] != expected_out[i]: err_fields.append(fields[i]) if not err_fields: return "OK" else: return "Mismatch in fields %s" % str(err_fields)
a1395632fa632215795f8800dfdb457ae864a4ae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7432/a1395632fa632215795f8800dfdb457ae864a4ae/run_tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 3813, 12, 31647, 16, 2665, 67, 659, 16, 1842, 2135, 16, 3112, 4672, 2295, 31647, 273, 1221, 67, 5814, 529, 2932, 4057, 1911, 267, 7923, 2295, 659, 84, 273, 1221, 67, 5814, 529...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 3813, 12, 31647, 16, 2665, 67, 659, 16, 1842, 2135, 16, 3112, 4672, 2295, 31647, 273, 1221, 67, 5814, 529, 2932, 4057, 1911, 267, 7923, 2295, 659, 84, 273, 1221, 67, 5814, 529...
def edit_categories(request, savetext, category_edit, catlist):
def edit_categories(request, savetext, action, catlist):
def edit_categories(request, savetext, category_edit, catlist): # Original code copied from PageEditor # Filter out anything that is not a category newcategories = wikiutil.filterCategoryPages(request, catlist) # If no categories to set or add, bail out now if not newcategories and not category_edit == 'del': return savetext # strip trailing whitespace savetext = savetext.rstrip() confirmed = [] # Add category separator if last non-empty line contains # non-categories. lines = filter(None, savetext.splitlines()) if lines: #TODO: this code is broken, will not work for extended links #categories, e.g ["category hebrew"] categories = lines[-1].split() if categories: confirmed = wikiutil.filterCategoryPages(request, categories) if len(confirmed) < len(categories): # This was not a categories line, if deleting, our job is done if category_edit == 'del': return savetext + u'\n' # otherwise add separator savetext += u'\n----\n' elif category_edit == 'set': # Delete existing when setting categories savetext = '\n'.join(savetext.split('\n')[:-1]) + u'\n' elif category_edit == 'del': # Delete existing and separator when deleting categories savetext = '\n'.join(savetext.split('\n')[:-2]) # Add is default if category_edit == 'set': # Delete existing categories confirmed = [] elif category_edit == 'del': # Just in case, do not add anything newcategories = [] if not lines: # add separator savetext += u'\n----\n' # Add categories for category in newcategories: if category in confirmed: continue if savetext and savetext[-1] != u'\n': savetext += ' ' savetext += category savetext += u'\n' # Should end with newline! return savetext
4e2010aaa060818029db2ad27412ff25742250ad /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/4e2010aaa060818029db2ad27412ff25742250ad/editing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3874, 67, 8995, 12, 2293, 16, 4087, 27830, 16, 3150, 67, 4619, 16, 6573, 1098, 4672, 468, 19225, 981, 9268, 628, 3460, 6946, 225, 468, 4008, 596, 6967, 716, 353, 486, 279, 3150, 394, 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, 3874, 67, 8995, 12, 2293, 16, 4087, 27830, 16, 3150, 67, 4619, 16, 6573, 1098, 4672, 468, 19225, 981, 9268, 628, 3460, 6946, 225, 468, 4008, 596, 6967, 716, 353, 486, 279, 3150, 394, 8...
secret, format = id.rsplit(':', 1) user_subscriptions = self.context.subscriptions[secret] for_format = [s for s in user_subscriptions if s.metadata['format'] == format] for_format = for_format[0] user_subscriptions.remove(for_format)
key, format = id.rsplit('-', 1) subs = self.context.subscriptions.query(key=key, format=format) for subscription in subs: self.context.subscriptions.remove_subscription(subscription)
def remove(self, (id, item)): secret, format = id.rsplit(':', 1) user_subscriptions = self.context.subscriptions[secret] for_format = [s for s in user_subscriptions if s.metadata['format'] == format] #assert len(for_format) == 1 for_format = for_format[0] user_subscriptions.remove(for_format)
612955c63d795c26eaba7c24cea8d986b4c83abd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9843/612955c63d795c26eaba7c24cea8d986b4c83abd/channel.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1206, 12, 2890, 16, 261, 350, 16, 761, 3719, 30, 4001, 16, 740, 273, 612, 18, 86, 4939, 2668, 30, 2187, 404, 13, 729, 67, 19964, 273, 365, 18, 2472, 18, 19964, 63, 5875, 65, 364, 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, 1206, 12, 2890, 16, 261, 350, 16, 761, 3719, 30, 4001, 16, 740, 273, 612, 18, 86, 4939, 2668, 30, 2187, 404, 13, 729, 67, 19964, 273, 365, 18, 2472, 18, 19964, 63, 5875, 65, 364, 6...
sage: P, = E.gens()
sage: P = E([0,-1])
sage: def naive_height(P):
cd6219a64ace5987dd70fb915ac37e633f404e15 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cd6219a64ace5987dd70fb915ac37e633f404e15/ell_point.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 272, 410, 30, 1652, 28224, 67, 4210, 12, 52, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 272, 410, 30, 1652, 28224, 67, 4210, 12, 52, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
os.system(mplex_cmd % (chapter.props.mpg_name, chapter.props.video_name, chapter.props.sound_name))
os.system(mplex_cmd % (chapter.mpg_name, chapter.video_name, chapter.sound_name))
def __check_mpg(self, chapter): mplex_cmd = "mplex -v 0 -f 4 -o '%s' '%s' '%s'" if os.access(chapter.props.mpg_name, os.F_OK): print "mpeg %s already exists" % chapter.props.mpg_name return
197c33d735d49bab858cd4dda3c7f019e3dd0db3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2675/197c33d735d49bab858cd4dda3c7f019e3dd0db3/VideoCD.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1893, 67, 1291, 75, 12, 2890, 16, 23580, 4672, 312, 7179, 67, 4172, 273, 315, 1291, 4149, 300, 90, 374, 300, 74, 1059, 300, 83, 1995, 87, 11, 1995, 87, 11, 1995, 87, 4970, 309,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1893, 67, 1291, 75, 12, 2890, 16, 23580, 4672, 312, 7179, 67, 4172, 273, 315, 1291, 4149, 300, 90, 374, 300, 74, 1059, 300, 83, 1995, 87, 11, 1995, 87, 11, 1995, 87, 4970, 309,...
swig = self.find_swig() swig_cmd = [swig, "-python", "-ISWIG"] if self.swig_cpp: swig_cmd.append("-c++") for source in swig_sources: target = swig_targets[source] self.announce("swigging %s to %s" % (source, target)) self.spawn(swig_cmd + ["-o", target, source]) return new_sources build_ext.build_ext.swig_sources = swig_sources
build_ext.build_ext.swig_sources = swig_sources
def swig_sources (self, sources): """Walk the list of source files in 'sources', looking for SWIG interface (.i) files. Run SWIG on all that are found, and return a modified 'sources' list with SWIG source files replaced by the generated C (or C++) files. """ new_sources = [] swig_sources = [] swig_targets = {} # XXX this drops generated C/C++ files into the source tree, which # is fine for developers who want to distribute the generated # source -- but there should be an option to put SWIG output in # the temp dir. if self.swig_cpp: target_ext = '.cpp' else: target_ext = '.c' for source in sources: (base, ext) = os.path.splitext(source) if ext == ".i": # SWIG interface file new_sources.append(base + target_ext) swig_sources.append(source) swig_targets[source] = new_sources[-1] else: new_sources.append(source) if not swig_sources: return new_sources swig = self.find_swig() swig_cmd = [swig, "-python", "-ISWIG"] if self.swig_cpp: swig_cmd.append("-c++") for source in swig_sources: target = swig_targets[source] self.announce("swigging %s to %s" % (source, target)) self.spawn(swig_cmd + ["-o", target, source]) return new_sources
a3445be2469ebc765311af9285429177182b14f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8055/a3445be2469ebc765311af9285429177182b14f6/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1352, 360, 67, 10141, 261, 2890, 16, 5550, 4672, 225, 3536, 9463, 326, 666, 434, 1084, 1390, 316, 296, 10141, 2187, 7849, 364, 16392, 3047, 1560, 261, 18, 77, 13, 1390, 18, 225, 1939, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1352, 360, 67, 10141, 261, 2890, 16, 5550, 4672, 225, 3536, 9463, 326, 666, 434, 1084, 1390, 316, 296, 10141, 2187, 7849, 364, 16392, 3047, 1560, 261, 18, 77, 13, 1390, 18, 225, 1939, ...
_phrase_noop("fourtieth"),
_phrase_noop("fortieth"),
def _phrase_noop(str): return str
4691e1450edc2750b4ba8a6c340eeff4c7a53964 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3136/4691e1450edc2750b4ba8a6c340eeff4c7a53964/EN.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9429, 67, 2135, 556, 12, 701, 4672, 327, 609, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 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, 389, 9429, 67, 2135, 556, 12, 701, 4672, 327, 609, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
if not is_valid_ip_address(localip): raise Exception("Local IP address is invalid.")
def recvmess(localip, localport, function): """ <Purpose> Registers a function as an event handler for incoming messages <Arguments> localip: The local IP or hostname to register the handler on localport: The port to listen on function: The function that messages should be delivered to. It should expect the following arguments: (remoteIP, remoteport, message, commhandle) <Exceptions> None. <Side Effects> Registers an event handler. <Returns> The commhandle for this event handler. """ if not localip or localip == '0.0.0.0': raise Exception("Must specify a local IP address") if not is_valid_ip_address(localip): raise Exception("Local IP address is invalid.") if not is_valid_network_port(localport): raise Exception("Local port number must be an integer, between 1 and 65535.") # Check that the user specified function exists and takes 4 arguments try: # Get the argument count arg_count = function.func_code.co_argcount # We need the function to take 4 parameters assert(arg_count == 4) except: # If this is not a function, an exception will be raised. raise Exception("Specified function must be valid, and take 4 parameters. See recvmess.") restrictions.assertisallowed('recvmess',localip,localport) nanny.tattle_check('messport',localport) # Armon: Check if the specified local ip is allowed if not ip_is_allowed(localip): raise Exception, "IP '"+localip+"' is not allowed." # check if I'm already listening on this port / ip # NOTE: I check as though there might be a socket open that is sending a # message. This is nonsense since sendmess doesn't result in a socket # persisting. This is done so that if sockets for sendmess are cached # later (as seems likely) the resulting code will not break. oldhandle = find_tipo_commhandle('UDP', localip, localport, False) if oldhandle: # if it was already there, update the function and return comminfo[oldhandle]['function'] = function return oldhandle handle = idhelper.getuniqueid() # we'll need to add it, so add a socket... nanny.tattle_add_item('insockets',handle) # get the socket try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.bind((localip,localport)) nonportable.preparesocket(s) except: try: s.close() except: pass nanny.tattle_remove_item('insockets',handle) raise # set up our table entry comminfo[handle] = {'type':'UDP','localip':localip, 'localport':localport,'function':function,'socket':s, 'outgoing':False} # start the selector if it's not running already check_selector() return handle
86d29537aa93ae6d463ba0845d7be285b0ad21e5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/86d29537aa93ae6d463ba0845d7be285b0ad21e5/emulcomm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1950, 3489, 403, 12, 3729, 625, 16, 1191, 655, 16, 445, 4672, 3536, 411, 10262, 4150, 34, 2526, 6045, 279, 445, 487, 392, 871, 1838, 364, 6935, 2743, 225, 411, 4628, 34, 1191, 625, 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, 1950, 3489, 403, 12, 3729, 625, 16, 1191, 655, 16, 445, 4672, 3536, 411, 10262, 4150, 34, 2526, 6045, 279, 445, 487, 392, 871, 1838, 364, 6935, 2743, 225, 411, 4628, 34, 1191, 625, 30,...
K = self.base_ring()._magma_init_(magma)
K = magma(self.base_ring())
def _magma_init_(self, magma): r""" EXAMPLES: We first coerce a square matrix. :: sage: magma(MatrixSpace(QQ,3)) # optional - magma Full Matrix Algebra of degree 3 over Rational Field :: sage: magma(MatrixSpace(Integers(8),2,3)) # optional - magma Full RMatrixSpace of 2 by 3 matrices over IntegerRing(8) """ K = self.base_ring()._magma_init_(magma) if self.__nrows == self.__ncols: s = 'MatrixAlgebra(%s,%s)'%(K, self.__nrows) else: s = 'RMatrixSpace(%s,%s,%s)'%(K, self.__nrows, self.__ncols) return s
1e2f368ad3ae5357b67ddd25abdbfeacbd204591 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1e2f368ad3ae5357b67ddd25abdbfeacbd204591/matrix_space.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4527, 2540, 67, 2738, 67, 12, 2890, 16, 4447, 2540, 4672, 436, 8395, 5675, 8900, 11386, 30, 1660, 1122, 12270, 279, 8576, 3148, 18, 225, 493, 225, 272, 410, 30, 4447, 2540, 12, 46...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4527, 2540, 67, 2738, 67, 12, 2890, 16, 4447, 2540, 4672, 436, 8395, 5675, 8900, 11386, 30, 1660, 1122, 12270, 279, 8576, 3148, 18, 225, 493, 225, 272, 410, 30, 4447, 2540, 12, 46...
d[u] = [v]
d[u] = {v:a}
def rauzy_graph(self, n): r""" Returns the Rauzy graph of the factors of length n of self.
2fac876941614005ebb088ac2802236608f8de31 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/2fac876941614005ebb088ac2802236608f8de31/word.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 767, 89, 21832, 67, 4660, 12, 2890, 16, 290, 4672, 436, 8395, 2860, 326, 534, 8377, 21832, 2667, 434, 326, 14490, 434, 769, 290, 434, 365, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 767, 89, 21832, 67, 4660, 12, 2890, 16, 290, 4672, 436, 8395, 2860, 326, 534, 8377, 21832, 2667, 434, 326, 14490, 434, 769, 290, 434, 365, 18, 2, -100, -100, -100, -100, -100, -100, -1...
pilfilter = 0
pilfilter = PIL.Image.NEAREST
def scale(self,data,w,h): """ scale image (with material from ImageTag_Hotfix)""" #make sure we have valid int's keys = {'height':int(h), 'width':int(w)}
cbbe1b99524b56d21cfaf3809b9eb1252d3ea8a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/cbbe1b99524b56d21cfaf3809b9eb1252d3ea8a2/Field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3159, 12, 2890, 16, 892, 16, 91, 16, 76, 4672, 3536, 3159, 1316, 261, 1918, 9390, 628, 3421, 1805, 67, 25270, 904, 15574, 468, 6540, 3071, 732, 1240, 923, 509, 1807, 1311, 273, 13666, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3159, 12, 2890, 16, 892, 16, 91, 16, 76, 4672, 3536, 3159, 1316, 261, 1918, 9390, 628, 3421, 1805, 67, 25270, 904, 15574, 468, 6540, 3071, 732, 1240, 923, 509, 1807, 1311, 273, 13666, ...
gst.debug('getting features for plugin %s' % plugin.get_name())
def output_plugin(plugin, indent=0): print "PLUGIN", plugin.get_name() version = plugin.get_version() elements = {} gst.debug('getting features for plugin %s' % plugin.get_name()) for feature in plugin.get_feature_list(): if isinstance(feature, gst.ElementFactory): elements[feature.get_name()] = feature gst.debug("got features") elementsoutput = [] keys = elements.keys() keys.sort() for name in keys: feature = elements[name] elementsoutput.append(output_element_factory(feature, indent + 2)) filename = plugin.get_filename() basename = filename if basename: basename = os.path.basename(basename) d = { 'name': xmlencode(plugin.get_name()), 'description': xmlencode(plugin.get_description()), 'filename': filename, 'basename': basename, 'version': version, 'license': xmlencode(plugin.get_license()), 'package': xmlencode(plugin.get_package()), 'origin': xmlencode(plugin.get_origin()), 'elements': "\n".join(elementsoutput), } block = PLUGIN_TEMPLATE % d offset = get_offset(indent) return offset + ("\n" + offset).join(block.split("\n"))
c14ef33a0707f6bb6ff1456696c14446178e182b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1022/c14ef33a0707f6bb6ff1456696c14446178e182b/gst-xmlinspect.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 876, 67, 4094, 12, 4094, 16, 3504, 33, 20, 4672, 1172, 315, 19415, 3113, 1909, 18, 588, 67, 529, 1435, 1177, 273, 1909, 18, 588, 67, 1589, 1435, 225, 2186, 273, 2618, 225, 364, 2572, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 876, 67, 4094, 12, 4094, 16, 3504, 33, 20, 4672, 1172, 315, 19415, 3113, 1909, 18, 588, 67, 529, 1435, 1177, 273, 1909, 18, 588, 67, 1589, 1435, 225, 2186, 273, 2618, 225, 364, 2572, ...
try: compile("1+*3", "filename", "exec") except SyntaxError, detail: if not detail.filename == "filename": raise TestFailed, "expected 'filename', got %r" % detail.filename
def comp_args((a, b)): return a,b self.assertEqual(comp_args((1, 2)), (1, 2))
exec 'def f(a, a): pass'
cfaee582698839a2f4c5a779f9a4b3f30c7efa67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cfaee582698839a2f4c5a779f9a4b3f30c7efa67/test_compile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1196, 296, 536, 284, 12, 69, 16, 279, 4672, 1342, 11, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1196, 296, 536, 284, 12, 69, 16, 279, 4672, 1342, 11, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
for dict in self.dicts:
for i, dict in enumerate(self.dicts):
def drawEventMap(self): dM = self.dictMagnitude dO = self.dictOrigin if dO == {}: err = "Error: No hypocenter data!" self._write_err(err) return #toolbar.pan() #XXX self.figEventMap.canvas.widgetlock.release(toolbar) self.axEventMap = self.fig.add_subplot(111) axEM = self.axEventMap axEM.set_aspect('equal', adjustable="datalim") self.fig.subplots_adjust(bottom=0.07, top=0.95, left=0.07, right=0.98) axEM.scatter([dO['Longitude']], [dO['Latitude']], 30, color='red', marker='o') errLon, errLat = utlLonLat(dO['Longitude'], dO['Latitude'], dO['Longitude Error'], dO['Latitude Error']) errLon -= dO['Longitude'] errLat -= dO['Latitude'] ypos = 0.97 xpos = 0.03 axEM.text(xpos, ypos, '%7.3f +/- %0.2fkm\n' % \ (dO['Longitude'], dO['Longitude Error']) + \ '%7.3f +/- %0.2fkm\n' % \ (dO['Latitude'], dO['Latitude Error']) + \ ' %.1fkm +/- %.1fkm' % \ (dO['Depth'], dO['Depth Error']), va='top', ha='left', family='monospace', transform=axEM.transAxes) if 'Standarderror' in dO: axEM.text(xpos, ypos, "\n\n\n\n Residual: %.3f s" % \ dO['Standarderror'], va='top', ha='left', color=PHASE_COLORS['P'], transform=axEM.transAxes, family='monospace') if 'Magnitude' in dM and 'Uncertainty' in dM: self.netMagLabel = '\n\n\n\n\n %.2f (Var: %.2f)' % \ (dM['Magnitude'], dM['Uncertainty']) self.netMagText = axEM.text(xpos, ypos, self.netMagLabel, va='top', ha='left', transform=axEM.transAxes, color=PHASE_COLORS['Mag'], family='monospace') errorell = Ellipse(xy = [dO['Longitude'], dO['Latitude']], width=errLon, height=errLat, angle=0, fill=False) axEM.add_artist(errorell) self.scatterMagIndices = [] self.scatterMagLon = [] self.scatterMagLat = [] for dict in self.dicts: # determine which stations are used in location if 'Pres' in dict or 'Sres' in dict: stationColor = 'black' else: stationColor = 'gray' # plot stations at respective coordinates with names axEM.scatter([dict['StaLon']], [dict['StaLat']], s=300, marker='v', color='', edgecolor=stationColor) axEM.text(dict['StaLon'], dict['StaLat'], ' ' + dict['Station'], color=stationColor, va='top', family='monospace') if 'Pres' in dict: presinfo = '\n\n %+0.3fs' % dict['Pres'] if 'PPol' in dict: presinfo += ' %s' % dict['PPol'] axEM.text(dict['StaLon'], dict['StaLat'], presinfo, va='top', family='monospace', color=PHASE_COLORS['P']) if 'Sres' in dict: sresinfo = '\n\n\n %+0.3fs' % dict['Sres'] if 'SPol' in dict: sresinfo += ' %s' % dict['SPol'] axEM.text(dict['StaLon'], dict['StaLat'], sresinfo, va='top', family='monospace', color=PHASE_COLORS['S']) if 'Mag' in dict: self.scatterMagIndices.append(i) self.scatterMagLon.append(dict['StaLon']) self.scatterMagLat.append(dict['StaLat']) axEM.text(dict['StaLon'], dict['StaLat'], ' ' + dict['Station'], va='top', family='monospace') axEM.text(dict['StaLon'], dict['StaLat'], '\n\n\n\n %0.2f (%s)' % \ (dict['Mag'], dict['MagChannel']), va='top', family='monospace', color=PHASE_COLORS['Mag']) if len(self.scatterMagLon) > 0 : self.scatterMag = axEM.scatter(self.scatterMagLon, self.scatterMagLat, s=150, marker='v', color='', edgecolor='black', picker=10) axEM.set_xlabel('Longitude') axEM.set_ylabel('Latitude') time = dO['Time'] timestr = time.strftime("%Y-%m-%d %H:%M:%S") timestr += ".%02d" % (time.microsecond / 1e4 + 0.5) axEM.set_title(timestr) #####XXX disabled because it plots the wrong info if the event was ##### fetched from seishub #####lines = open(PROGRAMS['3dloc']['files']['out']).readlines() #####infoEvent = lines[0].rstrip() #####infoPicks = '' #####for line in lines[1:]: ##### infoPicks += line #####axEM.text(0.02, 0.95, infoEvent, transform = axEM.transAxes, ##### fontsize = 12, verticalalignment = 'top', ##### family = 'monospace') #####axEM.text(0.02, 0.90, infoPicks, transform = axEM.transAxes, ##### fontsize = 10, verticalalignment = 'top', ##### family = 'monospace') # save id to disconnect when switching back to stream dislay self.eventMapPickEvent = self.canv.mpl_connect('pick_event', self.selectMagnitudes) try: self.scatterMag.set_facecolors(self.eventMapColors) except: pass
2c1327481790c538265f81ea04dd0d01b722fbfc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10346/2c1327481790c538265f81ea04dd0d01b722fbfc/obspyck.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 1133, 863, 12, 2890, 4672, 302, 49, 273, 365, 18, 1576, 11372, 10754, 302, 51, 273, 365, 18, 1576, 7571, 309, 302, 51, 422, 16648, 393, 273, 315, 668, 30, 2631, 16117, 504, 2328,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 1133, 863, 12, 2890, 4672, 302, 49, 273, 365, 18, 1576, 11372, 10754, 302, 51, 273, 365, 18, 1576, 7571, 309, 302, 51, 422, 16648, 393, 273, 315, 668, 30, 2631, 16117, 504, 2328,...
bitesized_keyword='easy')
bitesized_keyword='easy', bug_project_name_format='{project}')
def __init__(self): TracBugTracker.__init__(self, project_name='I2P', base_url='http://trac.i2p2.de/', bitesized_keyword='easy') # Unconfirmed, there were no such bugs at the time
492ed0e9fe59cd560a17e8afa9f302c46097de7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11976/492ed0e9fe59cd560a17e8afa9f302c46097de7b/trac_instances.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 2197, 71, 19865, 8135, 16186, 2738, 972, 12, 2890, 16, 1984, 67, 529, 2218, 45, 22, 52, 2187, 1026, 67, 718, 2218, 2505, 2207, 313, 1077, 18, 77, 22, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 2197, 71, 19865, 8135, 16186, 2738, 972, 12, 2890, 16, 1984, 67, 529, 2218, 45, 22, 52, 2187, 1026, 67, 718, 2218, 2505, 2207, 313, 1077, 18, 77, 22, ...
elif column in ['time', 'date','changetime', 'created', 'modified']:
elif column in ('time', 'date','changetime', 'created', 'modified'):
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)
2a745aa87936e1e869b815421da626d392098904 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/2a745aa87936e1e869b815421da626d392098904/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...
page=wikipedia.Page(wikipedia.mylang,pagetitle)
page=wikipedia.Page(wikipedia.getSite(),pagetitle)
def asktoadd(pl): ctoshow = 500 print print("==%s==")%pl.title() while 1: answer = raw_input("y(es)/n(o)/i(gnore)/(o)ther options? ") if answer=='y': include(pl) break if answer=='c': include(pl,realinclude=False) break if answer=='z': if pl.exists(): if not pl.isRedirectPage(): linkterm = wikipedia.input(u"In what manner should it be alphabetized?") include(pl,linkterm=linkterm) break include(pl) break elif answer=='n': exclude(pl) break elif answer=='i': exclude(pl,real_exclude=False) break elif answer=='o': print("t: Give the beginning of the text of the page") print("z: Add under another title (as [[Category|Title]])") print("x: Add the page, but do not check links to and from it") print("c: Do not add the page, but do check links") print("a: Add another page") print("l: Give a list of the pages to check") elif answer=='a': pagetitle = raw_input("Specify page to add:") page=wikipedia.Page(wikipedia.mylang,pagetitle) if not page in checked.keys(): include(page) elif answer=='x': if pl.exists(): if pl.isRedirectPage(): print("Redirect page. Will be included normally.") pl2=wikipedia.Page(mysite,pl.getRedirectTarget()) checkprepare(pl2) else: include(pl,checklinks=False) else: print("Page does not exist; not added.") exclude(pl,real_exclude=False) break elif answer=='l': print("Number of pages still to check: %s")%len(tocheck) print("Pages to be checked:") print tocheck print("==%s==")%pl.title() elif answer=='t': print("==%s==")%pl.title() try: wikipedia.output(pl.get(get_redirect=True)[0:ctoshow]) except wikipedia.NoPage: print "Page does not exist." ctoshow += 500 else: print("Not understood.")
9b56e21b52260247fd79970eba6055a2da3ce295 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/9b56e21b52260247fd79970eba6055a2da3ce295/makecat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6827, 869, 1289, 12, 412, 4672, 5691, 538, 13606, 273, 6604, 1172, 1172, 2932, 631, 9, 87, 631, 7923, 9, 412, 18, 2649, 1435, 1323, 404, 30, 5803, 273, 1831, 67, 2630, 2932, 93, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6827, 869, 1289, 12, 412, 4672, 5691, 538, 13606, 273, 6604, 1172, 1172, 2932, 631, 9, 87, 631, 7923, 9, 412, 18, 2649, 1435, 1323, 404, 30, 5803, 273, 1831, 67, 2630, 2932, 93, 12, ...
return self._attrsNS[(namespaceURI, localName)]
return self._attrsNS.get((namespaceURI, localName))
def getAttributeNodeNS(self, namespaceURI, localName): return self._attrsNS[(namespaceURI, localName)]
9e1fe1ec675386a4be12471a8b785a385d326316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9e1fe1ec675386a4be12471a8b785a385d326316/minidom.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4061, 907, 3156, 12, 2890, 16, 19421, 16, 11927, 4672, 327, 365, 6315, 7039, 3156, 63, 12, 4937, 3098, 16, 11927, 25887, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4061, 907, 3156, 12, 2890, 16, 19421, 16, 11927, 4672, 327, 365, 6315, 7039, 3156, 63, 12, 4937, 3098, 16, 11927, 25887, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
self.write(cr, uid, ids, {'state': 'running'}) return True
if not has_start and not has_signal_without_from: raise osv.except_osv(_("Error"), _("The campaign hasn't any starting activity nor any activity with a signal and no previous activity.")) return self.write(cr, uid, ids, {'state': 'running'})
def state_running_set(self, cr, uid, ids, *args): # TODO check that all subcampaigns are running campaign = self.browse(cr, uid, ids[0]) if not campaign.activity_ids : raise osv.except_osv("Error", "There is no activitity in the campaign") activity_ids = [ act_id.id for act_id in campaign.activity_ids] if not activity_ids: raise osv.except_osv(_("Error"), _("The campaign cannot be started : there are no activities in it")) act_obj = self.pool.get('marketing.campaign.activity') act_ids = act_obj.search(cr, uid, [('id', 'in', activity_ids), ('type', '=', 'email')]) for activity in act_obj.browse(cr, uid, act_ids): if not activity.email_template_id.enforce_from_account : raise osv.except_osv(_("Error"), _("The campaign cannot be started: an email account is missing in the email activity '%s'")%activity.name) if activity.email_template_id.enforce_from_account.state != 'approved' : raise osv.except_osv(_("Error"), _("The campaign cannot be started: the email account is not approved in the email activity '%s'")%activity.name) self.write(cr, uid, ids, {'state': 'running'}) return True
9f6839faa1900a1dc012884b012b4d0d255c1acc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f6839faa1900a1dc012884b012b4d0d255c1acc/marketing_campaign.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 919, 67, 8704, 67, 542, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 380, 1968, 4672, 468, 2660, 866, 716, 777, 720, 14608, 87, 854, 3549, 8965, 273, 365, 18, 25731, 12, 3353, 16, 455...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 919, 67, 8704, 67, 542, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 380, 1968, 4672, 468, 2660, 866, 716, 777, 720, 14608, 87, 854, 3549, 8965, 273, 365, 18, 25731, 12, 3353, 16, 455...
for key, val in dict1:
for key, val in dict1.items():
def update(self, dict1): #bruce 050117 # note: unlike repeated setitem, this only opens and closes once. if _shelf: for key, val in dict1: #e (on one KeyError, should we store the rest?) #e (better, should we check all keys before storing anything?) self[key] = val #e could optimize, but at least this leaves it open else: try: _reopen() self.update(dict1) finally: _close() return
ec8a859d3ed011440577812b946ae82bd833326a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/ec8a859d3ed011440577812b946ae82bd833326a/preferences.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 16, 2065, 21, 4672, 468, 2848, 3965, 374, 9172, 4033, 468, 4721, 30, 640, 5625, 12533, 444, 1726, 16, 333, 1338, 10400, 471, 13445, 3647, 18, 309, 389, 674, 19079, 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, 1089, 12, 2890, 16, 2065, 21, 4672, 468, 2848, 3965, 374, 9172, 4033, 468, 4721, 30, 640, 5625, 12533, 444, 1726, 16, 333, 1338, 10400, 471, 13445, 3647, 18, 309, 389, 674, 19079, 30, ...
self.goodrevs = self.opener(self.good_path).read().splitlines() self.goodrevs = [hg.bin(x) for x in self.goodrevs]
self.goodnodes = self.opener(self.good_path).read().splitlines() self.goodnodes = [hg.bin(x) for x in self.goodnodes]
def __init__(self, ui, repo): self.repo = repo self.path = repo.join("bisect") self.opener = util.opener(self.path) self.ui = ui self.goodrevs = [] self.badrev = None self.good_path = "good" self.bad_path = "bad" self.is_reset = False
6919e042e934d02082016dfb73d7ed6ccac1b5b5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/6919e042e934d02082016dfb73d7ed6ccac1b5b5/hbisect.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5915, 16, 3538, 4672, 365, 18, 7422, 273, 3538, 365, 18, 803, 273, 3538, 18, 5701, 2932, 70, 291, 386, 7923, 365, 18, 25098, 273, 1709, 18, 25098, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5915, 16, 3538, 4672, 365, 18, 7422, 273, 3538, 365, 18, 803, 273, 3538, 18, 5701, 2932, 70, 291, 386, 7923, 365, 18, 25098, 273, 1709, 18, 25098, 12, ...
self.issue(SELECTION) def Update(self): pass
def position(self): if self.var_position.get()=='Аbsolute' and self.var_basepoint.get()=='USER': self.var_basepoint.set('C') self.Update()
def init_from_doc(self, *arg): self.Update() self.issue(SELECTION)
87283f38a0f6a4d331e6c9a23a665163b188fb52 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3123/87283f38a0f6a4d331e6c9a23a665163b188fb52/move_plugin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 67, 2080, 67, 2434, 12, 2890, 16, 380, 3175, 4672, 365, 18, 1891, 1435, 365, 18, 13882, 12, 1090, 15445, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1208, 67, 2080, 67, 2434, 12, 2890, 16, 380, 3175, 4672, 365, 18, 1891, 1435, 365, 18, 13882, 12, 1090, 15445, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
8
4
def rank(self): """ Return the rank of the underlying lattice of self.
83d03c9b2d797a52ad4e3f2fe47728d1f93f64bc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/83d03c9b2d797a52ad4e3f2fe47728d1f93f64bc/abvar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6171, 12, 2890, 4672, 3536, 2000, 326, 6171, 434, 326, 6808, 16690, 434, 365, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 6171, 12, 2890, 4672, 3536, 2000, 326, 6171, 434, 326, 6808, 16690, 434, 365, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if isinstance(v, type):
if isinstance(v, (type, types.ClassType)):
def modify_for_nested_pickle(cls, name_prefix, module): r""" Modify the subclasses of the given class to be picklable, by giving them a mangled name and putting the mangled name in the module namespace. INPUTS: - ``cls`` - The class to modify. - ``name_prefix`` - The prefix to prepend to the class name. - ``module`` - The module object to modify with the mangled name. EXAMPLES:: sage: from sage.misc.misc import * sage: class A(object): ... class B(object): ... pass ... sage: module = sys.modules['__main__'] sage: A.B.__name__ 'B' sage: getattr(module, 'A.B', 'Not found') 'Not found' sage: modify_for_nested_pickle(A, 'A', sys.modules['__main__']) sage: A.B.__name__ 'A.B' sage: getattr(module, 'A.B', 'Not found') <class '__main__.A.B'> """ for (name, v) in cls.__dict__.iteritems(): if isinstance(v, type): if v.__name__ == name and v.__module__ == module.__name__ and getattr(module, name, None) is not v: # OK, probably this is a nested class. dotted_name = name_prefix + '.' + name v.__name__ = dotted_name setattr(module, dotted_name, v) modify_for_nested_pickle(v, dotted_name, module)
ac86f61b865afdf705efb925a67ef2bd7532736b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/ac86f61b865afdf705efb925a67ef2bd7532736b/misc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5612, 67, 1884, 67, 12985, 67, 20847, 12, 6429, 16, 508, 67, 3239, 16, 1605, 4672, 436, 8395, 9518, 326, 15320, 434, 326, 864, 667, 358, 506, 6002, 80, 429, 16, 635, 21057, 2182, 279, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5612, 67, 1884, 67, 12985, 67, 20847, 12, 6429, 16, 508, 67, 3239, 16, 1605, 4672, 436, 8395, 9518, 326, 15320, 434, 326, 864, 667, 358, 506, 6002, 80, 429, 16, 635, 21057, 2182, 279, ...