rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
jids = [u.jid for u in subscribers[lang]]
jids = [u.jid for u in subscribers[lang] if u.jid]
def page_change(type, request, page, subscribers, **kwargs): _ = request.getText if subscribers: # send notifications to all subscribers results = [_('Status of sending notifications:')] for lang in subscribers: jids = [u.jid for u in subscribers[lang]] names = [u.name for u in subscribers[lang]] msg = page_change_message(type, request, page, lang, **kwargs) jabberok, status = send_notification(request, jids, msg) recipients = ", ".join(names) results.append(_('[%(lang)s] %(recipients)s: %(status)s') % { 'lang': lang, 'recipients': recipients, 'status': status}) # Return notifications sent results. Ignore trivial - we don't have # to lie. If notification was sent, just tell about it. return '<p>\n%s\n</p> ' % '<br>'.join(results) # No notifications sent, no message. return ''
22260e87cf52e72443b0d385b6aa0a576cc76461 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/888/22260e87cf52e72443b0d385b6aa0a576cc76461/jabbernotify.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1363, 67, 3427, 12, 723, 16, 590, 16, 1363, 16, 16768, 16, 2826, 4333, 4672, 225, 389, 273, 590, 18, 588, 1528, 225, 309, 16768, 30, 468, 1366, 9208, 358, 777, 16768, 1686, 273, 306, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1363, 67, 3427, 12, 723, 16, 590, 16, 1363, 16, 16768, 16, 2826, 4333, 4672, 225, 389, 273, 590, 18, 588, 1528, 225, 309, 16768, 30, 468, 1366, 9208, 358, 777, 16768, 1686, 273, 306, ...
dispIncr.view("DISP INCR")
def step(self, t, dt): """ Advance to next time step. """ dispIncr = self.fields.get("dispIncr(t->t+dt)")
ddcd113872eabed45c98191d7d8d296e8c2e22a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8645/ddcd113872eabed45c98191d7d8d296e8c2e22a8/Implicit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2235, 12, 2890, 16, 268, 16, 3681, 4672, 3536, 4052, 5882, 358, 1024, 813, 2235, 18, 3536, 16232, 382, 3353, 273, 365, 18, 2821, 18, 588, 2932, 25453, 382, 3353, 12, 88, 2122, 88, 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, 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, 2235, 12, 2890, 16, 268, 16, 3681, 4672, 3536, 4052, 5882, 358, 1024, 813, 2235, 18, 3536, 16232, 382, 3353, 273, 365, 18, 2821, 18, 588, 2932, 25453, 382, 3353, 12, 88, 2122, 88, 15, ...
return errorMsg(msg, req, c, ln)
return errorMsg(str(msg), req, ln)
def _getfile_py(req,c=CFG_SITE_NAME,ln=CFG_SITE_LANG,recid="",docid="",version="",name="",format=""): _ = gettext_set_language(ln)
382a1f25f9b0d159df208291e44a573986f659ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/382a1f25f9b0d159df208291e44a573986f659ca/websubmit_webinterface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 768, 67, 2074, 12, 3658, 16, 71, 33, 19727, 67, 20609, 67, 1985, 16, 2370, 33, 19727, 67, 20609, 67, 10571, 16, 3927, 350, 1546, 3113, 2434, 350, 1546, 3113, 1589, 1546, 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, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 768, 67, 2074, 12, 3658, 16, 71, 33, 19727, 67, 20609, 67, 1985, 16, 2370, 33, 19727, 67, 20609, 67, 10571, 16, 3927, 350, 1546, 3113, 2434, 350, 1546, 3113, 1589, 1546, 3113...
if (defaultValue != self.value) or (self.saveDefaults == True): configfile.setKey(self.configPath, self.datatoFile(self.controlType,self.value))
if self.value != defaultValue or self.saveDefaults: configfile.setKey(self.configPath, self.datatoFile(self.controlType, self.value)) else: oldValue = configfile.getKey(self.configPath) if oldValue is not None and oldValue != defaultValue: configfile.setKey(self.configPath, self.datatoFile(self.controlType, self.value), True)
def save(self): if self.controlType == configSatlist: defaultValue = self.getIndexbyEntry(self.defaultValue) else: defaultValue = self.defaultValue if (defaultValue != self.value) or (self.saveDefaults == True): configfile.setKey(self.configPath, self.datatoFile(self.controlType,self.value))
6c7144777d4e9001792e2843e9891f861b45dab9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/6c7144777d4e9001792e2843e9891f861b45dab9/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 12, 2890, 4672, 309, 365, 18, 7098, 559, 422, 642, 15163, 1098, 30, 4593, 273, 365, 18, 588, 1016, 1637, 1622, 12, 2890, 18, 27652, 13, 469, 30, 4593, 273, 365, 18, 27652, 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, 1923, 12, 2890, 4672, 309, 365, 18, 7098, 559, 422, 642, 15163, 1098, 30, 4593, 273, 365, 18, 588, 1016, 1637, 1622, 12, 2890, 18, 27652, 13, 469, 30, 4593, 273, 365, 18, 27652, 309, ...
def __init__(self, poly, prec, halt, print_mode, names): UnramifiedExtensionGeneric.__init__(self, poly, prec, print_mode, names, UnramifiedExtensionAbsoluteElement)
def __init__(self, prepoly, poly, prec, halt, print_mode, shift_seed, names): ntl_poly = ntl_ZZ_pX([a.lift() for a in poly.list()], poly.base_ring().prime()**prec) if prec <= 30: self.prime_pow = PowComputer_ext_maker(poly.base_ring().prime(), prec, prec, prec, True, ntl_poly, "small", "u") else: self.prime_pow = PowComputer_ext_maker(poly.base_ring().prime(), 30, prec, prec, True, ntl_poly, "big", "u") self._shift_seed = None self._pre_poly = prepoly UnramifiedExtensionGeneric.__init__(self, poly, prec, print_mode, names, pAdicZZpXCAElement)
def __init__(self, poly, prec, halt, print_mode, names): UnramifiedExtensionGeneric.__init__(self, poly, prec, print_mode, names, UnramifiedExtensionAbsoluteElement)
b9ffa8b1f92ad68de3210909edfe6b8fd5f5e7af /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/b9ffa8b1f92ad68de3210909edfe6b8fd5f5e7af/padic_extension_leaves.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 7573, 16, 13382, 16, 18389, 16, 1172, 67, 3188, 16, 1257, 4672, 1351, 1940, 939, 3625, 7014, 16186, 2738, 972, 12, 2890, 16, 7573, 16, 13382, 16, 1172, 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, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 7573, 16, 13382, 16, 18389, 16, 1172, 67, 3188, 16, 1257, 4672, 1351, 1940, 939, 3625, 7014, 16186, 2738, 972, 12, 2890, 16, 7573, 16, 13382, 16, 1172, 6...
if not hasattr(self,'_has_sorted_indices'):
if not hasattr(self,'__has_sorted_indices'):
def __get_sorted(self): """Determine whether the matrix has sorted indices
70b31b27df718b5d2558dbe1cdb499715748ff4f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12971/70b31b27df718b5d2558dbe1cdb499715748ff4f/compressed.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 67, 10350, 12, 2890, 4672, 3536, 8519, 2856, 326, 3148, 711, 3115, 4295, 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, 1001, 588, 67, 10350, 12, 2890, 4672, 3536, 8519, 2856, 326, 3148, 711, 3115, 4295, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
d.addCallback(cb)
def eb(failure): log.err(failure)
cf2910994f0de430039079505dc227f5534e5048 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11015/cf2910994f0de430039079505dc227f5534e5048/xmpp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20371, 12, 12251, 4672, 613, 18, 370, 12, 12251, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20371, 12, 12251, 4672, 613, 18, 370, 12, 12251, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
error=evaluator(i) old_direction=d(error) i-=old_direction
old_error=evaluator(i) old_direction=d(old_error) i+=old_direction
def d(e): return 1 if e>=0 else -1
c07c82bed8331cd53d493b1de7dce0aea9c32e03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/150/c07c82bed8331cd53d493b1de7dce0aea9c32e03/qpaeq.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 302, 12, 73, 4672, 327, 404, 309, 425, 34, 33, 20, 469, 300, 21, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 302, 12, 73, 4672, 327, 404, 309, 425, 34, 33, 20, 469, 300, 21, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
if 'ocaid' in e and is_daisy_encrypted(e['ocaid']): e['encrypted_daisy'] = True
if 'ocaid' in e: collection = get_ia_collection(e['ocaid']) print 'collection:', collection e['ia_collection'] = collection e['public_scan'] = ('lendinglibrary' not in collection) and ('printdisabled' not in collection) overdrive_id = e.get('identifiers', {}).get('overdrive_id', None) if overdrive_id: e['overdrive'] = overdrive
def get_pub_year(e): pub_date = e.get('publish_date', None) if pub_date: m = re_year.search(pub_date) if m: return m.group(1)
4f14756dcf2ada5fa63000e1182e93702aa193df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3913/4f14756dcf2ada5fa63000e1182e93702aa193df/update_work.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 10174, 67, 6874, 12, 73, 4672, 5634, 67, 712, 273, 425, 18, 588, 2668, 6543, 67, 712, 2187, 599, 13, 309, 5634, 67, 712, 30, 312, 273, 283, 67, 6874, 18, 3072, 12, 10174, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 10174, 67, 6874, 12, 73, 4672, 5634, 67, 712, 273, 425, 18, 588, 2668, 6543, 67, 712, 2187, 599, 13, 309, 5634, 67, 712, 30, 312, 273, 283, 67, 6874, 18, 3072, 12, 10174, ...
return command
return command.encode(sys.getfilesystemencoding())
def _process_command(self, command): if sys.platform.startswith('java'): # Jython's os.popen doesn't handle Unicode as explained in # http://jython.org/bugs/1735774. This bug is still in Jython 2.2. command = str(command) if '>' not in command: if command.endswith('&'): command = command[:-1] + ' 2>&1 &' else: command += ' 2>&1' self._info("Running command '%s'" % command) return command
22718eb63b64d3e439b3be9903a8d1725b0093cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6988/22718eb63b64d3e439b3be9903a8d1725b0093cc/OperatingSystem.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2567, 67, 3076, 12, 2890, 16, 1296, 4672, 309, 2589, 18, 9898, 18, 17514, 1918, 2668, 6290, 11, 4672, 468, 804, 18490, 1807, 1140, 18, 84, 3190, 3302, 1404, 1640, 9633, 487, 19765, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2567, 67, 3076, 12, 2890, 16, 1296, 4672, 309, 2589, 18, 9898, 18, 17514, 1918, 2668, 6290, 11, 4672, 468, 804, 18490, 1807, 1140, 18, 84, 3190, 3302, 1404, 1640, 9633, 487, 19765, ...
format = u'%%-%is|%%s%%s' % width_l
def format_props(self): tkt = self.ticket fields = [f for f in tkt.fields if f['name'] not in ('summary', 'cc', 'time', 'changetime')] width = [0, 0, 0, 0] i = 0 for f in fields: if f['type'] == 'textarea': continue fname = f['name'] if not fname in tkt.values: continue fval = tkt[fname] or '' if fval.find('\n') != -1: continue idx = 2 * (i % 2) width[idx] = max(len(f['label']), width[idx]) width[idx + 1] = max(len(fval), width[idx + 1]) i += 1 width_l = width[0] + width[1] + 5 width_r = width[2] + width[3] + 5 half_cols = (self.COLS - 1) / 2 if width_l + width_r + 1 > self.COLS: if ((width_l > half_cols and width_r > half_cols) or (width[0] > half_cols / 2 or width[2] > half_cols / 2)): width_l = half_cols width_r = half_cols elif width_l > width_r: width_l = min((self.COLS - 1) * 2 / 3, width_l) width_r = self.COLS - width_l - 1 else: width_r = min((self.COLS - 1) * 2 / 3, width_r) width_l = self.COLS - width_r - 1 sep = width_l * '-' + '+' + width_r * '-' txt = sep + CRLF cell_tmp = [u'', u''] big = [] i = 0 width_lr = [width_l, width_r] for f in [f for f in fields if f['name'] != 'description']: fname = f['name'] if not tkt.values.has_key(fname): continue fval = tkt[fname] or '' if fname in ['owner', 'reporter']: fval = obfuscate_email_address(fval) if f['type'] == 'textarea' or '\n' in unicode(fval): big.append((f['label'], CRLF.join(fval.splitlines()))) else: # Note: f['label'] is a Babel's LazyObject, make sure its # __str__ method won't be called. str_tmp = u'%s: %s' % (f['label'], unicode(fval)) idx = i % 2 cell_tmp[idx] += wrap(str_tmp, width_lr[idx] - 2 + 2 * idx, (width[2 * idx] - len(f['label']) + 2 * idx) * ' ', 2 * ' ', CRLF) cell_tmp[idx] += CRLF i += 1 cell_l = cell_tmp[0].splitlines() cell_r = cell_tmp[1].splitlines() format = u'%%-%is|%%s%%s' % width_l for i in range(max(len(cell_l), len(cell_r))): if i >= len(cell_l): cell_l.append(width_l * ' ') elif i >= len(cell_r): cell_r.append('') txt += format % (cell_l[i], cell_r[i], CRLF) if big: txt += sep for name, value in big: txt += CRLF.join(['', name + ':', value, '', '']) txt += sep return txt
5493b0c9877b25a3b6e71a29f79a95fe91fb3c5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/5493b0c9877b25a3b6e71a29f79a95fe91fb3c5b/notification.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 9693, 12, 2890, 4672, 268, 8629, 273, 365, 18, 16282, 1466, 273, 306, 74, 364, 284, 316, 268, 8629, 18, 2821, 309, 284, 3292, 529, 3546, 486, 316, 7707, 7687, 2187, 296, 952, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 9693, 12, 2890, 4672, 268, 8629, 273, 365, 18, 16282, 1466, 273, 306, 74, 364, 284, 316, 268, 8629, 18, 2821, 309, 284, 3292, 529, 3546, 486, 316, 7707, 7687, 2187, 296, 952, ...
status_list.add(task_id, state, meta)
status_list.add(task_id, state, ticket, meta)
def from_xml(cls, root, hdr, body): status_list = cls() entries = body.find(cls.tag) for entry in entries.findall(XBE("Status")): task_id = entry.attrib["task-id"] state = bes.toXBETaskState(entry.find( BES_ACTIVITY("ActivityStatus"))) meta = parse_dictionary(entry.find(XBE("Meta/Dict")), {}) status_list.add(task_id, state, meta) return status_list
d5225af4c7b6c3a7725ccaa7713734e02c76b4c2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2459/d5225af4c7b6c3a7725ccaa7713734e02c76b4c2/message.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 628, 67, 2902, 12, 6429, 16, 1365, 16, 7723, 16, 1417, 4672, 1267, 67, 1098, 273, 2028, 1435, 3222, 273, 1417, 18, 4720, 12, 6429, 18, 2692, 13, 364, 1241, 316, 3222, 18, 4720, 454, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 628, 67, 2902, 12, 6429, 16, 1365, 16, 7723, 16, 1417, 4672, 1267, 67, 1098, 273, 2028, 1435, 3222, 273, 1417, 18, 4720, 12, 6429, 18, 2692, 13, 364, 1241, 316, 3222, 18, 4720, 454, ...
lang_name = LANG[lang_value] for sublang_name in SUBLANG[sublang_value]:
lang_name = LANG.get(lang_value, '*unknown*') for sublang_name in SUBLANG.get(sublang_value, list()):
def get_sublang_name_for_lang( lang_value, sublang_value ): lang_name = LANG[lang_value] for sublang_name in SUBLANG[sublang_value]: # if the main language is a substring of sublang's name, then # return that if lang_name in sublang_name: return sublang_name # otherwise return the first sublang name return SUBLANG[sublang_value][0]
fd6a8a480d51744675cb05df8f47cbf3e0406454 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4177/fd6a8a480d51744675cb05df8f47cbf3e0406454/pefile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 87, 440, 539, 67, 529, 67, 1884, 67, 4936, 12, 3303, 67, 1132, 16, 17809, 539, 67, 1132, 262, 30, 3303, 67, 529, 273, 19913, 18, 588, 12, 4936, 67, 1132, 16, 14609, 8172, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 87, 440, 539, 67, 529, 67, 1884, 67, 4936, 12, 3303, 67, 1132, 16, 17809, 539, 67, 1132, 262, 30, 3303, 67, 529, 273, 19913, 18, 588, 12, 4936, 67, 1132, 16, 14609, 8172, ...
relative_dir = cur_dir[len(BASE_DIRECTORY):]
relative_dir = cur_dir[len(BASE_DIRECTORY) + 1:]
def ApplyRules(existing_rules, deps, includes, cur_dir): """Applies the given deps and include rules, returning the new rules. Args: existing_rules: A set of existing rules that will be combined. deps: The list of imports from the "deps" section of the DEPS file. include: The list of rules from the "include_rules" section of DEPS. cur_dir: The current directory. We will create an implicit rule that allows inclusion from this directory. Returns: A new set of rules combining the existing_rules with the other arguments. """ rules = existing_rules # First apply the implicit "allow" rule for the current directory. if cur_dir.lower().startswith(BASE_DIRECTORY): relative_dir = cur_dir[len(BASE_DIRECTORY):] # Normalize path separators to slashes. relative_dir = relative_dir.replace("\\", "/") source = relative_dir if len(source) == 0: source = "." # Make the help string a little more meaningful. rules.AddRule("+" + relative_dir, "Default rule for " + source) else: raise Exception("Internal error: base directory is not at the beginning" + " for\n %s and base dir\n %s" % (cur_dir, BASE_DIRECTORY)) # Next apply the DEPS additions, these are all allowed. for (index, key) in enumerate(deps): rules.AddRule("+" + key, relative_dir + "'s deps for " + key) # Last, apply the additional explicit rules. for (index, rule_str) in enumerate(includes): rules.AddRule(rule_str, relative_dir + "'s include_rules") return rules
c40671f2093ca48862fb1212226c8ccb95d0adc9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9392/c40671f2093ca48862fb1212226c8ccb95d0adc9/checkdeps.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5534, 4478, 12, 11711, 67, 7482, 16, 8740, 16, 6104, 16, 662, 67, 1214, 4672, 3536, 13029, 326, 864, 8740, 471, 2341, 2931, 16, 5785, 326, 394, 2931, 18, 225, 6634, 30, 2062, 67, 7482,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5534, 4478, 12, 11711, 67, 7482, 16, 8740, 16, 6104, 16, 662, 67, 1214, 4672, 3536, 13029, 326, 864, 8740, 471, 2341, 2931, 16, 5785, 326, 394, 2931, 18, 225, 6634, 30, 2062, 67, 7482,...
if not node.attributes.has_key('align'):
if (not node.attributes.has_key('align') or node.attributes['align'] == 'center'):
def visit_figure(self, node): if not node.attributes.has_key('align'): align = 'center' else: align = 'flush'+node.attributes['align'] self.body.append( '\\begin{figure}[htbp]\\begin{%s}\n' % align ) self.context.append( '\\end{%s}\\end{figure}\n' % align )
a2461f582a703ae324d9176d274e03a3bfcf4d12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/a2461f582a703ae324d9176d274e03a3bfcf4d12/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 67, 19675, 12, 2890, 16, 756, 4672, 309, 261, 902, 756, 18, 4350, 18, 5332, 67, 856, 2668, 7989, 6134, 578, 756, 18, 4350, 3292, 7989, 3546, 422, 296, 5693, 11, 4672, 5689, 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, 3757, 67, 19675, 12, 2890, 16, 756, 4672, 309, 261, 902, 756, 18, 4350, 18, 5332, 67, 856, 2668, 7989, 6134, 578, 756, 18, 4350, 3292, 7989, 3546, 422, 296, 5693, 11, 4672, 5689, 273, ...
str += '<H3>'+fname+'</H3>\n' str += '<CODE><B>' +fname + pstr + '</B></CODE><p>\n' str += '<DL>\n'
str += '<h3 class="func-details">'+fname+'</h3>\n' str += self._func_signature(fname, fdoc)
def _func_details(self, functions, cls, heading='Function Details'): """## Return a detailed description of the functions in a class or module.""" functions = self._sort(functions) if len(functions) == 0: return '' str = self._table_header(heading, 'details')+'</TABLE>'
89bd16eaf8c7e556babe42c6a92621dbc9b8a7e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/89bd16eaf8c7e556babe42c6a92621dbc9b8a7e9/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 644, 67, 6395, 12, 2890, 16, 4186, 16, 2028, 16, 11053, 2218, 2083, 21897, 11, 4672, 3536, 1189, 2000, 279, 6864, 2477, 434, 326, 4186, 316, 279, 667, 578, 1605, 12123, 4186, 273, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 644, 67, 6395, 12, 2890, 16, 4186, 16, 2028, 16, 11053, 2218, 2083, 21897, 11, 4672, 3536, 1189, 2000, 279, 6864, 2477, 434, 326, 4186, 316, 279, 667, 578, 1605, 12123, 4186, 273, ...
options
';'.join(options)
def getControlFromAttribute(self, attrname, attr, readonly, isNew=False): attrlabel = '@@%s@@' % attrname sControl = '' sTab = '' if isinstance(attr, datatypes.String): sControl = AUTO_CONTROLS[datatypes.String] % \ (self.yoffset + 3, attrlabel, attrname, self.yoffset, attr.value, self.getStringFromBoolean(readonly)) self.yoffset += 25
19d016592fde3a93ded6b6761dfcf716d2874a72 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2504/19d016592fde3a93ded6b6761dfcf716d2874a72/ui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 27174, 1265, 1499, 12, 2890, 16, 1604, 529, 16, 1604, 16, 17102, 16, 10783, 33, 8381, 4672, 1604, 1925, 273, 4622, 36, 9, 87, 36, 20887, 738, 1604, 529, 272, 3367, 273, 875, 272, 5661,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 27174, 1265, 1499, 12, 2890, 16, 1604, 529, 16, 1604, 16, 17102, 16, 10783, 33, 8381, 4672, 1604, 1925, 273, 4622, 36, 9, 87, 36, 20887, 738, 1604, 529, 272, 3367, 273, 875, 272, 5661,...
print("The Python SSL module was not built")
def find_working_perl(perls): for perl in perls: fh = os.popen(perl + ' -e "use Win32;"') fh.read() rc = fh.close() if rc: continue return perl print("Can not find a suitable PERL:") if perls: print(" the following perl interpreters were found:") for p in perls: print(" ", p) print(" None of these versions appear suitable for building OpenSSL") else: print(" NO perl interpreters were found on this machine at all!") print(" Please install ActivePerl and ensure it appears on your path") print("The Python SSL module was not built") return None
2336111aef67cf9946a468b757bcebbfcad713de /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/2336111aef67cf9946a468b757bcebbfcad713de/build_ssl.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 20478, 67, 457, 80, 12, 457, 3251, 4672, 364, 1534, 80, 316, 1534, 3251, 30, 7625, 273, 1140, 18, 84, 3190, 12, 457, 80, 397, 296, 300, 73, 315, 1202, 21628, 1578, 4868, 61...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 20478, 67, 457, 80, 12, 457, 3251, 4672, 364, 1534, 80, 316, 1534, 3251, 30, 7625, 273, 1140, 18, 84, 3190, 12, 457, 80, 397, 296, 300, 73, 315, 1202, 21628, 1578, 4868, 61...
def fl_set_form_atclose(form, py_fmclose, data): """ fl_set_form_atclose(form, py_fmclose, data) -> form atclose reference
def fl_set_form_atclose(pForm, py_fmclose, data): """ fl_set_form_atclose(pForm, py_fmclose, data) -> form atclose reference
def fl_set_form_atclose(form, py_fmclose, data): """ fl_set_form_atclose(form, py_fmclose, data) -> form atclose reference Calls a callback function before closing the form. <form> form the receive the message <pyfmclose> python callback function to be called <data> argument to be passed to function """ c_fmclose = FL_FORM_ATCLOSE(py_fmclose) _cfunc_refs[get_rand_dictkey()] = c_fmclose retval = _fl_set_form_atclose(form, c_fmclose, data) return retval
9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 542, 67, 687, 67, 270, 4412, 12, 84, 1204, 16, 2395, 67, 25089, 4412, 16, 501, 4672, 3536, 1183, 67, 542, 67, 687, 67, 270, 4412, 12, 84, 1204, 16, 2395, 67, 25089, 4412, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 542, 67, 687, 67, 270, 4412, 12, 84, 1204, 16, 2395, 67, 25089, 4412, 16, 501, 4672, 3536, 1183, 67, 542, 67, 687, 67, 270, 4412, 12, 84, 1204, 16, 2395, 67, 25089, 4412, ...
def server_lookup(key):
def nat_server_lookup(key):
def server_lookup(key): # Get the proper key, add the prefix key = NAT_SRV_PREFIX + key # Fetch all the keys lst = centralizedadvertise_lookup(key, NAT_MAX_LOOKUP) num = len(lst) # Safety check... assert(num <= 1) if num == 0: raise Exception, "Host could not be found!" # Get the information about the server info = deserialize(lst[0]) # Return a tuple of the forwarder IP port return (info["forwarder"], info["port"])
a700f57ccfaddb096c690e1d2973742b129bd73a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/a700f57ccfaddb096c690e1d2973742b129bd73a/NAT_advertisement.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10535, 67, 3567, 67, 8664, 12, 856, 4672, 468, 968, 326, 5338, 498, 16, 527, 326, 1633, 498, 273, 31395, 67, 10090, 58, 67, 6307, 397, 498, 225, 468, 8065, 777, 326, 1311, 9441, 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, 10535, 67, 3567, 67, 8664, 12, 856, 4672, 468, 968, 326, 5338, 498, 16, 527, 326, 1633, 498, 273, 31395, 67, 10090, 58, 67, 6307, 397, 498, 225, 468, 8065, 777, 326, 1311, 9441, 273, ...
self.commands.append(msg['subject'])
self.commands.append(msg.get('subject', ''))
def __init__(self, mlist, msg, msgdata): self.mlist = mlist self.msg = msg self.msgdata = msgdata # Only set returnaddr if the response is to go to someone other than # the address specified in the From: header (e.g. for the password # command). self.returnaddr = None self.commands = [] self.results = [] self.ignored = [] self.lineno = 0 self.subjcmdretried = 0 # Always process the Subject: header first self.commands.append(msg['subject']) # Find the first text/plain part part = None for part in typed_subpart_iterator(msg, 'text', 'plain'): break if part is None or part is not msg: # Either there was no text/plain part or we ignored some # non-text/plain parts. self.results.append(_('Ignoring non-text/plain MIME parts')) if part is None: # E.g the outer Content-Type: was text/html return body = part.get_payload() # text/plain parts better have string payloads assert isinstance(body, StringType) or isinstance(body, UnicodeType) lines = body.splitlines() # Use no more lines than specified self.commands.extend(lines[:mm_cfg.DEFAULT_MAIL_COMMANDS_MAX_LINES]) self.ignored.extend(lines[mm_cfg.DEFAULT_MAIL_COMMANDS_MAX_LINES:])
a5f6ee789db06fac97b0ab4242edb1186a1a6eab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/a5f6ee789db06fac97b0ab4242edb1186a1a6eab/CommandRunner.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 312, 1098, 16, 1234, 16, 1234, 892, 4672, 365, 18, 781, 376, 273, 312, 1098, 365, 18, 3576, 273, 1234, 365, 18, 3576, 892, 273, 1234, 892, 468, 5098, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 312, 1098, 16, 1234, 16, 1234, 892, 4672, 365, 18, 781, 376, 273, 312, 1098, 365, 18, 3576, 273, 1234, 365, 18, 3576, 892, 273, 1234, 892, 468, 5098, 4...
if injection:
if injection is not None and injectionconfidence is not None and injection_area is not None:
def cbcBayesPostProc(outdir,data,oneDMenu,twoDGreedyMenu,GreedyRes,confidence_levels,twoDplots,injfile=None,eventnum=None,skyres=None,bayesfactornoise=None,bayesfactorcoherent=None): """ This is a demonstration script for using the functionality/data structures contained in pylal.bayespputils . It will produce a webpage from a file containing posterior samples generated by the parameter estimation codes with 1D/2D plots and stats from the marginal posteriors for each parameter/set of parameters. """ if eventnum is not None and injfile is None: print "You specified an event number but no injection file. Ignoring!" if data is None: print 'You must specify an input data file' exit(1) # if outdir is None: print "You must specify an output directory." exit(1) if not os.path.isdir(outdir): os.makedirs(outdir) # commonOutputFileObj=open(data[0]) #Select injections using tc +/- 0.1s if it exists or eventnum from the injection file if injfile: import itertools injections = SimInspiralUtils.ReadSimInspiralFromFiles([injfile]) if(eventnum is not None): if(len(injections)<eventnum): print "Error: You asked for event %d, but %s contains only %d injections" %(eventnum,injfile,len(injections)) sys.exit(1) else: injection=injections[eventnum] else: if(len(injections)<1): print 'Warning: Cannot find injection with end time %f' %(means[2]) else: injection = itertools.ifilter(lambda a: abs(a.get_end() - means[2]) < 0.1, injections).next() ## Load Bayes factors ## # Add Bayes factor information to summary file # if bayesfactornoise is not None: bfile=open(bayesfactornoise,'r') BSN=bfile.read() bfile.close() print 'BSN: %s'%BSN if bayesfactorcoherent is not None: bfile=open(bayesfactorcoherent,'r') BCI=bfile.read() bfile.close() print 'BCI: %s'%BCI #Create an instance of the posterior class using the posterior values loaded #from the file and any injection information (if given). pos = bppu.Posterior(commonOutputFileObj,SimInspiralTableEntry=injection) if ('mc' in pos.names or 'mchirp' in pos.names) and \ 'eta' in pos.names and \ ('mass1' not in pos.names or 'm1' not in pos.names) and\ ('m2' not in pos.names or 'm2' not in pos.names): if 'mc' in pos.names: mchirp_name='mc' else: mchirp_name='mchirp' if injection: inj_mass1,inj_mass2=bppu.mc2ms(injection.mchirp,injection.eta) mass1_samps,mass2_samps=bppu.mc2ms(pos[mchirp_name].samples,pos['eta'].samples) mass1_pos=bppu.OneDPosterior('m1',mass1_samps,injected_value=inj_mass1) mass2_pos=bppu.OneDPosterior('m2',mass2_samps,injected_value=inj_mass2) pos.append(mass1_pos) pos.append(mass2_pos) ##Print some summary stats for the user...## #Number of samples print "Number of posterior samples: %i"%len(pos) # Means print 'Means:' print str(pos.means) #Median print 'Median:' print str(pos.medians) #maxL print 'maxL:' max_pos,max_pos_co=pos.maxL print max_pos_co #==================================================================# #Create web page #==================================================================# html=bppu.htmlPage('Posterior PDFs') #Create a section for meta-data/run information html_meta=html.add_section('Summary') html_meta.p('Produced from '+str(len(pos))+' posterior samples.') html_meta.p('Samples read from %s'%(data[0])) #Create a section for model selection results (if they exist) if bayesfactornoise is not None: html_model=html.add_section('Model selection') html_model.p('log Bayes factor ( coherent vs gaussian noise) = %s, Bayes factor=%f'%(BSN,exp(float(BSN)))) if bayesfactorcoherent is not None: html_model.p('log Bayes factor ( coherent vs incoherent OR noise ) = %s, Bayes factor=%f'%(BCI,exp(float(BCI)))) #Create a section for summary statistics html_stats=html.add_section('Summary statistics') html_stats.write(str(pos)) #==================================================================# #Generate sky map #==================================================================# #If sky resolution parameter has been specified try and create sky map... skyreses=None sky_injection_cl=None if skyres is not None and 'ra' in pos.names and 'dec' in pos.names: #Greedy bin sky samples (ra,dec) into a grid on the sky which preserves #? top_ranked_sky_pixels,sky_injection_cl,skyreses,injection_area=bppu.greedy_bin_sky(pos,skyres,confidence_levels) print "BCI for sky area:" print skyreses #Create sky map in outdir bppu.plot_sky_map(top_ranked_sky_pixels,outdir) #Create a web page section for sky localization results/plots html_sky=html.add_section('Sky Localization') if injection: if sky_injection_cl: html_sky.p('Injection found at confidence interval %f in sky location'%(sky_injection_cl)) else: html_sky.p('Injection not found in posterior bins in sky location!') html_sky.write('<img width="35%" src="skymap.png"/>') if skyres is not None: html_sky_write='<table border="1"><tr><th>Confidence region</th><th>size (sq. deg)</th></tr>' fracs=skyreses.keys() fracs.sort() skysizes=[skyreses[frac] for frac in fracs] for frac,skysize in zip(fracs,skysizes): html_sky_write+=('<tr><td>%f</td><td>%f</td></tr>'%(frac,skysize)) html_sky_write+=('</table>') html_sky.write(html_sky_write) #==================================================================# #2D posteriors #==================================================================# #Loop over parameter pairs in twoDGreedyMenu and bin the sample pairs #using a greedy algorithm . The ranked pixels (toppoints) are used #to plot 2D histograms and evaluate Bayesian confidence intervals. #Make a folder for the 2D kde plots margdir=os.path.join(outdir,'2Dkde') if not os.path.isdir(margdir): os.makedirs(margdir) twobinsdir=os.path.join(outdir,'2Dbins') if not os.path.isdir(twobinsdir): os.makedirs(twobinsdir) #Add a section to the webpage for a table of the confidence interval #results. html_tcig=html.add_section('2D confidence intervals (greedy binning)') #Generate the top part of the table html_tcig_write='<table width="100%" border="1"><tr><th/>' confidence_levels.sort() for cl in confidence_levels: html_tcig_write+='<th>%f</th>'%cl if injection: html_tcig_write+='<th>Injection Confidence Level</th>' html_tcig_write+='<th>Injection Confidence Interval</th>' html_tcig_write+='</tr>' #= Add a section for a table of 2D marginal PDFs (kde) html_tcmp=html.add_section('2D Marginal PDFs') html_tcmp.br() #Table matter html_tcmp_write='<table border="1" width="100%">' row_count=0 for par1_name,par2_name in twoDGreedyMenu: par1_name=par1_name.lower() par2_name=par2_name.lower() print "Binning %s-%s to determine confidence levels ..."%(par1_name,par2_name) try: pos[par1_name.lower()] except KeyError: print "No input chain for %s, skipping binning."%par1_name continue try: pos[par2_name.lower()] except KeyError: print "No input chain for %s, skipping binning."%par2_name continue #Bin sizes try: par1_bin=GreedyRes[par1_name] except KeyError: print "Bin size is not set for %s, skipping %s/%s binning."%(par1_name,par1_name,par2_name) continue try: par2_bin=GreedyRes[par2_name] except KeyError: print "Bin size is not set for %s, skipping %s/%s binning."%(par2_name,par1_name,par2_name) continue #Form greedy binning input structure greedy2Params={par1_name:par1_bin,par2_name:par2_bin} #Greedy bin the posterior samples toppoints,injection_cl,reses,injection_area=\ bppu.greedy_bin_two_param(pos,greedy2Params,confidence_levels) print "BCI %s-%s:"%(par1_name,par2_name) print reses #Generate new BCI html table row BCItableline='<tr><td>%s-%s</td>'%(par1_name,par2_name) cls=reses.keys() cls.sort() for cl in cls: BCItableline+='<td>%f</td>'%reses[cl] if injection is not None and injection_cl is not None: BCItableline+='<td>%f</td>'%injection_cl BCItableline+='<td>%f</td>'%injection_area BCItableline+='</tr>' #Append new table line to section html html_tcig_write+=BCItableline #= Plot 2D histograms of greedily binned points =# #greedy2PlotFig=bppu.plot_two_param_greedy_bins(np.array(toppoints),pos,greedy2Params) #greedy2PlotFig.savefig(os.path.join(twobinsdir,'%s-%s_greedy2.png'%(par1_name,par2_name))) #= Generate 2D kde plots =# print 'Generating %s-%s plot'%(par1_name,par2_name) par1_pos=pos[par1_name].samples par2_pos=pos[par2_name].samples if (size(np.unique(par1_pos))<2 or size(np.unique(par2_pos))<2): continue plot2DkdeParams={par1_name:50,par2_name:50} myfig=bppu.plot_two_param_kde(pos,plot2DkdeParams) twoDKdePath=os.path.join(margdir,par1_name+'-'+par2_name+'_2Dkernel.png') if row_count==0: html_tcmp_write+='<tr>' html_tcmp_write+='<td width="30%"><img width="100%" src="'+twoDKdePath+'"/></td>' row_count+=1 if row_count==3: html_tcmp_write+='</tr>' row_count=0 myfig.savefig(twoDKdePath) #Finish off the BCI table and write it into the etree html_tcig_write+='</table>' html_tcig.write(html_tcig_write) #Finish off the 2D kde plot table while row_count!=0: html_tcmp_write+='<td/>' row_count+=1 if row_count==3: row_count=0 html_tcmp_write+='</tr>' html_tcmp_write+='</table>' html_tcmp.write(html_tcmp_write) #Add a link to all plots html_tcmp.br() html_tcmp.a("2D/",'All 2D Marginal PDFs') html_tcmp.hr() #==================================================================# #1D posteriors #==================================================================# #Loop over each parameter and determine the contigious and greedy #confidence levels and some statistics. #Add section for 1D confidence intervals html_ogci=html.add_section('1D confidence intervals (greedy binning)') #Generate the top part of the table html_ogci_write='<table width="100%" border="1"><tr><th/>' confidence_levels.sort() for cl in confidence_levels: html_ogci_write+='<th>%f</th>'%cl if injection: html_ogci_write+='<th>Injection Confidence Level</th>' html_ogci_write+='<th>Injection Confidence Interval</th>' html_ogci_write+='</tr>' #Add section for 1D marginal PDFs and sample plots html_ompdf=html.add_section('1D marginal posterior PDFs') html_ompdf.br() #Table matter html_ompdf_write= '<table><tr><th>Histogram and Kernel Density Estimate</th><th>Samples used</th></tr>' onepdfdir=os.path.join(outdir,'1Dpdf') if not os.path.isdir(onepdfdir): os.makedirs(onepdfdir) sampsdir=os.path.join(outdir,'1Dsamps') if not os.path.isdir(sampsdir): os.makedirs(sampsdir) for par_name in oneDMenu: par_name=par_name.lower() print "Binning %s to determine confidence levels ..."%par_name try: pos[par_name.lower()] except KeyError: print "No input chain for %s, skipping binning."%par_name continue try: par_bin=GreedyRes[par_name] except KeyError: print "Bin size is not set for %s, skipping binning."%par_name continue binParams={par_name:par_bin} toppoints,injectionconfidence,reses,injection_area=bppu.greedy_bin_one_param(pos,binParams,confidence_levels) oneDContCL,oneDContInj = bppu.contigious_interval_one_param(pos,binParams,confidence_levels) #Generate new BCI html table row BCItableline='<tr><td>%s</td>'%(par_name) cls=reses.keys() cls.sort() for cl in cls: BCItableline+='<td>%f</td>'%reses[cl] if injection: BCItableline+='<td>%f</td>'%injectionconfidence BCItableline+='<td>%f</td>'%injection_area BCItableline+='</tr>' #Append new table line to section html html_ogci_write+=BCItableline #Generate 1D histogram/kde plots print "Generating 1D plot for %s."%par_name oneDPDFParams={par_name:50} rbins,plotFig=bppu.plot_one_param_pdf(pos,oneDPDFParams) figname=par_name+'.png' oneDplotPath=os.path.join(onepdfdir,figname) plotFig.savefig(oneDplotPath) if rbins: print "r of injected value of %s (bins) = %f"%(par_name, rbins) ##Produce plot of raw samples myfig=plt.figure(figsize=(4,3.5),dpi=80) pos_samps=pos[par_name].samples plt.plot(pos_samps,'.',figure=myfig) injpar=pos[par_name].injval if injpar: if min(pos_samps)<injpar and max(pos_samps)>injpar: plt.plot([0,len(pos_samps)],[injpar,injpar],'r-.') myfig.savefig(os.path.join(sampsdir,figname.replace('.png','_samps.png'))) html_ompdf_write+='<tr><td><img src="1Dpdf/'+figname+'"/></td><td><img src="1Dsamps/'+figname.replace('.png','_samps.png')+'"/></td></tr>' html_ompdf_write+='</table>' html_ompdf.write(html_ompdf_write) html_ogci_write+='</table>' html_ogci.write(html_ogci_write) html_ogci.hr() html_ogci.br() html_ompdf.hr() html_ompdf.br() html_footer=html.add_section('') html_footer.p('Produced using cbcBayesPostProc.py at '+strftime("%Y-%m-%d %H:%M:%S")+' .') html_footer.p(git_version.verbose_msg) #Save results page resultspage=open(os.path.join(outdir,'posplots.html'),'w') resultspage.write(str(html)) # Save posterior samples too... posfilename=os.path.join(outdir,'posterior_samples.dat') posfile=open(posfilename,'w') input_file=open(data[0]) posfile.write(input_file.read()) # posfilename2=os.path.join(outdir,'posterior_samples2.dat') pos.write_to_file(posfilename2) #Close files input_file.close() posfile.close() resultspage.close()
3208edd14b770d206fb4669352923910659e297b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/3208edd14b770d206fb4669352923910659e297b/cbcBayesPostProc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2875, 71, 38, 528, 281, 3349, 15417, 12, 659, 1214, 16, 892, 16, 476, 40, 4599, 16, 15415, 40, 43, 15656, 93, 4599, 16, 43, 15656, 93, 607, 16, 27911, 67, 12095, 16, 15415, 40, 13214...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2875, 71, 38, 528, 281, 3349, 15417, 12, 659, 1214, 16, 892, 16, 476, 40, 4599, 16, 15415, 40, 43, 15656, 93, 4599, 16, 43, 15656, 93, 607, 16, 27911, 67, 12095, 16, 15415, 40, 13214...
message = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_INFO,buttons=gtk.BUTTONS_OK, message_format="You do not have the LADSPA effects plugins installed") message.format_secondary_text("Jokosher requires this package to be able to use effects, please install the relevant package for your distribution.\n\nNOTE FOR WINDOWS USERS: Jokosher with LADSPA is not currently supported on Windows.") message.show_all() response = message.run() if response == gtk.RESPONSE_OK: message.destroy()
message = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_INFO,buttons=gtk.BUTTONS_OK, message_format="You do not have the LADSPA effects plugins installed") if platform.system() =="Windows": message.format_secondary_text("Jokosher does not currently support LADSPA plugins on Windows") else: message.format_secondary_text("Jokosher requires this package to be able to use effects, please install the relevant package for your distribution.") message.show_all() response = message.run() if response == gtk.RESPONSE_OK: message.destroy()
def OnEffectsButtonClicked(self, widget): """ Creates and shows the instrument effects dialog if LADSPA is installed. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. mouse -- reserved for GTK callbacks, don't use it explicitly. """ Globals.debug("props button pressed")
4c07ecee2fc8f5d24e70e3a29568d1ddbb6ab279 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10033/4c07ecee2fc8f5d24e70e3a29568d1ddbb6ab279/ControlsBox.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 29013, 3616, 27633, 12, 2890, 16, 3604, 4672, 3536, 10210, 471, 17975, 326, 10353, 16605, 6176, 309, 511, 1880, 3118, 37, 353, 5876, 18, 225, 7012, 30, 3604, 1493, 8735, 364, 19688, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 29013, 3616, 27633, 12, 2890, 16, 3604, 4672, 3536, 10210, 471, 17975, 326, 10353, 16605, 6176, 309, 511, 1880, 3118, 37, 353, 5876, 18, 225, 7012, 30, 3604, 1493, 8735, 364, 19688, ...
self.elasticStage, self.viscousStage, self.iterateEvent = lithomop3d.setupPETScLogging()
self.autoprestrStage, self.elasticStage, self.viscousStage, self.iterateEvent = lithomop3d.setupPETScLogging()
def run(self): from ElementTypeDef import ElementTypeDef import lithomop3d
c4fe6f5294629ba1d700ff89f7e8fc2ae6870f44 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8640/c4fe6f5294629ba1d700ff89f7e8fc2ae6870f44/Lithomop3d_setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 628, 3010, 559, 3262, 1930, 3010, 559, 3262, 1930, 328, 483, 362, 556, 23, 72, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 628, 3010, 559, 3262, 1930, 3010, 559, 3262, 1930, 328, 483, 362, 556, 23, 72, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
self.state.ID = '%s.PORT.%s.%d' % (log.hostname,self.args.host,self.args.port)
if self.ID == None: self.ID = '%s.PORT.%s.%d' % (log.hostname,self.args.host,self.args.port) self.state.ID = self.ID
def tokenparser(self, toklist, toktypes, indent):
a03c7f1500a50c5df0f8131c092499b9c81e76ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3643/a03c7f1500a50c5df0f8131c092499b9c81e76ce/directive.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1147, 4288, 12, 2890, 16, 946, 1098, 16, 946, 2352, 16, 3504, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1147, 4288, 12, 2890, 16, 946, 1098, 16, 946, 2352, 16, 3504, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
fops = [float(op) for op in self._operands] return self._operator(*fops)
""" TESTS: sage: f=x*sin(0) sage: float(f(1)) 0.0 sage: w = I - I sage: float(w) 0.0 """ return self._convert(float)
def __float__(self): fops = [float(op) for op in self._operands] return self._operator(*fops)
1da728f53d1de8d68f97e594791b41d62f5fde91 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/1da728f53d1de8d68f97e594791b41d62f5fde91/calculus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 5659, 972, 12, 2890, 4672, 284, 4473, 273, 306, 5659, 12, 556, 13, 364, 1061, 316, 365, 6315, 4063, 5708, 65, 327, 365, 6315, 9497, 30857, 74, 4473, 13, 2, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5659, 972, 12, 2890, 4672, 284, 4473, 273, 306, 5659, 12, 556, 13, 364, 1061, 316, 365, 6315, 4063, 5708, 65, 327, 365, 6315, 9497, 30857, 74, 4473, 13, 2, -100, -100, -100, -100...
_PE._cvReleaseMat(self)
_PE._cvReleaseMatND(self)
def _CvMatND__del__(self): if self._owner is True: _PE._cvReleaseMat(self)
412ca2c96a145035b5a597ff3b0f791d9710dcb9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4310/412ca2c96a145035b5a597ff3b0f791d9710dcb9/codegen.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 39, 90, 15947, 2908, 972, 3771, 972, 12, 2890, 4672, 309, 365, 6315, 8443, 353, 1053, 30, 389, 1423, 6315, 19774, 7391, 15947, 12, 2890, 13, 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, 389, 39, 90, 15947, 2908, 972, 3771, 972, 12, 2890, 4672, 309, 365, 6315, 8443, 353, 1053, 30, 389, 1423, 6315, 19774, 7391, 15947, 12, 2890, 13, 2, -100, -100, -100, -100, -100, -100, ...
self.zoom(False)
self.zoom_out()
def key_zoom_out(self): self.zoom(False)
7cd4bfb36cabda84fe4f18835cc6b00b74f6b268 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6502/7cd4bfb36cabda84fe4f18835cc6b00b74f6b268/terminal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 498, 67, 14932, 67, 659, 12, 2890, 4672, 365, 18, 14932, 12, 8381, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 498, 67, 14932, 67, 659, 12, 2890, 4672, 365, 18, 14932, 12, 8381, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
self.queue_draw()
def select_color_at(self, x,y): d = sqrt((x-self.x0)**2 + (y-self.y0)**2) if self.r2 < d < self.r3: h,s,v = self.hsv h = 0.5 + 0.5*atan2(y-self.y0, self.x0-x)/pi self.color = hsv_to_rgb(h,s,v) self.hsv = (h,s,v) self.redraw_circle_line() self.draw_inside_circle() self.on_select(self.color) elif self.r1 < d < self.r2: a = pi+atan2(y-self.y0, self.x0-x) for i,a1 in enumerate(self.angles): if a1-2*pi/CIRCLE_N < a < a1: clr = self.simple_colors[i] self.color = clr self.hsv = rgb_to_hsv(*clr) self.redraw_circle_line() self.draw_inside_circle() self.on_select(self.color) break elif d < self.r1 and (x-self.x0) < 0: self.hsv = rgb_to_hsv(*self.color) self.queue_draw() self.on_select(self.color)
cd5fd2a1d2e5c6534f52c057144e393781b87482 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7129/cd5fd2a1d2e5c6534f52c057144e393781b87482/colorsamplerwindow.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2027, 67, 3266, 67, 270, 12, 2890, 16, 619, 16, 93, 4672, 302, 273, 5700, 12443, 92, 17, 2890, 18, 92, 20, 13, 636, 22, 397, 261, 93, 17, 2890, 18, 93, 20, 13, 636, 22, 13, 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, 2027, 67, 3266, 67, 270, 12, 2890, 16, 619, 16, 93, 4672, 302, 273, 5700, 12443, 92, 17, 2890, 18, 92, 20, 13, 636, 22, 397, 261, 93, 17, 2890, 18, 93, 20, 13, 636, 22, 13, 309, ...
log.error("Could not send command, no relay has connected yet") self.dispatcher.openser.reply("error")
try_relays = self.protocols[:] random.shuffle(try_relays) defer = self._try_next(try_relays, command, headers) defer.addCallback(self._add_session, try_relays, call_id) return defer def _add_session(self, result, try_relays, call_id): self.sessions[call_id] = try_relays[-1] return result def _relay_error(self, failure, try_relays, command, headers): failure.trap(RelayError) log.warn("Relay from %s returned error: %s" % (try_relays.pop().ip, failure.value)) return self._try_next(try_relays, command, headers) def _try_next(self, try_relays, command, headers): if len(try_relays) == 0: raise RelayError("No suitable relay found") defer = try_relays[-1].send_command(command, headers) defer.addErrback(self._relay_error, try_relays, command, headers) return defer
def send_command(self, command, headers): if self.protocols: random.choice(self.protocols).send_command(command, headers) else: log.error("Could not send command, no relay has connected yet") self.dispatcher.openser.reply("error")
52c591872af75930b633f50641d72f593784ac59 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3445/52c591872af75930b633f50641d72f593784ac59/dispatcher.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 3076, 12, 2890, 16, 1296, 16, 1607, 4672, 309, 365, 18, 31018, 30, 2744, 18, 11569, 12, 2890, 18, 31018, 2934, 4661, 67, 3076, 12, 3076, 16, 1607, 13, 469, 30, 613, 18, 163...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 3076, 12, 2890, 16, 1296, 16, 1607, 4672, 309, 365, 18, 31018, 30, 2744, 18, 11569, 12, 2890, 18, 31018, 2934, 4661, 67, 3076, 12, 3076, 16, 1607, 13, 469, 30, 613, 18, 163...
self.assertEquals(unicode(self.unicode_text), u'Möhren')
self.assertEquals(unicode(self.unicode_text), unicode('Möhren', 'utf8'))
def test_unicode(self): self.assertEquals(unicode(self.unicode_text), u'Möhren') self.assertEquals(str(self.unicode_text), 'M\xf6hren')
a656d97d1c90fa95cbd1e2a28371e55afb01340e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1278/a656d97d1c90fa95cbd1e2a28371e55afb01340e/test_nodes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9124, 12, 2890, 4672, 365, 18, 11231, 8867, 12, 9124, 12, 2890, 18, 9124, 67, 955, 3631, 5252, 2668, 49, 132, 119, 76, 1187, 2187, 296, 3158, 28, 26112, 365, 18, 11231, 8867,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9124, 12, 2890, 4672, 365, 18, 11231, 8867, 12, 9124, 12, 2890, 18, 9124, 67, 955, 3631, 5252, 2668, 49, 132, 119, 76, 1187, 2187, 296, 3158, 28, 26112, 365, 18, 11231, 8867,...
credentials = open(options['authfile']).readline()
credentials = open(options.authfile).readline()
def main(): """Main program function: Grabs command-line arguments, starts up threads, and runs the program.""" try: # Set the default username to the current user username = os.getlogin() except: username = None # Grab command line arguments and the command to run (if any) usage = 'usage: %prog [options] "[command1]" "[command2]" ...' parser = OptionParser(usage=usage, version=__version__) parser.disable_interspersed_args() parser.add_option("-f", "--file", dest="hostfile", default=None, help="Location of the file containing the host list.", metavar="<file>") parser.add_option("-o", "--outfile", dest="outfile", default=None, help="Location of the file where the results will be saved.", metavar="<file>") parser.add_option("-a", "--authfile", dest="authfile", default=None, help="Location of the file containing the credentials to be used for connections (format is \"username:password\").", metavar="<file>") parser.add_option("-t", "--threads", dest="max_threads", default=10, type="int", help="Number of threads to spawn for simultaneous connection attempts [default: 10].", metavar="<int>") parser.add_option("-u", "--username", dest="username", default=username, help="The username to be used when connecting.", metavar="<username>") parser.add_option("-P", "--password", dest="password", default=None, help="The password to be used when connecting (not recommended--use an authfile unless the username and password are transient", metavar="<password>") parser.add_option("-q", "--quiet", action="store_false", dest="verbose", default=True, help="Don't print status messages to stdout (only print errors).") parser.add_option("-c", "--copy-file", dest="copy_file", default=None, help="Location of the file to copy to and optionally execute (-x) on hosts.", metavar="<file>") parser.add_option("-D", "--dest", dest="destination", default="/tmp/", help="Path where the file should be copied on the remote host (default: /tmp/).", metavar="<path>") parser.add_option("-x", "--execute", action="store_true", dest="execute", default=False, help="Execute the copied file (just like executing a given command).") parser.add_option("-r", "--remove", action="store_true", dest="remove", default=False, help="Remove (clean up) the SFTP'd file after execution.") parser.add_option("-T", "--timeout", dest="timeout", default=30, help="Timeout (in seconds) before giving up on an SSH connection (default: 30)", metavar="<seconds>") parser.add_option("-s", "--sudo", action="store_true", dest="sudo", default=False, help="Use sudo to execute the command (default: as root).") parser.add_option("-U", "--sudouser", dest="run_as", default="root", help="Run the command (via sudo) as this user.", metavar="<username>") (options, args) = parser.parse_args() # Check to make sure we were passed at least one command line argument try: sys.argv[1] except: print "\nError: At a minimum you must supply an input hostfile (-f)" parser.print_help() sys.exit(2) commands = False return_code = 0 ## Assume anything passed to us beyond the command line switches are commands to be executed if len(args) > 0: commands = args # Assign the options to more readable variables password = options.password local_filepath = options.copy_file remote_filepath = options.destination execute = options.execute remove = options.remove sudo = options.sudo max_threads = options.max_threads timeout = options.timeout run_as = options.run_as verbose = options.verbose outfile = options.outfile if options.hostfile == None: print "Error: You must supply a file (-f <file>) containing the host list to check." print "Use the -h option to see usage information." sys.exit(2) if options.outfile is None and options.verbose is False: print "Error: You have not specified any mechanism to output results." print "Please don't use quite mode (-q) without an output file (-o <file>)." sys.exit(2) if local_filepath is not None and commands is not False: print "Error: You can either run commands or execute a file. Not both." sys.exit(2) # Read in the host list to check hostlist = open(options.hostfile).read() if options.authfile is not None: credentials = open(options['authfile']).readline() username, password = credentials.split(":") # Get the username and password to use when checking hosts if options.username == None: username = raw_input('Username: ') if options.password == None: password = getpass.getpass('Password: ') hostlist_list = [] try: # This wierd little sequence of loops allows us to hit control-C in the middle of program execution and get immediate results for host in hostlist.split("\n"): # Turn the hostlist into an actual list if host != "": hostlist_list.append(host) output_queue = sshpt(hostlist_list, username, password, max_threads, timeout, commands, local_filepath, remote_filepath, execute, remove, sudo, run_as, verbose, outfile) output_queue.join() # Just to be safe we wait for the OutputThread to finish before moving on except KeyboardInterrupt: print 'caught KeyboardInterrupt, exiting...' return_code = 1 # Return code should be 1 if the user issues a SIGINT (control-C) # Clean up stopSSHQueue() stopOutputThread() sys.exit(return_code) except Exception, detail: print 'caught Exception...' print detail return_code = 2 # Clean up stopSSHQueue() stopOutputThread() sys.exit(return_code)
1459466ffc2512b812bc80c26d85eadf669894b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11566/1459466ffc2512b812bc80c26d85eadf669894b9/sshpt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3536, 6376, 5402, 445, 30, 225, 10812, 2038, 1296, 17, 1369, 1775, 16, 2542, 731, 7403, 16, 471, 7597, 326, 5402, 12123, 225, 775, 30, 468, 1000, 326, 805, 2718, 358, 326, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6376, 5402, 445, 30, 225, 10812, 2038, 1296, 17, 1369, 1775, 16, 2542, 731, 7403, 16, 471, 7597, 326, 5402, 12123, 225, 775, 30, 468, 1000, 326, 805, 2718, 358, 326, ...
TixWidget.__init__(self, master, 'tixResizeHandle', ['options'], cnf, kw)
TixWidget.__init__(self, master, 'tixResizeHandle', ['options'], cnf, kw)
def __init__(self, master, cnf={}, **kw):
86af7ef7e3f4448abc89aa941517a84075d99a38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/86af7ef7e3f4448abc89aa941517a84075d99a38/Tix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4171, 16, 23118, 28793, 2826, 9987, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4171, 16, 23118, 28793, 2826, 9987, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
req = "%s AND D.DirectoryPath LIKE '%s/%s/%s'" % ( req,'%',("%8.f" % int(production)).replace(' ','0'),'%')
req = "%s AND D.DirectoryPath LIKE '%s/%s/%s'" % (req,'%',("%8.f" % int(production)).replace(' ','0'),'%')
def getStorageSummary(self,dir='',fileType='',production='',sites=[]): """ Retrieves the storage summary for all of the known directories """ req = "SELECT DU.StorageElement,SUM(DU.StorageElementSize),SUM(DU.StorageElementFiles) FROM DirectoryUsage AS DU, Directory AS D WHERE D.DirectoryPath LIKE '%s%s'" % (dir,'%') if fileType: req = "%s AND D.DirectoryPath LIKE '%s/%s/%s'" % (req,'%',fileType,'%') if production: req = "%s AND D.DirectoryPath LIKE '%s/%s/%s'" % ( req,'%',("%8.f" % int(production)).replace(' ','0'),'%') if sites: req = "%s AND DU.StorageElement IN (%s)" % (req,stringListToString(sites)) req = "%s AND DU.DirectoryID=D.DirectoryID GROUP BY DU.StorageElement;" % req print req err = "StorageUsageDB.getStorageSummary: Failed to get storage summary." res = self._query(req) if not res['OK']: return S_ERROR("%s %s" % (err, res['Message'])) usageDict = {} for storageElement,size,files in res['Value']: usageDict[storageElement] = {'Size':int(size), 'Files':int(files)} return S_OK(usageDict)
856565cbe07955afd5136aab3787ed791a5f1661 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/856565cbe07955afd5136aab3787ed791a5f1661/StorageUsageDB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13840, 4733, 12, 2890, 16, 1214, 2218, 2187, 768, 559, 2218, 2187, 17273, 2218, 2187, 12180, 33, 8526, 4672, 3536, 20507, 326, 2502, 4916, 364, 777, 434, 326, 4846, 6402, 3536, 1111, 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, 13840, 4733, 12, 2890, 16, 1214, 2218, 2187, 768, 559, 2218, 2187, 17273, 2218, 2187, 12180, 33, 8526, 4672, 3536, 20507, 326, 2502, 4916, 364, 777, 434, 326, 4846, 6402, 3536, 1111, 273, ...
if(fill_value!=0){
if(fill_value!=0){
def my_dup2(st): s="" iter=0 for i in range(unroll_bsize): d["unroll_biter"]=i for j in range(unroll_ksize): d["unroll_kiter"]=j d["unroll_iter"]=iter iter+=1 s+=st%d return s+"\n"
aaea1d322c657ba643c240526cb3f00d5d2d997d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/aaea1d322c657ba643c240526cb3f00d5d2d997d/conv.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3399, 67, 26427, 22, 12, 334, 4672, 272, 1546, 6, 1400, 33, 20, 364, 277, 316, 1048, 12, 318, 2693, 67, 70, 1467, 4672, 302, 9614, 318, 2693, 67, 70, 2165, 11929, 33, 77, 364, 525, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3399, 67, 26427, 22, 12, 334, 4672, 272, 1546, 6, 1400, 33, 20, 364, 277, 316, 1048, 12, 318, 2693, 67, 70, 1467, 4672, 302, 9614, 318, 2693, 67, 70, 2165, 11929, 33, 77, 364, 525, ...
print path
def getRootPath(): path = os.path.dirname(os.path.abspath(__file__)) if os.path.isdir(os.path.join(path, "media")): print path return path path = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),"..\\..")) if os.path.isdir(os.path.join(path, "media")): print path return path
1464f29b0b316177573c8b2d1f8c3b5df5ec9bbf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/808/1464f29b0b316177573c8b2d1f8c3b5df5ec9bbf/svn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18863, 13332, 589, 273, 1140, 18, 803, 18, 12287, 12, 538, 18, 803, 18, 5113, 803, 12, 972, 768, 972, 3719, 309, 1140, 18, 803, 18, 291, 1214, 12, 538, 18, 803, 18, 5701, 12, 803, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18863, 13332, 589, 273, 1140, 18, 803, 18, 12287, 12, 538, 18, 803, 18, 5113, 803, 12, 972, 768, 972, 3719, 309, 1140, 18, 803, 18, 291, 1214, 12, 538, 18, 803, 18, 5701, 12, 803, ...
flavorsList = package.getAnnotation('generatedFlavors') flavorsList.append(flavor) package.annotate('generatedFlavors',flavorsList)
flavorsList = package.getAnnotation('generatedFlavors',None) if not flavorsList: package.annotate('generatedFlavors',[flavor]) else: flavorsList.append(flavor)
subscriber = "def apply" + name + "(context, event):\n"
415a38dd5c32cc15fb39d208c5d5eda8955b5dec /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11941/415a38dd5c32cc15fb39d208c5d5eda8955b5dec/ArchetypesGenerator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 9467, 273, 315, 536, 2230, 6, 397, 508, 397, 7751, 2472, 16, 871, 4672, 64, 82, 6, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 9467, 273, 315, 536, 2230, 6, 397, 508, 397, 7751, 2472, 16, 871, 4672, 64, 82, 6, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
(Unix timestamp, timezone offset).
(Unix timestamp, timezone offset).
def extshelp(): doc = _(r''' Mercurial has the ability to add new features through the use of extensions. Extensions may add new commands, add options to existing commands, change the default behavior of commands, or implement hooks. Extensions are not loaded by default for a variety of reasons: they can increase startup overhead; they may be meant for advanced usage only; they may provide potentially dangerous abilities (such as letting you destroy or modify history); they might not be ready for prime time; or they may alter some usual behaviors of stock Mercurial. It is thus up to the user to activate extensions as needed. To enable the "foo" extension, either shipped with Mercurial or in the Python search path, create an entry for it in your hgrc, like this:: [extensions] foo = You may also specify the full path to an extension:: [extensions] myfeature = ~/.hgext/myfeature.py To explicitly disable an extension enabled in an hgrc of broader scope, prepend its path with !:: [extensions] # disabling extension bar residing in /path/to/extension/bar.py hgext.bar = !/path/to/extension/bar.py # ditto, but no path was supplied for extension baz hgext.baz = ! ''') exts, maxlength = extensions.enabled() doc += listexts(_('enabled extensions:'), exts, maxlength) exts, maxlength = extensions.disabled() doc += listexts(_('disabled extensions:'), exts, maxlength) return doc
6559436b337b2c23d3cc0ede357a66e82d94a983 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/6559436b337b2c23d3cc0ede357a66e82d94a983/help.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1110, 674, 1992, 13332, 997, 273, 389, 12, 86, 26418, 14940, 1397, 649, 711, 326, 7123, 358, 527, 394, 4467, 3059, 326, 999, 434, 4418, 18, 23105, 2026, 527, 394, 4364, 16, 527, 702, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1110, 674, 1992, 13332, 997, 273, 389, 12, 86, 26418, 14940, 1397, 649, 711, 326, 7123, 358, 527, 394, 4467, 3059, 326, 999, 434, 4418, 18, 23105, 2026, 527, 394, 4364, 16, 527, 702, 3...
select min(pt.id) as id, a.name as project, sum(pt.remaining_hours) as remaining_hours, a.state, pu.uid from project_task as pt, project_project as p, account_analytic_account as a, project_user_rel as pu where pt.project_id=p.id and p.category_id = a.id and pu.project_id=p.id group by a.name,a.state,pu.uid
select min(pt.id) as id, aaa.name as project, CASE WHEN pu.uid is null THEN aaa.user_id ELSE pu.uid END as uid, sum(pt.remaining_hours) as remaining_hours, aaa.state from project_task pt left join project_project as pp ON (pt.project_id=pp.id) left join account_analytic_account as aaa ON (pp.category_id=aaa.id) left join project_user_rel as pu ON (pu.project_id=pp.id) where pt.create_uid=aaa.user_id group by aaa.name,aaa.state,pu.uid,aaa.user_id
def init(self, cr): tools.sql.drop_view_if_exists(cr, 'project_vs_remaining_hours') cr.execute(""" create or replace view project_vs_remaining_hours as ( select min(pt.id) as id, a.name as project, sum(pt.remaining_hours) as remaining_hours, a.state, pu.uid from project_task as pt, project_project as p, account_analytic_account as a, project_user_rel as pu where pt.project_id=p.id and p.category_id = a.id and pu.project_id=p.id group by a.name,a.state,pu.uid ) """)
d4a4ee06d7e670eb0600ea3d44507dd639bad859 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d4a4ee06d7e670eb0600ea3d44507dd639bad859/project_report.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 12, 2890, 16, 4422, 4672, 8513, 18, 4669, 18, 7285, 67, 1945, 67, 430, 67, 1808, 12, 3353, 16, 296, 4406, 67, 6904, 67, 17956, 67, 16814, 6134, 4422, 18, 8837, 2932, 3660, 752, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 12, 2890, 16, 4422, 4672, 8513, 18, 4669, 18, 7285, 67, 1945, 67, 430, 67, 1808, 12, 3353, 16, 296, 4406, 67, 6904, 67, 17956, 67, 16814, 6134, 4422, 18, 8837, 2932, 3660, 752, ...
sage: J = range(7)
sage: J = range(8)
def dwt(self,other="haar",wavelet_k=2): """ Wraps the gsl WaveletTransform.forward in dwt.pyx (written by Johua Kantor). Assumes the length of the sample is a power of 2. Uses the GSL function gsl_wavelet_transform_forward.
837c0b7c218776beb9f35f10fe4f0b231105b3a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/837c0b7c218776beb9f35f10fe4f0b231105b3a3/dft.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 302, 6046, 12, 2890, 16, 3011, 1546, 3395, 297, 3113, 24801, 808, 67, 79, 33, 22, 4672, 3536, 678, 7506, 326, 314, 2069, 678, 842, 808, 4059, 18, 11565, 316, 302, 6046, 18, 2074, 92, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 302, 6046, 12, 2890, 16, 3011, 1546, 3395, 297, 3113, 24801, 808, 67, 79, 33, 22, 4672, 3536, 678, 7506, 326, 314, 2069, 678, 842, 808, 4059, 18, 11565, 316, 302, 6046, 18, 2074, 92, ...
""" self.dirty = False
""" self.dirty = False
def parse_fstab(self,filename): """ filename path to sources.list file Parse the fstab file used for defining static information about filesystems If no value is passed to filename then /etc/fstab is used by default. This method parses the fstab file populating a dictionary with the mount points and mount options. The dictionary is returned when the parser has finished. """ self.dirty = False rx_mountpoint = re.compile('^\s*(?!#)(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*$') self.filename = filename if not filename: self.filename = '/etc/fstab' f = open(self.filename) mount_lines = f.readlines() f.close() mount_map = {} self.order = 0 dummy_key = 0 for l in mount_lines: m = rx_mountpoint.match(l) if m: mount_map[(m.groups()[:2])] = { 'sourcefs': m.groups()[0], 'mountpoint': m.groups()[1], 'fstype': m.groups()[2], 'options': m.groups()[3], 'dump': m.groups()[4], 'fsckorder': m.groups()[5], 'order': self.order, 'linetype':'mnt'} else: mount_map[dummy_key] = { 'text': l.strip(), 'order': self.order, 'linetype':'other'} dummy_key += 1 self.order += 1 return mount_map
89d1edf639fbe898a2839b722aa9fc2081b8d29a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2487/89d1edf639fbe898a2839b722aa9fc2081b8d29a/fstabhelpers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 74, 334, 378, 12, 2890, 16, 3459, 4672, 3536, 1544, 202, 803, 358, 5550, 18, 1098, 585, 225, 2884, 326, 20223, 378, 585, 1399, 364, 9364, 760, 1779, 2973, 6496, 87, 971, 1158...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 74, 334, 378, 12, 2890, 16, 3459, 4672, 3536, 1544, 202, 803, 358, 5550, 18, 1098, 585, 225, 2884, 326, 20223, 378, 585, 1399, 364, 9364, 760, 1779, 2973, 6496, 87, 971, 1158...
sage: EtaProduct(36, {6:6, 2:-6}).qexp(10)
sage: EtaProduct(36, {6:6, 2:-6}).q_expansion(10)
def qexp(self, n): r""" The q-expansion of self at the cusp at infinity. INPUT: - ``n`` (integer): number of terms to calculate OUTPUT: - a power series over `\ZZ` in the variable `q`, with a *relative* precision of `1 + O(q^n)`. ALGORITHM: Calculates eta to (n/m) terms, where m is the smallest integer dividing self.level() such that self.r(m) != 0. Then multiplies. EXAMPLES:: sage: EtaProduct(36, {6:6, 2:-6}).qexp(10) q + 6*q^3 + 27*q^5 + 92*q^7 + 279*q^9 + O(q^11) sage: R.<q> = ZZ[[]] sage: EtaProduct(2,{2:24,1:-24}).qexp(100) == delta_qexp(101)(q^2)/delta_qexp(101)(q) True """ R,q = PowerSeriesRing(ZZ, 'q').objgen() pr = R(1) if self == self.parent()(1): return pr eta_n = max([ (n/d).floor() for d in self._keys if self.r(d) != 0]) eta = qexp_eta(R, eta_n) for d in self._keys: if self.r(d) != 0: pr *= eta(q**d)**self.r(d) return pr*q**(self._sumDR / ZZ(24))*( R(1).add_bigoh(n))
1f0a985e63b3c9db13caec99340e4d04898d08a6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/1f0a985e63b3c9db13caec99340e4d04898d08a6/etaproducts.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1043, 2749, 12, 2890, 16, 290, 4672, 436, 8395, 1021, 1043, 17, 2749, 12162, 434, 365, 622, 326, 27964, 84, 622, 27272, 18, 225, 12943, 30, 282, 300, 12176, 82, 10335, 261, 7745, 4672, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1043, 2749, 12, 2890, 16, 290, 4672, 436, 8395, 1021, 1043, 17, 2749, 12162, 434, 365, 622, 326, 27964, 84, 622, 27272, 18, 225, 12943, 30, 282, 300, 12176, 82, 10335, 261, 7745, 4672, ...
"""
This method returns a list of Blast record objects. """ self.reset()
def parse(self, handler): """Parses the XML data
222c25b5ffb6f82620be0e71c5d11e486994dbfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/222c25b5ffb6f82620be0e71c5d11e486994dbfb/NCBIXML.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 2890, 16, 1838, 4672, 3536, 6656, 326, 3167, 501, 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, 1109, 12, 2890, 16, 1838, 4672, 3536, 6656, 326, 3167, 501, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
self.bodyContent.append(self.language.labels[name.lower()])
if name: self.bodyContent.append(self.language.labels[name.lower()])
def visit_admonition(self, node, name, admonitionCellAtts={}): baseAdmonitionCellAtts = {"width" : "15%"} baseAdmonitionCellAtts.update(admonitionCellAtts) self.bodyContent.append('<table width="90%" border="1" align="center">\n' '<tbody><tr><td><table width="100%"><tbody><tr>\n') self.bodyContent.append(self.starttag(node, 'td', **baseAdmonitionCellAtts)) self.bodyContent.append(self.language.labels[name.lower()]) self.bodyContent.append('</td><td>')
51d559af3f14e908f4c13821936788419a581c33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/51d559af3f14e908f4c13821936788419a581c33/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 67, 361, 2586, 608, 12, 2890, 16, 756, 16, 508, 16, 1261, 2586, 608, 4020, 3075, 87, 12938, 4672, 1026, 1871, 2586, 608, 4020, 3075, 87, 273, 12528, 2819, 6, 294, 315, 3600, 1640...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 67, 361, 2586, 608, 12, 2890, 16, 756, 16, 508, 16, 1261, 2586, 608, 4020, 3075, 87, 12938, 4672, 1026, 1871, 2586, 608, 4020, 3075, 87, 273, 12528, 2819, 6, 294, 315, 3600, 1640...
if mlen == 0 and tmsg.lower().startswith('project-id-version:'):
if mlen == 0:
def _parse(self, fp): """Override this method to support alternative .mo formats.""" unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endian 32 # bit words. self._catalog = catalog = {} self.plural = lambda n: int(n != 1) # germanic plural by default buf = fp.read() buflen = len(buf) # Are we big endian or little endian? magic = unpack('<I', buf[:4])[0] if magic == self.LE_MAGIC: version, msgcount, masteridx, transidx = unpack('<4I', buf[4:20]) ii = '<II' elif magic == self.BE_MAGIC: version, msgcount, masteridx, transidx = unpack('>4I', buf[4:20]) ii = '>II' else: raise IOError(0, 'Bad magic number', filename) # Now put all messages from the .mo file buffer into the catalog # dictionary. for i in xrange(0, msgcount): mlen, moff = unpack(ii, buf[masteridx:masteridx+8]) mend = moff + mlen tlen, toff = unpack(ii, buf[transidx:transidx+8]) tend = toff + tlen if mend < buflen and tend < buflen: msg = buf[moff:mend] tmsg = buf[toff:tend] if msg.find('\x00') >= 0: # Plural forms msgid1, msgid2 = msg.split('\x00') tmsg = tmsg.split('\x00') if self._coerce: msgid1 = unicode(msgid1, self._charset) tmsg = [unicode(x, self._charset) for x in tmsg] for i in range(len(tmsg)): catalog[(msgid1, i)] = tmsg[i] else: if self._coerce: msg = unicode(msg, self._charset) tmsg = unicode(tmsg, self._charset) catalog[msg] = tmsg else: raise IOError(0, 'File is corrupt', filename) # See if we're looking at GNU .mo conventions for metadata if mlen == 0 and tmsg.lower().startswith('project-id-version:'): # Catalog description for item in tmsg.splitlines(): item = item.strip() if not item: continue k, v = item.split(':', 1) k = k.strip().lower() v = v.strip() self._info[k] = v if k == 'content-type': self._charset = v.split('charset=')[1] elif k == 'plural-forms': v = v.split(';')
d9095dbda378bf7d6cc74c3872b467dab7e5a960 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d9095dbda378bf7d6cc74c3872b467dab7e5a960/gettext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 12, 2890, 16, 4253, 4672, 3536, 6618, 333, 707, 358, 2865, 10355, 263, 8683, 6449, 12123, 6167, 273, 1958, 18, 17309, 1544, 273, 3869, 12, 7944, 16, 296, 529, 2187, 28707, 468...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 12, 2890, 16, 4253, 4672, 3536, 6618, 333, 707, 358, 2865, 10355, 263, 8683, 6449, 12123, 6167, 273, 1958, 18, 17309, 1544, 273, 3869, 12, 7944, 16, 296, 529, 2187, 28707, 468...
self.connections[connum].SetPortUp(portnum, connected)
self.connections[connum].SetPortUp(portnum, err == 0)
def conn_change_cb(self, domain, err, connum, portnum, connected): if (err): self.ui.new_log("Connection error for " + self.name + ": " + OpenIPMI.get_error_string(err)) pass if (not self.first_conn): self.first_conn = True self.ipmb_rescan_time = domain.get_ipmb_rescan_time() self.sel_rescan_time = domain.get_sel_rescan_time() domain.iterate_connections(self) pass if (connum not in self.connections): self.ui.new_log("Got connection for invalid connection number") return self.connections[connum].SetPortUp(portnum, connected) any_con_up = False for c in self.connections.itervalues(): any_con_up = c.IsUp() or any_con_up pass if (any_con_up): if (not self.any_con_up): self.ui.decr_item_critical(self.treeroot) pass pass else: if (self.any_con_up): self.ui.incr_item_critical(self.treeroot) pass pass self.any_con_up = any_con_up return
1adcc36f44c9460920ad4e020a9aeb016f78c39a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3867/1adcc36f44c9460920ad4e020a9aeb016f78c39a/_domain.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1487, 67, 3427, 67, 7358, 12, 2890, 16, 2461, 16, 393, 16, 1487, 379, 16, 1756, 2107, 16, 5840, 4672, 309, 261, 370, 4672, 365, 18, 4881, 18, 2704, 67, 1330, 2932, 1952, 555, 364, 31...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1487, 67, 3427, 67, 7358, 12, 2890, 16, 2461, 16, 393, 16, 1487, 379, 16, 1756, 2107, 16, 5840, 4672, 309, 261, 370, 4672, 365, 18, 4881, 18, 2704, 67, 1330, 2932, 1952, 555, 364, 31...
sage: C.cliques_containing_node(cliques=E)
sage: C.cliques_containing_vertex(cliques=E)
def cliques_containing_node(self, nodes=None, cliques=None, with_labels=False): """ Returns the cliques containing each node, represented as a list of lists. (Returns a single list if only one input node). Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. (See examples below). INPUT: -- nodes - the nodes to inspect (default is entire graph) -- with_labels - (boolean) default False returns list as above True returns a dictionary keyed by node labels -- cliques - list of cliques (if already computed) EXAMPLES: sage: C = Graph('DJ{') sage: C.cliques_containing_node() [[[4, 0]], [[4, 1, 2, 3]], [[4, 1, 2, 3]], [[4, 1, 2, 3]], [[4, 1, 2, 3], [4, 0]]] sage: E = C.cliques() sage: E [[4, 1, 2, 3], [4, 0]] sage: C.cliques_containing_node(cliques=E) [[[4, 0]], [[4, 1, 2, 3]], [[4, 1, 2, 3]], [[4, 1, 2, 3]], [[4, 1, 2, 3], [4, 0]]] sage: F = graphs.Grid2dGraph(2,3) sage: F.cliques_containing_node(with_labels=True) {(0, 1): [[(0, 1), (0, 0)], [(0, 1), (0, 2)], [(0, 1), (1, 1)]], (1, 2): [[(1, 2), (0, 2)], [(1, 2), (1, 1)]], (0, 0): [[(0, 1), (0, 0)], [(1, 0), (0, 0)]], (1, 1): [[(0, 1), (1, 1)], [(1, 2), (1, 1)], [(1, 0), (1, 1)]], (1, 0): [[(1, 0), (0, 0)], [(1, 0), (1, 1)]], (0, 2): [[(0, 1), (0, 2)], [(1, 2), (0, 2)]]} sage: F.cliques_containing_node(nodes=[(0, 1), (1, 2)]) [[[(0, 1), (0, 0)], [(0, 1), (0, 2)], [(0, 1), (1, 1)]], [[(1, 2), (0, 2)], [(1, 2), (1, 1)]]] sage: D = DiGraph({0:[1,2,3], 1:[2], 3:[0,1]}) sage.: D.show(figsize=[2,2]) sage: D.cliques_containing_node() Traceback (most recent call last): ... TypeError: Function defined for undirected graphs only. See documentation. sage: D = D.to_undirected() sage.: D.show(figsize=[2,2]) sage: D.cliques_containing_node() [[[0, 1, 2], [0, 1, 3]], [[0, 1, 2], [0, 1, 3]], [[0, 1, 2]], [[0, 1, 3]]] """ if (self.is_directed()): raise TypeError('Function defined for undirected graphs only. See documentation.') else: import networkx.cliques return networkx.cliques.cliques_containing_node(self._nxg, nodes, cliques, with_labels)
e18c70bce8ce7ee3fa2314ee3c87879177e3b7a1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/e18c70bce8ce7ee3fa2314ee3c87879177e3b7a1/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4942, 29896, 67, 1213, 3280, 67, 2159, 12, 2890, 16, 2199, 33, 7036, 16, 4942, 29896, 33, 7036, 16, 598, 67, 5336, 33, 8381, 4672, 3536, 2860, 326, 4942, 29896, 4191, 1517, 756, 16, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4942, 29896, 67, 1213, 3280, 67, 2159, 12, 2890, 16, 2199, 33, 7036, 16, 4942, 29896, 33, 7036, 16, 598, 67, 5336, 33, 8381, 4672, 3536, 2860, 326, 4942, 29896, 4191, 1517, 756, 16, 10...
return any((key in model.get_value(iter, column).lower()) for column in self.SEARCH_COLUMNS)
return any((key in (model.get_value(iter, column) or '').lower()) for column in self.SEARCH_COLUMNS)
def _filter_visible_func(self, model, iter): # If searching is active, set visibility based on search text if self._search_term is not None: key = self._search_term.lower() return any((key in model.get_value(iter, column).lower()) for column in self.SEARCH_COLUMNS)
fe87c0f89e914a5ad2fb56174c6045a933c4228b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12778/fe87c0f89e914a5ad2fb56174c6045a933c4228b/model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2188, 67, 8613, 67, 644, 12, 2890, 16, 938, 16, 1400, 4672, 468, 971, 15300, 353, 2695, 16, 444, 9478, 2511, 603, 1623, 977, 309, 365, 6315, 3072, 67, 6408, 353, 486, 599, 30, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2188, 67, 8613, 67, 644, 12, 2890, 16, 938, 16, 1400, 4672, 468, 971, 15300, 353, 2695, 16, 444, 9478, 2511, 603, 1623, 977, 309, 365, 6315, 3072, 67, 6408, 353, 486, 599, 30, 4...
impl_func = func.GetInfo('impl_func') if impl_func == None or impl_func == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" typedef %s::Result Result;\n" % func.original_name) file.Write(" Result* result = GetResultAs<Result*>();\n") file.Write(" *result = 0;\n") arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sresult_shm_id(), result_shm_offset());\n" % (func.name, arg_string, comma)) file.Write(" WaitForCmd();\n") file.Write(" return *result;\n") file.Write("}\n") file.Write("\n") else: self.WriteGLES2ImplementationDeclaration(func, file)
file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sresult_shm_id(), result_shm_offset());\n" % (func.name, arg_string, comma)) file.Write(" WaitForCmd();\n") file.Write(" return GetResultAs<%s>();\n" % func.return_type) file.Write("}\n") file.Write("\n")
def WriteGLES2ImplementationHeader(self, func, file): """Overrriden from TypeHandler.""" impl_func = func.GetInfo('impl_func') if impl_func == None or impl_func == True: file.Write("%s %s(%s) {\n" % (func.return_type, func.original_name, func.MakeTypedOriginalArgString(""))) file.Write(" typedef %s::Result Result;\n" % func.original_name) file.Write(" Result* result = GetResultAs<Result*>();\n") file.Write(" *result = 0;\n") arg_string = func.MakeOriginalArgString("") comma = "" if len(arg_string) > 0: comma = ", " file.Write(" helper_->%s(%s%sresult_shm_id(), result_shm_offset());\n" % (func.name, arg_string, comma)) file.Write(" WaitForCmd();\n") file.Write(" return *result;\n") file.Write("}\n") file.Write("\n") else: self.WriteGLES2ImplementationDeclaration(func, file)
85c6d6739a81098c35cb35c3430f038ed4f5ddab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/85c6d6739a81098c35cb35c3430f038ed4f5ddab/build_gles2_cmd_buffer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 43, 11386, 22, 13621, 1864, 12, 2890, 16, 1326, 16, 585, 4672, 3536, 22042, 1691, 275, 628, 1412, 1503, 12123, 9380, 67, 644, 273, 1326, 18, 967, 966, 2668, 11299, 67, 644, 6134, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 43, 11386, 22, 13621, 1864, 12, 2890, 16, 1326, 16, 585, 4672, 3536, 22042, 1691, 275, 628, 1412, 1503, 12123, 9380, 67, 644, 273, 1326, 18, 967, 966, 2668, 11299, 67, 644, 6134, ...
height = 400; width = 400;
height = 360; width = 360;
def drawGraph(request, xStart=-180.0, yStart=-180.0, xEnd=180.0, yEnd=180.0, attribute='Observations', xProperty='phi', yProperty='psi', reference=None, residue=None, xBin=10, yBin=10): svg = SVG() x = 55; y = 45; height = 400; width = 400; hashsize = 10 #background svg.rect(x, y, width, height, 1, '#00fffff', '#222222'); #svg.rect(0, 0, width+90, height+90, 1, '#00fffff'); #svg.rect(x, y, width, height, 1, '#666666'); #border svg.rect(x, y, width, height, 1, '#000000'); #axis if xStart < 0 and xEnd > 0: xZero = (width/(xEnd-xStart)) * abs (xStart) svg.line( x+xZero, y, x+xZero, y+height, 1, '#666666'); if yStart < 0 and xEnd > 0: yZero = height+y - (height/(yEnd-yStart)) * abs (yStart) svg.line( x, yZero, x+width, yZero, 1, '#666666'); #hashes for i in range(9): hashx = x+(width/8.0)*i hashy = y+(height/8.0)*i svg.line( hashx, y+height, hashx, y+height+hashsize, 1, '#000000'); svg.line( x, hashy, x-hashsize, hashy, 1, '#000000'); #labels xstep = (xEnd - xStart) / 4 ystep = (yEnd - yStart) / 4 for i in range(5): xtext = xStart + xstep*i xhash = x+(width/4)*i-(2.5*len(str(xtext))) svg.text(xhash, y+height+hashsize*2+3, str(xtext),12) ytext = yEnd - ystep*i yhash = y+(height/4)*i+4 svg.text(x-5-(8*len(str(ytext))), yhash, str(ytext),12) #title text len1 = 220 - len(xProperty)*7/2 - len(xProperty)*7/2 len2 = 182 - len(attribute)*7/2 svg.text(len1,15, 'Plot of %s vs. %s' % (xProperty,yProperty), 12) svg.text(len2,35, 'Shading Based Off of %s' % attribute, 12) cdp = ConfDistPlot( 400, #height 400, #width 0, #Xpadding 0, #Ypadding x, #Xoffset y, #Yoffset xStart, #Xstart xEnd, #Xend yStart, #Ystart yEnd, #Yend xBin, #Xbin yBin, #Ybin xProperty, #X property yProperty, #Y property attribute, #property residue, #residue Index #reference request.session['search'].querySet() ) boxes = cdp.Plot() return (svg,boxes)
29369efcb698022e11c3c1503b781a33276d2219 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6163/29369efcb698022e11c3c1503b781a33276d2219/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 4137, 12, 2293, 16, 619, 1685, 29711, 18278, 18, 20, 16, 677, 1685, 29711, 18278, 18, 20, 16, 619, 1638, 33, 18278, 18, 20, 16, 677, 1638, 33, 18278, 18, 20, 16, 1566, 2218, 26...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 4137, 12, 2293, 16, 619, 1685, 29711, 18278, 18, 20, 16, 677, 1685, 29711, 18278, 18, 20, 16, 619, 1638, 33, 18278, 18, 20, 16, 677, 1638, 33, 18278, 18, 20, 16, 1566, 2218, 26...
if (ProxyUtil.findHTTPSProxy()): DebugPrint(0, 'WARNING: http_proxy is set but not supported when UseSoapProtocol is set to 1') __connection = httplib.HTTPSConnection(Config.get_SSLHost(), cert_file = pr_cert_file, key_file = pr_key_file)
if (ProxyUtil.findHTTPSProxy()): DebugPrint(0, 'WARNING: http_proxy is set but not supported when UseSoapProtocol is set to 1') __connection = httplib.HTTPSConnection(Config.get_SSLHost(), cert_file = pr_cert_file, key_file = pr_key_file)
def __connect(): global __connection global __connected global __connectionError global __certificateRejected global __connectionRetries global __retryDelay global __last_retry_time #__connectionError = True #return __connected if __connectionError: __disconnect() __connectionError = False if __connectionRetries > MaxConnectionRetries: current_time = time.time() if not __last_retry_time: # Set time but do not reset failures __last_retry_time = current_time return __connected; if (current_time - __last_retry_time) > __retryDelay: __last_retry_time = current_time DebugPrint(1, "Retry connection after ", __retryDelay, "s") __retryDelay = __retryDelay * __backoff_factor if __retryDelay > __maximumDelay: __retryDelay = __maximumDelay __connectionRetries = 0 __connectionRetries = __connectionRetries + 1 if (not __connected) and (__connectionRetries <= MaxConnectionRetries): if Config.get_UseSSL() == 0 and Config.get_UseSoapProtocol() == 1: if (ProxyUtil.findHTTPProxy()): DebugPrint(0, 'WARNING: http_proxy is set but not supported') __connection = httplib.HTTP(Config.get_SOAPHost()) DebugPrint(1, 'Connected via HTTP to: ' + Config.get_SOAPHost()) #print "Using SOAP protocol" elif Config.get_UseSSL() == 0 and Config.get_UseSoapProtocol() == 0: try: if (ProxyUtil.findHTTPProxy()): DebugPrint(0, 'WARNING: http_proxy is set but not supported') #__connection = ProxyUtil.HTTPConnection(Config.get_SOAPHost(), # http_proxy = ProxyUtil.findHTTPProxy()) __connection = httplib.HTTPConnection(Config.get_SOAPHost()) except Exception, e: DebugPrint(0, "ERROR: could not initialize HTTP connection") DebugPrintTraceback() __connectionError = True return __connected try: DebugPrint(4, "DEBUG: Connect") __connection.connect() DebugPrint(4, "DEBUG: Connect: OK") except Exception, e: DebugPrint(4, "DEBUG: Connect: FAILED") DebugPrint(0, "Error: While trying to connect to HTTP, caught exception " + str(e)) DebugPrintTraceback() __connectionError = True return __connected DebugPrint(1,"Connection via HTTP to: " + Config.get_SOAPHost()) #print "Using POST protocol" else: # assert(Config.get_UseSSL() == 1) if Config.get_UseGratiaCertificates() == 0: pr_cert_file = Config.get_CertificateFile() pr_key_file = Config.get_KeyFile() else: pr_cert_file = Config.get_GratiaCertificateFile() pr_key_file = Config.get_GratiaKeyFile() if (pr_cert_file == None): DebugPrint(0, "Error: While trying to connect to HTTPS, no valid local certificate.") __connectionError = True return __connected DebugPrint(4, "DEBUG: Attempting to connect to HTTPS") try: if (ProxyUtil.findHTTPSProxy()): DebugPrint(0, 'WARNING: http_proxy is set but not supported when UseSoapProtocol is set to 1') #__connection = ProxyUtil.HTTPSConnection(Config.get_SSLHost(), # cert_file = pr_cert_file, # key_file = pr_key_file, # http_proxy = ProxyUtil.findHTTPSProxy()) __connection = httplib.HTTPSConnection(Config.get_SSLHost(), cert_file = pr_cert_file, key_file = pr_key_file) except Exception, e: DebugPrint(0, "ERROR: could not initialize HTTPS connection") DebugPrintTraceback() __connectionError = True return __connected try: DebugPrint(4, "DEBUG: Connect") __connection.connect() DebugPrint(4, "DEBUG: Connect: OK") except Exception, e: DebugPrint(4, "DEBUG: Connect: FAILED") DebugPrint(0, "Error: While trying to connect to HTTPS, caught exception " + str(e)) DebugPrintTraceback() __connectionError = True return __connected DebugPrint(1, "Connected via HTTPS to: " + Config.get_SSLHost()) #print "Using SSL protocol" # Successful DebugPrint(4, "DEBUG: Connection SUCCESS") __connected = True # Reset connection retry count to 0 and the retry delay to its initial value __connectionRetries = 0 __retryDelay = __initialDelay return __connected
637869f92a8322c20ea53836dc7393fc485f077a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/637/637869f92a8322c20ea53836dc7393fc485f077a/Gratia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 3612, 13332, 2552, 1001, 4071, 2552, 1001, 8537, 2552, 1001, 4071, 668, 2552, 1001, 14108, 19902, 2552, 1001, 4071, 13656, 2552, 1001, 9620, 6763, 2552, 1001, 2722, 67, 9620, 67, 957, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3612, 13332, 2552, 1001, 4071, 2552, 1001, 8537, 2552, 1001, 4071, 668, 2552, 1001, 14108, 19902, 2552, 1001, 4071, 13656, 2552, 1001, 9620, 6763, 2552, 1001, 2722, 67, 9620, 67, 957, ...
op1.int.reverse() op2.int.reverse()
def __add__(self, other, context=None): """Returns self + other.
636a6b100fe6083388bc5315758326078abe65b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/636a6b100fe6083388bc5315758326078abe65b4/decimal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1289, 972, 12, 2890, 16, 1308, 16, 819, 33, 7036, 4672, 3536, 1356, 365, 397, 1308, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1289, 972, 12, 2890, 16, 1308, 16, 819, 33, 7036, 4672, 3536, 1356, 365, 397, 1308, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
n_mat=int(v1[1])
n_mat=int(v1[1].rstrip(";"))
def load_msh(filename,orbiterpath,convert_coords): '''Read MSH file''' print("filepath=",filename,"orbiterpath=",orbiterpath) file=open(filename,"r") s=file.readline(); if s!='MSHX1\n': print("This file is not orbiter mesh: ",s) return else: print("Orbiter mesh format detected ") n_groups=0 #N of groups from header n_materials=0 #N of mats from header n_textures=0 #N of texs from header n_grp=0 #real N of groups mat=[] #mats in group (int) tex=[] #texs in group (int) groups=[] #groups description [label(str),mat(int),tex(int),nv(int),nt(int),obj(bpy.data.object)] materials=[] #materials description [name,[diff RGBA],[amb RGBA],[spec RGBAP],[emit RGBA]] textures=[] #[texture filename, texture name] while True: s=file.readline() if s=='': break; v=s.split() #print (v) #------Reading GROUPS section------------- if v[0]=="GROUPS": print("Reading groups:") n_groups=int(v[1]); n_mat=0; n_tex=0 #group material and texture label="" while n_grp<n_groups: s1=file.readline(); v1=s1.split() #if v1[0]=="NONORMAL": # print("NONORMAL!") if v1[0]=="LABEL": label=v1[1] if v1[0]=="MATERIAL": n_mat=int(v1[1]) #1..n if v1[0]=="TEXTURE": n_tex=int(v1[1]) #1..n #Reading geometry if v1[0]=="GEOM": vtx=[] tri=[] norm=[] uv=[] nv=int(v1[1]) nt=int(v1[2]) #print ("Group No:",n_grp," verts=",nv," tris=",nt) for n in range(nv): s2=file.readline(); v2=s2.split(); #print(v2); if convert_coords: vtx.append([-float(v2[0]),-float(v2[2]),float(v2[1])])# convert from left-handed coord system else: vtx.append([float(v2[0]),float(v2[1]),float(v2[2])]) #without conversion if len(v2)>5: #there are normals (not vtx+uvs only) #should I convert the normals? norm.append([float(v2[3]),float(v2[4]),float(v2[5])]) if len(v2)==8: #there are normals and uvs if convert_coords: #in Blender, (0,0) is the upper-left corner. #in Orbiter -- lower-left corner. So I must invert V axis uv.append([float(v2[6]),1.0-float(v2[7])]) else: uv.append([float(v2[6]),float(v2[7])]) elif len(v2)==5: #there are only uvs if convert_coords: uv.append([float(v2[3]),1.0-float(v2[4])]) else: uv.append([float(v2[3]),float(v2[4])]) for n in range(nt): #read triangles s2=file.readline(); v2=s2.split(); if convert_coords: tri.append([int(v2[0]),int(v2[2]),int(v2[1])]) #reverted triangle else: tri.append([int(v2[0]),int(v2[1]),int(v2[2])]) #non reverted triangle #print (vtx) #print(norm) n_grp=n_grp+1; if label=='': label="ORBGroup"+str(n_grp) obj=create_mesh(label,vtx,tri,norm,uv) if n_mat!=0: mat.append(n_mat) if n_tex!=0: tex.append(n_tex) groups.append([label,n_mat,n_tex,nv,nt,obj]) label="" #--------------Reading MATERIALS section----------------------- elif v[0]=="MATERIALS": n_materials=int(v[1]) print("-------Reading Materials section,nmats=",n_materials,"------------") #material names for i in range (n_materials): materials.append([file.readline().strip()]) #material properties for i in range (n_materials): file.readline(); # TODO: name checking for n in range(4): s1=file.readline() v1=s1.split() print("Reading material component,n=",n," comp=",v1) if (n==2)and(len(v1)==5): #Specular,5 components materials[i].append([float(v1[0]),float(v1[1]),float(v1[2]),float(v1[3]),float(v1[4])]) else: #Other, 4 components materials[i].append([float(v1[0]),float(v1[1]),float(v1[2]),float(v1[3])]) #---------------Reading TEXTURES section------------------ elif v[0]=="TEXTURES": n_textures=int(v[1]); for i in range(n_textures): textures.append([file.readline().strip(),"ORBTexture"+str(i)]) print(""); print("==========================Summary===========================================") print("Headers: groups=",n_groups," materials=",n_materials," textures=",n_textures) print("\nData:\nGroups:") print(groups,"\nReal No=",len(groups)) print("Materials:",materials) print("Textures:",textures) print("Materials in groups:",mat) print("Textures in groups:",tex) #file file.close() create_materials(groups,materials,textures,orbiterpath) return{"FINISHED"}
a742957b6ee3c17a1d5ddaf38dbe115cb0e00154 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10993/a742957b6ee3c17a1d5ddaf38dbe115cb0e00154/io_import_msh.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 81, 674, 12, 3459, 16, 16640, 2165, 803, 16, 6283, 67, 9076, 4672, 9163, 1994, 490, 2664, 585, 26418, 1172, 2932, 10561, 1546, 16, 3459, 10837, 16640, 2165, 803, 1546, 16, 1664...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 81, 674, 12, 3459, 16, 16640, 2165, 803, 16, 6283, 67, 9076, 4672, 9163, 1994, 490, 2664, 585, 26418, 1172, 2932, 10561, 1546, 16, 3459, 10837, 16640, 2165, 803, 1546, 16, 1664...
t_movies[field] = letters_only( item[ int(self.import_table[field]) ] )
t_movies[field] = letters_only(item[int(self.import_table[field])])
def get_movie_details(self): try: item = self.data.next() except: return None if item is None: return None import copy # start with the right line self.current_csv_row += 1 if self.current_csv_row < self.start_row: return None # assign the keys t_movies = copy.deepcopy(self.import_table)
8dd23db0ad40a315c4c2431088bf2a98189408a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2687/8dd23db0ad40a315c4c2431088bf2a98189408a8/CSV.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 8683, 13120, 67, 6395, 12, 2890, 4672, 775, 30, 761, 273, 365, 18, 892, 18, 4285, 1435, 1335, 30, 327, 599, 309, 761, 353, 599, 30, 327, 599, 1930, 1610, 468, 787, 598, 326,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8683, 13120, 67, 6395, 12, 2890, 4672, 775, 30, 761, 273, 365, 18, 892, 18, 4285, 1435, 1335, 30, 327, 599, 309, 761, 353, 599, 30, 327, 599, 1930, 1610, 468, 787, 598, 326,...
self.settingstable.attach(self.sliderdict[property.name], 1, 2, count, count+1)
self.settingstable.attach(self.sliderdict[property.name], 1, 2, count, count+1, gtk.FILL|gtk.EXPAND)
def OnEffectSetting(self, button): """ Show a dialog filled with settings sliders for a specific effect """ # TODO: Make this modal or as part of the effects window"""
298ee9df5d7e5e17445283747f69502114e8e577 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10033/298ee9df5d7e5e17445283747f69502114e8e577/InstrumentEffectsDialog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 12477, 5568, 12, 2890, 16, 3568, 4672, 3536, 9674, 279, 6176, 6300, 598, 1947, 2020, 24290, 364, 279, 2923, 5426, 3536, 225, 468, 2660, 30, 4344, 333, 13010, 578, 487, 1087, 434, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 12477, 5568, 12, 2890, 16, 3568, 4672, 3536, 9674, 279, 6176, 6300, 598, 1947, 2020, 24290, 364, 279, 2923, 5426, 3536, 225, 468, 2660, 30, 4344, 333, 13010, 578, 487, 1087, 434, 3...
all: examples.xml index.html
rebuild: examples.xml index.html
def dump_Makefile(): for file in glob.glob('*.xml'): extras.append(file) for file in glob.glob('*.out'): extras.append(file) Makefile="""# Beware this is autogenerated by index.py
f2a1283564df8ded1942b231c60c3a7ae4ff748a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12659/f2a1283564df8ded1942b231c60c3a7ae4ff748a/index.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 67, 6464, 768, 13332, 364, 585, 316, 4715, 18, 10581, 2668, 11146, 2902, 11, 4672, 11875, 18, 6923, 12, 768, 13, 364, 585, 316, 4715, 18, 10581, 2668, 11146, 659, 11, 4672, 11875, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4657, 67, 6464, 768, 13332, 364, 585, 316, 4715, 18, 10581, 2668, 11146, 2902, 11, 4672, 11875, 18, 6923, 12, 768, 13, 364, 585, 316, 4715, 18, 10581, 2668, 11146, 659, 11, 4672, 11875, ...
if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue'
print "Using Bugzilla v%s schema." % BZ_VERSION if BZ_VERSION == 2110: activityFields['removed'] = "oldvalue" activityFields['added'] = "newvalue"
def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "Bugzilla MySQL('%s':'%s':'%s':'%s'): connecting..." % (_db, _host, _user, _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 "cleaning 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""") os.system('rm -rf %s' % trac.env.get_attachments_dir()) os.mkdir(trac.env.get_attachments_dir()) trac.db().commit() print print "1. import severities..." severities = (('blocker', '1'), ('critical', '2'), ('major', '3'), ('normal', '4'), ('minor', '5'), ('trivial', '6'), ('enhancement', '7')) trac.setSeverityList(severities) print print "2. import components..." sql = "SELECT value, initialowner AS owner FROM components" if PRODUCTS: sql += " WHERE %s" % productFilter('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, 'value') print print "3. import priorities..." priorities = (('P1', '1'), ('P2', '2'), ('P3', '3'), ('P4', '4'), ('P5', '5')) trac.setPriorityList(priorities) print print "4. import versions..." sql = "SELECT DISTINCTROW value FROM versions" if PRODUCTS: sql += " WHERE %s" % productFilter('program', PRODUCTS) mysql_cur.execute(sql) versions = mysql_cur.fetchall() trac.setVersionList(versions, 'value') print print "5. import milestones..." mysql_cur.execute("SELECT value FROM milestones") milestones = mysql_cur.fetchall() if milestones[0] == '---': trac.setMilestoneList(milestones, 'value') else: trac.setMilestoneList([], '') print print '6. retrieving bugs...' sql = "SELECT * FROM bugs " if PRODUCTS: sql += " WHERE %s" % productFilter('product', PRODUCTS) sql += " ORDER BY bug_id" mysql_cur.execute(sql) bugs = mysql_cur.fetchall() print print "7. 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'] ticket['component'] = bug['component'] ticket['severity'] = bug['bug_severity'] ticket['priority'] = bug['priority'] 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'])) ticket['cc'] = string.join(cc_list, ', ') ticket['version'] = bug['version'] if bug['target_milestone'] == '---': ticket['milestone'] = '' else: ticket['milestone'] = bug['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'] keywords = string.split(bug['keywords'], ' ') 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 = [] 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() keywordChange = False oldKeywords = string.join(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: kw = STATUS_KEYWORDS[removed] if kw in keywords: keywords.remove(kw) else: oldKeywords = string.join(keywords + [ kw ], " ") keywordChange = True if added in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[added] keywords.append(kw) keywordChange = True added = statusXlator[added] removed = statusXlator[removed] elif field_name == 'short_desc': field_name = 'summary' elif field_name == 'product': if removed in PRODUCT_KEYWORDS: kw = PRODUCT_KEYWORDS[removed] if kw in keywords: keywords.remove(kw) else: oldKeywords = string.join(keywords + [ kw ], " ") keywordChange = True if added in PRODUCT_KEYWORDS: kw = PRODUCT_KEYWORDS[added] keywords.append(kw) keywordChange = True 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 keywordChange: newKeywords = string.join(keywords, " ") ticketChangeKw = ticketChange ticketChangeKw['field'] = 'keywords' ticketChangeKw['oldvalue'] = oldKeywords ticketChangeKw['newvalue'] = newKeywords #trac.addTicketChange(ticket=bugid, time=activity['bug_when'], # author=trac.getLoginName(mysql_cur, activity['who']), # field='keywords', oldvalue=oldKeywords, newvalue=newKeywords) 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 else: #trac.addTicketChange(ticket=bugid, time=activity['bug_when'], # author=trac.getLoginName(mysql_cur, activity['who']), # field=field_name, oldvalue=removed, newvalue=added) 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 if bug['bug_status'] in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[bug['bug_status']] # may have already been added during activity import if kw not in keywords: keywords.append(kw) if bug['product'] in PRODUCT_KEYWORDS: kw = PRODUCT_KEYWORDS[bug['product']] # may have already been added during activity import if kw not in keywords: keywords.append(kw) 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']) tracAttachment = Attachment(a['filename'], a['thedata']) trac.addAttachment(bugid, tracAttachment, a['description'], author) ticket['keywords'] = string.join(keywords) ticketid = trac.addTicket(**ticket) print "Success!"
d0a718cdc641402f4871e728629c7ce1e81b3158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/d0a718cdc641402f4871e728629c7ce1e81b3158/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...
def __init__( self, hmmName, hmmdb, verbose=1, **kw ):
def __init__( self, hmmName, hmmdb, **kw ):
def __init__( self, hmmName, hmmdb, verbose=1, **kw ): """ @param hmmName: hmm profile name @type hmmName: str @param hmmdb: Pfam hmm database @type hmmdb: str """ self.hmmName = hmmName
532a977b37e0744945827ba27e3f206f4854f2fc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/482/532a977b37e0744945827ba27e3f206f4854f2fc/Hmmer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 365, 16, 366, 7020, 461, 16, 16349, 27574, 16, 2826, 9987, 262, 30, 3536, 632, 891, 366, 7020, 461, 30, 366, 7020, 3042, 508, 632, 723, 225, 366, 7020, 461, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 365, 16, 366, 7020, 461, 16, 16349, 27574, 16, 2826, 9987, 262, 30, 3536, 632, 891, 366, 7020, 461, 30, 366, 7020, 3042, 508, 632, 723, 225, 366, 7020, 461, 30, ...
self.root = None
self.root = self.prefix = None
def initialize_options(self): self.zip_ok = None self.install_dir = self.script_dir = self.exclude_scripts = None self.index_url = None self.find_links = None self.build_directory = None self.args = None self.optimize = self.record = None self.upgrade = self.always_copy = self.multi_version = None self.editable = self.no_deps = self.allow_hosts = None self.root = None
7057a529d083522066a6d8706e669627ec11bcf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8186/7057a529d083522066a6d8706e669627ec11bcf9/easy_install.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 67, 2116, 12, 2890, 4672, 365, 18, 4450, 67, 601, 273, 599, 365, 18, 5425, 67, 1214, 273, 365, 18, 4263, 67, 1214, 273, 365, 18, 10157, 67, 12827, 273, 599, 365, 18, 1615, 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, 4046, 67, 2116, 12, 2890, 4672, 365, 18, 4450, 67, 601, 273, 599, 365, 18, 5425, 67, 1214, 273, 365, 18, 4263, 67, 1214, 273, 365, 18, 10157, 67, 12827, 273, 599, 365, 18, 1615, 67, ...
self.runApiData(classList) elif trigger == "copy-resources": self.runResources(classList)
self.runApiData(classListProducer)
def printVariantInfo(variantSetNum, variants, variantSets, variantData): if len(variantSets) < 2: # only log when more than 1 set return variantStr = simplejson.dumps(variants,ensure_ascii=False) self._console.head("Processing variant set %s/%s" % (variantSetNum+1, len(variantSets)))
68e5b9fa3d83b95f5606b31661a65c2f8fae1008 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/68e5b9fa3d83b95f5606b31661a65c2f8fae1008/Generator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 9356, 966, 12, 8688, 694, 2578, 16, 12935, 16, 5437, 2785, 16, 5437, 751, 4672, 309, 562, 12, 8688, 2785, 13, 411, 576, 30, 225, 468, 1338, 613, 1347, 1898, 2353, 404, 444, 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, 1172, 9356, 966, 12, 8688, 694, 2578, 16, 12935, 16, 5437, 2785, 16, 5437, 751, 4672, 309, 562, 12, 8688, 2785, 13, 411, 576, 30, 225, 468, 1338, 613, 1347, 1898, 2353, 404, 444, 327, ...
for file in files: if os.path.exists(file): yield file
for filename in files: if os.path.exists(filename): yield filename
def list_files(self): files = [] # browser cache if self.options["cache"][1]: dirs = glob.glob(os.path.expanduser("~/.gnome2/epiphany/mozilla/epiphany/Cache/")) dirs += glob.glob(os.path.expanduser("~/.gnome2/epiphany/favicon_cache/")) for dirname in dirs: for filename in FileUtilities.children_in_directory(dirname, False): yield filename files += [ os.path.expanduser("~/.gnome2/epiphany/ephy-favicon-cache.xml") ]
737a941d1a6026b292895c42a857f9ec0bf05cea /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7853/737a941d1a6026b292895c42a857f9ec0bf05cea/CleanerBackend.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 67, 2354, 12, 2890, 4672, 1390, 273, 5378, 468, 4748, 1247, 309, 365, 18, 2116, 9614, 2493, 6, 6362, 21, 14542, 7717, 273, 4715, 18, 10581, 12, 538, 18, 803, 18, 12320, 1355, 2932...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 67, 2354, 12, 2890, 4672, 1390, 273, 5378, 468, 4748, 1247, 309, 365, 18, 2116, 9614, 2493, 6, 6362, 21, 14542, 7717, 273, 4715, 18, 10581, 12, 538, 18, 803, 18, 12320, 1355, 2932...
not shown. (type=C{boolean}) - C{index_parameters}: Whether or not to include function
not shown. @type index_parameters: C{boolean} @keyword index_parameters: Whether or not to include function
def __init__(self, docmap, **kwargs): """ Construct a new HTML formatter, using the given documentation map. @param docmap: The documentation to output. @type docmap: L{DocMap} @param kwargs: Keyword arguments: - C{prj_name}: The name of the project. Defaults to none. (type=C{string}) - C{prj_url}: The target for the project hopeage link on the navigation bar. If C{prj_url} is not specified, then no hyperlink is created. (type=C{string}) - C{prj_link}: The label for the project link on the navigation bar. This link can contain arbitrary HTML code (e.g. images). By default, a label is constructed from C{prj_name}. (type=C{string}) - C{top}: The top page for the documentation. This is the default page shown main frame, when frames are enabled. C{top} can be a URL, the name of a module, the name of a class, or one of the special strings C{"trees.html"}, C{"indices.html"}, or C{"help.html"}. By default, the top-level package or module is used, if there is one; otherwise, C{"trees"} is used. (type=C{string}) - C{css}: The CSS stylesheet file. If C{css} is a file name, then the specified file's conents will be used. Otherwise, if C{css} is the name of a CSS stylesheet in L{epydoc.css}, then that stylesheet will be used. Otherwise, an error is reported. If no stylesheet is specified, then the default stylesheet is used. (type=C{string}) - C{private_css}: The CSS stylesheet file for the private API documentation. If C{css} is a file name, then the specified file's conents will be used. Otherwise, if C{css} is the name of a CSS stylesheet in L{epydoc.css}, then that stylesheet will be used. Otherwise, an error is reported. If no stylesheet is specified, then the private API documentation will use the same stylesheet as the public API documentation. (type=C{string}) - C{help}: The name of the help file. If no help file is specified, then the default help file will be used. (type=C{string}) - C{private}: Whether to create documentation for private objects. By default, private objects are documented. (type=C{boolean}) - C{frames}: Whether to create a frames-based table of contents. By default, it is produced. (type=C{boolean}) - C{show_imports}: Whether or not to display lists of imported functions and classes. By default, they are not shown. (type=C{boolean}) - C{index_parameters}: Whether or not to include function parameters in the identifier index. By default, they are not included. (type=C{boolean}) - C{variable_maxlines}: The maximum number of lines that should be displayed for the value of a variable in the variable details section. By default, 8 lines are displayed. (type=C{int}) - C{variable_linelength}: The maximum line length used for displaying the values of variables in the variable details sections. If a line is longer than this length, then it will be wrapped to the next line. The default line length is 70 characters. (type=C{int}) - C{variable_summary_linelength}: The maximum line length used for displaying the values of variables in the summary section. If a line is longer than this length, then it will be truncated. The default is 40 characters. (type=C{int}) - C{variable_tooltip_linelength}: The maximum line length used for tooltips for the values of variables. If a line is longer than this length, then it will be truncated. The default is 600 characters. (type=C{int}) - C{inheritance}: How inherited objects should be displayed. If C{inheritance='grouped'}, then inherited objects are gathered into groups; if C{inheritance='listed'}, then inherited objects are listed in a short list at the end of their group; if C{inheritance='included'}, then inherited objects are mixed in with non-inherited objects. The default is 'grouped'. (type=C{string}) """ self._docmap = docmap
dad6dd09c82d3878a78d977cc13da79d4420db2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/dad6dd09c82d3878a78d977cc13da79d4420db2b/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 997, 1458, 16, 2826, 4333, 4672, 3536, 14291, 279, 394, 3982, 4453, 16, 1450, 326, 864, 7323, 852, 18, 632, 891, 997, 1458, 30, 1021, 7323, 358, 876, 18,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 997, 1458, 16, 2826, 4333, 4672, 3536, 14291, 279, 394, 3982, 4453, 16, 1450, 326, 864, 7323, 852, 18, 632, 891, 997, 1458, 30, 1021, 7323, 358, 876, 18,...
time.sleep(1)
time.sleep(10)
def test_build_net(quiet=0, peers=24, host='localhost', pause=1): from whrandom import randrange import thread port = 2001 l = [] if not quiet: print "Building %s peer table." % peers for i in xrange(peers): a = Khashmir(host, port + i) l.append(a) thread.start_new_thread(l[0].app.run, ()) time.sleep(1) for peer in l[1:]: peer.app.run() #time.sleep(.25) print "adding contacts...." for peer in l[1:]: n = l[randrange(0, len(l))].node peer.addContact(host, n.port) n = l[randrange(0, len(l))].node peer.addContact(host, n.port) n = l[randrange(0, len(l))].node peer.addContact(host, n.port) if pause: time.sleep(.30) time.sleep(1) print "finding close nodes...." for peer in l: peer.findCloseNodes() if pause: time.sleep(.5) if pause: time.sleep(2)
8af8fd84094b75c0a37a3b17a2b63d6db2c42563 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/665/8af8fd84094b75c0a37a3b17a2b63d6db2c42563/khashmir.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 3510, 67, 2758, 12, 20380, 33, 20, 16, 10082, 33, 3247, 16, 1479, 2218, 13014, 2187, 225, 11722, 33, 21, 4672, 628, 600, 9188, 1930, 5605, 3676, 1930, 2650, 1756, 273, 4044, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 3510, 67, 2758, 12, 20380, 33, 20, 16, 10082, 33, 3247, 16, 1479, 2218, 13014, 2187, 225, 11722, 33, 21, 4672, 628, 600, 9188, 1930, 5605, 3676, 1930, 2650, 1756, 273, 4044, ...
for at in self.nAtomsType: fc += str(at) + " "
for at in asc: fc += str(at[1]) + " "
def write_poscar(self, filename="POSCAR.out", fd=None): """Writes data into a POSCAR format file""" fc = "" # Contents of the file for a in self.atomNames: fc += str(a) + " " fc += "\n" + str(self.latticeConstant) + "\n" for i in xrange(3): for j in xrange(3): fc += str(self.basisVectors[i,j]) + " " fc += "\n" for at in self.nAtomsType: fc += str(at) + " " fc += "\n" if self.selectiveDynamics: fc += "Selective dynamics\n" if self.cartesian: fc += "Cartesian\n" else: fc += "Direct\n" for i in xrange(self.nAtoms): for j in xrange(3): fc += str(self.atoms[i,j]) + " " if self.selectiveDynamics: selflags = self.selectiveFlags[i] for j in xrange(3): fc += str(selflags[j]) + " " fc += "\n" if (fd == None): f = open(filename, "w") f.write(fc) f.close() else: fd.write(fc)
d792801f668d7e55645b3e7cc387131f46376389 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14986/d792801f668d7e55645b3e7cc387131f46376389/supercell.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 917, 9815, 12, 2890, 16, 1544, 1546, 2419, 2312, 985, 18, 659, 3113, 5194, 33, 7036, 4672, 3536, 8368, 501, 1368, 279, 13803, 2312, 985, 740, 585, 8395, 8036, 273, 1408, 468, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 917, 9815, 12, 2890, 16, 1544, 1546, 2419, 2312, 985, 18, 659, 3113, 5194, 33, 7036, 4672, 3536, 8368, 501, 1368, 279, 13803, 2312, 985, 740, 585, 8395, 8036, 273, 1408, 468, ...
Calls test_shell --layout-tests .../generator.html?<name> and writes the result to .../docs/<name>.html
Calls test_shell --layout-tests .../generator.html?<names> and writes the results to .../docs/<name>.html
def RenderPage(name, test_shell): """ Calls test_shell --layout-tests .../generator.html?<name> and writes the result to .../docs/<name>.html """ if not name: raise Exception("RenderPage called with empty name") generator_url = "file:" + urllib.pathname2url(_generator_html) + "?" + name input_file = _base_dir + "/" + name + ".html" # Copy page_shell to destination output and move aside original, if it exists. original = None if (os.path.isfile(input_file)): original = open(input_file, 'rb').read() os.remove(input_file) shutil.copy(_page_shell_html, input_file) # Run test_shell and capture result p = Popen([test_shell, "--layout-tests", generator_url], stdout=PIPE) # The remaining output will be the content of the generated page. result = p.stdout.read() content_start = result.find(_expected_output_preamble) content_end = result.find(_expected_output_postamble) if (content_start < 0): if (result.startswith("#TEST_TIMED_OUT")): raise Exception("test_shell returned TEST_TIMED_OUT.\n" + "Their was probably a problem with generating the " + "page\n" + "Try copying template/page_shell.html to:\n" + input_file + "\nAnd open it in chrome using the file: scheme.\n" + "Look from javascript errors via the inspector.") raise Exception("test_shell returned unexpected output: " + result) postamble_length = len(_expected_output_postamble) result = result[content_start:content_end + postamble_length] + "\n" # Remove the trailing #EOF that test shell appends to the output. result = result.replace('#EOF', '') # Remove page_shell os.remove(input_file) # Remove CRs that are appearing from captured test_shell output. result = result.replace('\r', '') # Write output open(input_file, 'wb').write(result) if (original and result == original): return None else: return input_file
b40d40f02a627229cc5081b53a2adde3111a181e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b40d40f02a627229cc5081b53a2adde3111a181e/build.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6987, 1964, 12, 529, 16, 1842, 67, 10304, 4672, 3536, 23665, 1842, 67, 10304, 1493, 6741, 17, 16341, 1372, 19, 8812, 18, 2620, 35, 32, 1973, 34, 471, 7262, 326, 1686, 358, 1372, 19, 85...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6987, 1964, 12, 529, 16, 1842, 67, 10304, 4672, 3536, 23665, 1842, 67, 10304, 1493, 6741, 17, 16341, 1372, 19, 8812, 18, 2620, 35, 32, 1973, 34, 471, 7262, 326, 1686, 358, 1372, 19, 85...
is_locked = open(lockfile) print 'ERROR: tvwrangler.py is locked'
is_locked = open(lockfile) print timestamp(), 'ERROR: tvwrangler.py is locked'
def do_file_move(showid, showname, snum, enum, epname, quality, fileext, origfilename): season_dir = 'Season ' + snum episode_filename = '[' + snum + 'x' + enum + ']' + ' ' + epname + ' [' + quality + ']' + fileext newpath = os.path.join(tv_dir, showname, season_dir, episode_filename) sdir = os.path.split(newpath) if not os.path.isdir(sdir[0]): os.makedirs(sdir[0]) shutil.move(origfilename, newpath) os.symlink(newpath, origfilename) else: for nukefile in os.listdir(sdir[0]): XXxXX = snum + 'x' + enum if nukefile.find(XXxXX) > 0: fullnukepath = os.path.join(sdir[0], nukefile) nukemoveto = os.path.join(nuke_dir, nukefile) nukemoveorigto = os.path.join(nuke_dir, origfilename) if quality == '1080P': shutil.move(fullnukepath, nukemoveto) find_relink(fullnukepath, nukemoveto) print 'NUKE: NEW1080P', origfilename, fullnukepath elif quality == '720P' and nukefile.find('1080P') < 0: shutil.move(fullnukepath, nukemoveto) find_relink(fullnukepath, nukemoveto) print 'NUKE: NEW720P', origfilename, fullnukepath elif nukefile.find('1080P') < 0 and nukefile.find('720P') < 0: shutil.move(fullnukepath, nukemoveto) find_relink(fullnukepath, nukemoveto) print 'NUKE:', origfilename, fullnukepath else: shutil.move(origfilename, nukemoveorigto) os.symlink(nukemoveorigto, origfilename) print 'NUKE: BETTERAVAIL', fullnukepath, origfilename if not os.path.islink(origfilename) and os.path.isfile(origfilename): shutil.move(origfilename, newpath) os.symlink(newpath, origfilename)
0dace5e13519b49a10fec8a5cdaff7b36ee5fb6b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13915/0dace5e13519b49a10fec8a5cdaff7b36ee5fb6b/tvwrangler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 768, 67, 8501, 12, 4500, 350, 16, 2405, 529, 16, 272, 2107, 16, 2792, 16, 5529, 529, 16, 9312, 16, 585, 408, 16, 1647, 3459, 4672, 225, 15874, 67, 1214, 273, 296, 1761, 2753...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 768, 67, 8501, 12, 4500, 350, 16, 2405, 529, 16, 272, 2107, 16, 2792, 16, 5529, 529, 16, 9312, 16, 585, 408, 16, 1647, 3459, 4672, 225, 15874, 67, 1214, 273, 296, 1761, 2753...
def highlight(text, keywords=None, prefix_tag='<strong>', suffix_tag="</strong>"): """ Returns text with all words highlighted with given tags (this function places 'prefix_tag' and 'suffix_tag' before and after words from 'keywords' in 'text'). for example set prefix_tag='<b style="color: black; background-color: rgb(255, 255, 102);">' and suffix_tag="</b>" @param text: the text to modify @param keywords: a list of string @return: highlighted text """ if not keywords: return text
def highlight_matches(text, compiled_pattern, \ prefix_tag='<strong>', suffix_tag="</strong>"): """ Highlight words in 'text' matching the 'compiled_pattern' """
def highlight(text, keywords=None, prefix_tag='<strong>', suffix_tag="</strong>"): """ Returns text with all words highlighted with given tags (this function places 'prefix_tag' and 'suffix_tag' before and after words from 'keywords' in 'text'). for example set prefix_tag='<b style="color: black; background-color: rgb(255, 255, 102);">' and suffix_tag="</b>" @param text: the text to modify @param keywords: a list of string @return: highlighted text """ if not keywords: return text #FIXME decide if non english accentuated char should be desaccentuaded def replace_highlight(match): """ replace match.group() by prefix_tag + match.group() + suffix_tag""" return prefix_tag + match.group() + suffix_tag #Build a pattern of the kind keyword1 | keyword2 | keyword3 pattern = '|'.join(keywords) compiled_pattern = re.compile(pattern, re.IGNORECASE) #Replace and return keywords with prefix+keyword+suffix return compiled_pattern.sub(replace_highlight, text)
772ca8adb4685aa5cb50ce35c8e38c154c7f0d99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2763/772ca8adb4685aa5cb50ce35c8e38c154c7f0d99/bibformat_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8839, 67, 8436, 12, 955, 16, 7743, 67, 4951, 16, 521, 1633, 67, 2692, 2218, 32, 9110, 1870, 16, 3758, 67, 2692, 1546, 1757, 9110, 2984, 4672, 3536, 31386, 4511, 316, 296, 955, 11, 3607...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8839, 67, 8436, 12, 955, 16, 7743, 67, 4951, 16, 521, 1633, 67, 2692, 2218, 32, 9110, 1870, 16, 3758, 67, 2692, 1546, 1757, 9110, 2984, 4672, 3536, 31386, 4511, 316, 296, 955, 11, 3607...
if polynomial not in self.coordinate_ring():
S = self.coordinate_ring() try: polynomial = S(polynomial) except TypeError:
def is_homogeneous(self, polynomial): r""" Check if ``polynomial`` is homogeneous.
efd25a3ebdf406120dec50c4c26fe9f3351fe4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/efd25a3ebdf406120dec50c4c26fe9f3351fe4f7/toric_variety.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 17125, 30075, 1481, 12, 2890, 16, 16991, 4672, 436, 8395, 2073, 309, 12176, 3915, 13602, 10335, 353, 13995, 30075, 1481, 18, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 17125, 30075, 1481, 12, 2890, 16, 16991, 4672, 436, 8395, 2073, 309, 12176, 3915, 13602, 10335, 353, 13995, 30075, 1481, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -10...
return '%s/%s' % (utool(), url)
return '%s/%s' % (utool(), remote)
def getRemoteUrl(self): """returns the remote URL of the Link """ # need to check why this is different than PortalLink utool = getToolByName(self, 'portal_url') remote = self._getRemoteUrl() if remote: if remote.startswith('/'): remote = remote[1:] return '%s/%s' % (utool(), url) else: return utool()
abf4508d246321fb479217685ac82a1285438695 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11956/abf4508d246321fb479217685ac82a1285438695/ATFavorite.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14879, 1489, 12, 2890, 4672, 3536, 6154, 326, 2632, 1976, 434, 326, 4048, 3536, 468, 1608, 358, 866, 11598, 333, 353, 3775, 2353, 25478, 2098, 31013, 225, 273, 336, 6364, 5911, 12, 2890, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14879, 1489, 12, 2890, 4672, 3536, 6154, 326, 2632, 1976, 434, 326, 4048, 3536, 468, 1608, 358, 866, 11598, 333, 353, 3775, 2353, 25478, 2098, 31013, 225, 273, 336, 6364, 5911, 12, 2890, ...
value = lfc.lfc_setfsizeg(guid,size,'AD',checksum)
value = lfc.lfc_setfsizeg( guid, size, 'AD', checksum )
def __addFile(self,lfn,pfn,size,se,guid,checksum): lfc.lfc_umask(0000) bdir = os.path.dirname(lfn) res = self.__executeOperation(bdir,'exists') # If we failed to find out whether the directory exists if not res['OK']: return S_ERROR(res['Message']) # If the directory doesn't exist if not res['Value']: #Make the directories recursively if needed res = self.__makeDirs(bdir) # If we failed to make the directory for the file if not res['OK']: return S_ERROR(res['Message']) #Create a new file fullLfn = '%s%s' % (self.prefix,lfn) value = lfc.lfc_creatg(fullLfn,guid,0664) if value != 0: errStr = lfc.sstrerror(lfc.cvar.serrno) gLogger.error("LcgFileCatalogClient__addFile: Failed to create GUID.", errStr) # Remove the file we just attempted to add res = self.__unlinkPath(lfn) if not res['OK']: gLogger.error("LcgFileCatalogClient.__addFile: Failed to remove file after failure.", res['Message']) return S_ERROR("LcgFileCatalogClient__addFile: Failed to create GUID: %s" % errStr) #Set the checksum and size of the file if not checksum: checksum = '' value = lfc.lfc_setfsizeg(guid,size,'AD',checksum) if value != 0: errStr = lfc.sstrerror(lfc.cvar.serrno) # Remove the file we just attempted to add res = self.__unlinkPath(lfn) if not res['OK']: gLogger.error("LcgFileCatalogClient.__addFile: Failed to remove file after failure to add checksum and size." % res['Message']) return S_ERROR("LcgFileCatalogClient.__addFile: Failed to set file size: %s" % errStr) return S_OK()
6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1289, 812, 12, 2890, 16, 80, 4293, 16, 84, 4293, 16, 1467, 16, 307, 16, 14066, 16, 15149, 4672, 328, 7142, 18, 80, 7142, 67, 379, 835, 12, 2787, 13, 324, 1214, 273, 1140, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1289, 812, 12, 2890, 16, 80, 4293, 16, 84, 4293, 16, 1467, 16, 307, 16, 14066, 16, 15149, 4672, 328, 7142, 18, 80, 7142, 67, 379, 835, 12, 2787, 13, 324, 1214, 273, 1140, 18, ...
postrefinement_stats['resolution_estimate_old'] = resolution
postrefinement_stats['resolution_estimate_old'] = resolution_old
def _parse_correct_lp(filename): '''Parse the contents of the CORRECT.LP file pointed to by filename.''' if not os.path.split(filename)[-1] == 'CORRECT.LP': raise RuntimeError, 'input filename not CORRECT.LP' file_contents = open(filename, 'r').readlines() postrefinement_stats = { } for i in range(len(file_contents)): if 'OF SPOT POSITION (PIXELS)' in file_contents[i]: rmsd_pixel = float(file_contents[i].split()[-1]) postrefinement_stats['rmsd_pixel'] = rmsd_pixel if 'OF SPINDLE POSITION (DEGREES)' in file_contents[i]: rmsd_phi = float(file_contents[i].split()[-1]) postrefinement_stats['rmsd_phi'] = rmsd_phi # want to convert this to mm in some standard setting! if 'DETECTOR COORDINATES (PIXELS) OF DIRECT BEAM' in file_contents[i]: beam = map(float, file_contents[i].split()[-2:]) postrefinement_stats['beam'] = beam if 'CRYSTAL TO DETECTOR DISTANCE (mm)' in file_contents[i]: distance = float(file_contents[i].split()[-1]) postrefinement_stats['distance'] = distance if 'UNIT CELL PARAMETERS' in file_contents[i]: cell = map(float, file_contents[i].split()[-6:]) postrefinement_stats['cell'] = cell if 'E.S.D. OF CELL PARAMETERS' in file_contents[i]: # bug # 3132 - check that the last token is not # "-1.0E+00-1.0E+00-1.0E+00-1.0E+00-1.0E+00-1.0E+00" - # if it is it means that the refinement didn't # happen (for some reason...) if '-1.0E+00-1.0E+00-1.0E+00' in file_contents[i]: cell_esd = [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0] else: cell_esd = map(float, file_contents[i].split()[-6:]) postrefinement_stats['cell_esd'] = cell_esd if 'REFLECTIONS ACCEPTED' in file_contents[i]: postrefinement_stats['n_ref'] = int(file_contents[i].split()[0]) # look for I/sigma (resolution) information... if 'RESOLUTION RANGE I/Sigma Chi^2 R-FACTOR R-FACTOR' in \ file_contents[i]: resolution_info = [] j = i + 3 while not '-----' in file_contents[j]: l = file_contents[j].split() resolution_info.append((float(l[1]),float(l[2]))) j += 1 # bug # 2409 - this seems a little harsh set as 1.0 so # set this to 0.75 - even then 0.5 may be better.. resolution_old = _resolution_estimate(resolution_info, 0.5) postrefinement_stats['resolution_estimate_old'] = resolution # also recover the highest resolution limit of the data j += 1 postrefinement_stats['highest_resolution'] = float( file_contents[j].split()[1]) return postrefinement_stats
7d1fd3cb02992e636723a5d7f2692d24ae1ed271 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3290/7d1fd3cb02992e636723a5d7f2692d24ae1ed271/XDSCorrectHelpers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 67, 6746, 67, 9953, 12, 3459, 4672, 9163, 3201, 326, 2939, 434, 326, 28359, 4512, 18, 14461, 585, 25874, 358, 635, 1544, 1093, 6309, 225, 309, 486, 1140, 18, 803, 18, 4939, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2670, 67, 6746, 67, 9953, 12, 3459, 4672, 9163, 3201, 326, 2939, 434, 326, 28359, 4512, 18, 14461, 585, 25874, 358, 635, 1544, 1093, 6309, 225, 309, 486, 1140, 18, 803, 18, 4939, ...
picker.connect(picker, SIGNAL('selected(const QwtPolygon&)'), slot)
if PYQT_VERSION == 0x040500: picker.connect(picker, SIGNAL('selected(const QPolygon&)'), slot) else: picker.connect(picker, SIGNAL('selected(const QwtPolygon&)'), slot)
def make(): demo = QMainWindow() toolBar = QToolBar(demo) toolBar.addAction(QWhatsThis.createAction(toolBar)) demo.addToolBar(toolBar) plot = QwtPlot(demo) demo.setCentralWidget(plot) plot.setTitle('Subclassing QwtPlotPicker Demo') plot.setCanvasBackground(Qt.white) plot.setWhatsThis( 'Shows how to subclass QwtPlotPicker so that\n' 'a PolygonRubberBand selection responds to\n' 'left mouse button events.' ) demo.resize(400, 400) demo.show() x = np.linspace(-2*np.pi, 2*np.pi, num=501) y = np.sin(x)*5 curve = QwtPlotCurve() curve.setData(x,y) curve.setPen(QPen(Qt.red)) curve.attach(plot) picker = PlotPicker(QwtPlot.xBottom, QwtPlot.yLeft, QwtPicker.PolygonSelection, QwtPlotPicker.PolygonRubberBand, QwtPicker.AlwaysOff, plot.canvas()) picker.setRubberBandPen(QPen(Qt.black, 1)) slot = lambda polygon: QMessageBox.information( None, 'PlotPicker signaled', str(polygon)) picker.connect(picker, SIGNAL('selected(const QwtPolygon&)'), slot) QWhatsThis.enterWhatsThisMode() QWhatsThis.showText( demo.mapToGlobal(QPoint(200, 200)), plot.whatsThis(), demo) return demo
a5b476da7e6edcba824b8a603141202af5ed5f44 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5650/a5b476da7e6edcba824b8a603141202af5ed5f44/PickerDemo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 13332, 21477, 273, 2238, 6376, 3829, 1435, 225, 5226, 5190, 273, 2238, 6364, 5190, 12, 27928, 13, 5226, 5190, 18, 1289, 1803, 12, 53, 2888, 2323, 2503, 18, 2640, 1803, 12, 6738, 51...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 13332, 21477, 273, 2238, 6376, 3829, 1435, 225, 5226, 5190, 273, 2238, 6364, 5190, 12, 27928, 13, 5226, 5190, 18, 1289, 1803, 12, 53, 2888, 2323, 2503, 18, 2640, 1803, 12, 6738, 51...
'user_id' : uid }
'user_id' : uid }
def do_alarm_create(self, cr, uid, ids, context={}): alarm_obj = self.pool.get('calendar.alarm') model_obj = self.pool.get('ir.model') attendee_obj = self.pool.get('calendar.attendee') model_id = model_obj.search(cr, uid, [('model','=',self._name)])[0]
75258015cae6ae0d493e7eb6204a16eafed73cd9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/75258015cae6ae0d493e7eb6204a16eafed73cd9/crm_meeting.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 20681, 67, 2640, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 12938, 4672, 13721, 67, 2603, 273, 365, 18, 6011, 18, 588, 2668, 11650, 18, 20681, 6134, 938, 67, 2603, 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, 741, 67, 20681, 67, 2640, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 12938, 4672, 13721, 67, 2603, 273, 365, 18, 6011, 18, 588, 2668, 11650, 18, 20681, 6134, 938, 67, 2603, 273, ...
this = apply(_quickfix.new_StatusText, args)
this = _quickfix.new_StatusText(*args)
def __init__(self, *args): this = apply(_quickfix.new_StatusText, args) try: self.this.append(this) except: self.this = this
7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 1482, 1528, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 1482, 1528, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 365, 1...
if row_id in row_id2NA_mismatch_rate and row_id2NA_mismatch_rate[row_id][1]<=max_mismatch_rate:
if row_id in row_id_wanted_set:
def removeRowsByMismatchRate(cls, snpData, row_id2NA_mismatch_rate, max_mismatch_rate=1): """ 2008-05-19 """ sys.stderr.write("Removing rows whose mismatch_rate >%s ..."%(max_mismatch_rate)) no_of_rows = 0 #extra computing time a bit, but to save memory for row_id in snpData.row_id_ls: if row_id in row_id2NA_mismatch_rate and row_id2NA_mismatch_rate[row_id][1]<=max_mismatch_rate: no_of_rows += 1 no_of_cols = len(snpData.col_id_ls) newSnpData = SNPData(col_id_ls=snpData.col_id_ls, row_id_ls=[]) newSnpData.data_matrix = num.zeros([no_of_rows, no_of_cols], num.int8) row_index = 0 for i in range(len(snpData.row_id_ls)): row_id = snpData.row_id_ls[i] if row_id in row_id2NA_mismatch_rate and row_id2NA_mismatch_rate[row_id][1]<=max_mismatch_rate: newSnpData.row_id_ls.append(row_id) newSnpData.data_matrix[row_index] = snpData.data_matrix[i] row_index += 1 newSnpData.no_of_rows_filtered_by_mismatch = len(snpData.row_id_ls)-no_of_rows sys.stderr.write("%s rows filtered by mismatch. Done.\n"%(newSnpData.no_of_rows_filtered_by_mismatch)) return newSnpData
a0db0d6d1d040c21cd05d0fc1b5346c1ed01e4df /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9645/a0db0d6d1d040c21cd05d0fc1b5346c1ed01e4df/SNP.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1206, 4300, 858, 16901, 4727, 12, 6429, 16, 28648, 751, 16, 1027, 67, 350, 22, 11277, 67, 11173, 1916, 67, 5141, 16, 943, 67, 11173, 1916, 67, 5141, 33, 21, 4672, 3536, 4044, 28, 17, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4300, 858, 16901, 4727, 12, 6429, 16, 28648, 751, 16, 1027, 67, 350, 22, 11277, 67, 11173, 1916, 67, 5141, 16, 943, 67, 11173, 1916, 67, 5141, 33, 21, 4672, 3536, 4044, 28, 17, ...
points = attrs['points']
points = as_latin1(attrs['points'])
def polygon(self, attrs): if self.in_defs: return points = attrs['points'] points = string.translate(points, commatospace) points = split(points) path = CreatePath() point = self.point for i in range(0, len(points), 2): path.AppendLine(point(points[i], points[i + 1])) path.AppendLine(path.Node(0)) path.ClosePath() self.parse_attrs(attrs) self.set_loader_style() self.loader.bezier(paths = (path,))
a31675f79ae27fada0eef18d280c6f1c55a842f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3123/a31675f79ae27fada0eef18d280c6f1c55a842f1/svgloader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7154, 12, 2890, 16, 3422, 4672, 309, 365, 18, 267, 67, 12537, 30, 327, 3143, 273, 487, 67, 26578, 21, 12, 7039, 3292, 4139, 19486, 3143, 273, 533, 18, 13929, 12, 4139, 16, 1543, 270, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7154, 12, 2890, 16, 3422, 4672, 309, 365, 18, 267, 67, 12537, 30, 327, 3143, 273, 487, 67, 26578, 21, 12, 7039, 3292, 4139, 19486, 3143, 273, 533, 18, 13929, 12, 4139, 16, 1543, 270, ...
elif self.mode == 'play':
def run(self): while 1: if self.mode == 'idle': self.mode_flag.wait() self.mode_flag.clear()
505872d0994e5006ebba4502ff1e3d02024cee39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/505872d0994e5006ebba4502ff1e3d02024cee39/mplayer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 1323, 404, 30, 309, 365, 18, 3188, 422, 296, 20390, 4278, 365, 18, 3188, 67, 6420, 18, 7048, 1435, 365, 18, 3188, 67, 6420, 18, 8507, 1435, 2, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 1323, 404, 30, 309, 365, 18, 3188, 422, 296, 20390, 4278, 365, 18, 3188, 67, 6420, 18, 7048, 1435, 365, 18, 3188, 67, 6420, 18, 8507, 1435, 2, -100, -100, -100, ...
self.regex = re.compile(self.regex, re.MULTILINE | re.UNICODE)
self.initRegex()
def __init__(self, request, name): """ Initialize, starting from <nothing>.
57193bda3846b44789d4d0abcb1bd20fee427dd1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/57193bda3846b44789d4d0abcb1bd20fee427dd1/wikidicts.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 590, 16, 508, 4672, 3536, 9190, 16, 5023, 628, 411, 30874, 18652, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 590, 16, 508, 4672, 3536, 9190, 16, 5023, 628, 411, 30874, 18652, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
self.InitMenu()
gobject.timeout_add(100, self.InitMenu)
def update_status(self, device, actions, status): print_debug ("update_status() of %s to %s" %(actions, status)) if self.items.has_key(device): if "_mount" in actions and status: #print " action UMOUNTING..." # if xxx_mount is True device is umounted self.items[device][5]=False if "_umount" in actions and status: #print " action MOUNTING..." self.items[device][5]=True #print " STATUS of %s is %s" %(device, status) self.items["%s"%device][3]["%s"%actions][2]=status self.InitMenu() else: print_debug( " WW: no updating status of %s"%(actions) )
2d5fe2737ed52045bfec6608b8b1c1961119b897 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13520/2d5fe2737ed52045bfec6608b8b1c1961119b897/TcosTrayIcon2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 2327, 12, 2890, 16, 2346, 16, 4209, 16, 1267, 4672, 1172, 67, 4148, 7566, 2725, 67, 2327, 1435, 434, 738, 87, 358, 738, 87, 6, 8975, 4905, 16, 1267, 3719, 225, 309, 365, 18...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 2327, 12, 2890, 16, 2346, 16, 4209, 16, 1267, 4672, 1172, 67, 4148, 7566, 2725, 67, 2327, 1435, 434, 738, 87, 358, 738, 87, 6, 8975, 4905, 16, 1267, 3719, 225, 309, 365, 18...
start = '1', end = '10', increment = '2', tmpdir = None):
start = 1, end = 10, increment = 2, extra_args = '', tmpdir = None):
def execute(self, iterations = 1, workfile = 'workfile.short', start = '1', end = '10', increment = '2', tmpdir = None): if not tmpdir: tmpdir = self.tmpdir args = '-f ' + ' '.join((workfile,start,end,increment)) for i in range(1, iterations+1): system(self.srcdir + '/reaim ' + args)
1580dc6d00fe5f3687dd697e0546e1982bd55b86 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12268/1580dc6d00fe5f3687dd697e0546e1982bd55b86/reaim.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 2890, 16, 11316, 273, 404, 16, 1440, 768, 273, 296, 1252, 768, 18, 6620, 2187, 787, 273, 404, 16, 679, 273, 1728, 16, 5504, 273, 576, 16, 2870, 67, 1968, 273, 10226, 20213, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 2890, 16, 11316, 273, 404, 16, 1440, 768, 273, 296, 1252, 768, 18, 6620, 2187, 787, 273, 404, 16, 679, 273, 1728, 16, 5504, 273, 576, 16, 2870, 67, 1968, 273, 10226, 20213, ...
<class 'sage.plot.graphics3d.TransformGroup'>
<class 'base.TransformGroup'>
def plot3d(self, stickers=True): """ sage: C = RubiksCube().move("R*U") sage: C.plot3d() <class 'sage.plot.graphics3d.TransformGroup'> sage: C.plot() Graphics object consisting of 55 graphics primitives """ while len(self.colors) < 7: self.colors.append((.1, .1, .1)) side_colors = [Texture(color=c, ambient=.75) for c in self.colors] start_colors = sum([[c]*8 for c in side_colors], []) facets = self._group.facets(self._state) facet_colors = [0]*48 for i in range(48): facet_colors[facets[i]-1] = start_colors[i] all_colors = side_colors + facet_colors pm = [-1,0,1] C = sum([self.cubie(.15, .025, x, y, z, all_colors, stickers) for x in pm for y in pm for z in pm], Box(.35, .35, .35, color=self.colors[-1])) return C.rotateZ(1.5) #.scale([1,-1,1]).rotateZ(1.5)
769721ac06e48c6980b8a90288696799a95b9f07 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/769721ac06e48c6980b8a90288696799a95b9f07/cubegroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3207, 23, 72, 12, 2890, 16, 25608, 414, 33, 5510, 4672, 3536, 272, 410, 30, 385, 273, 534, 373, 1766, 87, 39, 4895, 7675, 8501, 2932, 54, 14, 57, 7923, 272, 410, 30, 385, 18, 4032, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3207, 23, 72, 12, 2890, 16, 25608, 414, 33, 5510, 4672, 3536, 272, 410, 30, 385, 273, 534, 373, 1766, 87, 39, 4895, 7675, 8501, 2932, 54, 14, 57, 7923, 272, 410, 30, 385, 18, 4032, ...
'R':[]
def cvecs( self ): """ Return centering vectors for this space group. """ typ = self.mydata['symb'][0] ##TODO: find vectors for B and test for A and C and R ##TODO: http://img.chem.ucl.ac.uk/sgp/large/146az1.htm vs = { 'A':[ Vec( 0, 0.5, 0.5 ) ], 'C':[ Vec( 0.5, 0.5, 0 ) ], 'B':[], ##TODO: <<< error 'F':[ Vec( 0, 0.5, 0.5 ),Vec( 0.5, 0, 0.5 ), Vec( 0.5, 0.5, 0 ) ], 'I':[ Vec( 0.5, 0.5, 0.5 ) ], 'P':[], 'R':[] ##TODO: <<< error (some coordinate orientation has +(2/3,1/3,1/3),(1/3,2/3,2/3) } return vs[ typ ]
3554b4e1fc7ce83a03608aec5f44ee226fdc0262 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11755/3554b4e1fc7ce83a03608aec5f44ee226fdc0262/spgrp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 27698, 12, 365, 262, 30, 3536, 2000, 4617, 310, 10046, 364, 333, 3476, 1041, 18, 3536, 3815, 273, 365, 18, 4811, 892, 3292, 9009, 1627, 3546, 63, 20, 65, 7541, 6241, 30, 1104, 100...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 27698, 12, 365, 262, 30, 3536, 2000, 4617, 310, 10046, 364, 333, 3476, 1041, 18, 3536, 3815, 273, 365, 18, 4811, 892, 3292, 9009, 1627, 3546, 63, 20, 65, 7541, 6241, 30, 1104, 100...
self.do('rm -rf ' + self.workdir + '/*')
self.do('rm -rf ' + self.workdir) self.do('mkdir -p ' + self.workdir)
def run(self): global all_workers_stop self.do('mkdir -p ' + self.workdir) while not all_workers_stop: job = self.jobqueue.get() if job is None: return try: job.go(self) self.do('rm -rf ' + self.workdir + '/*') except: all_workers_stop = True raise
05e116931f3fb92344219947fdb45bbbe75318ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/05e116931f3fb92344219947fdb45bbbe75318ff/jobqueue.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 2552, 777, 67, 15625, 67, 5681, 365, 18, 2896, 2668, 26686, 300, 84, 296, 397, 365, 18, 1252, 1214, 13, 1323, 486, 777, 67, 15625, 67, 5681, 30, 1719, 273, 365, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 2552, 777, 67, 15625, 67, 5681, 365, 18, 2896, 2668, 26686, 300, 84, 296, 397, 365, 18, 1252, 1214, 13, 1323, 486, 777, 67, 15625, 67, 5681, 30, 1719, 273, 365, ...
'http://admin.fedoraproject.org/updates')
'https://admin.fedoraproject.org/updates')
def register(cls): cls._base_url = config.get('fedoracommunity.connector.bodhi.baseurl', 'http://admin.fedoraproject.org/updates') cls.register_query_updates()
bed594cd5f98c62b3995c94931295fcf217f00e0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12732/bed594cd5f98c62b3995c94931295fcf217f00e0/bodhiconnector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1744, 12, 6429, 4672, 2028, 6315, 1969, 67, 718, 273, 642, 18, 588, 2668, 74, 15534, 20859, 18, 23159, 18, 70, 369, 12266, 18, 1969, 718, 2187, 296, 4528, 2207, 3666, 18, 31835, 280, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1744, 12, 6429, 4672, 2028, 6315, 1969, 67, 718, 273, 642, 18, 588, 2668, 74, 15534, 20859, 18, 23159, 18, 70, 369, 12266, 18, 1969, 718, 2187, 296, 4528, 2207, 3666, 18, 31835, 280, 4...
data['cldr_am'] = amNode.text
data['cldr_am'] = amNode.text
def extractAmPm(calendarElement): data = {} amNode = calendarElement.find(".//am") if amNode != None: data['cldr_am'] = amNode.text pmNode = calendarElement.find(".//pm") if pmNode != None: data["cldr_pm"] = pmNode.text return data
eb1a4b4f96b21cb38ef782a546b34e1e48dfe76d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/eb1a4b4f96b21cb38ef782a546b34e1e48dfe76d/cldr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2608, 9864, 52, 81, 12, 11650, 1046, 4672, 501, 273, 2618, 225, 2125, 907, 273, 5686, 1046, 18, 4720, 2932, 18, 759, 301, 7923, 309, 2125, 907, 480, 599, 30, 501, 3292, 830, 3069, 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, 2608, 9864, 52, 81, 12, 11650, 1046, 4672, 501, 273, 2618, 225, 2125, 907, 273, 5686, 1046, 18, 4720, 2932, 18, 759, 301, 7923, 309, 2125, 907, 480, 599, 30, 501, 3292, 830, 3069, 67, ...
def __init__(data = None)
def __init__(data = None):
def __init__(data = None) if data == None: quickfix.BoolField.__init__(self, 130) else quickfix.BoolField.__init__(self, 130, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 7464, 974, 16186, 2738, 972, 12, 2890, 16, 404, 5082, 13, 469, 9549, 904, 18, 7464, 974, 16186, 2738, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 7464, 974, 16186, 2738, 972, 12, 2890, 16, 404, 5082, 13, 469, 9549, 904, 18, 7464, 974, 16186, 2738, ...
def combine_paths(*args):
def combine_paths(*args,**kws):
def combine_paths(*args): """ Return a list of existing paths composed by all combinations of items from arguments. """ r = [] for a in args: if not a: continue if type(a) is types.StringType: a = [a] r.append(a) args = r if not args: return [] if len(args)==1: result = reduce(lambda a,b:a+b,map(glob,args[0]),[]) elif len (args)==2: result = [] for a0 in args[0]: for a1 in args[1]: result.extend(glob(os.path.join(a0,a1))) else: result = combine_paths(*(combine_paths(args[0],args[1])+args[2:])) return result
11cffa55fceeda7a779a5a596b22fb98270f22b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/11cffa55fceeda7a779a5a596b22fb98270f22b8/system_info.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8661, 67, 4481, 30857, 1968, 16, 636, 79, 4749, 4672, 3536, 2000, 279, 666, 434, 2062, 2953, 18673, 635, 777, 17265, 434, 1516, 628, 1775, 18, 3536, 436, 273, 5378, 364, 279, 316, 833, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8661, 67, 4481, 30857, 1968, 16, 636, 79, 4749, 4672, 3536, 2000, 279, 666, 434, 2062, 2953, 18673, 635, 777, 17265, 434, 1516, 628, 1775, 18, 3536, 436, 273, 5378, 364, 279, 316, 833, ...
confPy.write(confPyTemplate % dict(project=metadata.get('Name', doc.project_name), copyright=metadata.get('Author', 'Zope Community'), version=metadata.get('Version', doc.version), release=metadata.get('Version', doc.version), staticDir=staticDir, templatesDir=templatesDir, indexDoc=self.options.get('index-doc','index') ))
confPy.write(confPyTemplate % dict( project=metadata.get('Name', doc.project_name), copyright=metadata.get('Author', 'Zope Community'), version=metadata.get('Version', doc.version), release=metadata.get('Version', doc.version), staticDir=staticDir, templatesDir=templatesDir, indexDoc=self.options.get('index-doc','index') ))
def install(self): installed = [] eggs, workingSet = self.egg.working_set() docs = [workingSet.find(pkg_resources.Requirement.parse(spec)) for spec in eggs]
288b213a23100e906c990f05ca1fbc910c54f778 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9728/288b213a23100e906c990f05ca1fbc910c54f778/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 12, 2890, 4672, 5876, 273, 5378, 9130, 564, 16, 5960, 694, 273, 365, 18, 23171, 18, 20478, 67, 542, 1435, 3270, 273, 306, 20478, 694, 18, 4720, 12, 10657, 67, 4683, 18, 18599, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3799, 12, 2890, 4672, 5876, 273, 5378, 9130, 564, 16, 5960, 694, 273, 365, 18, 23171, 18, 20478, 67, 542, 1435, 3270, 273, 306, 20478, 694, 18, 4720, 12, 10657, 67, 4683, 18, 18599, 18...
result = gProxyManager.requestToken( ownerDN, ownerGroup, pilotsToSubmit*5 )
result = gProxyManager.requestToken( ownerDN, ownerGroup, pilotsToSubmit * 5 )
def __getPilotOptions(self,queue,pilotsToSubmit): """ Prepare pilot options """ queueDict = self.queueDict[queue]['ParametersDict'] vo = gConfig.getValue( "/DIRAC/VirtualOrganization", "unknown" ) if vo == 'unknown': self.log.error('Virtual Organization is not defined in the configuration') return None pilotOptions = [ "-V '%s'" % vo ] setup = gConfig.getValue( "/DIRAC/Setup", "unknown" ) if setup == 'unknown': self.log.error('Setup is not defined in the configuration') return None pilotOptions.append( '-S %s' % setup ) diracVersion = gConfig.getValue( "/Operations/%s/%s/Versions/PilotVersion" % (vo,setup), "unknown" ) if diracVersion == 'unknown': self.log.error('PilotVersion is not defined in the configuration') return None pilotOptions.append( '-r %s' % diracVersion ) ownerDN = self.genericPilotDN ownerGroup = self.genericPilotGroup result = gProxyManager.requestToken( ownerDN, ownerGroup, pilotsToSubmit*5 ) if not result[ 'OK' ]: self.log.error( ERROR_TOKEN, result['Message'] ) return S_ERROR( ERROR_TOKEN ) ( token, numberOfUses ) = result[ 'Value' ] pilotOptions.append( '-o /Security/ProxyToken=%s' % token ) # Use Filling mode pilotOptions.append( '-M %s' % 5 )
fecf3d418a4e3a08002c58982e809e7e4b152546 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/fecf3d418a4e3a08002c58982e809e7e4b152546/SiteDirector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 52, 22797, 1320, 12, 2890, 16, 4000, 16, 84, 330, 6968, 774, 11620, 4672, 3536, 7730, 293, 22797, 702, 3536, 225, 2389, 5014, 273, 365, 18, 4000, 5014, 63, 4000, 23962, 2402, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 52, 22797, 1320, 12, 2890, 16, 4000, 16, 84, 330, 6968, 774, 11620, 4672, 3536, 7730, 293, 22797, 702, 3536, 225, 2389, 5014, 273, 365, 18, 4000, 5014, 63, 4000, 23962, 2402, ...
if self.scaledData[indices[j]][i] == "?": validData[i] = 0
if self.noJitteringScaledData[indices[j]][i] == "?": validData[i] = 0
def updateData(self, labels): self.removeCurves() self.tips.removeAll()
b2f2b60835147b81e5724a3275b610773bc3064b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/b2f2b60835147b81e5724a3275b610773bc3064b/OWSurveyPlotGraph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 751, 12, 2890, 16, 3249, 4672, 365, 18, 4479, 2408, 3324, 1435, 365, 18, 88, 7146, 18, 4479, 1595, 1435, 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, 1089, 751, 12, 2890, 16, 3249, 4672, 365, 18, 4479, 2408, 3324, 1435, 365, 18, 88, 7146, 18, 4479, 1595, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
elif ext == 'png':
elif ext == '.png':
def save(self, filename='sage.png', xmin=None, xmax=None, ymin=None, ymax=None, figsize=DEFAULT_FIGSIZE, fig=None, sub=None, savenow=True, dpi=None): """
7f9525ee63400047a2f2900c10232d9d012cd8cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/7f9525ee63400047a2f2900c10232d9d012cd8cb/plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 12, 2890, 16, 1544, 2218, 87, 410, 18, 6446, 2187, 13777, 33, 7036, 16, 14016, 33, 7036, 16, 15763, 33, 7036, 16, 15275, 33, 7036, 16, 14697, 33, 5280, 67, 5236, 4574, 16, 4291, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1923, 12, 2890, 16, 1544, 2218, 87, 410, 18, 6446, 2187, 13777, 33, 7036, 16, 14016, 33, 7036, 16, 15763, 33, 7036, 16, 15275, 33, 7036, 16, 14697, 33, 5280, 67, 5236, 4574, 16, 4291, ...
return sum([ (F2[AZ[i]+AZ[j]]-X1[AZ[i]]*X2[AZ[j]])^2 for i in range(26) for j in range(26) ])
return sum([ (F2[AZ[i]+AZ[j]]-X1[AZ[i]]*X2[AZ[j]])**2 for i in range(26) for j in range(26) ])
def coincidence_discriminant(S): """ Input A sequence of 2-character strings, e.g. produced as decimation of transposition ciphertext, or of adjacent characters in some sample plaintext. Output A measure of the difference of probability of association of two characters, relative to their independent probabilities. EXAMPLES: sage: S = strip_encoding("The cat in the hat.") sage: T = [ S[i:i+2] for i in range(len(S)-1) ] sage: coincidence_discriminant(T) """ AZ = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' AA = [ AZ[i] + AZ[j] for i in range(26) for j in range(26) ] X1 = frequency_distribution(''.join([ s[0] for s in S ])) X2 = frequency_distribution(''.join([ s[1] for s in S ])) F2 = {} RR = RealField() for XY in AA: F2[AA] = RR(0) eps = RR(1/len(S)) for AB in S: F2[AB] += eps return sum([ (F2[AZ[i]+AZ[j]]-X1[AZ[i]]*X2[AZ[j]])^2 for i in range(26) for j in range(26) ])
7ea31482358623b11403f05e3446fa7e23d5e5a1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/7ea31482358623b11403f05e3446fa7e23d5e5a1/string_ops.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13170, 71, 10328, 67, 2251, 9496, 20030, 12, 55, 4672, 3536, 2741, 432, 3102, 434, 576, 17, 11560, 2064, 16, 425, 18, 75, 18, 14929, 487, 2109, 5115, 434, 906, 3276, 12657, 16, 578, 43...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13170, 71, 10328, 67, 2251, 9496, 20030, 12, 55, 4672, 3536, 2741, 432, 3102, 434, 576, 17, 11560, 2064, 16, 425, 18, 75, 18, 14929, 487, 2109, 5115, 434, 906, 3276, 12657, 16, 578, 43...
os.system('python2.5 %sopenerp-server.py --pidfile=openerp.pid --xmlrpc-port=%s --netrpc-port=%s --addons-path=%s' %(root_path, str(port),str(netport),addons_path))
os.system('python2.5 %sopenerp-server.py --pidfile=openerp.pid --no-xmlrpcs --xmlrpc-port=%s --netrpc-port=%s --addons-path=%s' %(root_path, str(port),str(netport),addons_path))
def start_server(root_path, port, netport, addons_path): os.system('python2.5 %sopenerp-server.py --pidfile=openerp.pid --xmlrpc-port=%s --netrpc-port=%s --addons-path=%s' %(root_path, str(port),str(netport),addons_path))
76f98cad662fe5e8a1e99f18a50b4c44d52ad94d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/76f98cad662fe5e8a1e99f18a50b4c44d52ad94d/base_quality_interrogation.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 67, 3567, 12, 3085, 67, 803, 16, 1756, 16, 2901, 655, 16, 31439, 67, 803, 4672, 1140, 18, 4299, 2668, 8103, 22, 18, 25, 738, 87, 25098, 84, 17, 3567, 18, 2074, 225, 1493, 6610, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 67, 3567, 12, 3085, 67, 803, 16, 1756, 16, 2901, 655, 16, 31439, 67, 803, 4672, 1140, 18, 4299, 2668, 8103, 22, 18, 25, 738, 87, 25098, 84, 17, 3567, 18, 2074, 225, 1493, 6610, ...
Let's add a timetable to the app object: >>> ITimetables(app).timetables['2006.simple'] = tts.createTimetable(t1) >>> findRelatedTimetables(tts) [<Timetable: ('A', 'B'), {'A': <schooltool.timetable.TimetableDay object at ...>, 'B': <schooltool.timetable.TimetableDay object at ...>}, <schooltool.timetable.model.WeeklyTimetableModel object at ...>] Now, let's add a timetable of a different schema: >>> ITimetables(app).timetables['2006.other'] = tts2.createTimetable(t1) >>> findRelatedTimetables(tts) [<Timetable: ('A', 'B'), {'A': <schooltool.timetable.TimetableDay object at ...>, 'B': <schooltool.timetable.TimetableDay object at ...>}, <schooltool.timetable.model.WeeklyTimetableModel object at ...>]
def doctest_findRelatedTimetables_forSchoolTimetables(): """Tests for findRelatedTimetables() with school timetables >>> from schooltool.app.interfaces import ISchoolToolApplication >>> app = ISchoolToolApplication(None) >>> directlyProvides(app, IOwnTimetables) Let's creare a schoolyear and a couple of terms: >>> from schooltool.schoolyear.schoolyear import SchoolYear >>> from schooltool.schoolyear.interfaces import ISchoolYearContainer >>> schoolyears = ISchoolYearContainer(app) >>> schoolyears['2005-2006'] = SchoolYear("2005-2006", ... date(2005, 1, 1), ... date(2006, 12, 31)) >>> from schooltool.term.interfaces import ITermContainer >>> from schooltool.term.term import Term >>> t1 = ITermContainer(app)['2005'] = Term('2005', date(2005, 1, 1), ... date(2005, 12, 31)) >>> t2 = ITermContainer(app)['2006'] = Term('2006', date(2006, 1, 1), ... date(2006, 12, 31)) and a timetable schema: >>> from schooltool.timetable.schema import TimetableSchema >>> from schooltool.timetable.schema import TimetableSchemaDay >>> days = ('A', 'B') >>> periods1 = ('Green', 'Blue') >>> tts = TimetableSchema(days, model=makeTimetableModel()) >>> tts["A"] = TimetableSchemaDay(periods1) >>> tts["B"] = TimetableSchemaDay(periods1) >>> days = ('C', 'D') >>> tts2 = TimetableSchema(days, model=makeTimetableModel()) >>> tts2["C"] = TimetableSchemaDay(periods1) >>> tts2["D"] = TimetableSchemaDay(periods1) >>> ITimetableSchemaContainer(app)['simple'] = tts >>> ITimetableSchemaContainer(app)['other'] = tts2 Now we can call our utility function. Since our schema is not used, an empty list is returned: >>> from schooltool.timetable import findRelatedTimetables >>> findRelatedTimetables(tts) [] Let's add a timetable to the app object: >>> ITimetables(app).timetables['2006.simple'] = tts.createTimetable(t1) >>> findRelatedTimetables(tts) [<Timetable: ('A', 'B'), {'A': <schooltool.timetable.TimetableDay object at ...>, 'B': <schooltool.timetable.TimetableDay object at ...>}, <schooltool.timetable.model.WeeklyTimetableModel object at ...>] Now, let's add a timetable of a different schema: >>> ITimetables(app).timetables['2006.other'] = tts2.createTimetable(t1) >>> findRelatedTimetables(tts) [<Timetable: ('A', 'B'), {'A': <schooltool.timetable.TimetableDay object at ...>, 'B': <schooltool.timetable.TimetableDay object at ...>}, <schooltool.timetable.model.WeeklyTimetableModel object at ...>] Let's add some persons, groups and resources with timetables: >>> from schooltool.person.person import Person >>> from schooltool.group.group import Group >>> from schooltool.resource.resource import Resource >>> app['persons']['p1'] = Person('p1') >>> app['persons']['p2'] = Person('p2') >>> IGroupContainer(app)['g'] = Group('friends') >>> app['resources']['r'] = Resource('friends') >>> for ob in (app['persons']['p1'], app['persons']['p2'], ... IGroupContainer(app)['g'], app['resources']['r']): ... directlyProvides(ob, IOwnTimetables) >>> adapter = ITimetables(app['persons']['p1']) >>> adapter.timetables['2006.simple'] = tts.createTimetable(t2) >>> adapter.timetables['2005.simple'] = tts.createTimetable(t1) >>> adapter.timetables['2006.other'] = tts2.createTimetable(t2) >>> adapter = ITimetables(app['persons']['p2']) >>> adapter.timetables['2006.simple'] = tts.createTimetable(t2) >>> adapter = ITimetables(IGroupContainer(app)['g']) >>> adapter.timetables['2006.simple'] = tts.createTimetable(t2) >>> adapter.timetables['2006.other'] = tts2.createTimetable(t2) >>> adapter = ITimetables(app['resources']['r']) >>> adapter.timetables['2006.simple'] = tts.createTimetable(t2) Let's see the timetables for this schema now: >>> findRelatedTimetables(tts) [<Timetable: ('A', 'B'), ...>, <Timetable: ('A', 'B'), ...>, <Timetable: ('A', 'B'), ...>, <Timetable: ('A', 'B'), ...>, <Timetable: ('A', 'B'), ...>, <Timetable: ('A', 'B'), ...>] >>> [(tt.__parent__.__parent__.__name__, tt.__name__) ... for tt in findRelatedTimetables(tts)] [(None, '2006.simple'), (u'p1', '2006.simple'), (u'p1', '2005.simple'), (u'p2', '2006.simple'), (u'g', '2006.simple'), (u'r', '2006.simple')] Let's see the timetables of the other schema: >>> findRelatedTimetables(tts2) [<Timetable: ('C', 'D'), ...>, <Timetable: ('C', 'D'), ...>, <Timetable: ('C', 'D'), ...>] >>> [(tt.__parent__.__parent__.__name__, tt.__name__) ... for tt in findRelatedTimetables(tts2)] [(None, '2006.other'), (u'p1', '2006.other'), (u'g', '2006.other')] """
5327ab07ac6b37626f0e915d61c2f9b2129a747d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7127/5327ab07ac6b37626f0e915d61c2f9b2129a747d/test_timetable.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31263, 395, 67, 4720, 8017, 10178, 278, 1538, 67, 1884, 55, 343, 1371, 10178, 278, 1538, 13332, 3536, 14650, 364, 1104, 8017, 10178, 278, 1538, 1435, 598, 18551, 1371, 26668, 1538, 225, 40...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 31263, 395, 67, 4720, 8017, 10178, 278, 1538, 67, 1884, 55, 343, 1371, 10178, 278, 1538, 13332, 3536, 14650, 364, 1104, 8017, 10178, 278, 1538, 1435, 598, 18551, 1371, 26668, 1538, 225, 40...
title = u"Set s&haring logging level to debug", helpString = u'Enable RecordSet debugging'),
title = _(u"Set s&haring logging level to debug"), helpString = _(u'Enable RecordSet debugging')),
def makeVisibleHourMenuItems(parcel): """ Create the 'Visible Hours' submenu. Should look like: Automatic --------- 5 hours 6 hours
043a08a77771b31713425ec3f48a9c0186570e1d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/043a08a77771b31713425ec3f48a9c0186570e1d/menus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 6207, 13433, 4599, 3126, 12, 1065, 2183, 4672, 3536, 1788, 326, 296, 6207, 670, 4390, 11, 27539, 18, 9363, 2324, 3007, 30, 225, 11809, 4941, 300, 788, 1381, 7507, 1666, 7507, 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, 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, 1221, 6207, 13433, 4599, 3126, 12, 1065, 2183, 4672, 3536, 1788, 326, 296, 6207, 670, 4390, 11, 27539, 18, 9363, 2324, 3007, 30, 225, 11809, 4941, 300, 788, 1381, 7507, 1666, 7507, 2, -1...
self.finish_test(secDB)
self.finish_test(self.secDB)
def test01_associateWithDB(self): if verbose: print '\n', '-=' * 30 print "Running %s.test01_associateWithDB..." % \ self.__class__.__name__
86b26e6b7822e78d0e923fad44b0ab457da0cd51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/86b26e6b7822e78d0e923fad44b0ab457da0cd51/test_associate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1611, 67, 11577, 1190, 2290, 12, 2890, 4672, 309, 3988, 30, 1172, 2337, 82, 2187, 2400, 2218, 380, 5196, 1172, 315, 7051, 738, 87, 18, 3813, 1611, 67, 11577, 1190, 2290, 7070, 738,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1611, 67, 11577, 1190, 2290, 12, 2890, 4672, 309, 3988, 30, 1172, 2337, 82, 2187, 2400, 2218, 380, 5196, 1172, 315, 7051, 738, 87, 18, 3813, 1611, 67, 11577, 1190, 2290, 7070, 738,...
path = (action == 'new' and action + '.:(format)') or \ "%s.:(format);%s" % (new_path, action)
path = (action == 'new' and new_path + '\.:(format)') or \ "%s\.:(format);%s" % (new_path, action)
def requirements_for(meth): opts = options.copy() if method != 'any': opts['conditions'] = {'method':meth} return opts
da7004651758a3ba73f50c2731e2b08ce10f1730 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12081/da7004651758a3ba73f50c2731e2b08ce10f1730/base.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8433, 67, 1884, 12, 27305, 4672, 1500, 273, 702, 18, 3530, 1435, 309, 707, 480, 296, 2273, 4278, 1500, 3292, 6381, 3546, 273, 13666, 2039, 4278, 27305, 97, 327, 1500, 225, 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, 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, 8433, 67, 1884, 12, 27305, 4672, 1500, 273, 702, 18, 3530, 1435, 309, 707, 480, 296, 2273, 4278, 1500, 3292, 6381, 3546, 273, 13666, 2039, 4278, 27305, 97, 327, 1500, 225, 2, -100, -100,...
stdin=stdin,
stdin=subprocess.PIPE,
def run(self): """Run the process until finished or aborted. Don't call this directly instead call self.start() to start the thread else this will run in the context of the current thread. @note: overridden from Thread
b2a84c23c7e4f21c38f933384feb433f1442f031 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/b2a84c23c7e4f21c38f933384feb433f1442f031/processmanager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 3536, 1997, 326, 1207, 3180, 6708, 578, 18166, 18, 7615, 1404, 745, 333, 5122, 3560, 745, 365, 18, 1937, 1435, 358, 787, 326, 2650, 469, 333, 903, 1086, 316, 326, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 3536, 1997, 326, 1207, 3180, 6708, 578, 18166, 18, 7615, 1404, 745, 333, 5122, 3560, 745, 365, 18, 1937, 1435, 358, 787, 326, 2650, 469, 333, 903, 1086, 316, 326, ...
debug(" - checking cookie %s=%s", cookie.name, cookie.value)
_debug(" - checking cookie %s=%s", cookie.name, cookie.value)
def set_ok(self, cookie, request): """ If you override .set_ok(), be sure to call this method. If it returns false, so should your subclass (assuming your subclass wants to be more strict about which cookies to accept).
feb0a3bdbccc7b45bc8b960aa4c3434838b52d05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/feb0a3bdbccc7b45bc8b960aa4c3434838b52d05/cookielib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 601, 12, 2890, 16, 3878, 16, 590, 4672, 3536, 971, 1846, 3849, 263, 542, 67, 601, 9334, 506, 3071, 358, 745, 333, 707, 18, 225, 971, 518, 1135, 629, 16, 1427, 1410, 3433, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 601, 12, 2890, 16, 3878, 16, 590, 4672, 3536, 971, 1846, 3849, 263, 542, 67, 601, 9334, 506, 3071, 358, 745, 333, 707, 18, 225, 971, 518, 1135, 629, 16, 1427, 1410, 3433, 10...
class SnglBurstTable(DBTable): tableName = lsctables.SnglBurstTable.tableName validcolumns = lsctables.SnglBurstTable.validcolumns constraints = lsctables.SnglBurstTable.constraints next_id = lsctables.SnglBurstTable.next_id RowType = lsctables.SnglBurstTable.RowType how_to_index = lsctables.SnglBurstTable.how_to_index class SimBurstTable(DBTable): tableName = lsctables.SimBurstTable.tableName validcolumns = lsctables.SimBurstTable.validcolumns constraints = lsctables.SimBurstTable.constraints next_id = lsctables.SimBurstTable.next_id RowType = lsctables.SimBurstTable.RowType how_to_index = lsctables.SimBurstTable.how_to_index class SnglInspiralTable(DBTable): tableName = lsctables.SnglInspiralTable.tableName validcolumns = lsctables.SnglInspiralTable.validcolumns constraints = lsctables.SnglInspiralTable.constraints next_id = lsctables.SnglInspiralTable.next_id RowType = lsctables.SnglInspiralTable.RowType how_to_index = lsctables.SnglInspiralTable.how_to_index class SimInspiralTable(DBTable): tableName = lsctables.SimInspiralTable.tableName validcolumns = lsctables.SimInspiralTable.validcolumns constraints = lsctables.SimInspiralTable.constraints next_id = lsctables.SimInspiralTable.next_id RowType = lsctables.SimInspiralTable.RowType how_to_index = lsctables.SimInspiralTable.how_to_index
def get_out_segmentlistdict(self, process_ids = None): """ Return a segmentlistdict mapping instrument to out segment list. If process_ids is a list of process IDs, then only rows with matching IDs are included otherwise all rows are included. """ # start a segment list dictionary seglists = segments.segmentlistdict()
8994913ae6ac57e8ee70b7fa9d9dde61fc8f3bb8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5758/8994913ae6ac57e8ee70b7fa9d9dde61fc8f3bb8/dbtables.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 659, 67, 9273, 1098, 1576, 12, 2890, 16, 1207, 67, 2232, 273, 599, 4672, 3536, 2000, 279, 3267, 1098, 1576, 2874, 10353, 358, 596, 3267, 666, 18, 225, 971, 1207, 67, 2232, 353...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 659, 67, 9273, 1098, 1576, 12, 2890, 16, 1207, 67, 2232, 273, 599, 4672, 3536, 2000, 279, 3267, 1098, 1576, 2874, 10353, 358, 596, 3267, 666, 18, 225, 971, 1207, 67, 2232, 353...