rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
self.deposit_from_MMKit(self.getCoords(event))
if self.modkey is None: self.deposit_from_MMKit(self.getCoords(event))
def leftDouble(self, event): # mark 060126. '''Double click event handler for the left mouse button. ''' if self.cursor_over_when_LMB_pressed == 'Empty Space': self.deposit_from_MMKit(self.getCoords(event)) # does win_update(). return self.ignore_next_leftUp_event = True if isinstance(self.obj_doubleclicked, Atom): if self.obj_doubleclicked.is_singlet(): # Double-clicking on a singlet should do nothing. return else: # real atom if self.modkey == 'Control': self.o.assy.unselectConnected( [ self.obj_doubleclicked ] ) elif self.modkey == 'Delete': self.o.assy.deleteConnected( self.neighbors_of_last_deleted_atom ) else: self.o.assy.selectConnected( [ self.obj_doubleclicked ] ) if isinstance(self.obj_doubleclicked, Bond): if self.modkey == 'Control': self.o.assy.unselectConnected( [ self.obj_doubleclicked.atom1 ] ) elif self.modkey == 'Delete': self.o.assy.deleteConnected( [ self.obj_doubleclicked.atom1, self.obj_doubleclicked.atom2 ] ) else: self.o.assy.selectConnected( [ self.obj_doubleclicked.atom1 ] )
1896fef6e98391b6a442752126beb77d321388fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/1896fef6e98391b6a442752126beb77d321388fc/depositMode.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2002, 5265, 12, 2890, 16, 871, 4672, 468, 2267, 13026, 1611, 5558, 18, 9163, 5265, 4682, 871, 1838, 364, 326, 2002, 7644, 3568, 18, 9163, 225, 309, 365, 18, 9216, 67, 1643, 67, 13723, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2002, 5265, 12, 2890, 16, 871, 4672, 468, 2267, 13026, 1611, 5558, 18, 9163, 5265, 4682, 871, 1838, 364, 326, 2002, 7644, 3568, 18, 9163, 225, 309, 365, 18, 9216, 67, 1643, 67, 13723, ...
except msys.MsysException, e: print_(e)
except msys.MsysException: print_(geterror())
def main(dependencies, msvcr90_preparation, msys_preparation): """Build the dependencies according to the command line options.""" options, args = command_line() if options.arg_help: print_("These are the Pygame library dependencies:") for dep in dependencies: print_(" ", dep.name) return 0 try: chosen_deps = choose_dependencies(dependencies, options, args) except ChooseError, e: print_(e) return 1 print_("Destination directory:", options.destination_dir) if not chosen_deps: if not args: print_("No libraries specified.") elif options.build_all: print_("All libraries excluded") chosen_deps.insert(0, msvcr90_preparation) chosen_deps.insert(0, msys_preparation) try: msys_directory = options.msys_directory except AttributeError: msys_directory = None try: m = msys.Msys(msys_directory) except msys.MsysException, e: print_(e) return 1 start_time = None return_code = 1 set_environment_variables(m, options) print_("\n=== Starting build ===") start_time = time.time() # For file timestamp checks. try: build(chosen_deps, m) except BuildError, e: print_("Build aborted:", e) else: # A successful build! return_code = 0 summary(dependencies, m, start_time, chosen_deps, options) return return_code
5ed962a58a84830cbe0f649aee7072426feb4c22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1298/5ed962a58a84830cbe0f649aee7072426feb4c22/msys_link_VC_2008_dlls.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 11037, 16, 4086, 90, 3353, 9349, 67, 1484, 20961, 16, 4086, 1900, 67, 1484, 20961, 4672, 3536, 3116, 326, 5030, 4888, 358, 326, 1296, 980, 702, 12123, 225, 702, 16, 833, 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, 2774, 12, 11037, 16, 4086, 90, 3353, 9349, 67, 1484, 20961, 16, 4086, 1900, 67, 1484, 20961, 4672, 3536, 3116, 326, 5030, 4888, 358, 326, 1296, 980, 702, 12123, 225, 702, 16, 833, 273, ...
apend_when_current_valid(current, menu, (_("add service to favourites"), self.addServiceToBouquetSelected))
append_when_current_valid(current, menu, (_("add service to favourites"), self.addServiceToBouquetSelected))
def __init__(self, session, csel): Screen.__init__(self, session) self.csel = csel self.bsel = None
892b126f25f6adf5856fa1caa01d998f1e53afac /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6652/892b126f25f6adf5856fa1caa01d998f1e53afac/ChannelSelection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1339, 16, 276, 1786, 4672, 10146, 16186, 2738, 972, 12, 2890, 16, 1339, 13, 365, 18, 71, 1786, 273, 276, 1786, 365, 18, 70, 1786, 273, 599, 2, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1339, 16, 276, 1786, 4672, 10146, 16186, 2738, 972, 12, 2890, 16, 1339, 13, 365, 18, 71, 1786, 273, 276, 1786, 365, 18, 70, 1786, 273, 599, 2, -100, -1...
pt.tag_id == t.tag_id,
(pt.tag_id == t.tag_id) & (pt.post_id == p.post_id),
def get_cloud(self, max=None, ignore_privileges=False): """Get a categorycloud.""" # XXX: ignore_privileges is currently ignored and no privilege # checking is performed. As a matter of fact only published posts # appear in the cloud.
a19568afaf3324d99c401d3cbd7246fe3025aa69 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12815/a19568afaf3324d99c401d3cbd7246fe3025aa69/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 7277, 12, 2890, 16, 943, 33, 7036, 16, 2305, 67, 28459, 2852, 33, 8381, 4672, 3536, 967, 279, 3150, 7277, 12123, 468, 11329, 30, 2305, 67, 28459, 2852, 353, 4551, 5455, 471, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 7277, 12, 2890, 16, 943, 33, 7036, 16, 2305, 67, 28459, 2852, 33, 8381, 4672, 3536, 967, 279, 3150, 7277, 12123, 468, 11329, 30, 2305, 67, 28459, 2852, 353, 4551, 5455, 471, 1...
o = set([cl.rev(r) for r in repo.changelog.nodesbetween(o, None)[0]])
o = set([cl.rev(r) for r in repo.changelog.nodesbetween(o, revs)[0]])
def outgoing(repo, subset, x): import hg # avoid start-up nasties l = getargs(x, 0, 1, _("outgoing wants a repository path")) dest = l and getstring(l[0], _("outgoing wants a repository path")) or '' dest = repo.ui.expandpath(dest or 'default-push', dest or 'default') dest, branches = hg.parseurl(dest) other = hg.repository(hg.remoteui(repo, {}), dest) repo.ui.pushbuffer() o = discovery.findoutgoing(repo, other) repo.ui.popbuffer() cl = repo.changelog o = set([cl.rev(r) for r in repo.changelog.nodesbetween(o, None)[0]]) return [r for r in subset if r in o]
37ff95aaf863613ba0905a6712da28f28ee6380d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/37ff95aaf863613ba0905a6712da28f28ee6380d/revset.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12902, 12, 7422, 16, 7931, 16, 619, 4672, 1930, 22576, 468, 4543, 787, 17, 416, 290, 689, 606, 328, 273, 336, 1968, 12, 92, 16, 374, 16, 404, 16, 389, 2932, 31891, 14805, 279, 3352, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12902, 12, 7422, 16, 7931, 16, 619, 4672, 1930, 22576, 468, 4543, 787, 17, 416, 290, 689, 606, 328, 273, 336, 1968, 12, 92, 16, 374, 16, 404, 16, 389, 2932, 31891, 14805, 279, 3352, ...
if frame is not self.cur[4]: if frame is self.cur[4].f_back: self.trace_dispatch_return(self.cur[4], 0)
if frame is not self.cur[-2]: if frame is self.cur[-2].f_back: self.trace_dispatch_return(self.cur[-2], 0)
def trace_dispatch_return(self, frame, t): if frame is not self.cur[4]: if frame is self.cur[4].f_back: self.trace_dispatch_return(self.cur[4], 0) else: raise "Bad return", self.cur[3]
9ebcb42f5913b3bc74aa94442c2ef4852fc24231 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9ebcb42f5913b3bc74aa94442c2ef4852fc24231/profile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2606, 67, 10739, 67, 2463, 12, 2890, 16, 2623, 16, 268, 4672, 309, 2623, 353, 486, 365, 18, 1397, 18919, 22, 14542, 309, 2623, 353, 365, 18, 1397, 18919, 22, 8009, 74, 67, 823, 30, 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, 2606, 67, 10739, 67, 2463, 12, 2890, 16, 2623, 16, 268, 4672, 309, 2623, 353, 486, 365, 18, 1397, 18919, 22, 14542, 309, 2623, 353, 365, 18, 1397, 18919, 22, 8009, 74, 67, 823, 30, 3...
if confirmed:
if confirmed[1] == "yes" or confirmed[1] == "yestoall":
def deleteConfirmed(self, confirmed): if confirmed: eDVBDB.getInstance().removeServices(-1, -1, -1, self.satpos_to_remove)
58d96b9ff49080139dbe98546a7fe78953fca987 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/58d96b9ff49080139dbe98546a7fe78953fca987/Satconfig.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1430, 3976, 11222, 12, 2890, 16, 19979, 4672, 309, 19979, 63, 21, 65, 422, 315, 9707, 6, 578, 19979, 63, 21, 65, 422, 315, 93, 395, 83, 454, 6877, 425, 30199, 38, 2290, 18, 588, 1442...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1430, 3976, 11222, 12, 2890, 16, 19979, 4672, 309, 19979, 63, 21, 65, 422, 315, 9707, 6, 578, 19979, 63, 21, 65, 422, 315, 93, 395, 83, 454, 6877, 425, 30199, 38, 2290, 18, 588, 1442...
opcodes += [(x, [x[-1] == "b" and "BYTE"], [
opcodes += [(x, [x[-1] == "b" and "BYTE", "HAS_OS"], [
def print_code(code, functions): names = functions.keys() names.sort() for funcname in names: print """static void __attribute__((regparm(3))) %s(InstructionCache *cache, void *tmp_src, void *tmp_dst) { %s; }"""%(funcname, ";".join(functions[funcname])) print "int handle_code_byte(InstructionCacheEntry *entry, unsigned char code, int &op_mode) {" print "entry->offset_opcode = entry->inst_len;" print "switch (op_mode) {" p = code.keys() p.sort() for i in p: print """case 0x%s: { switch(code) {"""%i q = code[i].keys() q.sort() for j in q: print "case 0x%s:"%j print "{" for l in code[i][j]: print l,";" print "break; }" print """default: fetch_code(entry, 4); Logging::printf("unimplemented case %x at line %d code %02x%02x%02x\\n", code, __LINE__, entry->data[0], entry->data[1], entry->data[2]); UNIMPLEMENTED(this); } } break;""" print "default: assert(0); }" print "return _fault; }"
1576ce4c96163d457f1723a2de8fc7afacbeb550 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6150/1576ce4c96163d457f1723a2de8fc7afacbeb550/build_instructions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 710, 12, 710, 16, 4186, 4672, 1257, 273, 4186, 18, 2452, 1435, 1257, 18, 3804, 1435, 364, 1326, 529, 316, 1257, 30, 1172, 3536, 3845, 918, 1001, 4589, 972, 12443, 1574, 1065, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 710, 12, 710, 16, 4186, 4672, 1257, 273, 4186, 18, 2452, 1435, 1257, 18, 3804, 1435, 364, 1326, 529, 316, 1257, 30, 1172, 3536, 3845, 918, 1001, 4589, 972, 12443, 1574, 1065, ...
self.name = name
self.name = name
def __init__(self, config_file, dir='', name='datafind'):
a2bbfd42c8ab7fadc011df769e183127e596cd3e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/a2bbfd42c8ab7fadc011df769e183127e596cd3e/stfu_pipe.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 642, 67, 768, 16, 1577, 2218, 2187, 508, 2218, 892, 4720, 11, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 642, 67, 768, 16, 1577, 2218, 2187, 508, 2218, 892, 4720, 11, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
name = self.getName() if errors and errors.has_key(name): return 1 if self.required: res = self.validate_required(instance, value, errors) if res is not None: return res if self.enforceVocabulary: res = self.validate_vocabulary(instance, value, errors) if res is not None: return res res = instance.validate_field(name, value, errors) if res is not None: return res
def validate(self, value, instance, errors={}, **kwargs): """ Validate passed-in value using all field validators. Return None if all validations pass; otherwise, return failed result returned by validator """ name = self.getName() if errors and errors.has_key(name): return 1
64c71cec849e633ac53e1bcfe44e2c42bf15bd9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/64c71cec849e633ac53e1bcfe44e2c42bf15bd9b/Field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1954, 12, 2890, 16, 460, 16, 791, 16, 1334, 28793, 2826, 4333, 4672, 3536, 3554, 2275, 17, 267, 460, 1450, 777, 652, 11632, 18, 2000, 599, 309, 777, 20808, 1342, 31, 3541, 16, 327, 253...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1954, 12, 2890, 16, 460, 16, 791, 16, 1334, 28793, 2826, 4333, 4672, 3536, 3554, 2275, 17, 267, 460, 1450, 777, 652, 11632, 18, 2000, 599, 309, 777, 20808, 1342, 31, 3541, 16, 327, 253...
'percent' : i+i / 2})
'percent' : 10})
def ajax_getcredits(request): ret = [] if request.method == u'POST': for i in range(2,8): ret.append({'username' : "user" + str(i+1), 'percent' : i+i / 2}) print "returning ret: ", str(ret) json = simplejson.dumps(ret) print "json object is ", str(json) return HttpResponse(json, mimetype='application/json')
4d046e401ed03bbc6a8fa19f32e1c0d87af7cbc3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/4d046e401ed03bbc6a8fa19f32e1c0d87af7cbc3/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10733, 67, 588, 20610, 1282, 12, 2293, 4672, 325, 273, 5378, 309, 590, 18, 2039, 422, 582, 11, 3798, 4278, 364, 277, 316, 1048, 12, 22, 16, 28, 4672, 325, 18, 6923, 12590, 11, 5053, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10733, 67, 588, 20610, 1282, 12, 2293, 4672, 325, 273, 5378, 309, 590, 18, 2039, 422, 582, 11, 3798, 4278, 364, 277, 316, 1048, 12, 22, 16, 28, 4672, 325, 18, 6923, 12590, 11, 5053, ...
A shape is compatible when it has three dimensions (width, height,
A shape is compatible when it has three dimensions (width, height,
def depth(self): return self.shape[2]
7142b8e8a5aa0e21c28f74980abb0be6e15b7601 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12582/7142b8e8a5aa0e21c28f74980abb0be6e15b7601/arraytypes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3598, 12, 2890, 4672, 327, 365, 18, 4867, 63, 22, 65, 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, 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, 3598, 12, 2890, 4672, 327, 365, 18, 4867, 63, 22, 65, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
r""" Double factorial numbers: $(2n)!! = 2^n*n!$. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000165;a Double factorial numbers: (2n)!! = 2^n*n!. sage: a(0) 1 sage: a.offset 0 sage: a(8) 10321920 sage: a(20) 2551082656125828464640000 sage: a.list(9) [1, 2, 8, 48, 384, 3840, 46080, 645120, 10321920] AUTHOR: -- Jaap Spies (2007-01-24) """ def __init__(self):
def __init__(self): r""" Double factorial numbers: $(2n)!! = 2^n*n!$. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000165;a Double factorial numbers: (2n)!! = 2^n*n!. sage: a(0) 1 sage: a.offset 0 sage: a(8) 10321920 sage: a(20) 2551082656125828464640000 sage: a.list(9) [1, 2, 8, 48, 384, 3840, 46080, 645120, 10321920] AUTHOR: -- Jaap Spies (2007-01-24) """
def _eval(self, n): if n == 0: return Integer(1)
69a199217d612e1c590af73e16003812c85b93ec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/69a199217d612e1c590af73e16003812c85b93ec/sloane_functions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8622, 12, 2890, 16, 290, 4672, 309, 290, 422, 374, 30, 327, 2144, 12, 21, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8622, 12, 2890, 16, 290, 4672, 309, 290, 422, 374, 30, 327, 2144, 12, 21, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
self.patchme(patch, f, destDir, leveltuple)
self._patchAtLevels(patchPath, patch, destDir, leveltuple)
def do(self): f = self.doDownload() # FIXME: we should probably read in the patch directly now # that we aren't just applying in a pipeline
74eb99f93d5b6c7a5733427d060861e2b7213b60 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/74eb99f93d5b6c7a5733427d060861e2b7213b60/source.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 12, 2890, 4672, 284, 273, 365, 18, 2896, 7109, 1435, 468, 9852, 30, 732, 1410, 8656, 855, 316, 326, 4729, 5122, 2037, 468, 716, 732, 11526, 1404, 2537, 13650, 316, 279, 5873, 2, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 741, 12, 2890, 4672, 284, 273, 365, 18, 2896, 7109, 1435, 468, 9852, 30, 732, 1410, 8656, 855, 316, 326, 4729, 5122, 2037, 468, 716, 732, 11526, 1404, 2537, 13650, 316, 279, 5873, 2, -...
body.append((e, TreeBox(charset, Node(parser, None), preload_fields, options)))
body.append((e, TreeBox(charset, Node(parser, None), preload_fields, None, options)))
def run(): msg = _resize = retry = 0 events = ( "window resize", ) profile_display = args.profile_display while True: for e in events: try: if e == "window resize": size = ui.get_cols_rows() resize = log.height else: e = top.get_focus()[0].keypress(size[:1], e) if e is None: pass elif e == 'f1': try: body.select(body.tabs.index(help)) except ValueError: body.append(help) resize = log.height elif e in ('esc', 'ctrl w'): body.close() if body.box_widget is None: return resize = log.height elif e == '+': if log.height: resize = log.height - 1 elif e == '-': resize = log.height + 1 elif e == 'q': return #except AssertionError: # hachoir_log.error(getBacktrace()) except NewTab_Stream, e: stream = e.field.getSubIStream() logger.objects[stream] = e = "%u/%s" % (body.active, e.field.absolute_address) parser = guessParser(stream) if not parser: hachoir_log.error(_("No parser found for %s") % stream.source) else: logger.objects[parser] = e body.append((e, TreeBox(charset, Node(parser, None), preload_fields, options))) resize = log.height except NeedInput, e: input.do(*e.args) if profile_display: events = events[1:] break while True: if msgs[0]: for level, prefix, text in msgs[0]: log_count[level] += 1 txt = Text("[%u]%s %s" % (msg, prefix, text)) msg += 1 msgs[1].append(txt) _resize += txt.rows(size[:1]) if log.height < _resize and (resize is None or resize < _resize): resize = _resize log.set_focus(len(msgs[1])-1) sep.set_info(*tuple(log_count)) msgs[0] = [] if resize is not None: body.height = size[1] - sep.rows(size[:1]) - resize if body.height <= 0: resize += body.height - 1 body.height = 1 log.height = resize resize = None canvas = top.render(size, focus=True) if not msgs[0]: _resize = retry = 0 break assert not retry retry += 1 ui.draw_screen(size, canvas) msgs[2] = len(msgs[1]) if profile_display and events: continue while True: events = ui.get_input() if events: break
e9e10b368c103372b5294f1252b8bc0f03fe312c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/e9e10b368c103372b5294f1252b8bc0f03fe312c/urwid_ui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 13332, 1234, 273, 389, 15169, 273, 3300, 273, 374, 2641, 273, 261, 315, 5668, 7041, 3113, 262, 3042, 67, 5417, 273, 833, 18, 5040, 67, 5417, 1323, 1053, 30, 364, 425, 316, 2641, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 13332, 1234, 273, 389, 15169, 273, 3300, 273, 374, 2641, 273, 261, 315, 5668, 7041, 3113, 262, 3042, 67, 5417, 273, 833, 18, 5040, 67, 5417, 1323, 1053, 30, 364, 425, 316, 2641, ...
artist = metadata["artist"].encode("utf-8") title = metadata["title"].encode("utf-8")
artist = metadata["artist"] title = metadata["title"]
def process_track(album, metadata, release, track): tagger = album.tagger use_track_tags = tagger.config.setting["lastfm_use_track_tags"] use_artist_tags = tagger.config.setting["lastfm_use_artist_tags"] min_tag_usage = tagger.config.setting["lastfm_min_tag_usage"] ignore_tags = tagger.config.setting["lastfm_ignore_tags"].lower().split(",") if use_track_tags or use_artist_tags: artist = metadata["artist"].encode("utf-8") title = metadata["title"].encode("utf-8") if artist: if use_artist_tags: get_artist_tags_func = partial(get_artist_tags, album, metadata, artist, min_tag_usage, ignore_tags, None) else: get_artist_tags_func = None if title and use_track_tags: func = partial(get_track_tags, album, metadata, artist, title, min_tag_usage, ignore_tags, get_artist_tags_func, []) elif get_artist_tags_func: func = partial(get_artist_tags_func, []) if func: album._requests += 1 tagger.xmlws.add_task(func, position=1)
4c267f50672aa7d8aefe15824786d648f6f52947 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12415/4c267f50672aa7d8aefe15824786d648f6f52947/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 4101, 12, 25090, 16, 1982, 16, 3992, 16, 3298, 4672, 28777, 273, 14844, 18, 2692, 693, 999, 67, 4101, 67, 4156, 273, 28777, 18, 1425, 18, 8920, 9614, 2722, 25089, 67, 1202, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 4101, 12, 25090, 16, 1982, 16, 3992, 16, 3298, 4672, 28777, 273, 14844, 18, 2692, 693, 999, 67, 4101, 67, 4156, 273, 28777, 18, 1425, 18, 8920, 9614, 2722, 25089, 67, 1202, 6...
checkParamLen(len(params), 4, 'ILN')
checkParamLen(len(params), 5, 'ILN')
def handle_ILN(self, params): checkParamLen(len(params), 4, 'ILN') self.gotContactStatus(params[1], params[2], unquote(params[3]))
9b2b7163e441396d9e5e7f46775cd7809b4655be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9b2b7163e441396d9e5e7f46775cd7809b4655be/msn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 2627, 50, 12, 2890, 16, 859, 4672, 866, 786, 2891, 12, 1897, 12, 2010, 3631, 1381, 16, 296, 2627, 50, 6134, 365, 18, 13212, 6567, 1482, 12, 2010, 63, 21, 6487, 859, 63, 22,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 2627, 50, 12, 2890, 16, 859, 4672, 866, 786, 2891, 12, 1897, 12, 2010, 3631, 1381, 16, 296, 2627, 50, 6134, 365, 18, 13212, 6567, 1482, 12, 2010, 63, 21, 6487, 859, 63, 22,...
def decodeGivenEventualEncoding(self, eventualEncoding): return u'<![CDATA[' + self + u']]>'
def __str__(self, encoding=DEFAULT_OUTPUT_ENCODING): return "<![CDATA[%s]]>" % NavigableString.__str__(self, encoding)
def decodeGivenEventualEncoding(self, eventualEncoding): return u'<![CDATA[' + self + u']]>'
7300e101f39b7a1a436c6765d140c987cbc58a45 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/7300e101f39b7a1a436c6765d140c987cbc58a45/BeautifulSoup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2495, 6083, 1133, 1462, 4705, 12, 2890, 16, 871, 1462, 4705, 4672, 327, 582, 11, 5586, 63, 18375, 3292, 397, 365, 397, 582, 3546, 65, 1870, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2495, 6083, 1133, 1462, 4705, 12, 2890, 16, 871, 1462, 4705, 4672, 327, 582, 11, 5586, 63, 18375, 3292, 397, 365, 397, 582, 3546, 65, 1870, 2, -100, -100, -100, -100, -100, -100, -100, ...
success = False
def main(options, args): global VERBOSE if options.verbose: VERBOSE = True # Optional base directory of the repository. global BASE_DIRECTORY if not options.base_directory: BASE_DIRECTORY = os.path.abspath( os.path.join(os.path.abspath(sys.argv[0]), "..\..")) else: BASE_DIRECTORY = os.path.abspath(sys.argv[2]) # Figure out which directory we have to check. if len(args) == 0: # No directory to check specified, use the repository root. start_dir = BASE_DIRECTORY elif len(args) == 1: # Directory specified. Start here. It's supposed to be relative to the # base directory. start_dir = os.path.abspath(os.path.join(BASE_DIRECTORY, args[0])) else: # More than one argument, we don't handle this. PrintUsage() sys.exit(1) print "Using base directory:", BASE_DIRECTORY print "Checking:", start_dir base_rules = Rules() # The base directory should be lower case from here on since it will be used # for substring matching on the includes, and we compile on case-insensitive # systems. Plus, we always use slashes here since the include parsing code # will also normalize to slashes. BASE_DIRECTORY = BASE_DIRECTORY.lower() BASE_DIRECTORY = BASE_DIRECTORY.replace("\\", "/") start_dir = start_dir.replace("\\", "/") success = CheckDirectory(base_rules, start_dir) success = False if not success: print "\nFAILED\n" sys.exit(1) print "\nSUCCESS\n" sys.exit(0)
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, 2774, 12, 2116, 16, 833, 4672, 2552, 27857, 309, 702, 18, 11369, 30, 27857, 273, 1053, 225, 468, 4055, 1026, 1867, 434, 326, 3352, 18, 2552, 10250, 67, 17229, 309, 486, 702, 18, 1969, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 2116, 16, 833, 4672, 2552, 27857, 309, 702, 18, 11369, 30, 27857, 273, 1053, 225, 468, 4055, 1026, 1867, 434, 326, 3352, 18, 2552, 10250, 67, 17229, 309, 486, 702, 18, 1969, ...
def render_debug(self):
def __repr__(self):
def render_debug(self): return "%s([%s] == %s)" % (self.__class__.__name__, self.index, self.value)
8029c08a336d29362f33e74d33dd0ce2b6ca70ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/873/8029c08a336d29362f33e74d33dd0ce2b6ca70ca/deep.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12715, 972, 12, 2890, 4672, 327, 2213, 87, 3816, 9, 87, 65, 422, 738, 87, 2225, 738, 261, 2890, 16186, 1106, 972, 16186, 529, 972, 16, 365, 18, 1615, 16, 365, 18, 1132, 13, 2, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12715, 972, 12, 2890, 4672, 327, 2213, 87, 3816, 9, 87, 65, 422, 738, 87, 2225, 738, 261, 2890, 16186, 1106, 972, 16186, 529, 972, 16, 365, 18, 1615, 16, 365, 18, 1132, 13, 2, ...
if not self._dict['MD5Sum']:
if not self._dict.get('MD5Sum'):
def _archiveOK(self): """Test an archive. It should exist and the MD5 checksum should be correct.""" if not os.path.exists(self.archiveFilename): return 0 if not self._dict['MD5Sum']: sys.stderr.write("Warning: no MD5Sum for %s\n" % self.fullname()) return 1 data = open(self.archiveFilename, 'rb').read() checksum = md5.new(data).hexdigest() return checksum == self._dict['MD5Sum']
e32ebef53ae4eeda4639d77f6d83a624d78fab5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/e32ebef53ae4eeda4639d77f6d83a624d78fab5c/pimp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 10686, 3141, 12, 2890, 4672, 3536, 4709, 392, 5052, 18, 2597, 1410, 1005, 471, 326, 10852, 25, 6697, 1410, 506, 3434, 12123, 225, 309, 486, 1140, 18, 803, 18, 1808, 12, 2890, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 10686, 3141, 12, 2890, 4672, 3536, 4709, 392, 5052, 18, 2597, 1410, 1005, 471, 326, 10852, 25, 6697, 1410, 506, 3434, 12123, 225, 309, 486, 1140, 18, 803, 18, 1808, 12, 2890, 18, ...
pass
self._threads = test_support.threading_setup()
def setUp (self): pass
730659302902bbeaef7af0f9b9dc332c1682b661 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/730659302902bbeaef7af0f9b9dc332c1682b661/test_asynchat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 261, 2890, 4672, 1342, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 261, 2890, 4672, 1342, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
(screen_size[0] - (2*margin_x),line_height*len(lines)),
(screen_size[0] - (2*margin_x),total_height),
def paint_notes(self): screen_size = self.screen.get_size() margin_x = self.screen.get_size()[0]/50 margin_y = self.screen.get_size()[1]/50 if not self.notes_surface: if self.font_size == None: self.font_size = self.screen.get_size()[1] / 12 font = pygame.font.SysFont("Helvetica, Sans, Arial", size=self.font_size) line_height = font.get_linesize()
571640c83813b5ab1f297405a6ec6fab9e453edc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3598/571640c83813b5ab1f297405a6ec6fab9e453edc/xpressent-remote.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12574, 67, 12903, 12, 2890, 4672, 5518, 67, 1467, 273, 365, 18, 9252, 18, 588, 67, 1467, 1435, 7333, 67, 92, 273, 365, 18, 9252, 18, 588, 67, 1467, 1435, 63, 20, 18537, 3361, 7333, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12574, 67, 12903, 12, 2890, 4672, 5518, 67, 1467, 273, 365, 18, 9252, 18, 588, 67, 1467, 1435, 7333, 67, 92, 273, 365, 18, 9252, 18, 588, 67, 1467, 1435, 63, 20, 18537, 3361, 7333, 6...
self.action.append(self.svn.list, self.urls.get_active_text(),
self.action.append(self.svn.list, self.url,
def load(self): self.action = rabbitvcs.ui.action.SVNAction( self.svn, notification=False ) revision = self.revision_selector.get_revision_object() self.action.append(self.svn.list, self.urls.get_active_text(), revision=revision, recurse=False) self.action.append(self.init_repo_root_url) self.action.append(self.populate_table, 0) self.action.start()
02a0d2ab2d60373ee70e27145caa46e07128ada4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5119/02a0d2ab2d60373ee70e27145caa46e07128ada4/browser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 12, 2890, 4672, 365, 18, 1128, 273, 767, 70, 3682, 18982, 18, 4881, 18, 1128, 18, 23927, 50, 1803, 12, 365, 18, 31505, 16, 3851, 33, 8381, 262, 6350, 273, 365, 18, 13057, 67, 9...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 12, 2890, 4672, 365, 18, 1128, 273, 767, 70, 3682, 18982, 18, 4881, 18, 1128, 18, 23927, 50, 1803, 12, 365, 18, 31505, 16, 3851, 33, 8381, 262, 6350, 273, 365, 18, 13057, 67, 9...
if sys.platform == 'darwin':
if not self.icon_tabs:
def update_clipboard_page_icon(self): '''Updates the Clipboard page (tab) icon with a full or empty clipboard icon. ''' if sys.platform == 'darwin': # Work around for bug 1659. mark 060310 return if self.w.assy.shelf.get_pastable_chunks(): clipboard_pm = imagename_to_pixmap("clipboard-full.png") else: clipboard_pm = imagename_to_pixmap("clipboard-empty.png") self.mmkit_tab.setTabIconSet (self.clipboardPage, QIconSet(clipboard_pm))
3405785a246112b050764dbf4ef758897b8f04cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/3405785a246112b050764dbf4ef758897b8f04cd/MMKit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 14161, 3752, 67, 2433, 67, 3950, 12, 2890, 4672, 9163, 5121, 326, 385, 3169, 3752, 1363, 261, 7032, 13, 4126, 598, 279, 1983, 578, 1008, 20304, 4126, 18, 9163, 309, 2589, 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, 14161, 3752, 67, 2433, 67, 3950, 12, 2890, 4672, 9163, 5121, 326, 385, 3169, 3752, 1363, 261, 7032, 13, 4126, 598, 279, 1983, 578, 1008, 20304, 4126, 18, 9163, 309, 2589, 18, ...
(code,msg)=self.getreply() return code
return self.getreply()
def docmd(self, cmd, args=""): """Send a command, and return its response code.""" self.putcmd(cmd,args) (code,msg)=self.getreply() return code
7ce512fd70a64eb7cf9563bb31dd4291a44254dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/7ce512fd70a64eb7cf9563bb31dd4291a44254dd/smtplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 997, 1264, 12, 2890, 16, 1797, 16, 833, 1546, 6, 4672, 3536, 3826, 279, 1296, 16, 471, 327, 2097, 766, 981, 12123, 365, 18, 458, 4172, 12, 4172, 16, 1968, 13, 261, 710, 16, 3576, 13,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 997, 1264, 12, 2890, 16, 1797, 16, 833, 1546, 6, 4672, 3536, 3826, 279, 1296, 16, 471, 327, 2097, 766, 981, 12123, 365, 18, 458, 4172, 12, 4172, 16, 1968, 13, 261, 710, 16, 3576, 13,...
self._jobs = DiskJobStorage()
self._jobs = DiskJobStorage("")
def __init__(self, context): self._lock = threading.Lock() self._jobs = DiskJobStorage() self._wpool = _JobQueueWorkerPool(context)
ce594241d5daaf0cb9e70a5ba57f47bcd57c8de6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/ce594241d5daaf0cb9e70a5ba57f47bcd57c8de6/jqueue.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 819, 4672, 365, 6315, 739, 273, 17254, 18, 2531, 1435, 365, 6315, 10088, 273, 12951, 2278, 3245, 2932, 7923, 365, 6315, 91, 6011, 273, 389, 2278, 3183, 667...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 819, 4672, 365, 6315, 739, 273, 17254, 18, 2531, 1435, 365, 6315, 10088, 273, 12951, 2278, 3245, 2932, 7923, 365, 6315, 91, 6011, 273, 389, 2278, 3183, 667...
estr = "Fields may only occur at the top level."
estr = "Fields must be at the top level."
def _add_list(doc, bullet_token, stack, indent_stack, errors, warnings): """ Add a new list item or field to the DOM tree, with the given bullet or field tag. When necessary, create the associated list. """ # Determine what type of bullet it is. if bullet_token.contents[-1] == '-': list_type = 'ulist' elif bullet_token.contents[-1] == '.': list_type = 'olist' elif bullet_token.contents[-1] == ':': list_type = 'fieldlist' else: raise AssertionError('Bad Bullet: %r' % bullet_token.contents) # Is this a new list? newlist = 0 if stack[-1].tagName != list_type: newlist = 1 elif list_type == 'olist' and stack[-1].tagName == 'olist': old_listitem = stack[-1].childNodes[-1] old_bullet = old_listitem.getAttribute("bullet").split('.')[:-1] new_bullet = bullet_token.contents.split('.')[:-1] if (new_bullet[:-1] != old_bullet[:-1] or int(new_bullet[-1]) != int(old_bullet[-1])+1): newlist = 1 # Create the new list. if newlist: if stack[-1].tagName in ('ulist', 'olist', 'fieldlist'): stack.pop() indent_stack.pop() if list_type == 'fieldlist': # Fieldlist should be at the top-level. for tok in stack[2:]: if tok.tagName != "section": #print [s.tagName for s in stack[1:]] estr = "Fields may only occur at the top level." errors.append(StructuringError(estr, bullet_token)) break stack[2:] = [] indent_stack[2:] = [] # Add the new list. lst = doc.createElement(list_type) stack[-1].appendChild(lst) stack.append(lst) indent_stack.append(bullet_token.indent) if list_type == 'olist': start = bullet_token.contents.split('.')[:-1] if start != '1': lst.setAttribute("start", start[-1]) # Fields are treated somewhat specially: A "fieldlist" # node is created to make the parsing simpler, but fields # are adjoined directly into the "epytext" node, not into # the "fieldlist" node. if list_type == 'fieldlist': li = doc.createElement("field") tagwords = bullet_token.contents[1:-1].split() assert 0 < len(tagwords) < 3, "Bad field tag" tag = doc.createElement("tag") tag.appendChild(doc.createTextNode(tagwords[0])) li.appendChild(tag) if len(tagwords) > 1: arg = doc.createElement("arg") arg.appendChild(doc.createTextNode(tagwords[1])) li.appendChild(arg) else: li = doc.createElement("li") if list_type == 'olist': li.setAttribute("bullet", bullet_token.contents) # Add the bullet. stack[-1].appendChild(li) stack.append(li) indent_stack.append(None)
1ba423fa76e441e925c8c70cf95f5bb6dcd0229f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/1ba423fa76e441e925c8c70cf95f5bb6dcd0229f/epytext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1289, 67, 1098, 12, 2434, 16, 31650, 67, 2316, 16, 2110, 16, 3504, 67, 3772, 16, 1334, 16, 5599, 4672, 3536, 1436, 279, 394, 666, 761, 578, 652, 358, 326, 4703, 2151, 16, 598, 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, 389, 1289, 67, 1098, 12, 2434, 16, 31650, 67, 2316, 16, 2110, 16, 3504, 67, 3772, 16, 1334, 16, 5599, 4672, 3536, 1436, 279, 394, 666, 761, 578, 652, 358, 326, 4703, 2151, 16, 598, 3...
except pywbem.CIMError, ce: if ce.args[0] != pywbem.CIM_ERR_INVALID_NAMESPACE:
except CIMError, ce: if ce.args[0] != CIM_ERR_INVALID_NAMESPACE:
def p_qualifier(p): """qualifier : qualifierName | qualifierName ':' flavorList | qualifierName qualifierParameter | qualifierName qualifierParameter ':' flavorList """ qname = p[1] ns = p.parser.handle.default_namespace qval = None flavorlist = [] if len(p) == 3: qval = p[2] elif len(p) == 4: flavorlist = p[3] elif len(p) == 5: qval = p[2] flavorlist = p[4] try: qualdecl = p.parser.qualcache[ns][qname] except KeyError: try: quals = p.parser.handle.EnumerateQualifiers() except pywbem.CIMError, ce: if ce.args[0] != pywbem.CIM_ERR_INVALID_NAMESPACE: ce.file_line = (p.parser.file, p.lexer.lineno) raise _create_ns(p, p.parser.handle, ns) quals = None if quals: for qual in quals: p.parser.qualcache[ns][qual.name] = qual else: for fname in ['qualifiers', 'qualifiers_optional']: qualfile = p.parser.mofcomp.find_mof(fname) if qualfile: p.parser.mofcomp.compile_file(qualfile, ns) try: qualdecl = p.parser.qualcache[ns][qname] except KeyError: p.parser.log('Unknown qualifier: ' + qname) raise flavors = _build_flavors(flavorlist, qualdecl) if qval is None: if qualdecl.type == 'boolean': qval = True else: qval = qualdecl.value # default value else: qval = pywbem.tocimobj(qualdecl.type, qval) p[0] = pywbem.CIMQualifier(qname, qval, type=qualdecl.type, **flavors) # TODO propagated?
d1a547f385819908b15c26774bc5fc75671b5883 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10648/d1a547f385819908b15c26774bc5fc75671b5883/mof_compiler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 293, 67, 28157, 12, 84, 4672, 3536, 28157, 294, 12327, 461, 571, 12327, 461, 3921, 19496, 682, 571, 12327, 461, 12327, 1662, 571, 12327, 461, 12327, 1662, 3921, 19496, 682, 3536, 12621, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 293, 67, 28157, 12, 84, 4672, 3536, 28157, 294, 12327, 461, 571, 12327, 461, 3921, 19496, 682, 571, 12327, 461, 12327, 1662, 571, 12327, 461, 12327, 1662, 3921, 19496, 682, 3536, 12621, 27...
message = _('%(friend)s joined %(channel)s on %(server)s') % {
message = _('%(nick)s joined %(channel)s on %(server)s') % {
def handle_joins(self, connection, event): nick = event.source().split('!')[0] if nick in self.friends: header = _('<b>Known Friend Has Joined:</b>\n') message = _('%(friend)s joined %(channel)s on %(server)s') % { 'nick': nick, 'channel': event.target(), 'server': connection.get_server_name().rstrip('.proxy') } self.notify( header + message )
6e54791aa4581c35201767374be4003cd8bd08f7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5822/6e54791aa4581c35201767374be4003cd8bd08f7/notifier.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 30624, 12, 2890, 16, 1459, 16, 871, 4672, 10909, 273, 871, 18, 3168, 7675, 4939, 2668, 5124, 25146, 20, 65, 309, 10909, 316, 365, 18, 74, 22259, 30, 1446, 273, 389, 2668, 32,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 30624, 12, 2890, 16, 1459, 16, 871, 4672, 10909, 273, 871, 18, 3168, 7675, 4939, 2668, 5124, 25146, 20, 65, 309, 10909, 316, 365, 18, 74, 22259, 30, 1446, 273, 389, 2668, 32,...
print '<dd>', escape(form[key])
print '<dd>', escape(`form[key]`)
def print_form( form ): skeys = form.keys() skeys.sort() print '<h3> The following name/value pairs ' \ 'were entered in the form: </h3>' print '<dl>' for key in skeys: print '<dt>', escape(key), ':', print '<i>', escape(`type(form[key])`), '</i>', print '<dd>', escape(form[key]) print '</dl>'
6ad0821f9855d3a996dec254b980c62f01bfadb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/6ad0821f9855d3a996dec254b980c62f01bfadb7/cgi.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 687, 12, 646, 262, 30, 272, 2452, 273, 646, 18, 2452, 1435, 272, 2452, 18, 3804, 1435, 1172, 2368, 76, 23, 34, 1021, 3751, 508, 19, 1132, 5574, 296, 521, 296, 91, 822, 1621...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 687, 12, 646, 262, 30, 272, 2452, 273, 646, 18, 2452, 1435, 272, 2452, 18, 3804, 1435, 1172, 2368, 76, 23, 34, 1021, 3751, 508, 19, 1132, 5574, 296, 521, 296, 91, 822, 1621...
self.assertEqual(a.next(), 0) self.assertEqual(a.next(), 1)
for i in xrange(100): self.assertEqual(a.next(), i)
def irange(n): for i in xrange(n): yield i
9d7f0ec6c4ab535fc3d876ab7bbdc46393ad5147 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9d7f0ec6c4ab535fc3d876ab7bbdc46393ad5147/test_itertools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 277, 3676, 12, 82, 4672, 364, 277, 316, 12314, 12, 82, 4672, 2824, 277, 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, 277, 3676, 12, 82, 4672, 364, 277, 316, 12314, 12, 82, 4672, 2824, 277, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
'\\end_inset']
'\\end_inset']
def convert_pagebreaks(document): ' Convert inline Newpage insets to new format ' i = 0 while True: i = find_token(document.body, '\\newpage', i) if i == -1: break document.body[i:i+1] = ['\\begin_inset Newpage newpage', '\\end_inset'] i = 0 while True: i = find_token(document.body, '\\pagebreak', i) if i == -1: break document.body[i:i+1] = ['\\begin_inset Newpage pagebreak', '\\end_inset'] i = 0 while True: i = find_token(document.body, '\\clearpage', i) if i == -1: break document.body[i:i+1] = ['\\begin_inset Newpage clearpage', '\\end_inset'] i = 0 while True: i = find_token(document.body, '\\cleardoublepage', i) if i == -1: break document.body[i:i+1] = ['\\begin_inset Newpage cleardoublepage', '\\end_inset']
a97fbaa6858229f4bef56786ffb07688ef5a4d82 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7514/a97fbaa6858229f4bef56786ffb07688ef5a4d82/lyx_1_6.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 67, 2433, 29292, 12, 5457, 4672, 296, 4037, 6370, 1166, 2433, 23576, 358, 394, 740, 296, 277, 273, 374, 1323, 1053, 30, 277, 273, 1104, 67, 2316, 12, 5457, 18, 3432, 16, 3718, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 67, 2433, 29292, 12, 5457, 4672, 296, 4037, 6370, 1166, 2433, 23576, 358, 394, 740, 296, 277, 273, 374, 1323, 1053, 30, 277, 273, 1104, 67, 2316, 12, 5457, 18, 3432, 16, 3718, 27...
self.Manager.OpenFileInCurrent(filepath) new_editingpanel = EditingPanel(self, self.Manager) self.FileOpened.AddPage(new_editingpanel, "") self.FileOpened.SetSelection(self.Manager.GetCurrentNodeIndex())
result = self.Manager.OpenFileInCurrent(filepath) if type(result) == IntType: new_editingpanel = EditingPanel(self, self.Manager) new_editingpanel.SetIndex(result) self.FileOpened.AddPage(new_editingpanel, "") window = self.FileOpened.GetPage(0) if window: self.Manager.ChangeCurrentNode(window.GetIndex()) self.FileOpened.SetSelection(0)
def __init__(self, parent): self._init_ctrls(parent) self.HtmlFrameOpened = [] self.Manager = NodeManager(ScriptDirectory) for filepath in filesOpen: self.Manager.OpenFileInCurrent(filepath) new_editingpanel = EditingPanel(self, self.Manager) self.FileOpened.AddPage(new_editingpanel, "") self.FileOpened.SetSelection(self.Manager.GetCurrentNodeIndex()) if self.Manager.CurrentDS302Defined(): self.EditMenu.Enable(wxID_OBJDICTEDITEDITMENUITEMS8, True) else: self.EditMenu.Enable(wxID_OBJDICTEDITEDITMENUITEMS8, False) self.RefreshEditMenu() self.RefreshBufferState() self.RefreshProfileMenu() self.RefreshTitle() self.RefreshMainMenu()
0dbbb9e9f96aba95b4fb720110dd4f1bc1d9aa27 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11017/0dbbb9e9f96aba95b4fb720110dd4f1bc1d9aa27/objdictedit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 4672, 365, 6315, 2738, 67, 16277, 87, 12, 2938, 13, 365, 18, 4353, 3219, 23115, 273, 5378, 225, 365, 18, 1318, 273, 2029, 1318, 12, 3651, 2853, 13, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 4672, 365, 6315, 2738, 67, 16277, 87, 12, 2938, 13, 365, 18, 4353, 3219, 23115, 273, 5378, 225, 365, 18, 1318, 273, 2029, 1318, 12, 3651, 2853, 13, ...
registry_copy = copy.deepcopy(registry) try: p._resolve_dependencies(registry_copy) except UserError: pass else: p = package(self.dist_root, package_name) p._resolve_dependencies(registry)
self.dependency_registry.merge(p.dependency_registry)
def _resolve_dependencies(self, registry): if (self.name in registry.dict): return registry.append(self.name, self) if (self.config is not None): for package_name in self.config.get("packages_required_for_use", []): package(self.dist_root, package_name)._resolve_dependencies(registry) for package_name in self.config.get("packages_required_for_build", []): p = package(self.dist_root, package_name, must_exist=0) if (p.dist_path is None): registry.missing_for_build.append(package_name) else: p._resolve_dependencies(registry) for package_name in self.config.get("optional_packages", []): try: # look ahead stage 1 p = package(self.dist_root, package_name) except UserError: pass else: if (p.dist_path is not None): registry_copy = copy.deepcopy(registry) try: # look ahead stage 2 p._resolve_dependencies(registry_copy) except UserError: pass else: # repeat and keep results p = package(self.dist_root, package_name) p._resolve_dependencies(registry)
4d95924e6f16cb294c2bb448d7dbbf07007849a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/4d95924e6f16cb294c2bb448d7dbbf07007849a2/configure.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 10828, 67, 11037, 12, 2890, 16, 4023, 4672, 309, 261, 2890, 18, 529, 316, 4023, 18, 1576, 4672, 327, 4023, 18, 6923, 12, 2890, 18, 529, 16, 365, 13, 309, 261, 2890, 18, 1425, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 10828, 67, 11037, 12, 2890, 16, 4023, 4672, 309, 261, 2890, 18, 529, 316, 4023, 18, 1576, 4672, 327, 4023, 18, 6923, 12, 2890, 18, 529, 16, 365, 13, 309, 261, 2890, 18, 1425, 35...
timestamp = nowString.replace("-", "") timestamp = timestamp.replace(":", "") timestamp = timestamp.replace(" ", "") if not os.path.isdir(timestamp): print "skipping rsync to staging area, no dir", timestamp log.write("skipping rsync to staging area, no dir") else: if os.name == 'nt' or sys.platform == 'cygwin': platform = 'windows' elif sys.platform == 'darwin': platform = 'macosx' else: platform = 'linux' print "Rsyncing to staging area..." log.write('rsync -e ssh -avzp ' + timestamp + ' ' + options.rsyncServer + ':staging/' + platform) outputList = hardhatutil.executeCommandReturnOutputRetry( [rsyncProgram, "-e", "ssh", "-avzp", timestamp, options.rsyncServer + ":staging/" + platform]) hardhatutil.dumpOutputList(outputList, log) completedFile = timestamp + os.sep + "completed" open(completedFile, "w").close() log.write('rsync -e ssh -avzp ' + completedFile + ' ' + options.rsyncServer + ':staging/' + platform + "/" + timestamp) outputList = hardhatutil.executeCommandReturnOutputRetry( [rsyncProgram, "-e", "ssh", "-avzp", completedFile, options.rsyncServer + ":staging/" + platform + "/" + timestamp]) hardhatutil.dumpOutputList(outputList, log) hardhatutil.rmdirRecursive(timestamp)
UploadToStaging(nowString, log, rsyncProgram, options.rsyncServer)
def main(): global buildscriptFile, buildDir, fromAddr, mailtoAddr, alertAddr, adminAddr, defaultDomain, defaultRsyncServer # this is a sane default - the "true" value is pulled from the module being built treeName = "Chandler" parser = OptionParser(usage="%prog [options] buildName", version="%prog 1.2") parser.add_option("-t", "--toAddr", action="store", type="string", dest="toAddr", default=mailtoAddr, help="Where to mail script reports\n" " [default] " + mailtoAddr + defaultDomain) parser.add_option("-p", "--project", action="store", type="string", dest="project", default="newchandler", help="Name of script to use (without .py extension)\n" "[default] newchandler") parser.add_option("-o", "--output", action="store", type="string", dest="outputDir", default=os.path.join(os.environ['HOME'],"output"), help="Name of temp output directory\n" " [default] ~/output") parser.add_option("-a", "--alert", action="store", type="string", dest="alertAddr", default=alertAddr, help="E-mail to notify on build errors \n" " [default] " + alertAddr + defaultDomain) parser.add_option("-r", "--rsyncServer", action="store", type="string", dest="rsyncServer", default=defaultRsyncServer, help="Net address of server where builds get uploaded \n" " [default] " + defaultRsyncServer) parser.add_option("-s", "--skipRSync", action="store_true", dest="skipRsync", default=False, help="Skip rsync step \n" " [default] False") parser.add_option("-u", "--uploadStaging", action="store_true", dest="uploadStaging", default=False, help="Upload tarballs to staging area \n" " [default] False") parser.add_option("-S", "--skipTests", action="store_true", dest="skipTests", default=False, help="Skip Unit Tests \n" " [default] False") parser.add_option("-R", "--revision", action="store", type="string", dest="revID", default=None, help="revision # to checkout\n" " [default] None") parser.add_option("-w", "--work", action="store", type="string", dest="buildDir", default=buildDir, help="Name of working directory\n" " [default] ~/tinderbuild") (options, args) = parser.parse_args() if len(args) < 1: parser.print_help() parser.error("You must at least provide a name for your build") curDir = os.path.abspath(os.getcwd()) buildName = args[0] fromAddr += defaultDomain mailtoAddr = options.toAddr alertAddr = options.alertAddr buildDir = options.buildDir if mailtoAddr.find('@') == -1: mailtoAddr += defaultDomain if alertAddr.find('@') == -1: alertAddr += defaultDomain skipRsync = options.skipRsync uploadStaging = options.uploadStaging buildscriptFile = os.path.join("buildscripts", options.project + ".py") outputDir = os.path.abspath(options.outputDir) if not os.path.exists(outputDir): os.mkdir(outputDir) if not os.path.exists(buildDir): os.mkdir(buildDir) path = os.environ.get('PATH', os.environ.get('path')) svnProgram = hardhatutil.findInPath(path, "svn") if not skipRsync: rsyncProgram = hardhatutil.findInPath(path, "rsync") startInt = int(time.time()) startTime = str(startInt) nowString = time.strftime("%Y-%m-%d %H:%M:%S") buildVersion = hardhatutil.RemovePunctuation(nowString) print "Starting:", nowString, buildVersion, buildDir os.chdir(curDir) log = open(logFile, "w") log.write("Start: " + nowString + "\n") try: # load (or reload) the buildscript file for the project mod = hardhatutil.ModuleFromFile(buildscriptFile, "buildscript") treeName = mod.treeName sleepMinutes = mod.sleepMinutes SendMail(fromAddr, mailtoAddr, startTime, buildName, "building", treeName, None) ret = mod.Start(hardhatFile, buildDir, buildVersion, 0, log, upload=options.uploadStaging, skipTests=options.skipTests, revID=options.revID) except TinderbuildError, e: print e print "Tinderbuild: Build failed" log.write("Tinderbuild: Build failed\n") status = "build_failed" log.close() log = open(logFile, "r") logContents = log.read() log.close() SendMail(fromAddr, alertAddr, startTime, buildName, "The build failed", treeName, None) SendMail(fromAddr, mailtoAddr, startTime, buildName, status, treeName, logContents) log = open(logFile, "w") except Exception, e: print e print "Build failed" log.write("Build failed\n") status = "build_failed" log.close() log = open(logFile, "r") logContents = log.read() log.close() SendMail(fromAddr, alertAddr, startTime, buildName, "The build failed", treeName, None) SendMail(fromAddr, mailtoAddr, startTime, buildName, status, treeName, logContents) log = open(logFile, "w") else: if ret == "success-nochanges": print "There were no changes, and the tests were successful" log.write("There were no changes, and the tests were successful\n") status = "success" elif ret == "success-changes" or ret == "success-first-run": if ret == "success-first-run": print "First run of tinderbox, and the tests were successful" log.write("First run of tinderbox, and the tests were successful\n") else: print "There were changes, and the tests were successful" log.write("There were changes, and the tests were successful\n") status = "success" srcDir = os.path.join(buildDir, "output", buildVersion) newDir = os.path.join(outputDir, buildVersion) if os.path.exists(srcDir): print "Renaming " + srcDir + " to " + newDir log.write("Renaming " + srcDir + " to " + newDir + "\n") os.rename(os.path.join(buildDir, "output", buildVersion), newDir) if os.path.exists(outputDir+os.sep+"index.html"): os.remove(outputDir+os.sep+"index.html") if os.path.exists(outputDir+os.sep+"time.js"): os.remove(outputDir+os.sep+"time.js") print "Calling CreateIndex with " + newDir log.write("Calling CreateIndex with " + newDir + "\n") CreateIndex(treeName, outputDir, buildVersion, nowString, buildName) print "Calling RotateDirectories" log.write("Calling RotateDirectories\n") RotateDirectories(outputDir) buildNameNoSpaces = buildName.replace(" ", "") if skipRsync: print "skipping rsync" log.write("skipping rsync") else: print "Rsyncing..." log.write('rsync -e "ssh -l builder" -avzp ' + outputDir + os.sep + ' ' + options.rsyncServer + ':continuous/' + buildNameNoSpaces) outputList = hardhatutil.executeCommandReturnOutputRetry( [rsyncProgram, "-e", '"ssh -l builder"', "-avzp", outputDir + os.sep, options.rsyncServer + ":continuous/" + buildNameNoSpaces]) hardhatutil.dumpOutputList(outputList, log) if not uploadStaging: print "skipping rsync to staging area" log.write("skipping rsync to staging area") else: timestamp = nowString.replace("-", "") timestamp = timestamp.replace(":", "") timestamp = timestamp.replace(" ", "") if not os.path.isdir(timestamp): print "skipping rsync to staging area, no dir", timestamp log.write("skipping rsync to staging area, no dir") else: if os.name == 'nt' or sys.platform == 'cygwin': platform = 'windows' elif sys.platform == 'darwin': platform = 'macosx' else: platform = 'linux' print "Rsyncing to staging area..." log.write('rsync -e ssh -avzp ' + timestamp + ' ' + options.rsyncServer + ':staging/' + platform) outputList = hardhatutil.executeCommandReturnOutputRetry( [rsyncProgram, "-e", "ssh", "-avzp", timestamp, options.rsyncServer + ":staging/" + platform]) hardhatutil.dumpOutputList(outputList, log) completedFile = timestamp + os.sep + "completed" open(completedFile, "w").close() log.write('rsync -e ssh -avzp ' + completedFile + ' ' + options.rsyncServer + ':staging/' + platform + "/" + timestamp) outputList = hardhatutil.executeCommandReturnOutputRetry( [rsyncProgram, "-e", "ssh", "-avzp", completedFile, options.rsyncServer + ":staging/" + platform + "/" + timestamp]) hardhatutil.dumpOutputList(outputList, log) hardhatutil.rmdirRecursive(timestamp) elif ret[:12] == "build_failed": print "The build failed" log.write("The build failed\n") status = "build_failed" log.close() log = open(logFile, "r") logContents = log.read() log.close() SendMail(fromAddr, alertAddr, startTime, buildName, "The build failed", treeName, None) SendMail(fromAddr, mailtoAddr, startTime, buildName, status, treeName, logContents) log = open(logFile, "w") elif ret[:11] == "test_failed": print "Unit tests failed" log.write("Unit tests failed\n") status = "test_failed" log.close() log = open(logFile, "r") logContents = log.read() log.close() SendMail(fromAddr, alertAddr, startTime, buildName, "Unit tests failed", treeName, None) SendMail(fromAddr, mailtoAddr, startTime, buildName, status, treeName, logContents) log = open(logFile, "w") else: print "There were no changes" log.write("There were no changes in SVN\n") status = "not_running" log.write( "End = " + time.strftime("%Y-%m-%d %H:%M:%S") + "\n") try: log.close() maillog = open(logFile, "r") logContents = maillog.read() maillog.close() nowTime = str(int(time.time())) except e: print "exception during log flush and close" print e SendMail(fromAddr, mailtoAddr, startTime, buildName, status, treeName, logContents) if sleepMinutes: print "Sleeping %d minutes" % sleepMinutes time.sleep(sleepMinutes * 60)
10b855af175ec92972448d0ba0e775fdc95d4e89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/10b855af175ec92972448d0ba0e775fdc95d4e89/tinderbox.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2552, 1361, 4263, 812, 16, 1361, 1621, 16, 628, 3178, 16, 4791, 869, 3178, 16, 6881, 3178, 16, 3981, 3178, 16, 805, 3748, 16, 805, 54, 8389, 2081, 225, 468, 333, 353, 279,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2552, 1361, 4263, 812, 16, 1361, 1621, 16, 628, 3178, 16, 4791, 869, 3178, 16, 6881, 3178, 16, 3981, 3178, 16, 805, 3748, 16, 805, 54, 8389, 2081, 225, 468, 333, 353, 279,...
if request.method == 'POST': return redirect('villages') else: village_objects = get_user_villages(request) villages = Village.objects.filter(id__in = village_objects).distinct().order_by("-id")[offset:limit] if(villages): json_subcat = serializers.serialize("json", villages, relations=('block',)) else: json_subcat = 'EOF' return HttpResponse(json_subcat, mimetype="application/javascript")
if request.method == 'POST': return redirect('villages') else: village_objects = get_user_villages(request) villages = Village.objects.filter(id__in = village_objects).distinct().order_by("-id")[offset:limit] if(villages): json_subcat = serializers.serialize("json", villages, relations=('block',)) else: json_subcat = 'EOF' return HttpResponse(json_subcat, mimetype="application/javascript")
def get_villages_online(request, offset, limit): if request.method == 'POST': return redirect('villages') else: village_objects = get_user_villages(request) villages = Village.objects.filter(id__in = village_objects).distinct().order_by("-id")[offset:limit] if(villages): json_subcat = serializers.serialize("json", villages, relations=('block',)) else: json_subcat = 'EOF' return HttpResponse(json_subcat, mimetype="application/javascript")
7759d6eb08a7e6568691e648ed314450c8afa48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11995/7759d6eb08a7e6568691e648ed314450c8afa48e/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 90, 737, 1023, 67, 21026, 12, 2293, 16, 1384, 16, 1800, 4672, 309, 590, 18, 2039, 422, 296, 3798, 4278, 327, 3136, 2668, 90, 737, 1023, 6134, 469, 30, 331, 737, 410, 67, 691...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 90, 737, 1023, 67, 21026, 12, 2293, 16, 1384, 16, 1800, 4672, 309, 590, 18, 2039, 422, 296, 3798, 4278, 327, 3136, 2668, 90, 737, 1023, 6134, 469, 30, 331, 737, 410, 67, 691...
option.size: specifies the chart size as a tuple (width,
options.size: specifies the chart size as a tuple (width,
def asgooglechartURL(seq, options={}): """*seq* is a sequence of iterables (each one assumed to be the output from :meth:`asann`) into a URL suitable for passing to the Google Chart API. Each element of the sequence corresponds to a different data series, all the series are plotted on the same chart. *Options* is a dict mapping keywords to optional attributes: option.offset: specifies the inter-chart offset, as per the -o option (see module docstring). The default is zero. option.size: specifies the chart size as a tuple (width, height). The default is (600, 500). """ import itertools # default options default_options = dict(offset=0, size=(600,500), colour=['ff0000', '000000', '0000ff', 'ff00ff'], ) default_options.update(options) options = default_options prefix = 'http://chart.apis.google.com/chart' # Read all data because we need to compute min and max years data = [list(s) for s in seq] yearmin = min(map(lambda p:p[0], itertools.chain(*data))) yearmax = max(map(lambda p:p[0], itertools.chain(*data))) data = [pad(s, yearmin, yearmax) for s in data] # Let y be the list of years for the chart legend. We include # the first year of the series, the last year, and every decade # beginning. y = map(lambda x:x[0], data[0]) for i in range(1,len(y)-1): if y[i]%10: y[i]='' xaxis = '|' + '|'.join(map(str, y)) trends = [trendlines(l) for l in data] trenddata = [t[0] for t in trends] slopes = [t[1:len(data)+1] for t in trends] coefficients = [t[len(data)+1:] for t in trends] ds = ['-999|' + chartsingle(l) for l in data] + trenddata vaxis = '||-0.5|+0.0|+0.5|' chxl = 'chxl=0:'+xaxis+'|1:'+vaxis+'|2:'+vaxis chxt = 'chxt=x,y,r' chd='chd=t:' + '|'.join(ds) chs='chs=' + 'x'.join(map(str, options['size'])) # Choose scale, and deal with offset if we have to. offset = options['offset'] scale = [-100,100]*6 if offset and len(seq) > 1: scale *= len(seq) for i in range(len(seq)): # Y range of actual data series scale[4*i+2] -= i*offset scale[4*i+3] -= i*offset # Y range of first trend scale[4*len(seq) + 8*i + 2] -= offset scale[4*len(seq) + 8*i + 3] -= offset # Y range of second trend scale[4*len(seq) + 8*i + 6] -= offset scale[4*len(seq) + 8*i + 7] -= offset chds = 'chds=' + ','.join(map(str, scale)) # red, black, blue, magenta for the underlying graphs colours = options['colour'] colours = colours[:len(data)] chm = 'chm=' + '|'.join(slope_markers(slopes, coefficients, colours)) # Replicate each colour by three (for the chart and its two trend # lines). series_colours = colours + list(itertools.chain(*([c,c] for c in colours))) chco = 'chco=' + ','.join(series_colours) # Line Style chls = 'chls=' + '|'.join(['1']*len(data) + ['1,8,2', '1']*len(data)) return prefix + '?' + '&'.join( ['cht=lxy',chds,chd,chxt,chxl,chco,chls,chm,chs])
fcceccd589e2b05d5dde1db921d81cea9a2d7e4c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6890/fcceccd589e2b05d5dde1db921d81cea9a2d7e4c/vischeck.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 487, 9536, 11563, 1785, 12, 5436, 16, 702, 12938, 4672, 3536, 14, 5436, 14, 353, 279, 3102, 434, 27447, 261, 13798, 1245, 12034, 358, 506, 326, 876, 628, 294, 27305, 28288, 345, 1072, 24...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 487, 9536, 11563, 1785, 12, 5436, 16, 702, 12938, 4672, 3536, 14, 5436, 14, 353, 279, 3102, 434, 27447, 261, 13798, 1245, 12034, 358, 506, 326, 876, 628, 294, 27305, 28288, 345, 1072, 24...
For example, if `x010` is a variable over GF(2) for `r=2` and `c=2` then refers to the MOST significant bit of the entry in the position (1,0) in the state array matrix.
For example, if `x_{0,1,0}` is a variable over `\mathbb{F}_2` for `r=2` and `c=2` then refers to the *most* significant bit of the entry in the position (1,0) in the state array matrix.
def ring(self, order=None, reverse_variables=None): r""" Construct a ring as a base ring for the polynomial system.
361ee6a2b2c797fdc77944b615cb058df81aca2e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/361ee6a2b2c797fdc77944b615cb058df81aca2e/sr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9221, 12, 2890, 16, 1353, 33, 7036, 16, 4219, 67, 7528, 33, 7036, 4672, 436, 8395, 14291, 279, 9221, 487, 279, 1026, 9221, 364, 326, 16991, 2619, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9221, 12, 2890, 16, 1353, 33, 7036, 16, 4219, 67, 7528, 33, 7036, 4672, 436, 8395, 14291, 279, 9221, 487, 279, 1026, 9221, 364, 326, 16991, 2619, 18, 2, -100, -100, -100, -100, -100, -...
if file == '' or file is None: continue if mode is None:
if mode is None or mode == '': self.filenames.append(file)
def genFileLists(self): """produces lists of dirs and files for this header in two lists""" files = self.listTagByName('filenames') fileflags = self.listTagByName('fileflags') filemodes = self.listTagByName('filemodes') filetuple = zip(files, filemodes, fileflags) for (file, mode, flag) in filetuple: #garbage checks if file == '' or file is None: continue if mode is None: continue if stat.S_ISDIR(mode): self.dirnames.append(file) else: if flag is None: self.filenames.append(file) else: if (flag & 64): self.ghostnames.append(file) else: self.filenames.append(file)
72df9f312b4eb58908e08ce23106dc063ee9e2f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9557/72df9f312b4eb58908e08ce23106dc063ee9e2f3/dumpMetadata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3157, 812, 7432, 12, 2890, 4672, 3536, 11776, 764, 6035, 434, 7717, 471, 1390, 364, 333, 1446, 316, 2795, 6035, 8395, 225, 1390, 273, 365, 18, 1098, 1805, 5911, 2668, 19875, 6134, 585, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3157, 812, 7432, 12, 2890, 4672, 3536, 11776, 764, 6035, 434, 7717, 471, 1390, 364, 333, 1446, 316, 2795, 6035, 8395, 225, 1390, 273, 365, 18, 1098, 1805, 5911, 2668, 19875, 6134, 585, 7...
assy.assy_valid = False
assy.assy_valid = False
def readmmp(assy, filename, isInsert = False, showProgressDialog = False): #bruce 050302 split out some subroutines for use in other code """ Read an mmp file to create a new model (including a new Clipboard). Returns a tuple of (viewdata, tree, shelf). If isInsert is False (the default), assy will be modified to include the new items. This interface needs revising and clarifying. It should take only a filename as parameter, and return a single data structure representing the contents of that file. @param assy: the assembly the file contents are being added into @type assy: assembly.assembly @param filename: where the data will be read from @type filename: string @param isInsert: if True, the file contents are being added to an existing assembly, otherwise the file contents are being used to initialize a new assembly. @type isInsert: boolean @param showProgressDialog: if True, display a progress dialog while reading a file. Default is False. @type showProgressDialog: boolean """ assert assy.assy_valid assy.assy_valid = False # disable updaters during read [bruce 080117] try: grouplist = _readmmp(assy, filename, isInsert, showProgressDialog) if (not isInsert): _reset_grouplist(assy, grouplist) # handles grouplist is None (though not very well) finally: assy.assy_valid = True return grouplist
5ab7078870c7da1d9b23f1248aa39b43690b6113 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/5ab7078870c7da1d9b23f1248aa39b43690b6113/files_mmp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 81, 1291, 12, 428, 93, 16, 1544, 16, 353, 4600, 273, 1083, 16, 2405, 5491, 6353, 273, 1083, 4672, 468, 2848, 3965, 374, 3361, 23, 3103, 1416, 596, 2690, 720, 7028, 1465, 364, 999,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 81, 1291, 12, 428, 93, 16, 1544, 16, 353, 4600, 273, 1083, 16, 2405, 5491, 6353, 273, 1083, 4672, 468, 2848, 3965, 374, 3361, 23, 3103, 1416, 596, 2690, 720, 7028, 1465, 364, 999,...
line = self.re_assign.sub( r'\1 \2 ', line )
line = self.re_assign.sub( r'\1 \2 \3', line )
def process(self, line): if self.reading_copyright: if not self.re_copyright_end.match( line ): self.copyright += line return
8373f7b2a6666c9bb3bf966d4dc7a0cc8567d40a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9982/8373f7b2a6666c9bb3bf966d4dc7a0cc8567d40a/pp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 12, 2890, 16, 980, 4672, 309, 365, 18, 21803, 67, 29187, 30, 309, 486, 365, 18, 266, 67, 29187, 67, 409, 18, 1916, 12, 980, 262, 30, 365, 18, 29187, 1011, 980, 327, 2, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 12, 2890, 16, 980, 4672, 309, 365, 18, 21803, 67, 29187, 30, 309, 486, 365, 18, 266, 67, 29187, 67, 409, 18, 1916, 12, 980, 262, 30, 365, 18, 29187, 1011, 980, 327, 2, -100, ...
"""Clear the pattern cache"""
"""Clear the pattern cache."""
def purge(): """Clear the pattern cache""" _cache.clear() _cacheb.clear()
2b255e224e7ad1eec421785f11a5262b813383d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/2b255e224e7ad1eec421785f11a5262b813383d9/fnmatch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11668, 13332, 3536, 9094, 326, 1936, 1247, 12123, 389, 2493, 18, 8507, 1435, 389, 2493, 70, 18, 8507, 1435, 225, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 11668, 13332, 3536, 9094, 326, 1936, 1247, 12123, 389, 2493, 18, 8507, 1435, 389, 2493, 70, 18, 8507, 1435, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.o.write(' =%d=> ' % (self.hit + 1)) self.o.write(data) elif self.file_td_tail: self.o.write(data + ' ') if self.tag_structs['span']['s']:
self.o.write(self.file_td_head)
def handle_data(self, data): if self.hit < self.__max_hit: if self.tag_structs['td']['s']: if self.file_td_head: self.o.write(' =%d=> ' % (self.hit + 1)) self.o.write(data) elif self.file_td_tail: self.o.write(data + ' ')
1e291972ec3e480855c49b2ae77a567b9e37f6b8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10749/1e291972ec3e480855c49b2ae77a567b9e37f6b8/weblookup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 892, 12, 2890, 16, 501, 4672, 309, 365, 18, 15989, 411, 365, 16186, 1896, 67, 15989, 30, 309, 365, 18, 2692, 67, 1697, 87, 3292, 4465, 21712, 87, 3546, 30, 309, 365, 18, 76...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 892, 12, 2890, 16, 501, 4672, 309, 365, 18, 15989, 411, 365, 16186, 1896, 67, 15989, 30, 309, 365, 18, 2692, 67, 1697, 87, 3292, 4465, 21712, 87, 3546, 30, 309, 365, 18, 76...
(retcode, output) = google.process_utils.RunCommandFull(cmd, collect_output=True) if "Success" in output: return 0 else: return 1
return 0
def RunTests(build_dir=None): '''This is just a simple wrapper for running the test through v8_shell. Since v8_shell always returns 0 whether the test passes or fails, buildbot looks at stdout to test for failure. ''' script_dir = google.path_utils.ScriptDir() chrome_dir = google.path_utils.FindUpward(script_dir, "chrome") v8_dir = google.path_utils.FindUpward(script_dir, "v8") if build_dir: v8_shell = os.path.join(build_dir, "v8_shell.exe") else: v8_shell = os.path.join(chrome_dir, "Debug", "v8_shell.exe") # look for Debug version first if not os.path.isfile(v8_shell): v8_shell = os.path.join(chrome_dir, "Release", "v8_shell.exe") cmd = [v8_shell, "--allow-natives-syntax", "--expose-debug-as", "debugContext", os.path.join(chrome_dir, "browser", "debugger", "resources", "debugger_shell.js"), # TODO Change the location of mjsunit.js from the copy in this # directory to the copy in V8 when switching to use V8 from # code.google.com. # os.path.join(v8_dir, "test", "mjsunit", "mjsunit.js"), os.path.join(chrome_dir, "test", "debugger", "mjsunit.js"), os.path.join(chrome_dir, "test", "debugger", "test_protocol.js") ] (retcode, output) = google.process_utils.RunCommandFull(cmd, collect_output=True) if "Success" in output: return 0 else: return 1
58bfc6b074bf05e36f02a4349a6217b95f3b9c2c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/58bfc6b074bf05e36f02a4349a6217b95f3b9c2c/debugger_unittests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1939, 14650, 12, 3510, 67, 1214, 33, 7036, 4672, 9163, 2503, 353, 2537, 279, 4143, 4053, 364, 3549, 326, 1842, 3059, 331, 28, 67, 10304, 18, 7897, 331, 28, 67, 10304, 3712, 1135, 374, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1939, 14650, 12, 3510, 67, 1214, 33, 7036, 4672, 9163, 2503, 353, 2537, 279, 4143, 4053, 364, 3549, 326, 1842, 3059, 331, 28, 67, 10304, 18, 7897, 331, 28, 67, 10304, 3712, 1135, 374, ...
help="Specify the minimum, maximum and bin widt of "\
help="Specify the minimum, maximum and bin width of "\
def __init__(self, usage=None, option_list=None, options_class=None, version=None, conflict_handler='error', description=None, **kwargs): """ Constructor for C{DgsOptions}
3fa6573eb0df044af968d289d86fa17e98c2f1f9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/763/3fa6573eb0df044af968d289d86fa17e98c2f1f9/hlr_dgs_options.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4084, 33, 7036, 16, 1456, 67, 1098, 33, 7036, 16, 702, 67, 1106, 33, 7036, 16, 1177, 33, 7036, 16, 7546, 67, 4176, 2218, 1636, 2187, 2477, 33, 7036, 16...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4084, 33, 7036, 16, 1456, 67, 1098, 33, 7036, 16, 702, 67, 1106, 33, 7036, 16, 1177, 33, 7036, 16, 7546, 67, 4176, 2218, 1636, 2187, 2477, 33, 7036, 16...
>>> dump_tokens("x = 1 - y + 15 - 01 + 0x124 + z + a[5]")
>>> dump_tokens("x = 1 - y + 15 - 1 + 0x124 + z + a[5]")
>>> dump_tokens("def d01v_(a=1, *k, **w): pass")
1fbae9878cfa20d661d49e29e47c6085f32923a3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/1fbae9878cfa20d661d49e29e47c6085f32923a3/test_tokenize.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 4080, 4657, 67, 7860, 2932, 536, 302, 1611, 90, 67, 12, 69, 33, 21, 16, 380, 79, 16, 2826, 91, 4672, 1342, 7923, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 4080, 4657, 67, 7860, 2932, 536, 302, 1611, 90, 67, 12, 69, 33, 21, 16, 380, 79, 16, 2826, 91, 4672, 1342, 7923, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
numpages = len(sens)/perpage
numpages,rest = divmod(len(sens),perpage) numpages +=1
def get_time_str(time_f): if (str(time_f) == "") or (str(time_f) == "0.0"): return "" else: stime = time.ctime(float(time_f)) i = stime.find(":") return stime[i-2:i+6] + "." + str(time_f).split(".")[1]
3c832b51f649047ae3a766eda53f0b8e1981cf8a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5243/3c832b51f649047ae3a766eda53f0b8e1981cf8a/print_sensors.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 957, 67, 701, 12, 957, 67, 74, 4672, 309, 261, 701, 12, 957, 67, 74, 13, 422, 1408, 13, 578, 261, 701, 12, 957, 67, 74, 13, 422, 315, 20, 18, 20, 6, 4672, 327, 1408, 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, 336, 67, 957, 67, 701, 12, 957, 67, 74, 4672, 309, 261, 701, 12, 957, 67, 74, 13, 422, 1408, 13, 578, 261, 701, 12, 957, 67, 74, 13, 422, 315, 20, 18, 20, 6, 4672, 327, 1408, 4...
self.resize(800,400)
self.resize(800, 400)
def __init__(self, parent=None, signalManager = None, name='Classification Tree Viewer'): OWWidget.__init__(self, parent, signalManager, name)
85fccbe38c357665f758c0fb56be509433f7cf90 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/85fccbe38c357665f758c0fb56be509433f7cf90/OWClassificationTreeViewer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 33, 7036, 16, 4277, 1318, 273, 599, 16, 508, 2218, 19168, 4902, 4441, 264, 11, 4672, 18233, 4609, 16186, 2738, 972, 12, 2890, 16, 982, 16, 4277, 131...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 33, 7036, 16, 4277, 1318, 273, 599, 16, 508, 2218, 19168, 4902, 4441, 264, 11, 4672, 18233, 4609, 16186, 2738, 972, 12, 2890, 16, 982, 16, 4277, 131...
0x2018: ur'`', 0x2019: ur"'",
0x2018: ur'\textquoteleft{}', 0x2019: ur'\textquoteright{}',
def encode(self, text): """Return text with 'problematic' characters escaped.
615b7c63056f38506975fdabfa9a6028e81c9528 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5620/615b7c63056f38506975fdabfa9a6028e81c9528/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 12, 2890, 16, 977, 4672, 3536, 990, 977, 598, 296, 18968, 2126, 11, 3949, 8345, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 12, 2890, 16, 977, 4672, 3536, 990, 977, 598, 296, 18968, 2126, 11, 3949, 8345, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
if args[0][-3:] != ".py": usage('the script name must have a .py suffix')
def main(): # overridable context prefix = None # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path modargs = 0 debug = 1 odir = '' win = sys.platform[:3] == 'win' # modules that are imported by the Python runtime implicits = ["site", "exceptions"] # output files frozen_c = 'frozen.c' config_c = 'config.c' target = 'a.out' # normally derived from script name makefile = 'Makefile' subsystem = 'console' # parse command line try: opts, args = getopt.getopt(sys.argv[1:], 'deh:mo:p:P:qs:w') except getopt.error, msg: usage('getopt error: ' + str(msg)) # proces option arguments for o, a in opts: if o == '-h': print __doc__ return if o == '-d': debug = debug + 1 if o == '-e': extensions.append(a) if o == '-m': modargs = 1 if o == '-o': odir = a if o == '-p': prefix = a if o == '-P': exec_prefix = a if o == '-q': debug = 0 if o == '-w': win = not win if o == '-s': if not win: usage("-s subsystem option only on Windows") subsystem = a # default prefix and exec_prefix if not exec_prefix: if prefix: exec_prefix = prefix else: exec_prefix = sys.exec_prefix if not prefix: prefix = sys.prefix # determine whether -p points to the Python source tree ishome = os.path.exists(os.path.join(prefix, 'Include', 'pythonrun.h')) # locations derived from options version = sys.version[:3] if ishome: print "(Using Python source directory)" binlib = exec_prefix incldir = os.path.join(prefix, 'Include') config_c_in = os.path.join(prefix, 'Modules', 'config.c.in') frozenmain_c = os.path.join(prefix, 'Python', 'frozenmain.c') makefile_in = os.path.join(exec_prefix, 'Modules', 'Makefile') else: binlib = os.path.join(exec_prefix, 'lib', 'python%s' % version, 'config') incldir = os.path.join(prefix, 'include', 'python%s' % version) config_c_in = os.path.join(binlib, 'config.c.in') frozenmain_c = os.path.join(binlib, 'frozenmain.c') makefile_in = os.path.join(binlib, 'Makefile') supp_sources = [] defines = [] includes = ['-I' + incldir, '-I' + binlib] # sanity check of directories and files for dir in [prefix, exec_prefix, binlib, incldir] + extensions: if not os.path.exists(dir): usage('needed directory %s not found' % dir) if not os.path.isdir(dir): usage('%s: not a directory' % dir) if win: files = supp_sources else: files = [config_c_in, makefile_in] + supp_sources for file in supp_sources: if not os.path.exists(file): usage('needed file %s not found' % file) if not os.path.isfile(file): usage('%s: not a plain file' % file) if not win: for dir in extensions: setup = os.path.join(dir, 'Setup') if not os.path.exists(setup): usage('needed file %s not found' % setup) if not os.path.isfile(setup): usage('%s: not a plain file' % setup) # check that enough arguments are passed if not args: usage('at least one filename argument required') # check that the script name ends in ".py" if args[0][-3:] != ".py": usage('the script name must have a .py suffix') # check that file arguments exist for arg in args: if not os.path.exists(arg): usage('argument %s not found' % arg) if not os.path.isfile(arg): usage('%s: not a plain file' % arg) # process non-option arguments scriptfile = args[0] modules = args[1:] # derive target name from script name base = os.path.basename(scriptfile) base, ext = os.path.splitext(base) if base: if base != scriptfile: target = base else: target = base + '.bin' # handle -o option base_frozen_c = frozen_c base_config_c = config_c base_target = target if odir and not os.path.isdir(odir): try: os.mkdir(odir) print "Created output directory", odir except os.error, msg: usage('%s: mkdir failed (%s)' % (odir, str(msg))) if odir: frozen_c = os.path.join(odir, frozen_c) config_c = os.path.join(odir, config_c) target = os.path.join(odir, target) makefile = os.path.join(odir, makefile) # Actual work starts here... # collect all modules of the program mf = modulefinder.ModuleFinder(path, debug) for mod in implicits: mf.import_hook(mod) for mod in modules: if mod == '-m': modargs = 1 continue if modargs: if mod[-2:] == '.*': mf.import_hook(mod[:-2], None, ["*"]) else: mf.import_hook(mod) else: mf.load_file(mod) mf.run_script(scriptfile) if debug > 0: mf.report() print dict = mf.modules # generate output for frozen modules backup = frozen_c + '~' try: os.rename(frozen_c, backup) except os.error: backup = None outfp = open(frozen_c, 'w') try: makefreeze.makefreeze(outfp, dict, debug) if win and subsystem == 'windows': import winmakemakefile outfp.write(winmakemakefile.WINMAINTEMPLATE) finally: outfp.close() if backup: if cmp.cmp(backup, frozen_c): sys.stderr.write('%s not changed, not written\n' % frozen_c) os.rename(backup, frozen_c) # windows gets different treatment if win: # Taking a shortcut here... import winmakemakefile outfp = open(makefile, 'w') try: winmakemakefile.makemakefile(outfp, locals(), [frozenmain_c, frozen_c], target) finally: outfp.close() return # generate config.c and Makefile builtins = [] unknown = [] mods = dict.keys() mods.sort() for mod in mods: if dict[mod].__code__: continue if not dict[mod].__file__: builtins.append(mod) else: unknown.append(mod) addfiles = [] if unknown: addfiles, addmods = \ checkextensions.checkextensions(unknown, extensions) for mod in addmods: unknown.remove(mod) builtins = builtins + addmods if unknown: sys.stderr.write('Warning: unknown modules remain: %s\n' % string.join(unknown)) builtins.sort() infp = open(config_c_in) backup = config_c + '~' try: os.rename(config_c, backup) except os.error: backup = None outfp = open(config_c, 'w') try: makeconfig.makeconfig(infp, outfp, builtins) finally: outfp.close() infp.close() if backup: if cmp.cmp(backup, config_c): sys.stderr.write('%s not changed, not written\n' % config_c) os.rename(backup, config_c) cflags = defines + includes + ['$(OPT)'] libs = [os.path.join(binlib, 'libpython$(VERSION).a')] somevars = {} if os.path.exists(makefile_in): makevars = parsesetup.getmakevars(makefile_in) for key in makevars.keys(): somevars[key] = makevars[key] somevars['CFLAGS'] = string.join(cflags) # override files = ['$(OPT)', '$(LDFLAGS)', base_config_c, base_frozen_c] + \ supp_sources + addfiles + libs + \ ['$(MODLIBS)', '$(LIBS)', '$(SYSLIBS)'] backup = makefile + '~' try: os.rename(makefile, backup) except os.error: backup = None outfp = open(makefile, 'w') try: makemakefile.makemakefile(outfp, somevars, files, base_target) finally: outfp.close() if backup: if not cmp.cmp(backup, makefile): print 'previous Makefile saved as', backup else: sys.stderr.write('%s not changed, not written\n' % makefile) os.rename(backup, makefile) # Done! if odir: print 'Now run "make" in', odir, print 'to build the target:', base_target else: print 'Now run "make" to build the target:', base_target
f8b1a25a9026ecea98d9e90b2676d337c6d4e575 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/f8b1a25a9026ecea98d9e90b2676d337c6d4e575/freeze.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 468, 5713, 27621, 819, 1633, 273, 599, 15604, 468, 444, 2121, 598, 300, 84, 1456, 1196, 67, 3239, 273, 599, 5375, 468, 444, 2121, 598, 300, 52, 1456, 4418, 273, 5378, 589, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 468, 5713, 27621, 819, 1633, 273, 599, 15604, 468, 444, 2121, 598, 300, 84, 1456, 1196, 67, 3239, 273, 599, 5375, 468, 444, 2121, 598, 300, 52, 1456, 4418, 273, 5378, 589, ...
fmodel.update_core() alpha = fmodel.alpha_beta()[0].data()
def model_error_ml(self): #XXX needs clean solution / one more unfinished project if (self.alpha_beta_params is None): free_reflections_per_bin = 140 estimation_algorithm = "analytical" else: free_reflections_per_bin=self.alpha_beta_params.free_reflections_per_bin estimation_algorithm = self.alpha_beta_params.estimation_algorithm assert estimation_algorithm in ["analytical", "iterative"] est_exceptions = [] fmat6 = self.resolution_filter(d_max=6.0) for fmodel in [ fmat6, self]: ss = 1./flex.pow2(fmodel.f_obs.d_spacings().data()) if (estimation_algorithm == "analytical"): try: alpha, beta = maxlik.alpha_beta_est_manager( f_obs = fmodel.f_obs, f_calc = fmodel.f_model(), free_reflections_per_bin = free_reflections_per_bin, flags = fmodel.r_free_flags.data(), interpolation = True).alpha_beta() break except KeyboardInterrupt: raise except Exception, e: est_exceptions.append(str(e)) else: p = self.alpha_beta_params.sigmaa_estimator try: alpha, beta = sigmaa_estimator( miller_obs=fmodel.f_obs, miller_calc=fmodel.f_model(), r_free_flags=fmodel.r_free_flags, kernel_width_free_reflections=p.kernel_width_free_reflections, kernel_on_chebyshev_nodes=p.kernel_on_chebyshev_nodes, n_sampling_points=p.number_of_sampling_points, n_chebyshev_terms=p.number_of_chebyshev_terms, use_sampling_sum_weights=p.use_sampling_sum_weights).alpha_beta() break except KeyboardInterrupt: raise except Exception, e: est_exceptions.append(str(e)) else: raise RuntimeError( "Failure estimating alpha, beta coefficients:\n" + est_exceptions[0] + "\n" + " " + "-"*77 + "\n" + est_exceptions[1]) fmodel.update_core() alpha = fmodel.alpha_beta()[0].data() omega = flex.double() for ae,ssi in zip(alpha,ss): if(ae > 1.0): ae = 1.0 if(ae <= 0.0): ae = 1.e-6 coeff = -4./(math.pi**3*ssi) omega.append( math.sqrt( math.log(ae) * coeff ) ) #omega_ma = miller.array(miller_set= self.f_obs,data= flex.double(omega)) fmodel.update_core() omega_mean = flex.mean(omega) #sel = (omega < omega_mean * 3.0) & (omega > omega_mean / 3.0) #if(sel.count(True) > 0): # omega_mean = flex.mean(omega.select(sel)) return omega_mean #return flex.mean(omega), flex.max(omega), flex.min(omega)
fab2f37abea3d72e41f30c0909cef47032013e93 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/696/fab2f37abea3d72e41f30c0909cef47032013e93/f_model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 938, 67, 1636, 67, 781, 12, 2890, 4672, 468, 15639, 4260, 2721, 6959, 342, 1245, 1898, 640, 13527, 1984, 309, 261, 2890, 18, 5429, 67, 5758, 67, 2010, 353, 599, 4672, 4843, 67, 26606, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 938, 67, 1636, 67, 781, 12, 2890, 4672, 468, 15639, 4260, 2721, 6959, 342, 1245, 1898, 640, 13527, 1984, 309, 261, 2890, 18, 5429, 67, 5758, 67, 2010, 353, 599, 4672, 4843, 67, 26606, ...
r""" The all 1's sequence. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000012; a
def __init__(self): r"""
def _eval(self, n): return Integer(2*n+1)
8b300fed02e947af57b58146f62dccfc715cf0b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/8b300fed02e947af57b58146f62dccfc715cf0b9/sloane_functions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8622, 12, 2890, 16, 290, 4672, 327, 2144, 12, 22, 14, 82, 15, 21, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8622, 12, 2890, 16, 290, 4672, 327, 2144, 12, 22, 14, 82, 15, 21, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
d, i = self.kdtree.query([0,0,0],k=kk)
d, i = self.kdtree.query(np.array([0,0,0]),k=kk)
def test_single_query_multiple_neighbors(self): s = 23 kk = self.kdtree.n+s d, i = self.kdtree.query([0,0,0],k=kk) assert_equal(np.shape(d),(kk,)) assert_equal(np.shape(i),(kk,)) assert np.all(~np.isfinite(d[-s:])) assert np.all(i[-s:]==self.kdtree.n)
f5481e898654c2537ef079caa843017f03de608f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12971/f5481e898654c2537ef079caa843017f03de608f/test_kdtree.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 7526, 67, 2271, 67, 9622, 67, 17549, 12, 2890, 4672, 272, 273, 10213, 17654, 273, 365, 18, 79, 72, 3413, 18, 82, 15, 87, 302, 16, 277, 273, 365, 18, 79, 72, 3413, 18, 227...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7526, 67, 2271, 67, 9622, 67, 17549, 12, 2890, 4672, 272, 273, 10213, 17654, 273, 365, 18, 79, 72, 3413, 18, 82, 15, 87, 302, 16, 277, 273, 365, 18, 79, 72, 3413, 18, 227...
o.add_option("--skip-cvs", dest="skip_cvs", action="store_true", default=False, help="Skip pulling the old directories from the Mozilla CVS repository.")
def do_cvs_checkout(modules, tag, cvsroot, cvs, checkoutdir): """Check out a CVS directory into the mozilla/ subdirectory. modules is a list of directories to check out, e.g. ['extensions/irc'] """ for module in modules: (parent, leaf) = os.path.split(module) print "CVS checkout begin: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC") if tag == 'HEAD': check_call_noisy([cvs, '-d', cvsroot, '-q', 'checkout', '-P', '-A', '-d', leaf, 'mozilla/%s' % module], cwd=os.path.join(topsrcdir, checkoutdir, parent)) else: check_call_noisy([cvs, '-d', cvsroot, '-q', 'checkout', '-P', '-r', tag, '-d', leaf, 'mozilla/%s' % module], cwd=os.path.join(topsrcdir, checkoutdir, parent)) print "CVS checkout end: " + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S UTC")
5e26eee8a47e5fe451b10b8e7bff4e035d4462d2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11044/5e26eee8a47e5fe451b10b8e7bff4e035d4462d2/client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 71, 6904, 67, 17300, 12, 6400, 16, 1047, 16, 276, 6904, 3085, 16, 276, 6904, 16, 13926, 1214, 4672, 3536, 1564, 596, 279, 385, 14640, 1867, 1368, 326, 27513, 19, 29869, 18, 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, 741, 67, 71, 6904, 67, 17300, 12, 6400, 16, 1047, 16, 276, 6904, 3085, 16, 276, 6904, 16, 13926, 1214, 4672, 3536, 1564, 596, 279, 385, 14640, 1867, 1368, 326, 27513, 19, 29869, 18, 43...
self.notebook.append_page(sw, tab_label=gtk.Label("Exception"))
br = gtk.VBox() br.pack_start(sw) self.notebook.append_page(br, tab_label=gtk.Label("Exception")) exp = gtk.Expander(label='Bug report details') def _a(exp): self.send.set_sensitive(exp.get_expanded()) exp.connect_after('activate', _a) br.pack_start(exp, expand=False) tb = gtk.VBox(spacing=6) exp.add(tb) sg = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) h1 = gtk.HBox(spacing=12) tb.pack_start(h1, expand=False) l = gtk.Label('Title:') l.set_alignment(1, 0) sg.add_widget(l) h1.pack_start(l, expand=False, padding=6) self._ticketname = gtk.Entry() self._ticketname.set_has_frame(False) h1.pack_start(self._ticketname, padding=6) h1 = gtk.HBox(spacing=12) tb.pack_start(h1) l = gtk.Label('Description:') l.set_alignment(1, 0) sg.add_widget(l) h1.pack_start(l, expand=False, padding=6) self._ticketdesc = gtk.TextView() sw = gtk.ScrolledWindow() sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) sw.add(self._ticketdesc) h1.pack_start(sw, padding=6) self._ticketinclexc = gtk.CheckButton( label='Include exception traceback in report') tb.pack_start(self._ticketinclexc) self._ticketinclexc.set_active(True)
def _build_ui(self): # 416 = 600 / sqrt(2) = golden number self.set_default_size(600, 416) self.set_border_width(12)
ea0d5dd60f40deef6ff7a8cd7c023386e45eb51f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/ea0d5dd60f40deef6ff7a8cd7c023386e45eb51f/debugwindow.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3510, 67, 4881, 12, 2890, 4672, 468, 1059, 2313, 273, 14707, 342, 5700, 12, 22, 13, 273, 20465, 275, 1300, 365, 18, 542, 67, 1886, 67, 1467, 12, 28133, 16, 1059, 2313, 13, 365, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3510, 67, 4881, 12, 2890, 4672, 468, 1059, 2313, 273, 14707, 342, 5700, 12, 22, 13, 273, 20465, 275, 1300, 365, 18, 542, 67, 1886, 67, 1467, 12, 28133, 16, 1059, 2313, 13, 365, ...
if info[3] == '0.00' and not homoa: homoa = len(self.moenergies[0]) - 2
if info[3] != '0.00': homoa = len(self.moenergies[0]) - 1
def parse(self, fupdate=0.05, cupdate=0.002): """Extract information from the logfile.""" inputfile = open(self.filename, "r") if self.progress: inputfile.seek(0, 2) #go to end of file nstep = inputfile.tell() inputfile.seek(0) self.progress.initialize(nstep) oldstep = 0 # Used to avoid extracting the final geometry twice in a GeoOpt NOTFOUND, GETLAST, NOMORE = range(3) finalgeometry = NOTFOUND # Used for calculating the scftarget (variables names taken from the ADF manual) accint = SCFconv = sconv2 = None # keep track of nosym and unrestricted case to parse Energies since it doens't have an all Irreps section nosymflag = False unrestrictedflag = False for line in inputfile: if self.progress and random.random() < cupdate: step = inputfile.tell() if step != oldstep: self.progress.update(step, "Unsupported Information") oldstep = step if line.find("INPUT FILE") >= 0:
aa594e8f9fe23d76b9751fa21a3a3bdda6fed5de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8167/aa594e8f9fe23d76b9751fa21a3a3bdda6fed5de/adfparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 2890, 16, 284, 2725, 33, 20, 18, 6260, 16, 276, 2725, 33, 20, 18, 24908, 4672, 3536, 4976, 1779, 628, 326, 15204, 12123, 810, 768, 273, 1696, 12, 2890, 18, 3459, 16, 315, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 2890, 16, 284, 2725, 33, 20, 18, 6260, 16, 276, 2725, 33, 20, 18, 24908, 4672, 3536, 4976, 1779, 628, 326, 15204, 12123, 810, 768, 273, 1696, 12, 2890, 18, 3459, 16, 315, 8...
cty.c_long],
cty.c_long],
def flps_draw_frame(p1, p2, p3, p4, p5, p6, p7): """ flps_draw_frame(p1, p2, p3, p4, p5, p6, p7) """ _flps_draw_frame(p1, p2, p3, p4, p5, p6, p7)
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, 1121, 67, 9446, 67, 3789, 12, 84, 21, 16, 293, 22, 16, 293, 23, 16, 293, 24, 16, 293, 25, 16, 293, 26, 16, 293, 27, 4672, 3536, 1183, 1121, 67, 9446, 67, 3789, 12, 84, 21, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 1121, 67, 9446, 67, 3789, 12, 84, 21, 16, 293, 22, 16, 293, 23, 16, 293, 24, 16, 293, 25, 16, 293, 26, 16, 293, 27, 4672, 3536, 1183, 1121, 67, 9446, 67, 3789, 12, 84, 21, ...
Represents an event that's an exception to a recurring event—that is,
Represents an event that's an exception to a recurring event-that is,
def find_batch_link(self): return self.find_url('http://schemas.google.com/g/2005#batch')
e71518dab8c10c1820bbb169af5d22f3b1b36939 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10620/e71518dab8c10c1820bbb169af5d22f3b1b36939/data.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 5303, 67, 1232, 12, 2890, 4672, 327, 365, 18, 4720, 67, 718, 2668, 2505, 2207, 17928, 18, 9536, 18, 832, 19, 75, 19, 6976, 25, 7, 5303, 6134, 2, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 5303, 67, 1232, 12, 2890, 4672, 327, 365, 18, 4720, 67, 718, 2668, 2505, 2207, 17928, 18, 9536, 18, 832, 19, 75, 19, 6976, 25, 7, 5303, 6134, 2, -100, -100, -100, -100, -10...
return "%s %s %s" % (self.__class__.__name__, self._portName, self._chanID)
return "%s(port=%s, chanID=%s)" % (self.__class__.__name__, self._portName, self._chanID)
def __str__(self): return "%s %s %s" % (self.__class__.__name__, self._portName, self._chanID)
5eed45bbd5254c44a87c429e6fa71ff31f08cd74 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6354/5eed45bbd5254c44a87c429e6fa71ff31f08cd74/TkSerial.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 701, 972, 12, 2890, 4672, 327, 2213, 87, 738, 87, 738, 87, 6, 738, 261, 2890, 16186, 1106, 972, 16186, 529, 972, 16, 365, 6315, 655, 461, 16, 365, 6315, 7472, 734, 13, 2, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 701, 972, 12, 2890, 4672, 327, 2213, 87, 738, 87, 738, 87, 6, 738, 261, 2890, 16186, 1106, 972, 16186, 529, 972, 16, 365, 6315, 655, 461, 16, 365, 6315, 7472, 734, 13, 2, -100,...
self.delete_b = self.builder.get_object('delete') self.play_b = self.builder.get_object('speak')
def tree_select_changed(self, widget=None, event=None): self.model, self.iter = self.selection.get_selected() self.frame2.show() if self.iter is not None: self.delete_b = self.builder.get_object('delete') self.play_b = self.builder.get_object('speak') self.delete_b.set_sensitive(True) self.play_b.set_sensitive(True) if self.welcome is self.hbox2.get_children()[1]: self.welcome.hide() # self.hbox2.remove(self.welcome) # self.hbox2.pack_start(self.builder.get_object('frame2')) self.tree_value = self.model.get_value(self.iter,0) #print self.tree_value self.selected_word.show() self.selected_word.set_text(self.tree_value) #self.notebook2 = self.builder.get_object('notebook2') #cur_page = self.notebook2.get_current_page() #if self.tree_value not in wordz_db.list_groups(): #print self.tree_value self.hbox5.show() ''' w, h = self.window.get_size() self.vpan.set_position(h) tmp = self.vpan.get_position() self.vpan.set_position(int((240.0/450)*h)) else: self.vpan.set_position(10000) self.hbox3.hide()''' #if self.output_txtview.get_editable(): # self.output_txtview.set_editable(False) detail = wordz_db.get_details(self.tree_value) buff = self.output_txtview.get_buffer() buff.set_text(detail) self.output_txtview.set_buffer(buff) #self.output_txtview.modify_font(self.fontdesc) self.show_details_tree()
f1eb60aee989dcf191e25d63123e58bea48e79be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10994/f1eb60aee989dcf191e25d63123e58bea48e79be/wordgroupz.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2151, 67, 4025, 67, 6703, 12, 2890, 16, 3604, 33, 7036, 16, 871, 33, 7036, 4672, 365, 18, 2284, 16, 365, 18, 2165, 273, 365, 18, 10705, 18, 588, 67, 8109, 1435, 365, 18, 3789, 22, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2151, 67, 4025, 67, 6703, 12, 2890, 16, 3604, 33, 7036, 16, 871, 33, 7036, 4672, 365, 18, 2284, 16, 365, 18, 2165, 273, 365, 18, 10705, 18, 588, 67, 8109, 1435, 365, 18, 3789, 22, ...
Solver = Amesos.Lapack(Problem);
Solver = Amesos.Lapack(Problem)
def main(): Comm = Epetra.PyComm(); args = sys.argv[1:] if len(args) == 0: Type = "Amesos_Lapack" else: Type = args[0]; NumGlobalRows = 10; Map = Epetra.Map(NumGlobalRows, 0, Comm); LHS_exact = Epetra.MultiVector(Map, 1); LHS = Epetra.MultiVector(Map, 1); RHS = Epetra.MultiVector(Map, 1); Matrix = Epetra.CrsMatrix(Epetra.Copy, Map, 0); Indices = Epetra.IntSerialDenseVector(3); Values = Epetra.SerialDenseVector(3); Values[0] = 2.0; Values[1] = -1.0; Values[2] = -1.0; NumLocalRows = Map.NumMyElements() # Builds the matrix (1D Laplacian) for ii in range(0, NumLocalRows): i = Map.GID(ii) Indices[0] = i; if i == 0: NumEntries = 2; Indices[1] = i + 1; elif i == NumGlobalRows - 1: NumEntries = 2; Indices[1] = i - 1; else: NumEntries = 3; Indices[1] = i - 1; Indices[2] = i + 1; Matrix.InsertGlobalValues(i, NumEntries, Values, Indices); ierr = Matrix.FillComplete(); LHS_exact.Random(); Matrix.Multiply(False, LHS_exact, RHS); LHS.PutScalar(1.0); Problem = Epetra.LinearProblem(Matrix, LHS, RHS); if Type == "Amesos_Lapack": Solver = Amesos.Lapack(Problem); elif Type == "Amesos_Klu": Solver = Amesos.Klu(Problem); elif Type == "Amesos_Umfpack": Solver = Amesos.Umfpack(Problem); elif Type == "Amesos_Pardiso": Solver = Amesos.Umfpack(Problem); elif Type == "Amesos_Taucs": Solver = Amesos.Umfpack(Problem); elif Type == "Amesos_Superlu": Solver = Amesos.Superlu(Problem); elif Type == "Amesos_Superludist": Solver = Amesos.Superludist(Problem); elif Type == "Amesos_Dscpack": Solver = Amesos.Dscpack(Problem); elif Type == "Amesos_Mumps": Solver = Amesos.Mumps(Problem); else: print 'Selected solver (%s) not available' % Type PrintHelp(); sys.exit(-2); AmesosList = { "PrintStatus": True, "PrintTiming": True }; Solver.SetParameters(AmesosList); Solver.SymbolicFactorization(); Solver.NumericFactorization(); ierr = Solver.Solve(); print "Solver.Solve() return code = ", ierr del Solver
b0de99b594baede77af9aff7c1b994a5d198a226 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1130/b0de99b594baede77af9aff7c1b994a5d198a226/exSolvers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 16854, 273, 512, 6951, 354, 18, 9413, 12136, 5621, 225, 833, 273, 2589, 18, 19485, 63, 21, 26894, 309, 562, 12, 1968, 13, 422, 374, 30, 1412, 273, 315, 9864, 281, 538, 67,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 16854, 273, 512, 6951, 354, 18, 9413, 12136, 5621, 225, 833, 273, 2589, 18, 19485, 63, 21, 26894, 309, 562, 12, 1968, 13, 422, 374, 30, 1412, 273, 315, 9864, 281, 538, 67,...
print POW.derRead(POW.X509_CERTIFICATE, cert.toString()).pprint()
print cert.get_POW().pprint()
def pprint_cert(cert): print POW.derRead(POW.X509_CERTIFICATE, cert.toString()).pprint()
584230976aa6e04ad8fa463137935aa3cd05735c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/119/584230976aa6e04ad8fa463137935aa3cd05735c/xml-parse-test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18771, 67, 7593, 12, 7593, 4672, 1172, 3320, 18, 588, 67, 2419, 59, 7675, 84, 1188, 1435, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 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, 18771, 67, 7593, 12, 7593, 4672, 1172, 3320, 18, 588, 67, 2419, 59, 7675, 84, 1188, 1435, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
while n >= 0:
while n > 0:
def list_of_first_n(v,n): """ Given an iterator v, return first n elements it produces as a list. INPUT: v -- an interator n -- an integer OUTPUT: list EXAMPLES: sage: sage.server.notebook.interact.list_of_first_n(Primes(), 10) [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31] sage: sage.server.notebook.interact.list_of_first_n((1..5), 10) [1, 2, 3, 4, 5] sage: sage.server.notebook.interact.list_of_first_n(QQ, 10) [0, 1, -1, 1/2, -1/2, 2, -2, 1/3, -1/3, 3/2, -3/2] """ if not hasattr(v, 'next'): v = v.__iter__() w = [] while n >= 0: try: w.append(v.next()) except StopIteration: return w n -= 1 return w
1fa0a804a0f83216629cf426a73ed93e87320840 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/1fa0a804a0f83216629cf426a73ed93e87320840/interact.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 67, 792, 67, 3645, 67, 82, 12, 90, 16, 82, 4672, 3536, 16803, 392, 2775, 331, 16, 327, 1122, 290, 2186, 518, 15505, 487, 279, 666, 18, 225, 12943, 30, 331, 1493, 392, 1554, 639,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 792, 67, 3645, 67, 82, 12, 90, 16, 82, 4672, 3536, 16803, 392, 2775, 331, 16, 327, 1122, 290, 2186, 518, 15505, 487, 279, 666, 18, 225, 12943, 30, 331, 1493, 392, 1554, 639,...
Exactly one of pickle (a string containing a pickle) or file (the filename of a pickle) must be provided. EXAMPLES:
Exactly one of ``pickle`` (a string containing a pickle) or ``file`` (the filename of a pickle) must be provided. EXAMPLES::
def explain_pickle(pickle=None, file=None, compress=True, **kwargs): r""" Explain a pickle. (That is, produce source code such that evaluating the code is equivalent to loading the pickle.) Feeding the result of explain_pickle to sage_eval should be totally equivalent to loading the pickle with cPickle. INPUTS: pickle -- the pickle to explain, as a string (default: None) file -- a filename of a pickle (default: None) compress -- if False, don't attempt to decompress the pickle (default: True) in_current_sage -- if True, produce potentially simpler code that is tied to the current version of Sage. (default: False) default_assumptions -- if True, produce potentially simpler code that assumes that generic unpickling code will be used. This code may not actually work. (default: False) eval -- if True, then evaluate the resulting code and return the evaluated result. (default: False) preparse -- if True, then produce code to be evaluated with Sage's preparser; if False, then produce standard Python code; if None, then produce code that will work either with or without the preparser. (default: True) pedantic -- if True, then carefully ensures that the result has at least as much sharing as the result of cPickle (it may have more, for immutable objects). (default: False) Exactly one of pickle (a string containing a pickle) or file (the filename of a pickle) must be provided. EXAMPLES: sage: explain_pickle(dumps({('a', 'b'): [1r, 2r]})) {('a', 'b'):[1r, 2r]} sage: explain_pickle(dumps(RR(pi)), in_current_sage=True) from sage.rings.real_mpfr import __create__RealNumber_version0 from sage.rings.real_mpfr import __create__RealField_version0 __create__RealNumber_version0(__create__RealField_version0(53r, False, 'RNDN'), '3.4gvml245kc0@0', 32r) sage: s = 'hi' sage: explain_pickle(dumps((s, s))) ('hi', 'hi') sage: explain_pickle(dumps((s, s)), pedantic=True) si = 'hi' (si, si) sage: explain_pickle(dumps(5r)) 5r sage: explain_pickle(dumps(5r), preparse=False) 5 sage: explain_pickle(dumps(5r), preparse=None) int(5) sage: explain_pickle(dumps(22/7)) pg_make_rational = unpickle_global('sage.rings.rational', 'make_rational') pg_make_rational('m/7') sage: explain_pickle(dumps(22/7), in_current_sage=True) from sage.rings.rational import make_rational make_rational('m/7') sage: explain_pickle(dumps(22/7), default_assumptions=True) from sage.rings.rational import make_rational make_rational('m/7') """ if pickle is not None: p = pickle elif file is not None: p = open(file).read() else: raise ValueError, "Either pickle or file must be specified" if compress: try: p = comp.decompress(p) except Exception, msg1: try: p = comp_other.decompress(p) except Exception, msg2: # Maybe data is uncompressed? pass return explain_pickle_string(p, **kwargs)
3bed29c45c1270055cd235e22fd02f632971b39e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/3bed29c45c1270055cd235e22fd02f632971b39e/explain_pickle.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19765, 67, 20847, 12, 20847, 33, 7036, 16, 585, 33, 7036, 16, 8099, 33, 5510, 16, 2826, 4333, 4672, 436, 8395, 1312, 7446, 279, 13379, 18, 225, 261, 18163, 353, 16, 11402, 1084, 981, 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, 19765, 67, 20847, 12, 20847, 33, 7036, 16, 585, 33, 7036, 16, 8099, 33, 5510, 16, 2826, 4333, 4672, 436, 8395, 1312, 7446, 279, 13379, 18, 225, 261, 18163, 353, 16, 11402, 1084, 981, 4...
self.scroll_to_cell (path=path, use_align=FALSE)
self.scroll_to_cell (path=path, use_align=False)
def reloadConfig (self, widget): node = self.getSelection() if node.__class__ == dri.AppConfig: config = node.device.config elif node.__class__ == dri.DeviceConfig: config = node.config else: config = node dialog = gtk.MessageDialog ( mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, _("Really reload \"%s\" from disk?") % config.fileName) response = dialog.run() dialog.destroy() if response != gtk.RESPONSE_YES: return try: cfile = open (config.fileName, "r") except IOError: dialog = gtk.MessageDialog ( mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("Couldn't open \"%s\" for reading. " "The file was not reloaded.") % config.fileName) dialog.run() dialog.destroy() return # Try to parse the configuration file. try: newConfig = dri.DRIConfig (cfile) except dri.XMLError, problem: dialog = gtk.MessageDialog ( mainWindow, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("Configuration file \"%s\" contains errors:\n" "%s\n" "The file was not reloaded.") % (config.fileName, str(problem))) dialog.run() dialog.destroy() cfile.close() return cfile.close() # Check if the file is writable in the end. newConfig.writable = fileIsWritable (config.fileName) # find the position of config configList = self.getConfigList() index = configList.index (config) if index == len(configList)-1: sibling = None else: sibling = configList[index+1] if node.__class__ == dri.AppConfig: mainWindow.removeApp (node) elif node.__class__ == dri.DeviceConfig: for app in node.apps: mainWindow.removeApp (app) self.model.removeNode (config) self.model.addNode (newConfig, sibling) path = self.model.getPathFromNode (newConfig) self.expand_row (path, TRUE) self.get_selection().select_path (path) self.scroll_to_cell (path=path, use_align=FALSE)
ab8126074d7036807d1d842171687cc01617a181 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4580/ab8126074d7036807d1d842171687cc01617a181/driconf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7749, 809, 261, 2890, 16, 3604, 4672, 756, 273, 365, 18, 588, 6233, 1435, 309, 756, 16186, 1106, 972, 422, 302, 566, 18, 31904, 30, 642, 273, 756, 18, 5964, 18, 1425, 1327, 756, 16186,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7749, 809, 261, 2890, 16, 3604, 4672, 756, 273, 365, 18, 588, 6233, 1435, 309, 756, 16186, 1106, 972, 422, 302, 566, 18, 31904, 30, 642, 273, 756, 18, 5964, 18, 1425, 1327, 756, 16186,...
string = _('%d%%') % (value) return string
string = _('%d%%') % (value) return string
def perc100_2Text(value): string = _('%d%%') % (value) return string
7bbec779b2adb686d83b7357614afb2942b328c3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/503/7bbec779b2adb686d83b7357614afb2942b328c3/TechInfoDlg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26514, 6625, 67, 22, 1528, 12, 1132, 4672, 533, 273, 389, 29909, 72, 11438, 6134, 738, 261, 1132, 13, 327, 533, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26514, 6625, 67, 22, 1528, 12, 1132, 4672, 533, 273, 389, 29909, 72, 11438, 6134, 738, 261, 1132, 13, 327, 533, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
from elementtree import yyyyElementTree as etree
from elementtree import ElementTree as etree
def check_import(self): WhichElementTree = '' try: # 1. Try to use lxml. #from lxml import etree #WhichElementTree = 'lxml' raise ImportError('Ignoring lxml') except ImportError, e: try: # 2. Try to use ElementTree from the Python standard library. from xml.etree import yyyyElementTree as etree WhichElementTree = 'elementtree' except ImportError, e: try: # 3. Try to use a version of ElementTree installed as a separate # product. from elementtree import yyyyElementTree as etree WhichElementTree = 'elementtree' except ImportError, e: s1 = '\nSkipped test of odf_odt writer. ' \ 'In order to test odf_odt writer ' \ 'must install either a version of Python containing ' \ 'ElementTree (Python version >=2.5) or ' \ 'install ElementTree.\n\n' #self.fail(s1) sys.stderr.write(s1) return WhichElementTree
7f3aa34afae2f4e27754c52eae509579385636a2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1278/7f3aa34afae2f4e27754c52eae509579385636a2/test_odt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 5666, 12, 2890, 4672, 21918, 1046, 2471, 273, 875, 775, 30, 468, 404, 18, 6161, 358, 999, 328, 2902, 18, 468, 2080, 328, 2902, 1930, 12031, 468, 2888, 1354, 1046, 2471, 273, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 5666, 12, 2890, 4672, 21918, 1046, 2471, 273, 875, 775, 30, 468, 404, 18, 6161, 358, 999, 328, 2902, 18, 468, 2080, 328, 2902, 1930, 12031, 468, 2888, 1354, 1046, 2471, 273, 2...
print "init"
def __init__(self): print "init"
6d03bbedffbbef787bb86975b2ed166153657762 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3386/6d03bbedffbbef787bb86975b2ed166153657762/dshield.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 1172, 315, 2738, 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, 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, 1001, 2738, 972, 12, 2890, 4672, 1172, 315, 2738, 6, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
full_lal_pkg_config = PkgConfig("lal lalframe lalmetaio lalsupport")
full_lal_pkg_config = PkgConfig("lal lalframe")
def stripfirsttwo(string): return string[2:]
df512123e1f526be77cf9c59872a40eb3f2bec00 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3592/df512123e1f526be77cf9c59872a40eb3f2bec00/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2569, 3645, 15415, 12, 1080, 4672, 327, 533, 63, 22, 26894, 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, 2569, 3645, 15415, 12, 1080, 4672, 327, 533, 63, 22, 26894, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
'long': ('i', None, "int", "int"),
'long': ('l', None, "long", "long"),
def enum(type, name, value): if not enums.has_key(type): enums[type] = {} enums[type][name] = value
9eb77d45c2a2240afb12bbcdc0935585945ce1f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8293/9eb77d45c2a2240afb12bbcdc0935585945ce1f8/generator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2792, 12, 723, 16, 508, 16, 460, 4672, 309, 486, 17922, 18, 5332, 67, 856, 12, 723, 4672, 17922, 63, 723, 65, 273, 2618, 17922, 63, 723, 6362, 529, 65, 273, 460, 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, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2792, 12, 723, 16, 508, 16, 460, 4672, 309, 486, 17922, 18, 5332, 67, 856, 12, 723, 4672, 17922, 63, 723, 65, 273, 2618, 17922, 63, 723, 6362, 529, 65, 273, 460, 225, 2, -100, -100, ...
self.about.destroy()
self.about.hide()
def on_about_close(self, widget, response): self.about.destroy()
b1ba089eab550c82aaa29cceb84e7f80c8f2e228 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/b1ba089eab550c82aaa29cceb84e7f80c8f2e228/browser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 21071, 67, 4412, 12, 2890, 16, 3604, 16, 766, 4672, 365, 18, 21071, 18, 11662, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 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, 603, 67, 21071, 67, 4412, 12, 2890, 16, 3604, 16, 766, 4672, 365, 18, 21071, 18, 11662, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
local_op = Scan( (args,next_outs), n_seqs,n_outs,inplace_map,
local_op = Scan( (args,next_outs ), n_seqs,n_outs,inplace_map,
def scan(fn, sequences, initial_states, non_sequences, inplace_map={}, \ sequences_taps={}, outputs_taps = {}, n_steps = 0, \ truncate_gradient = -1, go_backwards = False, mode = 'FAST_RUN'): '''Function that constructs and applies a Scan op :param fn: Function that describes the operations involved in one step of scan Given variables representing all the slices of input and past values of outputs and other non sequences parameters, ``fn`` should produce variables describing the output of one time step of scan. The order in which the argument to this function are given is very important. You should have the following order * all time slices of the first sequence (as given in the ``sequences`` list) ordered cronologically * all time slices of the second sequence (as given in the ``sequences`` list) ordered cronologically * ... * all time slices of the first output (as given in the ``initial_state`` list) ordered cronologically * all time slices of the second otuput (as given in the ``initial_state`` list) ordered cronologically * ... * all other parameters over which scan doesn't iterate given in the same order as in ``non_sequences`` The outputs of these function should have the same order as in the list ``initial_states`` :param sequences: list of Theano variables over which scan needs to iterate :param initial_states: list of Theano variables containing the initial state used for the output. Note that if the function applied recursively uses only the previous value of the output or none, this initial state should have same shape as one time step of the output; otherwise, the initial state should have the same number of dimension as output. This can easily be understand through an example. For computing ``y[t]`` let assume that we need ``y[t-1]``, ``y[t-2]`` and ``y(t-4)``. Through an abuse of notation, when ``t = 0``, we would need values for ``y[-1]``, ``y[-2]`` and ``y[-4]``. These values are provided by the initial state of ``y``, which should have same number of dimension as ``y``, where the first dimension should be large enough to cover all past values, which in this case is 4. If ``init_y`` is the variable containing the initial state of ``y``, then ``init_y[0]`` corresponds to ``y[-4]``, ``init_y[1]`` corresponds to ``y[-3]``, ``init_y[2]`` corresponds to ``y[-2]``, ``init_y[3]`` corresponds to ``y[-1]``. By default, scan is set to use the last time step for each output. :param non_sequences: Parameters over which scan should not iterate. These parameters are given at each time step to the function applied recursively. :param inplace_map: Dictionary describing outputs computed *inplace*. ``inplace_map`` is a dictionary where keys are output indexes, and values are sequence indexes. Assigning a value ``j`` to a key ``i`` means that output number ``j`` will be computed inplace (in the same memory buffer) as the input number ``i``. :param sequences_taps: Dictionary describing what slices of the input sequences scan should use. At each step of the iteration you can use different slices of your input sequences(called here taps), and this dictionary lets you define exactly that. The keys of the dictionary are sequence indexes, the values are list of numbers. Having the following entry ``i : [k_1,k_2,k_3]``, means that at step ``t``, for sequence ``x``, that has the index ``i`` in the list of sequences, you would use the values ``x[t+k_1]``, ``x[t+k_2]`` and ``x[t+k_3]``. ``k_1``, ``k_2``, ``k_3`` values can be positive or negative and the sequence for which you request this taps should be large enough to accomodate them. If in the cronological order, ``k`` is the first past value of sequence ``x``, then index 0 of ``x`` will correspond to step ``k`` (if ``k`` is -3, then, abusing notation ``x[0]`` will be seen by scan as ``x[-3]``). If you do not want to use any taps for a given sequence you need to set the corresponding entry in the dictionary to the empy list. By default, for each sequence that is not represented in the dictionary scan will assume that the at every step it needs to provide the current value of that sequence. :param outputs_taps: Dictionary describing what slices of the input sequences scan should use. The ``outputs_taps`` are defined in an analogouws way to ``sequences_taps``, just that the taps are for the outputs generated by scan. As such they can only be negative, i.e. refer to past value of outputs. By default scan will expect to use for any outpu the last time step, if nothing else is specified. :param n_steps: Number of steps to iterate. Sometimes you want to either enforce a fixed number of steps, or you might not even have any sequences you want to iterate over, but rather just to repeat some computation for a fixed number of steps. ``n_steps`` gives you this possibility. It can be a theano scalar or a number. :param truncate_gradient: Number of steps to use in truncated BPTT. If you compute gradients through a scan op, they are computed using backpropagation through time. By providing a different value then -1, you choose to use truncated BPTT instead of classical BPTT, where you only do ``truncate_gradient`` number of steps. :param go_backwards: Flag indicating if you should go bacwards through the sequences ''' # check if inputs are just single variables instead of lists if not (type(sequences) in (list, tuple)): seqs = [sequences] else: seqs = sequences if not (type(initial_states) in (list,tuple)): init_outs = [initial_states] else: init_outs = initial_states if not (type(non_sequences) in (list,tuple)): non_seqs = [non_sequences] else: non_seqs = non_sequences # compute number of sequences and number of seqs n_seqs = len(seqs) n_outs = len(init_outs) # update sequences_taps[idx] to contain 0 if it is not defined for i in xrange(n_seqs): if not sequences_taps.has_key(i): sequences_taps.update({i:[0]}) # if input sequence is not actually used by the recursive function elif sequences_taps[i] == []: sequences_taps.__delitem__(i) elif not (type(sequences_taps[i]) in (list,tuple)): sequences_taps[i] = [sequences_taps[i]] # update outputs_taps[idx] to contain -1 if it is not defined for i in xrange(n_outs): if not outputs_taps.has_key(i): outputs_taps.update({i:[-1]}) elif outputs_taps[i] == []: outputs_taps.__delitem__(i) elif not(type(outputs_taps[i]) in (list,tuple)): outputs_taps[i] = [outputs_taps[i]] ''' # update stored_steps_output list for i in xrange(n_outs): if not stored_steps_output.has_key(i): stored_steps_output[i] = True elif not stored_steps_output[i]: if outputs_taps[i] != [-1]: stored_steps_output[i] = True warning('You need to keep past value of outputs if you use'\ 'past taps of output different from -1') ''' stored_steps_output = [ 0 for i in xrange(n_outs)] # create theano inputs for the recursive function args = [] for (i,seq) in enumerate(seqs): if sequences_taps.has_key(i): for k in xrange(len(sequences_taps[i])): args += [seq[0].type() ] for (i,init_out) in enumerate(init_outs): if outputs_taps.has_key(i): for k in xrange(len(outputs_taps[i])): if outputs_taps[i] == [-1]: args += [init_out.type() ] else: args += [init_out[0].type() ] args += non_seqs next_outs = fn(*args) if not (type(next_outs) in (list,tuple)): next_outs = [next_outs] # Create the Scan op object local_op = Scan( (args,next_outs), n_seqs,n_outs,inplace_map, sequences_taps, outputs_taps, truncate_gradient, go_backwards, stored_steps_output, mode) # Call the object on the input sequences, initial values for outs, # and non sequences return local_op( *( [theano.tensor.as_tensor(n_steps)] \ + seqs \ + init_outs \ + non_seqs))
a996911a98e2dd0e74149e67cb944c3af5f56240 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/a996911a98e2dd0e74149e67cb944c3af5f56240/scan.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4135, 12, 4293, 16, 8463, 16, 2172, 67, 7992, 16, 1661, 67, 17190, 16, 11783, 67, 1458, 28793, 521, 8463, 67, 88, 6679, 28793, 6729, 67, 88, 6679, 273, 10615, 290, 67, 8986, 273, 374, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4135, 12, 4293, 16, 8463, 16, 2172, 67, 7992, 16, 1661, 67, 17190, 16, 11783, 67, 1458, 28793, 521, 8463, 67, 88, 6679, 28793, 6729, 67, 88, 6679, 273, 10615, 290, 67, 8986, 273, 374, ...
if len(x) == 0: return False
def __contains__(self,x): """ TESTS: sage: [] in Permutations() False sage: [1] in Permutations() True sage: [2] in Permutations() False sage: [1,2] in Permutations() True sage: [2,1] in Permutations() True sage: [1,2,2] in Permutations() False sage: [3,1,5,2] in Permutations() False sage: [3,4,1,5,2] in Permutations() True """ if isinstance(x, Permutation_class): return True elif isinstance(x, __builtin__.list): if len(x) == 0: return False s = x[:] s.sort() if s != range(1, len(x)+1): return False return True else: return False
5f617a51d7654f552ce7d17b4c276dfd0fad9485 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/5f617a51d7654f552ce7d17b4c276dfd0fad9485/permutation.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12298, 972, 12, 2890, 16, 92, 4672, 3536, 22130, 55, 30, 272, 410, 30, 5378, 316, 13813, 22190, 1435, 1083, 272, 410, 30, 306, 21, 65, 316, 13813, 22190, 1435, 1053, 272, 410, 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, 12298, 972, 12, 2890, 16, 92, 4672, 3536, 22130, 55, 30, 272, 410, 30, 5378, 316, 13813, 22190, 1435, 1083, 272, 410, 30, 306, 21, 65, 316, 13813, 22190, 1435, 1053, 272, 410, 30...
buff = unicode(fp.read(2*length), 'utf-8') return CFString(buff.encode('utf-16be'))
buff = fp.read(2*length) buff = unicode(buff, 'utf-16be') buff = buff.encode('utf-8') return CFString(buff)
def read_binary_unicode_string(self, fname,fp,length): ''' Read a unicode string value, coded as UTF-16BE ''' # The problem is: we get the length of the string IN CHARACTERS; # since a char in UTF-16 can be 16 or 32 bit long, we don't really know # how long the string is in bytes buff = unicode(fp.read(2*length), 'utf-8') return CFString(buff.encode('utf-16be'))
a8451f976e92e1ab0ee898026c9e2c967f786f8e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14208/a8451f976e92e1ab0ee898026c9e2c967f786f8e/CFPropertyList.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 8578, 67, 9124, 67, 1080, 12, 2890, 16, 5299, 16, 7944, 16, 2469, 4672, 9163, 2720, 279, 5252, 533, 460, 16, 29512, 487, 6380, 17, 2313, 5948, 9163, 468, 1021, 6199, 353, 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, 855, 67, 8578, 67, 9124, 67, 1080, 12, 2890, 16, 5299, 16, 7944, 16, 2469, 4672, 9163, 2720, 279, 5252, 533, 460, 16, 29512, 487, 6380, 17, 2313, 5948, 9163, 468, 1021, 6199, 353, 30, ...
f=listdir(texdir) d={}
def maketexdict(texdir): if not texdir: return None f=listdir(texdir) d={} # Handle unicode if type(texdir)==types.UnicodeType: for name in f: name=normalize(name) d[name.lower()]=name else: for name in f: d[name.lower()]=name return (texdir, d)
8c28ab890987aaec9a765ee255813f6b600bcb02 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11663/8c28ab890987aaec9a765ee255813f6b600bcb02/convbgl.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29796, 278, 338, 1576, 12, 21763, 1214, 4672, 309, 486, 16573, 1214, 30, 327, 599, 225, 468, 5004, 5252, 309, 618, 12, 21763, 1214, 13, 631, 2352, 18, 16532, 559, 30, 364, 508, 316, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29796, 278, 338, 1576, 12, 21763, 1214, 4672, 309, 486, 16573, 1214, 30, 327, 599, 225, 468, 5004, 5252, 309, 618, 12, 21763, 1214, 13, 631, 2352, 18, 16532, 559, 30, 364, 508, 316, 28...
res = l.items[0]
res = l.ll_getitem_fast(0)
def ll_pop_zero(func, l): length = l.length if func is dum_checkidx and (length == 0): raise IndexError newlength = length - 1 res = l.items[0] j = 0 items = l.items j1 = j+1 while j < newlength: items[j] = items[j1] j = j1 j1 += 1 ITEM = typeOf(l).TO.ITEM if isinstance(ITEM, Ptr): items[newlength] = nullptr(ITEM.TO) _ll_list_resize_le(l, newlength) return res
afabe8603c579750f81fa9c16896184dfa4a53b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/afabe8603c579750f81fa9c16896184dfa4a53b8/rlist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6579, 67, 5120, 67, 7124, 12, 644, 16, 328, 4672, 769, 273, 328, 18, 2469, 309, 1326, 353, 4569, 67, 1893, 3465, 471, 261, 2469, 422, 374, 4672, 1002, 10195, 394, 2469, 273, 769, 300, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6579, 67, 5120, 67, 7124, 12, 644, 16, 328, 4672, 769, 273, 328, 18, 2469, 309, 1326, 353, 4569, 67, 1893, 3465, 471, 261, 2469, 422, 374, 4672, 1002, 10195, 394, 2469, 273, 769, 300, ...
all.append(record)
def annual_anomalies(stream): """Iterates over the station record *stream*, returning an iterator giving an annual anomaly series for each station as (station, anoms). The algorithm is as follows: compute monthly averages, then monthly anomalies, then seasonal anomalies (means of monthly anomalies for at least two months) then annual anomalies (means of seasonal anomalies for at least three seasons). """ all = [] for record in stream: station = record.station all.append(record) series = record.series_as_tenths monthly_means = [] for m in range(12): month_data = filter(valid, series[m::12]) # neglect December of final year, as we do not use its season. if m == 11 and valid(series[-1]): month_data = month_data[:-1] monthly_means.append(float(sum(month_data)) / len(month_data)) annual_anoms = [] first = None for y in range(len(series)/12): # Seasons are Dec-Feb, Mar-May, Jun-Aug, Sep-Nov. Dec from previous year. total = [0.0] * 4 # total monthly anomaly for each season count = [0] * 4 # number of valid months in each season for m in range(-1, 11): index = y * 12 + m if index >= 0: # no Dec value in year -1 datum = series[index] if valid(datum): season = (m+1) // 3 # season number 0-3 total[season] += datum - monthly_means[(m + 12) % 12] count[season] += 1 season_anomalies = [] # list of valid seasonal anomalies for s in range(4): # valid seasonal anomaly requires at least 2 valid months if count[s] > 1: season_anomalies.append(total[s]/count[s]) # valid annual anomaly requires at least 3 valid seasons if len(season_anomalies) > 2: v = (10.0 * sum(season_anomalies)) / len(season_anomalies) annual_anoms.append(int(round(v))) if first is None: first = y last = y else: annual_anoms.append(BAD) if first is not None: record.first = first + record.first_year record.last = last + record.first_year record.anomalies = annual_anoms[first: last+1] yield record
b8ca3d48ed1bf1ada1c3b9786de3fd73e2c1d845 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6890/b8ca3d48ed1bf1ada1c3b9786de3fd73e2c1d845/step2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8226, 1462, 67, 304, 362, 287, 606, 12, 3256, 4672, 3536, 22051, 1879, 326, 13282, 1409, 380, 3256, 14, 16, 5785, 392, 2775, 21057, 392, 8226, 1462, 392, 26988, 4166, 364, 1517, 13282, 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, 8226, 1462, 67, 304, 362, 287, 606, 12, 3256, 4672, 3536, 22051, 1879, 326, 13282, 1409, 380, 3256, 14, 16, 5785, 392, 2775, 21057, 392, 8226, 1462, 392, 26988, 4166, 364, 1517, 13282, 4...
andi t3, t3, 4 or reg, reg, t3
andi t4, t3, 4, flags=(EZF,) or reg, reg, t4 mov t1, t1, t3, flags=(nCEZF,)
def macroop BSF_R_M { mov t1, t1, t0, dataSize=8 ld t1, seg, sib, disp # Determine if the input was zero, and also move it to a temp reg. and t1, t1, t1, flags=(ZF,) bri t0, label("end"), flags=(CZF,) # Zero out the result register mov reg, reg, t0 subi t2, t1, 1 xor t1, t2, t1 # Bit 6 srli t3, t1, 32, dataSize=8 andi t3, t3, 32 or reg, reg, t3 # Bit 5 srli t3, t1, 16, dataSize=8 andi t3, t3, 16 or reg, reg, t3 # Bit 4 srli t3, t1, 8, dataSize=8 andi t3, t3, 8 or reg, reg, t3 # Bit 3 srli t3, t1, 4, dataSize=8 andi t3, t3, 4 or reg, reg, t3 # Bit 2 srli t3, t1, 2, dataSize=8 andi t3, t3, 2 or reg, reg, t3 # Bit 1 srli t3, t1, 1, dataSize=8 andi t3, t3, 1 or reg, reg, t3
3e7c07fe3694f0322ad14a3f78d57cc10c7ca6f6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7385/3e7c07fe3694f0322ad14a3f78d57cc10c7ca6f6/bit_scan.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11522, 556, 605, 22395, 67, 54, 67, 49, 288, 225, 5730, 268, 21, 16, 268, 21, 16, 268, 20, 16, 30216, 33, 28, 16916, 268, 21, 16, 2291, 16, 12092, 16, 16232, 225, 468, 10229, 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, 11522, 556, 605, 22395, 67, 54, 67, 49, 288, 225, 5730, 268, 21, 16, 268, 21, 16, 268, 20, 16, 30216, 33, 28, 16916, 268, 21, 16, 2291, 16, 12092, 16, 16232, 225, 468, 10229, 309, ...
Returns the sum of a graph with itself n times. Note that the graph must on the left side of the multiplication currently.
Returns the sum of a graph with itself n times.
def __mul__(self, n): """ Returns the sum of a graph with itself n times. Note that the graph must on the left side of the multiplication currently.
55cacd53f2c4e16325b15b66e938ed4ddb411acd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/55cacd53f2c4e16325b15b66e938ed4ddb411acd/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 16411, 972, 12, 2890, 16, 290, 4672, 3536, 2860, 326, 2142, 434, 279, 2667, 598, 6174, 290, 4124, 18, 225, 3609, 716, 326, 2667, 1297, 603, 326, 2002, 4889, 434, 326, 23066, 4551, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 16411, 972, 12, 2890, 16, 290, 4672, 3536, 2860, 326, 2142, 434, 279, 2667, 598, 6174, 290, 4124, 18, 225, 3609, 716, 326, 2667, 1297, 603, 326, 2002, 4889, 434, 326, 23066, 4551, ...
('chid', long_t),
('chid', int_t),
def Cast(args): """returns pointer to arg type for casting """ count, ftype = args.count, args.type if ftype == STRING: count = MAX_STRING_SIZE if ftype not in Map: ftype = double_t return ctypes.cast(args.raw_dbr, ctypes.POINTER(count*Map[ftype]))
3a61996fd2d283126a087ca9b66435eef3cb4fdd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12945/3a61996fd2d283126a087ca9b66435eef3cb4fdd/dbr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19782, 12, 1968, 4672, 3536, 6154, 4407, 358, 1501, 618, 364, 27660, 3536, 1056, 16, 21219, 273, 833, 18, 1883, 16, 833, 18, 723, 309, 21219, 422, 9469, 30, 1056, 273, 4552, 67, 5804, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19782, 12, 1968, 4672, 3536, 6154, 4407, 358, 1501, 618, 364, 27660, 3536, 1056, 16, 21219, 273, 833, 18, 1883, 16, 833, 18, 723, 309, 21219, 422, 9469, 30, 1056, 273, 4552, 67, 5804, ...
write_message("citation_list (x cites y): "+str(citation_list),sys.stderr) write_message("reference_list (x is cited by y): "+str(reference_list),sys.stderr) insert_cit_ref_list_intodb(citation_list, reference_list)
def ref_analyzer(citation_informations, initialresult, initial_citationlist, initial_referencelist): """Analyze the citation informations and calculate the citation weight and cited by list dictionary """ citation_list = initial_citationlist reference_list = initial_referencelist result = initialresult d_reports_numbers = citation_informations[0] d_references_report_numbers = citation_informations[1] d_references_s = citation_informations[2] #of type: {77: ['Nucl. Phys. B 72 (1974) 461','blah blah'], 93: ['..'], ..} d_records_s = citation_informations[3] t1 = os.times()[4] for recid, refnumbers in d_references_report_numbers.iteritems(): for refnumber in refnumbers: p = refnumber f = 'reportnumber' rec_id = get_recids_matching_query(p, f) if rec_id: if result.has_key(rec_id[0]): result[rec_id[0]] += 1 citation_list[rec_id[0]].append(recid) reference_list[recid].append(rec_id[0]) t2 = os.times()[4] for recid, refss in d_references_s.iteritems(): for refs in refss: p = refs f = 'publref' rec_id = get_recids_matching_query(p, f) if rec_id and not recid in citation_list[rec_id[0]]: result[rec_id[0]] += 1 citation_list[rec_id[0]].append(recid) if rec_id and not rec_id[0] in reference_list[recid]: reference_list[recid].append(rec_id[0]) t3 = os.times()[4] for rec_id, recnumbers in d_reports_numbers.iteritems(): for recnumber in recnumbers: p = recnumber f = '999C5r' recid_list = get_recids_matching_query(p, f) if recid_list: for recid in recid_list: if not recid in citation_list[rec_id]: result[rec_id] += 1 citation_list[rec_id].append(recid) if not rec_id in reference_list[recid]: reference_list[recid].append(rec_id) t4 = os.times()[4] for recid, recs in d_records_s.iteritems(): tmp = recs.find("-") if tmp < 0: recs_modified = recs else: recs_modified = recs[:tmp] p = recs_modified f = '999C5s' rec_ids = get_recids_matching_query(p, f) if rec_ids: for rec_id in rec_ids: if not rec_id in citation_list[recid]: result[recid] += 1 citation_list[recid].append(rec_id) if not recid in reference_list[rec_id]: reference_list[rec_id].append(recid) #remove empty lists in citation and reference keys = citation_list.keys() for k in keys: if not citation_list[k]: del citation_list[k] keys = reference_list.keys() for k in keys: if not reference_list[k]: del reference_list[k] t5 = os.times()[4] write_message("citation_list (x cites y): "+str(citation_list),sys.stderr) write_message("reference_list (x is cited by y): "+str(reference_list),sys.stderr) insert_cit_ref_list_intodb(citation_list, reference_list) print "\nExecution time for analyzing the citation information generating the dictionary: " print "checking ref number: ", (t2-t1) print "checking ref ypvt: ", (t3-t2) print "checking rec number: ", (t4-t3) print "checking rec ypvt: ", (t5-t4) print "total time of refAnalize: ", (t5-t1) return result
8b4a8a9af6349e80f5e2d26d9d1503f19e02608b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/8b4a8a9af6349e80f5e2d26d9d1503f19e02608b/bibrank_citation_indexer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1278, 67, 13647, 12, 71, 8773, 67, 267, 687, 1012, 16, 2172, 2088, 16, 2172, 67, 71, 8773, 1098, 16, 2172, 67, 266, 586, 1331, 5449, 4672, 3536, 31984, 326, 21145, 26978, 471, 4604, 32...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1278, 67, 13647, 12, 71, 8773, 67, 267, 687, 1012, 16, 2172, 2088, 16, 2172, 67, 71, 8773, 1098, 16, 2172, 67, 266, 586, 1331, 5449, 4672, 3536, 31984, 326, 21145, 26978, 471, 4604, 32...
ids=[ids]
ids = [ids]
def _set_maximum_date(self, cr, uid, ids, name, value, arg, context): if not value: return False if isinstance(ids, (int, long)): ids=[ids] for pick in self.browse(cr, uid, ids, context): sql_str="""update stock_move set date_planned='%s' where picking_id=%d """ % (value,pick.id)
369221b47101072e094ad2d02fe2edd2b47690aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/369221b47101072e094ad2d02fe2edd2b47690aa/stock.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 542, 67, 15724, 67, 712, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 508, 16, 460, 16, 1501, 16, 819, 4672, 309, 486, 460, 30, 327, 1083, 309, 1549, 12, 2232, 16, 261, 474, 16...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 542, 67, 15724, 67, 712, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 508, 16, 460, 16, 1501, 16, 819, 4672, 309, 486, 460, 30, 327, 1083, 309, 1549, 12, 2232, 16, 261, 474, 16...
demo = demo and mdemo
demo = demo or mdemo
def state_update(self, cr, uid, ids, newstate, states_to_update, context={}, level=50): if level<1: raise orm.except_orm(_('Error'), _('Recursion error in modules dependencies !')) demo = True for module in self.browse(cr, uid, ids): mdemo = True for dep in module.dependencies_id: if dep.state == 'unknown': raise orm.except_orm(_('Error'), _('You try to install a module that depends on the module: %s.\nBut this module is not available in your system.') % (dep.name,)) if dep.state != newstate: ids2 = self.search(cr, uid, [('name','=',dep.name)]) mdemo = self.state_update(cr, uid, ids2, newstate, states_to_update, context, level-1,) and mdemo if not module.dependencies_id: mdemo = module.demo if module.state in states_to_update: self.write(cr, uid, [module.id], {'state': newstate, 'demo':mdemo}) demo = demo and mdemo return demo
dc559134f81c7bd434a7886522413c67364a14f9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/dc559134f81c7bd434a7886522413c67364a14f9/module.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 919, 67, 2725, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 394, 2019, 16, 5493, 67, 869, 67, 2725, 16, 819, 28793, 1801, 33, 3361, 4672, 309, 1801, 32, 21, 30, 1002, 13969, 18, 14137...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 919, 67, 2725, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 394, 2019, 16, 5493, 67, 869, 67, 2725, 16, 819, 28793, 1801, 33, 3361, 4672, 309, 1801, 32, 21, 30, 1002, 13969, 18, 14137...
self.closed_callback()
def handle_close(self): self.closed_callback() self.close()
83d0d88c58db97947833d0bf9f3b4f0ccf01c51d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9601/83d0d88c58db97947833d0bf9f3b4f0ccf01c51d/server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 4412, 12, 2890, 4672, 365, 18, 4412, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1640, 67, 4412, 12, 2890, 4672, 365, 18, 4412, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if doc: while doc and not doc[0].strip(): doc.pop(0) m = re.search(r"^([A-Z].*?\.\s)", " ".join(doc).strip()) if m: summary = m.group(1).strip() else: summary = doc[0].strip()
while doc and not doc[0].strip(): doc.pop(0) m = re.search(r"^([A-Z].*?\.\s)", " ".join(doc).strip()) if m: summary = m.group(1).strip() elif doc: summary = doc[0].strip()
def append_row(*column_texts): row = nodes.row('') for text in column_texts: node = nodes.paragraph('') vl = ViewList() vl.append(text, '<autosummary>') state.nested_parse(vl, 0, node) row.append(nodes.entry('', node)) body.append(row)
939012eb1ed98d550b5b2c9ecdb59c4efc4e0821 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5532/939012eb1ed98d550b5b2c9ecdb59c4efc4e0821/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 714, 67, 492, 30857, 2827, 67, 26256, 4672, 1027, 273, 2199, 18, 492, 2668, 6134, 364, 977, 316, 1057, 67, 26256, 30, 756, 273, 2199, 18, 22445, 2668, 6134, 19755, 273, 4441, 682, 1435, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 714, 67, 492, 30857, 2827, 67, 26256, 4672, 1027, 273, 2199, 18, 492, 2668, 6134, 364, 977, 316, 1057, 67, 26256, 30, 756, 273, 2199, 18, 22445, 2668, 6134, 19755, 273, 4441, 682, 1435, ...
self._buf = ''
self._buf = b""
def __init__(self, sock, ssl, bufsize=None): SharedSocketClient.__init__(self, sock) self._ssl = ssl self._buf = '' self._bufsize = bufsize or self.__class__.BUFSIZE
ffdaa6b15dbb640b0db5edfe62df1487d59cff6b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/ffdaa6b15dbb640b0db5edfe62df1487d59cff6b/httplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 7313, 16, 5832, 16, 1681, 1467, 33, 7036, 4672, 10314, 4534, 1227, 16186, 2738, 972, 12, 2890, 16, 7313, 13, 365, 6315, 8157, 273, 5832, 365, 6315, 4385, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1001, 2738, 972, 12, 2890, 16, 7313, 16, 5832, 16, 1681, 1467, 33, 7036, 4672, 10314, 4534, 1227, 16186, 2738, 972, 12, 2890, 16, 7313, 13, 365, 6315, 8157, 273, 5832, 365, 6315, 4385, ...
elif sys.platform[:5] == "hp-ux":
elif sys.platform[:5] == "hp-ux":
def runtime_library_dir_option(self, dir): # XXX Hackish, at the very least. See Python bug #445902: # http://sourceforge.net/tracker/index.php # ?func=detail&aid=445902&group_id=5470&atid=105470 # Linkers on different platforms need different options to # specify that directories need to be added to the list of # directories searched for dependencies when a dynamic library # is sought. GCC has to be told to pass the -R option through # to the linker, whereas other compilers just know this. # Other compilers may need something slightly different. At # this time, there's no way to determine this information from # the configuration data stored in the Python installation, so # we use this hack. compiler = os.path.basename(sysconfig.get_config_var("CC")) if sys.platform[:6] == "darwin": # MacOSX's linker doesn't understand the -R flag at all return "-L" + dir elif sys.platform[:5] == "hp-ux": return "+s -L" + dir elif compiler[:3] == "gcc" or compiler[:3] == "g++": return "-Wl,-R" + dir else: return "-R" + dir
7224f31027a87b615b0f8452134f745d64259381 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7224f31027a87b615b0f8452134f745d64259381/unixccompiler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3099, 67, 12083, 67, 1214, 67, 3482, 12, 2890, 16, 1577, 4672, 468, 11329, 670, 484, 1468, 16, 622, 326, 8572, 4520, 18, 225, 2164, 6600, 7934, 468, 6334, 6162, 3103, 30, 468, 1062, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3099, 67, 12083, 67, 1214, 67, 3482, 12, 2890, 16, 1577, 4672, 468, 11329, 670, 484, 1468, 16, 622, 326, 8572, 4520, 18, 225, 2164, 6600, 7934, 468, 6334, 6162, 3103, 30, 468, 1062, 22...
wid = self.glade.get_widget('tree_toolbar') for child in wid.get_children():
for child in self.toolbar.get_children():
def sig_key_press(self, widget, event): if event.keyval == gtk.keysyms.Left: selection = self.tree_res.view.get_selection() model, paths = selection.get_selected_rows() if len(paths) == 1: if not self.tree_res.view.row_expanded(paths[0]): if len(paths[0]) > 1: new_path = paths[0][:-1] selection.select_path(new_path) self.tree_res.view.collapse_row(new_path) elif self.tree_res.toolbar: wid = self.glade.get_widget('tree_toolbar') for child in wid.get_children(): if child.get_active(): child.child.grab_focus() break for path in paths: self.tree_res.view.collapse_row(path) return True elif event.keyval == gtk.keysyms.Right: model, paths = self.tree_res.view.get_selection()\ .get_selected_rows() for path in paths: self.tree_res.view.expand_row(path, False) return True
86db51bc9b100d1f6a8db8af0c3c6bc94eca6aa0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9151/86db51bc9b100d1f6a8db8af0c3c6bc94eca6aa0/tree.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3553, 67, 856, 67, 1028, 12, 2890, 16, 3604, 16, 871, 4672, 309, 871, 18, 856, 1125, 422, 22718, 18, 2452, 93, 959, 18, 3910, 30, 4421, 273, 365, 18, 3413, 67, 455, 18, 1945, 18, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3553, 67, 856, 67, 1028, 12, 2890, 16, 3604, 16, 871, 4672, 309, 871, 18, 856, 1125, 422, 22718, 18, 2452, 93, 959, 18, 3910, 30, 4421, 273, 365, 18, 3413, 67, 455, 18, 1945, 18, 5...
def filerByKeyword(contribIterator, keyword):
def filterByKeyword(contribIterator, keyword):
def filerByKeyword(contribIterator, keyword): return filterKey(contribIterator, "keyword", keyword)
a306d2391726cf957c45ad2bfdbe0ec8d15a1e40 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/a306d2391726cf957c45ad2bfdbe0ec8d15a1e40/contrib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12219, 8736, 12, 26930, 3198, 16, 4932, 4672, 327, 1034, 653, 12, 26930, 3198, 16, 315, 11041, 3113, 4932, 13, 282, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 12219, 8736, 12, 26930, 3198, 16, 4932, 4672, 327, 1034, 653, 12, 26930, 3198, 16, 315, 11041, 3113, 4932, 13, 282, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
self.treeView = treeView
def __init__(self, treeView = None, **kw): super(MethodView, self).__init__(**kw) if not treeView: self.client = self.session.Client(self, showMethodTree = True) treeView = self.client.methodTreeView self.model = self.TreeModel(self) self.treeView = treeView self.treeView.append_column(gtk.TreeViewColumn("tree", gtk.CellRendererText(), markup=0)) self.treeView.set_model(self.model) self.treeView.connect("row-activated", self.rowActivated) self.treeView.connect("cursor-changed", self.rowSelected) self.treeView.connect("button-press-event", self.rowExamined)
b52b21170296d5c58869e5d937601914028e5c0d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9377/b52b21170296d5c58869e5d937601914028e5c0d/gnomoire.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2151, 1767, 273, 599, 16, 2826, 9987, 4672, 2240, 12, 1305, 1767, 16, 365, 2934, 972, 2738, 972, 12, 636, 9987, 13, 309, 486, 2151, 1767, 30, 365, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2151, 1767, 273, 599, 16, 2826, 9987, 4672, 2240, 12, 1305, 1767, 16, 365, 2934, 972, 2738, 972, 12, 636, 9987, 13, 309, 486, 2151, 1767, 30, 365, 18, ...
register("MacOSX", None, MacOSX('default'), -1)
register("MacOSX", None, MacOSXOSAScript('default'), -1) register("safari", None, MacOSXOSAScript('safari'), -1) register("firefox", None, MacOSXOSAScript('firefox'), -1)
def open(self, url, new=0, autoraise=True): assert "'" not in url # hack for local urls if not ':' in url: url = 'file:'+url
4ef1c7e7efbd8827b9f97c73d0eb9a31604e83f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/4ef1c7e7efbd8827b9f97c73d0eb9a31604e83f2/webbrowser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 12, 2890, 16, 880, 16, 394, 33, 20, 16, 2059, 10610, 784, 33, 5510, 4672, 1815, 5862, 486, 316, 880, 468, 11769, 364, 1191, 6903, 309, 486, 3921, 316, 880, 30, 880, 273, 296, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1696, 12, 2890, 16, 880, 16, 394, 33, 20, 16, 2059, 10610, 784, 33, 5510, 4672, 1815, 5862, 486, 316, 880, 468, 11769, 364, 1191, 6903, 309, 486, 3921, 316, 880, 30, 880, 273, 296, 7...
color = self.app.brush.get_color_hsv() context.set_color_hsv(color)
def context_cb(self, action): name = action.get_name() store = False bm = self.app.brushmanager if name == 'ContextStore': context = bm.selected_context if not context: print 'No context was selected, ignoring store command.' return store = True else: if name.endswith('s'): store = True name = name[:-1] i = int(name[-2:]) context = bm.contexts[i] bm.selected_context = context if store: context.copy_settings_from(self.app.brush) context.preview = bm.selected_brush.preview context.save() else: # restore (but keep color) color = self.app.brush.get_color_hsv() context.set_color_hsv(color) bm.select_brush(context)
e8f68a3123c8ad646d12122a3da0eb00182d4ae6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7129/e8f68a3123c8ad646d12122a3da0eb00182d4ae6/document.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 819, 67, 7358, 12, 2890, 16, 1301, 4672, 508, 273, 1301, 18, 588, 67, 529, 1435, 1707, 273, 1083, 18829, 273, 365, 18, 2910, 18, 2848, 1218, 4181, 309, 508, 422, 296, 1042, 2257, 4278,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 819, 67, 7358, 12, 2890, 16, 1301, 4672, 508, 273, 1301, 18, 588, 67, 529, 1435, 1707, 273, 1083, 18829, 273, 365, 18, 2910, 18, 2848, 1218, 4181, 309, 508, 422, 296, 1042, 2257, 4278,...
test()
test()
def test(): import sys import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'td') except getopt.error, msg: sys.stdout = sys.stderr print msg print "usage: quopri [-t | -d] [file] ..." print "-t: quote tabs" print "-d: decode; default encode" sys.exit(2) deco = 0 tabs = 0 for o, a in opts: if o == '-t': tabs = 1 if o == '-d': deco = 1 if tabs and deco: sys.stdout = sys.stderr print "-t and -d are mutually exclusive" sys.exit(2) if not args: args = ['-'] sts = 0 for file in args: if file == '-': fp = sys.stdin else: try: fp = open(file) except IOError, msg: sys.stderr.write("%s: can't open (%s)\n" % (file, msg)) sts = 1 continue if deco: decode(fp, sys.stdout) else: encode(fp, sys.stdout, tabs) if fp is not sys.stdin: fp.close() if sts: sys.exit(sts)
7ad3eb0691b28b7bbfefbfe6d3feaf80fa53186d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/7ad3eb0691b28b7bbfefbfe6d3feaf80fa53186d/quopri.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 13332, 1930, 2589, 1930, 336, 3838, 775, 30, 1500, 16, 833, 273, 336, 3838, 18, 588, 3838, 12, 9499, 18, 19485, 63, 21, 30, 6487, 296, 4465, 6134, 1335, 336, 3838, 18, 1636, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 13332, 1930, 2589, 1930, 336, 3838, 775, 30, 1500, 16, 833, 273, 336, 3838, 18, 588, 3838, 12, 9499, 18, 19485, 63, 21, 30, 6487, 296, 4465, 6134, 1335, 336, 3838, 18, 1636, 16, ...
handler = self.apihandler + method
handler = method if not handler.startswith(self.apihandler): handler = '/'.join((self.apihandler, handler))
def _request(self, request_type, method, info=None): handler = self.apihandler + method log.debug("_request calling: %s to host:port : %s:%s" % (handler, self.host, self.port)) if self.cert_file: log.info("Using SSLv3 context") context = SSL.Context("sslv3") context.load_cert(self.cert_file, keyfile=self.key_file) conn = httpslib.HTTPSConnection(self.host, self.port, ssl_context=context) else: conn = httplib.HTTPSConnection(self.host, self.port) log.debug("Request_type: %s" % request_type) log.debug("info: %s" % info) log.debug("headers: %s" % self.headers) conn.request(request_type, handler, body=json.dumps(info), headers=self.headers) response = conn.getresponse() if response.status == 404: return None self.validateResponse(response) rinfo = response.read() if not len(rinfo): return None return json.loads(rinfo)
75e301377cff16ad7e67e64652c5a3a59c72320b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10692/75e301377cff16ad7e67e64652c5a3a59c72320b/connection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2293, 12, 2890, 16, 590, 67, 723, 16, 707, 16, 1123, 33, 7036, 4672, 1838, 273, 707, 309, 486, 1838, 18, 17514, 1918, 12, 2890, 18, 2425, 4176, 4672, 225, 1838, 273, 2023, 18, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2293, 12, 2890, 16, 590, 67, 723, 16, 707, 16, 1123, 33, 7036, 4672, 1838, 273, 707, 309, 486, 1838, 18, 17514, 1918, 12, 2890, 18, 2425, 4176, 4672, 225, 1838, 273, 2023, 18, 5...
headfile.write(' public :: %s,%s,%s,%s,%s,%s\n' % (writesubname,readsubname,wpointn
headfile.write(' public :: %s, &\n %s, &\n %s, &\n %s, &\n %s, &\n %s\n' % (writesubname,readsubname,wpointn
def write_type_restart(t,headfile,bodyfile): writesubname = 'rsw_'+t.name readsubname = 'rsr_'+t.name wpointn=writesubname+'_point' rpointn=readsubname+ '_point' wparrn_1d=writesubname+'_pointarr_1d' rparrn_1d=readsubname +'_pointarr_1d' wparrn_2d=writesubname+'_pointarr_2d' rparrn_2d=readsubname +'_pointarr_2d' wparrn_3d=writesubname+'_pointarr_3d' rparrn_3d=readsubname +'_pointarr_3d' no_restart=get_no_restart(t) # Make public headfile.write(' public :: %s,%s,%s,%s,%s,%s\n' % (writesubname,readsubname,wpointn ,rpointn,writesubname+'_pointarr',readsubname+'_pointarr')) headfile.write('\n') headfile.write('interface %s\n'%(writesubname+'_pointarr')) headfile.write(' module procedure %s\n'%(wparrn_1d)) headfile.write('end interface\n') headfile.write('\n') headfile.write('interface %s\n'%(readsubname+'_pointarr')) headfile.write(' module procedure %s\n'%(rparrn_1d)) headfile.write('end interface\n') headfile.write('\n') # Write code (scalar) bodyfile.write(' recursive subroutine %s(file,dat)\n' % (writesubname)) bodyfile.write('\n') bodyfile.write(usefiles) bodyfile.write(' implicit none\n') bodyfile.write('\n') bodyfile.write(' type(restart_file),intent(inout) :: file\n') bodyfile.write(' type(%s) :: dat\n'%(t.name)) bodyfile.write(' logical :: assoc\n') bodyfile.write('\n') bodyfile.write(' call check_write(file)\n') bodyfile.write('\n') for var in t.components: if not (var.name in no_restart): var_write(var,bodyfile,t.name,'dat%') bodyfile.write('\n') bodyfile.write(' end subroutine %s\n' % (writesubname)) bodyfile.write('\n') # Write code (scalar pointer) bodyfile.write(' recursive subroutine %s(file,dat)\n' % (wpointn)) bodyfile.write('\n') bodyfile.write(usefiles) bodyfile.write(' implicit none\n') bodyfile.write('\n') bodyfile.write(' type(restart_file),intent(inout) :: file\n') bodyfile.write(' type(%s),pointer :: dat\n'%(t.name)) bodyfile.write(' logical :: assoc\n') bodyfile.write('\n') bodyfile.write(' call check_write(file)\n') bodyfile.write('\n') for var in t.components: if not (var.name in no_restart): var_write(var,bodyfile,t.name,'dat%') bodyfile.write('\n') bodyfile.write(' end subroutine %s\n' % (wpointn)) bodyfile.write('\n') # Write code (1D pointer array) bodyfile.write('recursive subroutine %s(file,prefix,name,values)\n'%(wparrn_1d)) bodyfile.write('\n') bodyfile.write(usefiles) bodyfile.write(' implicit none\n') bodyfile.write('\n') bodyfile.write(' type(restart_file),intent(inout) :: file\n') bodyfile.write(' character(*), intent(in) :: prefix\n') bodyfile.write(' character(*), intent(in) :: name\n') bodyfile.write(' type(%s),dimension(:),pointer :: values\n'%(t.name)) bodyfile.write('\n') bodyfile.write(' integer :: status,varid\n') bodyfile.write(' character(varnamelen) :: varname\n') bodyfile.write(' integer,dimension(1) :: sh\n') bodyfile.write(' integer :: i\n') bodyfile.write('\n') bodyfile.write(' if (associated(values)) then\n') bodyfile.write(' sh=shape(values)\n') bodyfile.write(' call write_array_pointer(file,prefix,name,sh)\n') bodyfile.write(' do i=1,sh(1)\n') bodyfile.write(' call %s(file,values(i))\n'%(writesubname)) bodyfile.write(' end do\n') bodyfile.write(' else\n') bodyfile.write(' call write_null_array_pointer(file,prefix,name)\n') bodyfile.write(' end if\n') bodyfile.write('\n') bodyfile.write('end subroutine %s\n'%(wparrn_1d)) # Read code (scalar) bodyfile.write(' recursive subroutine %s(file,dat)\n' % (readsubname)) bodyfile.write('\n') bodyfile.write(usefiles) bodyfile.write(' implicit none\n') bodyfile.write('\n') bodyfile.write(' type(restart_file),intent(inout) :: file\n') bodyfile.write(' type(%s) :: dat\n'%(t.name)) bodyfile.write(' logical :: assoc\n') bodyfile.write('\n') bodyfile.write(' call check_read(file)\n') bodyfile.write('\n') for var in t.components: if not (var.name in no_restart): var_read(var,bodyfile,t.name,'dat%') bodyfile.write('\n') bodyfile.write(' end subroutine %s\n' % (readsubname)) bodyfile.write('\n') # Read code (scalar pointer) bodyfile.write(' recursive subroutine %s(file,dat)\n' % (rpointn)) bodyfile.write('\n') bodyfile.write(usefiles) bodyfile.write(' implicit none\n') bodyfile.write('\n') bodyfile.write(' type(restart_file),intent(inout) :: file\n') bodyfile.write(' type(%s),pointer :: dat\n'%(t.name)) bodyfile.write(' logical :: assoc\n') bodyfile.write('\n') bodyfile.write(' call check_read(file)\n') bodyfile.write('\n') bodyfile.write(' allocate(dat)\n') for var in t.components: if not (var.name in no_restart): var_read(var,bodyfile,t.name,'dat%') bodyfile.write('\n') bodyfile.write(' end subroutine %s\n' % (rpointn)) bodyfile.write('\n') # Read code (1D pointer array) bodyfile.write('recursive subroutine %s(file,prefix,name,values)\n'%(rparrn_1d)) bodyfile.write('\n') bodyfile.write(usefiles) bodyfile.write(' implicit none\n') bodyfile.write('\n') bodyfile.write(' type(restart_file),intent(inout) :: file\n') bodyfile.write(' character(*), intent(in) :: prefix\n') bodyfile.write(' character(*), intent(in) :: name\n') bodyfile.write(' type(%s),dimension(:),pointer :: values\n'%(t.name)) bodyfile.write('\n') bodyfile.write(' integer :: status,varid\n') bodyfile.write(' character(varnamelen) :: varname\n') bodyfile.write(' integer,dimension(1) :: sh\n') bodyfile.write(' logical :: assoc\n') bodyfile.write(' integer :: i\n') bodyfile.write('\n') bodyfile.write(' if (associated(values)) then\n') bodyfile.write(' deallocate(values)\n') bodyfile.write(' nullify(values)\n') bodyfile.write(' end if\n') bodyfile.write('\n') bodyfile.write(' call read_array_pointer(file,prefix,name,sh,assoc)\n') bodyfile.write(' if (assoc) then\n') bodyfile.write(' allocate(values(sh(1)))\n') bodyfile.write(' do i=1,sh(1)\n') bodyfile.write(' call %s(file,values(i))\n'%(readsubname)) bodyfile.write(' end do\n') bodyfile.write(' end if\n') bodyfile.write('\n') bodyfile.write('end subroutine %s\n'%(rparrn_1d)) bodyfile.write('\n')
281d8426eef40564bfa46579c4cde29e085d8038 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2666/281d8426eef40564bfa46579c4cde29e085d8038/make_restarts.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 723, 67, 19164, 12, 88, 16, 1978, 768, 16, 3432, 768, 4672, 7262, 373, 529, 273, 296, 86, 5328, 4623, 15, 88, 18, 529, 855, 1717, 529, 225, 273, 296, 5453, 86, 4623, 15, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 723, 67, 19164, 12, 88, 16, 1978, 768, 16, 3432, 768, 4672, 7262, 373, 529, 273, 296, 86, 5328, 4623, 15, 88, 18, 529, 855, 1717, 529, 225, 273, 296, 5453, 86, 4623, 15, ...
self.add_task_tree_to_list(tree_store, cid, my_row, selected_uid,\ active_tasks=active_tasks)
self.add_task_tree_to_list( tree_store, cid, my_row, selected_uid, active_tasks=active_tasks)
def add_task_tree_to_list(self, tree_store, tid, parent, selected_uid=None,\ active_tasks=[], treeview=True): task = self.req.get_task(tid) st_count = self.__count_tasks_rec(task, active_tasks) if selected_uid and selected_uid == tid: # Temporarily disabled #title = self.__build_task_title(task, extended=True) title_str = self.__build_task_title(task, st_count, extended=False) else: title_str = self.__build_task_title(task, st_count, extended=False)
451ea29e3924785bc6c6b8648aa6459b292a0db4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/451ea29e3924785bc6c6b8648aa6459b292a0db4/browser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 4146, 67, 3413, 67, 869, 67, 1098, 12, 2890, 16, 2151, 67, 2233, 16, 11594, 16, 982, 16, 3170, 67, 1911, 33, 7036, 17211, 2695, 67, 9416, 22850, 6487, 2151, 1945, 33, 5510, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 4146, 67, 3413, 67, 869, 67, 1098, 12, 2890, 16, 2151, 67, 2233, 16, 11594, 16, 982, 16, 3170, 67, 1911, 33, 7036, 17211, 2695, 67, 9416, 22850, 6487, 2151, 1945, 33, 5510, ...
found = self.investigateThinca( trigCache.pfnlist(), inj, ifo, stage, self.number )
found = self.investigateThinca( trigCache.pfnlist(), inj, ifo, \ stage, self.number )
def fillTable(page, contents ): """ Making life easier... """
97e32f7f2ca5cb3d7f0c99dedfdf52cb1afe6f09 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5758/97e32f7f2ca5cb3d7f0c99dedfdf52cb1afe6f09/followup_missed.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3636, 1388, 12, 2433, 16, 2939, 262, 30, 3536, 490, 6159, 17140, 15857, 2777, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 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, 3636, 1388, 12, 2433, 16, 2939, 262, 30, 3536, 490, 6159, 17140, 15857, 2777, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
''' Render a "plain" representation of the property '''
""" Render a "plain" representation of the property """
def plain(self, escape=0): ''' Render a "plain" representation of the property ''' if not self.is_view_ok(): return self._('[hidden]')
16a3ebf380b95607b344181655488d818a27791f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1906/16a3ebf380b95607b344181655488d818a27791f/templating.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7351, 12, 2890, 16, 4114, 33, 20, 4672, 3536, 6987, 279, 315, 7446, 6, 4335, 434, 326, 1272, 3536, 309, 486, 365, 18, 291, 67, 1945, 67, 601, 13332, 327, 365, 6315, 2668, 63, 6345, 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, 7351, 12, 2890, 16, 4114, 33, 20, 4672, 3536, 6987, 279, 315, 7446, 6, 4335, 434, 326, 1272, 3536, 309, 486, 365, 18, 291, 67, 1945, 67, 601, 13332, 327, 365, 6315, 2668, 63, 6345, 3...
themeFonts[int(textnode.attributes["font"].value)],
themeFonts[textnode.attributes["font"].value],
def drawThemeItem(page, itemsonthispage, itemnum, menuitem, bgimage, draw, bgimagemask, drawmask, highlightcolor, spumuxdom, spunode, numberofitems, chapternumber, chapterlist): """Draws text and graphics onto a dvd menu, called by createMenu and createChapterMenu""" #Get the XML containing information about this item infoDOM = xml.dom.minidom.parse( os.path.join(getItemTempPath(itemnum),"info.xml") ) #Error out if its the wrong XML if infoDOM.documentElement.tagName != "fileinfo": fatalError("The info.xml file (%s) doesn't look right" % os.path.join(getItemTempPath(itemnum),"info.xml")) #boundarybox holds the max and min dimensions for this item so we can auto build a menu highlight box boundarybox=9999,9999,0,0 wantHighlightBox = True #Loop through all the nodes inside this menu item for node in menuitem.childNodes: #Process each type of item to add it onto the background image if node.nodeName=="graphic": #Overlay graphic image onto background #if this graphic item is a movie thumbnail then we dont process it here if node.attributes["filename"].value == "%movie": #this is a movie item but we must still update the boundary box boundarybox=checkBoundaryBox(boundarybox, node) else: imagefilename = expandItemText(infoDOM,node.attributes["filename"].value, itemnum, page, itemsonthispage, chapternumber, chapterlist) if doesFileExist(imagefilename) == False: if imagefilename == node.attributes["filename"].value: imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if doesFileExist(imagefilename): picture = Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture = picture.convert("RGBA") #see if an image mask exists imagemaskfilename = None if node.hasAttribute("mask"): if node.attribute["mask"].value <> "": imagemaskfilename = getThemeFile(themeName, node.attributes["mask"].value) if imagemaskfilename <> None and doesFileExist(imagemaskfilename): maskpicture = Image.open(imagemaskfilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) maskpicture = maskpicture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), maskpicture) del maskpicture else: bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added image %s" % imagefilename) boundarybox=checkBoundaryBox(boundarybox, node) else: write( "Image file does not exist '%s'" % imagefilename) elif node.nodeName=="text": #Apply some text to the background, including wordwrap if required. text=expandItemText(infoDOM,node.attributes["value"].value, itemnum, page, itemsonthispage,chapternumber,chapterlist) if text>"": paintText( draw, getScaledAttribute(node, "x"), getScaledAttribute(node, "y"), getScaledAttribute(node, "w"), getScaledAttribute(node, "h"), text, themeFonts[int(node.attributes["font"].value)], node.attributes["colour"].value, node.attributes["align"].value ) boundarybox=checkBoundaryBox(boundarybox, node) del text elif node.nodeName=="previous": if page>1: #Overlay previous graphic button onto background imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if not doesFileExist(imagefilename): fatalError("Cannot find image for previous button (%s)." % imagefilename) maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) if not doesFileExist(maskimagefilename): fatalError("Cannot find mask image for previous button (%s)." % maskimagefilename) picture=Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added previous button image %s" % imagefilename) picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added previous button mask image %s" % imagefilename) button = spumuxdom.createElement("button") button.setAttribute("name","previous") button.setAttribute("x0","%s" % getScaledAttribute(node, "x")) button.setAttribute("y0","%s" % getScaledAttribute(node, "y")) button.setAttribute("x1","%s" % (getScaledAttribute(node, "x") + getScaledAttribute(node, "w"))) button.setAttribute("y1","%s" % (getScaledAttribute(node, "y") + getScaledAttribute(node, "h"))) spunode.appendChild(button) elif node.nodeName=="next": if itemnum < numberofitems: #Overlay next graphic button onto background imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if not doesFileExist(imagefilename): fatalError("Cannot find image for next button (%s)." % imagefilename) maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) if not doesFileExist(maskimagefilename): fatalError("Cannot find mask image for next button (%s)." % maskimagefilename) picture = Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture = picture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added next button image %s " % imagefilename) picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added next button mask image %s" % imagefilename) button = spumuxdom.createElement("button") button.setAttribute("name","next") button.setAttribute("x0","%s" % getScaledAttribute(node, "x")) button.setAttribute("y0","%s" % getScaledAttribute(node, "y")) button.setAttribute("x1","%s" % (getScaledAttribute(node, "x") + getScaledAttribute(node, "w"))) button.setAttribute("y1","%s" % (getScaledAttribute(node, "y") + getScaledAttribute(node, "h"))) spunode.appendChild(button) elif node.nodeName=="titlemenu": if itemnum < numberofitems: #Overlay next graphic button onto background imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if not doesFileExist(imagefilename): fatalError("Cannot find image for titlemenu button (%s)." % imagefilename) maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) if not doesFileExist(maskimagefilename): fatalError("Cannot find mask image for titlemenu button (%s)." % maskimagefilename) picture = Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture = picture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added titlemenu button image %s " % imagefilename) picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture write( "Added titlemenu button mask image %s" % imagefilename) button = spumuxdom.createElement("button") button.setAttribute("name","titlemenu") button.setAttribute("x0","%s" % getScaledAttribute(node, "x")) button.setAttribute("y0","%s" % getScaledAttribute(node, "y")) button.setAttribute("x1","%s" % (getScaledAttribute(node, "x") + getScaledAttribute(node, "w"))) button.setAttribute("y1","%s" % (getScaledAttribute(node, "y") + getScaledAttribute(node, "h"))) spunode.appendChild(button) elif node.nodeName=="button": wantHighlightBox = False #Overlay item graphic/text button onto background imagefilename = getThemeFile(themeName, node.attributes["filename"].value) if not doesFileExist(imagefilename): fatalError("Cannot find image for menu button (%s)." % imagefilename) maskimagefilename = getThemeFile(themeName, node.attributes["mask"].value) if not doesFileExist(maskimagefilename): fatalError("Cannot find mask image for menu button (%s)." % maskimagefilename) picture=Image.open(imagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimage.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")), picture) del picture # if we have some text paint that over the image textnode = node.getElementsByTagName("textnormal") if textnode.length > 0: textnode = textnode[0] text=expandItemText(infoDOM,textnode.attributes["value"].value, itemnum, page, itemsonthispage,chapternumber,chapterlist) if text>"": paintText( draw, getScaledAttribute(textnode, "x"), getScaledAttribute(textnode, "y"), getScaledAttribute(textnode, "w"), getScaledAttribute(textnode, "h"), text, themeFonts[int(textnode.attributes["font"].value)], textnode.attributes["colour"].value, textnode.attributes["align"].value ) boundarybox=checkBoundaryBox(boundarybox, node) del text write( "Added button image %s" % imagefilename) picture=Image.open(maskimagefilename,"r").resize((getScaledAttribute(node, "w"), getScaledAttribute(node, "h"))) picture=picture.convert("RGBA") bgimagemask.paste(picture, (getScaledAttribute(node, "x"), getScaledAttribute(node, "y")),picture) #del picture # if we have some text paint that over the image textnode = node.getElementsByTagName("textselected") if textnode.length > 0: textnode = textnode[0] text=expandItemText(infoDOM,textnode.attributes["value"].value, itemnum, page, itemsonthispage,chapternumber,chapterlist) textImage=Image.new("RGBA",picture.size) textDraw=ImageDraw.Draw(textImage) if text>"": paintText(textDraw, getScaledAttribute(node, "x") - getScaledAttribute(textnode, "x"), getScaledAttribute(node, "y") - getScaledAttribute(textnode, "y"), getScaledAttribute(textnode, "w"), getScaledAttribute(textnode, "h"), text, themeFonts[int(textnode.attributes["font"].value)], "white", textnode.attributes["align"].value ) #convert the RGB image to a 1 bit image (width, height) = textImage.size for y in range(height): for x in range(width): if textImage.getpixel((x,y)) < (100, 100, 100, 255): textImage.putpixel((x,y), (0, 0, 0, 0)) else: textImage.putpixel((x,y), (255, 255, 255, 255)) bgimagemask.paste(textnode.attributes["colour"].value, (getScaledAttribute(textnode, "x"), getScaledAttribute(textnode, "y")), textImage) boundarybox=checkBoundaryBox(boundarybox, node) del text, textImage, textDraw del picture elif node.nodeName=="#text" or node.nodeName=="#comment": #Do nothing assert True else: write( "Dont know how to process %s" % node.nodeName) if drawmask == None: return #Draw the mask for this item if wantHighlightBox == True: # Make the boundary box bigger than the content to avoid over writing it boundarybox=boundarybox[0]-1,boundarybox[1]-1,boundarybox[2]+1,boundarybox[3]+1 drawmask.rectangle(boundarybox,outline=highlightcolor) # Draw another line to make the box thicker - PIL does not support linewidth boundarybox=boundarybox[0]-1,boundarybox[1]-1,boundarybox[2]+1,boundarybox[3]+1 drawmask.rectangle(boundarybox,outline=highlightcolor) node = spumuxdom.createElement("button") #Fiddle this for chapter marks.... if chapternumber>0: node.setAttribute("name","%s" % chapternumber) else: node.setAttribute("name","%s" % itemnum) node.setAttribute("x0","%d" % int(boundarybox[0])) node.setAttribute("y0","%d" % int(boundarybox[1])) node.setAttribute("x1","%d" % int(boundarybox[2] + 1)) node.setAttribute("y1","%d" % int(boundarybox[3] + 1)) spunode.appendChild(node)
c82d8a0c4a33fc669861191621297cdbb83d3d9b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13713/c82d8a0c4a33fc669861191621297cdbb83d3d9b/mythburn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 8335, 1180, 12, 2433, 16, 761, 816, 2211, 2433, 16, 761, 2107, 16, 3824, 1726, 16, 7611, 2730, 16, 3724, 16, 7611, 15374, 351, 835, 16, 3724, 4455, 16, 8839, 3266, 16, 1694, 379,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8335, 1180, 12, 2433, 16, 761, 816, 2211, 2433, 16, 761, 2107, 16, 3824, 1726, 16, 7611, 2730, 16, 3724, 16, 7611, 15374, 351, 835, 16, 3724, 4455, 16, 8839, 3266, 16, 1694, 379,...