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 |
|---|---|---|---|---|---|---|
WHERE m.model = %s | WHERE m.model = '%s' | def domain_get(self, cr, uid, model_name): # root user above constraint if uid == 1: return '', [] | f49da35cabf28785be0d0da9ab1c3c28d2bca7f4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/f49da35cabf28785be0d0da9ab1c3c28d2bca7f4/ir_rule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2461,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
938,
67,
529,
4672,
468,
1365,
729,
5721,
4954,
309,
4555,
422,
404,
30,
327,
10226,
5378,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2461,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
938,
67,
529,
4672,
468,
1365,
729,
5721,
4954,
309,
4555,
422,
404,
30,
327,
10226,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
return False | raise TranslationError("File name already exists: " + generatedfilename) | def _translation_is_needed(repyfilename, generatedfilename): """ Checks if generatedfile needs to be regenerated. Does several checks to decide if generating generatedfilename based on repyfilename is a good idea. --does file already exist? --was it automatically generated? --was the original modified since the last translation? """ if not os.path.isfile(repyfilename): raise TranslationError("no such file:", repyfilename) if not os.path.isfile(generatedfilename): return True try: fh = open(generatedfilename, "r") first_line = fh.readline().rstrip("\n") fh.close() if first_line != TRANSLATION_TAGLINE: #This file was probably not generated by repyhelper, or was modified by #the user. Let's not clobber the file, just to be safe. return False except IOError: #Error opening the file. Assume this means we need to regen return False #If we get here and modification time of orig is older than gen, this is still #a valid generation repystat = os.stat(repyfilename) genstat = os.stat(generatedfilename) if repystat.st_mtime < genstat.st_mtime: return False return True | 5d64f0bf704450635592d5e51f4271f89bc04c6d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/5d64f0bf704450635592d5e51f4271f89bc04c6d/repyhelper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10173,
67,
291,
67,
17471,
12,
266,
2074,
3459,
16,
4374,
3459,
4672,
3536,
13074,
309,
4374,
768,
4260,
358,
506,
960,
7489,
18,
9637,
11392,
4271,
358,
16288,
309,
12516,
4374,
34... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10173,
67,
291,
67,
17471,
12,
266,
2074,
3459,
16,
4374,
3459,
4672,
3536,
13074,
309,
4374,
768,
4260,
358,
506,
960,
7489,
18,
9637,
11392,
4271,
358,
16288,
309,
12516,
4374,
34... |
self.log.info( 'CEs requested by TaskQueueID %s:' % taskQueueDict['TaskQueueID'], ', '.join( taskQueueDict['GridCEs'] ) ) | self.log.info( 'CEs requested by TaskQueue %s:' % taskQueueDict['TaskQueueID'], ', '.join( taskQueueDict['GridCEs'] ) ) | def __resolveCECandidates( self, taskQueueDict ): """ Return a list of CE's """ # assume user knows what they're doing and avoid site mask e.g. sam jobs if 'GridCEs' in taskQueueDict and taskQueueDict['GridCEs']: self.log.info( 'CEs requested by TaskQueueID %s:' % taskQueueDict['TaskQueueID'], ', '.join( taskQueueDict['GridCEs'] ) ) return taskQueueDict['GridCEs'] | 4fc45f848c73ccd70e55d2692551954ac266f79d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/4fc45f848c73ccd70e55d2692551954ac266f79d/TaskQueueDirector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
10828,
1441,
18455,
12,
365,
16,
1562,
3183,
5014,
262,
30,
3536,
2000,
279,
666,
434,
29538,
1807,
3536,
468,
6750,
729,
21739,
4121,
2898,
4565,
9957,
471,
4543,
2834,
3066,
425,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10828,
1441,
18455,
12,
365,
16,
1562,
3183,
5014,
262,
30,
3536,
2000,
279,
666,
434,
29538,
1807,
3536,
468,
6750,
729,
21739,
4121,
2898,
4565,
9957,
471,
4543,
2834,
3066,
425,
... |
line = r"\%s%s" % (m.group(1), line[m.end():]) | line = r"\%s %s" % (m.group(1), line[m.end():]) | def subconvert(line, ofp, table, discards, autoclosing, knownempty, endchar=None): stack = [] while line: if line[0] == endchar and not stack: return line[1:] m = _comment_rx.match(line) if m: text = m.group(1) if text: ofp.write("(COMMENT\n") ofp.write("-%s\n" % encode(text)) ofp.write(")COMMENT\n") ofp.write("-\\n\n") else: ofp.write("-\\n\n") line = line[m.end():] continue m = _begin_env_rx.match(line) if m: # re-write to use the macro handler line = r"\%s%s" % (m.group(1), line[m.end():]) continue m =_end_env_rx.match(line) if m: # end of environment envname = m.group(1) if envname == "document": # special magic for n in stack[1:]: if n not in autoclosing: raise LaTeXFormatError("open element on stack: " + `n`) # should be more careful, but this is easier to code: stack = [] ofp.write(")document\n") elif envname == stack[-1]: ofp.write(")%s\n" % envname) del stack[-1] else: | fd9c2ca53cfbd9d2df1c1c71382345041d3849ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/fd9c2ca53cfbd9d2df1c1c71382345041d3849ae/latex2esis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
6283,
12,
1369,
16,
434,
84,
16,
1014,
16,
10388,
87,
16,
23173,
10910,
16,
4846,
5531,
16,
679,
3001,
33,
7036,
4672,
2110,
273,
5378,
1323,
980,
30,
309,
980,
63,
20,
65,
422,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
6283,
12,
1369,
16,
434,
84,
16,
1014,
16,
10388,
87,
16,
23173,
10910,
16,
4846,
5531,
16,
679,
3001,
33,
7036,
4672,
2110,
273,
5378,
1323,
980,
30,
309,
980,
63,
20,
65,
422,... |
for i,isn in t.body: | for i, isn in t.body: | def slice_trace(trace, inbufs, outbufs): print "Doing initial slice..." start_ts = time.time() dynslice(trace, outbufs, output_track=True) end_ts = time.time() print "Slicing done in %s, calculating control dependencies..." % datetime.timedelta(seconds=end_ts-start_ts) tbs = make_tbs(trace) tbdict = make_tbdict(tbs) # Calculate control dependencies cfg = make_cfg(tbs) start_ts = time.time() wlist = [] for c in cfg: if len(cfg[c]) < 2: continue for t in tbdict[c]: for i,isn in t.body: if is_jcc(isn.op) or is_dynjump(isn.op): wlist.append( (i, uses(isn)) ) #dynslice(trace, uses(isn), start=i) isn.mark() multislice(trace, wlist) end_ts = time.time() print "Added branches in %s" % (datetime.timedelta(seconds=end_ts-start_ts)) print "Performing slice closure..." fp_iterations = 0 outerst = time.time() while True: innerst = time.time() wlist = [] for t in tbdict: for insns in zip(*[r.body for r in tbdict[t]]): if (any(i.in_slice for _,i in insns) and not all(i.in_slice for _,i in insns)): wlist += [(i,uses(x)) for i,x in insns if not x.in_slice] for _,isn in insns: isn.mark() if not wlist: break multislice(trace, wlist) fp_iterations += 1 innered = time.time() print "Sliced %d new instructions in %s" % (len(wlist), datetime.timedelta(seconds=innered-innerst)) outered = time.time() print "Reached fixed point after %d iterations, time: %s" % (fp_iterations, datetime.timedelta(seconds=outered-outerst)) return trace, tbs, tbdict, cfg | 63b309d6f3838e4cb5c2921faf3bb1472f46245c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4260/63b309d6f3838e4cb5c2921faf3bb1472f46245c/newslice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2788,
67,
5129,
12,
5129,
16,
316,
4385,
87,
16,
596,
4385,
87,
4672,
1172,
315,
3244,
310,
2172,
2788,
7070,
787,
67,
3428,
273,
813,
18,
957,
1435,
19417,
6665,
12,
5129,
16,
596,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2788,
67,
5129,
12,
5129,
16,
316,
4385,
87,
16,
596,
4385,
87,
4672,
1172,
315,
3244,
310,
2172,
2788,
7070,
787,
67,
3428,
273,
813,
18,
957,
1435,
19417,
6665,
12,
5129,
16,
596,
... |
disk_type = forms.ChoiceField(label="Hard disk type", | disk_type = forms.ChoiceField(label="Hard disk type", | def clean(self): data = self.cleaned_data owner = self.owner if owner: if isinstance(owner, (Organization,)): grantee = owner.group else: grantee = owner.user data['grantee'] = grantee # superusers bypass all permission and quota checks if not self.user.is_superuser and owner: msg = None if isinstance(owner, (Organization,)): # check user membership in group if group if not grantee.user_set.filter(id=self.user.id).exists(): msg = u"User is not a member of the specified group." else: if not owner.user_id == self.user.id: msg = "You are not allowed to act on behalf of this user." # check permissions on cluster if 'cluster' in data: cluster = data['cluster'] if not (owner.has_perm('create_vm', cluster) \ or owner.has_perm('admin', cluster)): msg = u"Owner does not have permissions for this cluster." # check quota quota = cluster.get_quota(owner) if quota.values(): used = owner.used_resources if used['ram']: ram = used['ram'] + data.get('ram', 0) if ram > quota['ram']: del data['ram'] q_msg = u"Owner does not have enough ram remaining on this cluster." self._errors["ram"] = self.error_class([q_msg]) if used['disk']: disk = used['disk'] + data.get('disk_size', 0) if disk > quota['disk']: del data['disk_size'] q_msg = u"Owner does not have enough diskspace remaining on this cluster." self._errors["disk_size"] = self.error_class([q_msg]) if used['virtual_cpus']: vcpus = used['virtual_cpus'] + data.get('vcpus', 0) if vcpus > quota['virtual_cpus']: del data['vcpus'] q_msg = u"Owner does not have enough virtual cpus remaining on this cluster." self._errors["vcpus"] = self.error_class([q_msg]) if msg: self._errors["owner"] = self.error_class([msg]) del data['owner'] pnode = data.get("pnode", '') snode = data.get("snode", '') iallocator = data.get('iallocator', False) iallocator_hostname = data.get('iallocator_hostname', '') disk_template = data.get("disk_template") # Need to have pnode != snode if disk_template == "drbd" and not iallocator: if pnode == snode and (pnode != '' or snode != ''): # We know these are not in self._errors now msg = u"Primary and Secondary Nodes must not match." self._errors["pnode"] = self.error_class([msg]) # These fields are no longer valid. Remove them from the # cleaned data. del data["pnode"] del data["snode"] else: if "snode" in self._errors: del self._errors["snode"] # If boot_order = CD-ROM make sure imagepath is set as well. boot_order = data.get('bootorder', '') image_path = data.get('imagepath', '') if boot_order == 'cdrom': if image_path == '': msg = u'Image path required if boot device is CD-ROM.' self._errors["imagepath"] = self.error_class([msg]) del data["imagepath"] del data["bootorder"] if iallocator: # If iallocator is checked, # don't display error messages for nodes if iallocator_hostname != '': if 'pnode' in self._errors: del self._errors['pnode'] if 'snode' in self._errors: del self._errors['snode'] else: msg = u'Automatic Allocation was selected, but there is no \ IAllocator available.' self._errors['iallocator'] = self.error_class([msg]) # Always return the full collection of cleaned data. return data | 1728e4ea656e2cd36b3b7a3da5d55041335d2017 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10509/1728e4ea656e2cd36b3b7a3da5d55041335d2017/virtual_machine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
12,
2890,
4672,
501,
273,
365,
18,
6200,
329,
67,
892,
225,
3410,
273,
365,
18,
8443,
309,
3410,
30,
309,
1549,
12,
8443,
16,
261,
8113,
16,
3719,
30,
15889,
22579,
273,
3410,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
12,
2890,
4672,
501,
273,
365,
18,
6200,
329,
67,
892,
225,
3410,
273,
365,
18,
8443,
309,
3410,
30,
309,
1549,
12,
8443,
16,
261,
8113,
16,
3719,
30,
15889,
22579,
273,
3410,
... |
self.iter = iter(self.func()) | self.iter = None | def __init__(self, func): self.func = func self.iter = iter(self.func()) | a9f2bb7a2fd04db2139d0ebbfd75eb47e085cbe1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7315/a9f2bb7a2fd04db2139d0ebbfd75eb47e085cbe1/toolbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1326,
4672,
365,
18,
644,
273,
1326,
365,
18,
2165,
273,
599,
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... | [
1,
1,
1,
1,
1,
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,
1326,
4672,
365,
18,
644,
273,
1326,
365,
18,
2165,
273,
599,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
Istrip = I.strip() if Istrip.endswith('?') and not Istrip.startswith(' C.set_introspect(I, '') | if cell_system == 'sage': Istrip = I.strip() if Istrip.endswith('?') and not Istrip.startswith(' C.set_introspect(I, '') | def start_next_comp(self): if len(self.__queue) == 0: return | 0101e9198fa09e9dfd87c8d84f87d61e1b768211 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/0101e9198fa09e9dfd87c8d84f87d61e1b768211/worksheet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
4285,
67,
2919,
12,
2890,
4672,
309,
562,
12,
2890,
16186,
4000,
13,
422,
374,
30,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
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,
787,
67,
4285,
67,
2919,
12,
2890,
4672,
309,
562,
12,
2890,
16186,
4000,
13,
422,
374,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'Parse the command line options.' | def parse_cmdline(self): 'Parse the command line options.' # An empty command line causes the help message to be shown if len(self.argv) == 1: self.argv = self.argv + ['-h'] # Usage string usage = "%prog [options] <target process IDs or names...>" self.parser = optparse.OptionParser(usage=usage) # Options to set the search method search = optparse.OptionGroup(self.parser, "What to search", "(at least one of these switches must be used)") search.add_option("-s", "--string", action="append", metavar="VALUE", help="where VALUE is case sensitive text") search.add_option("-i", "--istring", action="append", metavar="VALUE", help="where VALUE is case insensitive text") search.add_option("-x", "--hexa", action="append", metavar="VALUE", help="where VALUE is hexadecimal data") search.add_option("-p", "--pattern", action="append", metavar="VALUE", help="where VALUE is an hexadecimal pattern") search.add_option("-r", "--regexp", action="append", metavar="VALUE", help="where VALUE is a POSIX regular expression") self.parser.add_option_group(search) # Options to control the search internals engine = optparse.OptionGroup(self.parser, "How to search") | ca6136c120538727397f9ecc3b54e85d1c43f1e9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7261/ca6136c120538727397f9ecc3b54e85d1c43f1e9/pfind.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
4172,
1369,
12,
2890,
4672,
225,
468,
1922,
1008,
1296,
980,
14119,
326,
2809,
883,
358,
506,
12188,
309,
562,
12,
2890,
18,
19485,
13,
422,
404,
30,
365,
18,
19485,
273,
365... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
4172,
1369,
12,
2890,
4672,
225,
468,
1922,
1008,
1296,
980,
14119,
326,
2809,
883,
358,
506,
12188,
309,
562,
12,
2890,
18,
19485,
13,
422,
404,
30,
365,
18,
19485,
273,
365... | |
subscribers[event] = [] | subscribers[event] = set() | def run(self): | 52dcf638f6ef2886b9f82cc8816d66ed0e0531ae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12796/52dcf638f6ef2886b9f82cc8816d66ed0e0531ae/tasks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
<b>that</i><span selected></b></a><minor /><a href="big daddy">yow za</a> | <b>that</i><span selected></b></a><minor /><a href="big "daddy" o">yow za</a> | def handleCleanup(self): # usually overridden sys.stderr.write("XML cleanup\n") | 40c303066e2ef26cc7500d0d1bbbb5cc8267cc62 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14305/40c303066e2ef26cc7500d0d1bbbb5cc8267cc62/simplexmlparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
15007,
12,
2890,
4672,
468,
11234,
11000,
2589,
18,
11241,
18,
2626,
2932,
4201,
6686,
64,
82,
7923,
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,
1640,
15007,
12,
2890,
4672,
468,
11234,
11000,
2589,
18,
11241,
18,
2626,
2932,
4201,
6686,
64,
82,
7923,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return socket.inet_ntoa(i.get(ifname)["addr"].data) | return i.get(ifname)["addr"].data def new_read_routes(): rtlst = [] def addrt(rt,lst): dst,gw = rt lst.append(rt) r = dnet.route() print r.loop(addrt, rtlst) return rtlst | def get_if_addr(ifname): i = dnet.intf() return socket.inet_ntoa(i.get(ifname)["addr"].data) | 3189058f12fcf8b5eb134c746ce4ab9b49c84e27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/3189058f12fcf8b5eb134c746ce4ab9b49c84e27/scapy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
430,
67,
4793,
12,
430,
529,
4672,
277,
273,
302,
2758,
18,
17655,
1435,
327,
2987,
18,
23864,
67,
496,
11867,
12,
77,
18,
588,
12,
430,
529,
13,
9614,
4793,
6,
8009,
892,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
336,
67,
430,
67,
4793,
12,
430,
529,
4672,
277,
273,
302,
2758,
18,
17655,
1435,
327,
2987,
18,
23864,
67,
496,
11867,
12,
77,
18,
588,
12,
430,
529,
13,
9614,
4793,
6,
8009,
892,
... |
for analysis in ['CountLoci', 'Pileup']: | for analysis in commandsList: | def usage(): print "Optional arguments:" print " -f QUEUE Farm jobs to QUEUE on LSF" | 34ee48fd821318ee01a1cdd7e2455d900af2719a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2773/34ee48fd821318ee01a1cdd7e2455d900af2719a/StressTestGATK.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
315,
6542,
1775,
2773,
1172,
315,
225,
300,
74,
31600,
282,
478,
4610,
6550,
358,
31600,
603,
511,
22395,
6,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
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,
4084,
13332,
1172,
315,
6542,
1775,
2773,
1172,
315,
225,
300,
74,
31600,
282,
478,
4610,
6550,
358,
31600,
603,
511,
22395,
6,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.body.append(self.starttag(node, 'table', CLASS='footnote', frame="void", rules="none")) self.body.append('<col class="label" />\n' '<col />\n' '<tbody valign="top">\n' '<tr><td>\n') | self.body.append('\\footnote{') | def visit_footnote(self, node): self.body.append(self.starttag(node, 'table', CLASS='footnote', frame="void", rules="none")) self.body.append('<col class="label" />\n' '<col />\n' '<tbody valign="top">\n' '<tr><td>\n') | 3541e2bd45b74d7737cefd640f62e8e052d4ca72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/3541e2bd45b74d7737cefd640f62e8e052d4ca72/latex2e.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
10923,
7652,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
12,
2890,
18,
1937,
2692,
12,
2159,
16,
296,
2121,
2187,
7383,
2218,
10923,
7652,
2187,
2623,
1546,
6459,
3113,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
10923,
7652,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
12,
2890,
18,
1937,
2692,
12,
2159,
16,
296,
2121,
2187,
7383,
2218,
10923,
7652,
2187,
2623,
1546,
6459,
3113,
... |
""" <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" /> | ''' <serviceType id="Foo" interface="zope.app.component.tests.service.IFooService" /> | def testDuplicateServiceConfig(self): self.assertRaises( ConfigurationConflictError, xmlconfig, StringIO(template % ( """ <serviceType id="Foo" interface=" zope.app.component.tests.service.IFooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.fooService" /> <service serviceType="Foo" component=" zope.app.component.tests.service.foo2" /> """ ))) | f3220b3768925f7acfef6df62db125eae9ecb495 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9537/f3220b3768925f7acfef6df62db125eae9ecb495/test_servicedirective.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
11826,
1179,
809,
12,
2890,
4672,
365,
18,
11231,
12649,
6141,
12,
4659,
10732,
668,
16,
2025,
1425,
16,
15777,
12,
3202,
738,
261,
9163,
411,
3278,
559,
612,
1546,
42,
5161,
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,
1842,
11826,
1179,
809,
12,
2890,
4672,
365,
18,
11231,
12649,
6141,
12,
4659,
10732,
668,
16,
2025,
1425,
16,
15777,
12,
3202,
738,
261,
9163,
411,
3278,
559,
612,
1546,
42,
5161,
6,
... |
return QuotientRingElement(self.parent(), self.__rep + right.__rep) | return self.parent()(self.__rep + right.__rep) | def _add_(self, right): """ Add quotient ring element ``self`` to another quotient ring element, ``right``. If the quotient is `R/I`, the addition is carried out in `R` and then reduced to `R/I`. | fc3fae1786d321a0c137a5fed83a122c88d61d29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/fc3fae1786d321a0c137a5fed83a122c88d61d29/quotient_ring_element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
67,
12,
2890,
16,
2145,
4672,
3536,
1436,
26708,
9221,
930,
12176,
2890,
10335,
358,
4042,
26708,
9221,
930,
16,
12176,
4083,
68,
8338,
971,
326,
26708,
353,
1375,
54,
19,
45,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
2145,
4672,
3536,
1436,
26708,
9221,
930,
12176,
2890,
10335,
358,
4042,
26708,
9221,
930,
16,
12176,
4083,
68,
8338,
971,
326,
26708,
353,
1375,
54,
19,
45,... |
for lfn,replicas in lfnReplicas.items(): if replicas.has_key(storageElementName): | for lfn, replicas in lfnReplicas.items(): if replicas.has_key( storageElementName ): | def __executeReplicaStorageElementOperation(self,storageElementName,lfn,method,argsDict={}): """ A simple wrapper that allows replica querying then perform the StorageElement operation """ res = self._executeFileCatalogFunction(lfn,'getReplicas') if not res['OK']: errStr = "ReplicaManager.__executeReplicaStorageElementOperation: Completely failed to get replicas for LFNs." gLogger.error(errStr,res['Message']) return res failed = res['Value']['Failed'] for lfn,reason in res['Value']['Failed'].items(): gLogger.error("ReplicaManager.__executeReplicaStorageElementOperation: Failed to get replicas for file.", "%s %s" % (lfn,reason)) lfnReplicas = res['Value']['Successful'] pfnDict = {} for lfn,replicas in lfnReplicas.items(): if replicas.has_key(storageElementName): pfnDict[replicas[storageElementName]] = lfn else: errStr = "ReplicaManager.__executeReplicaStorageElementOperation: File does not have replica at supplied Storage Element." gLogger.error(errStr, "%s %s" % (lfn,storageElementName)) failed[lfn] = errStr res = self._executeStorageElementFunction(storageElementName,pfnDict.keys(),method,argsDict) if not res['OK']: gLogger.error("ReplicaManager.__executeReplicaStorageElementOperation: Failed to execute %s StorageElement operation." % method,res['Message']) return res successful = {} for pfn,pfnRes in res['Value']['Successful'].items(): successful[pfnDict[pfn]] = pfnRes for pfn, errorMessage in res['Value']['Failed'].items(): failed[pfnDict[pfn]] = errorMessage resDict = {'Successful':successful,'Failed':failed} return S_OK(resDict) | 9fabceb719d19d46d8b75011d2932552dbe360f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9fabceb719d19d46d8b75011d2932552dbe360f9/ReplicaManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
8837,
14222,
3245,
1046,
2988,
12,
2890,
16,
5697,
30584,
16,
80,
4293,
16,
2039,
16,
1968,
5014,
12938,
4672,
3536,
432,
4143,
4053,
716,
5360,
12335,
23936,
1508,
3073,
326,
5235,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8837,
14222,
3245,
1046,
2988,
12,
2890,
16,
5697,
30584,
16,
80,
4293,
16,
2039,
16,
1968,
5014,
12938,
4672,
3536,
432,
4143,
4053,
716,
5360,
12335,
23936,
1508,
3073,
326,
5235,
... |
return '%1.2f:0.00000' % (data.support) | info_string= '%1.2f:0.00000' % (data.support) | def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100% support return ':%1.2f' % self.max_support else: return ':%1.2f' % (data.support) elif self.branchlengths_only: # write only branchlengths, ignore support return ':%1.5f' % (data.branchlength) else: # write suport and branchlengths (e.g. .con tree of mrbayes) if terminal: return ':%1.5f' % (data.branchlength) else: if data.branchlength is not None and data.support is not None: # we have blen and suppport return '%1.2f:%1.5f' % (data.support,data.branchlength) elif data.branchlength is not None: # we have only blen return '0.00000:%1.5f' % (data.branchlength) elif data.support is not None: # we have only support return '%1.2f:0.00000' % (data.support) else: return '0.00:0.00000' | 1d0cf60ee46f5cb849555bc7e3c6e92b439d6d98 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7167/1d0cf60ee46f5cb849555bc7e3c6e92b439d6d98/Trees.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
1376,
67,
1080,
12,
892,
16,
15979,
33,
8381,
4672,
3536,
2729,
11562,
2357,
4955,
2865,
19,
7500,
14907,
12123,
468,
14565,
10449,
56,
1360,
309,
365,
18,
7446,
30,
468,
7351,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
1376,
67,
1080,
12,
892,
16,
15979,
33,
8381,
4672,
3536,
2729,
11562,
2357,
4955,
2865,
19,
7500,
14907,
12123,
468,
14565,
10449,
56,
1360,
309,
365,
18,
7446,
30,
468,
7351,... |
or cmp(x.sortorder, y.sortorder)) | or cmp(x.sortorder, y.sortorder)) | def sorted_events_listing(self, p_objects=[], skey='', rkey=0): """Return sorted events""" results = [] if not skey or skey == 'start_date': p_objects.sort(lambda x,y: cmp(y.start_date, x.start_date) \ or cmp(x.sortorder, y.sortorder)) if not rkey: p_objects.reverse() results.extend(p_objects) else: if rkey: rkey=1 l_objects = utSortObjsByLocaleAttr(p_objects, skey, rkey, self.gl_get_selected_language()) results.extend(l_objects) return results | ffeb211164a19371c4ffa202b70c9aa9c9628d54 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3287/ffeb211164a19371c4ffa202b70c9aa9c9628d54/SEMIDESite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3115,
67,
5989,
67,
21228,
12,
2890,
16,
293,
67,
6911,
22850,
6487,
272,
856,
2218,
2187,
436,
856,
33,
20,
4672,
3536,
990,
3115,
2641,
8395,
1686,
273,
5378,
309,
486,
272,
856,
578... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3115,
67,
5989,
67,
21228,
12,
2890,
16,
293,
67,
6911,
22850,
6487,
272,
856,
2218,
2187,
436,
856,
33,
20,
4672,
3536,
990,
3115,
2641,
8395,
1686,
273,
5378,
309,
486,
272,
856,
578... |
def NewToMigrating(self): | def NewToMigrating( self ): | def NewToMigrating(self): """ Obtain the new files from the migration monitoring db and (where necessary) add the size and checksum information """ # First get the new files from the database gLogger.info("NewToMigrating: Attempting to obtain 'New' files.") res = self.__getFiles('','New') if not res['OK']: gLogger.error("NewToMigrating: Failed to get 'New' files.", res['Message']) return res newFiles = res['Value']['Files'] if not newFiles: gLogger.info("NewToMigrating: Found no 'New' files.") return S_OK() # Get the metadata from the catalog for which do not have size or checksum res = self.__getCatalogFileMetadata(newFiles) if not res['OK']: gLogger.error("NewToMigrating: Failed to get metadata for files",res['Message']) return res metadata = res['Value'] # Add the metadata to the migration monitoring DB. res = self.__updateNewMigrating(metadata) return S_OK() | d0365a9152f6e7105162edd475d5401448bfdaed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/d0365a9152f6e7105162edd475d5401448bfdaed/MigrationMonitoringAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1166,
774,
25483,
1776,
12,
365,
262,
30,
3536,
24850,
326,
394,
1390,
628,
326,
6333,
16309,
1319,
471,
261,
6051,
4573,
13,
527,
326,
963,
471,
6697,
1779,
3536,
468,
5783,
336,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1166,
774,
25483,
1776,
12,
365,
262,
30,
3536,
24850,
326,
394,
1390,
628,
326,
6333,
16309,
1319,
471,
261,
6051,
4573,
13,
527,
326,
963,
471,
6697,
1779,
3536,
468,
5783,
336,
326,
... |
utils.InfoDialog(self, _("Riepilogo"), self.col_lst, self.vars, mod.get_value (it, 14)) | utils.InfoDialog(self.main_db, _("Riepilogo"), self.col_lst, self.main_db.vars) | def on_row_activated (self, tree, path, col): mod = self.view.get_model() it = mod.get_iter_from_string(str(path[0])) utils.InfoDialog(self, _("Riepilogo"), self.col_lst, self.vars, mod.get_value (it, 14)) #pass | cf8a6b5ae5f430b04c26db9094eeeabf417ecc7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2406/cf8a6b5ae5f430b04c26db9094eeeabf417ecc7b/manutenzione.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
492,
67,
18836,
261,
2890,
16,
2151,
16,
589,
16,
645,
4672,
681,
273,
365,
18,
1945,
18,
588,
67,
2284,
1435,
518,
273,
681,
18,
588,
67,
2165,
67,
2080,
67,
1080,
12,
70... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
492,
67,
18836,
261,
2890,
16,
2151,
16,
589,
16,
645,
4672,
681,
273,
365,
18,
1945,
18,
588,
67,
2284,
1435,
518,
273,
681,
18,
588,
67,
2165,
67,
2080,
67,
1080,
12,
70... |
if i==len(args): | if not active_found: | def search(self, cr, user, args, offset=0, limit=None, order=None): # if the object has a field named 'active', filter out all inactive # records unless they were explicitely asked for if 'active' in self._columns: i = 0 while i<len(args): if args[i][0]=='active': if not args[i][2]: del args[i] i += 1 if i==len(args): args.append(('active', '=', 1)) | 40235f8bee489683d14cd87b9bdfc6c802dfa4aa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12853/40235f8bee489683d14cd87b9bdfc6c802dfa4aa/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
4422,
16,
729,
16,
833,
16,
1384,
33,
20,
16,
1800,
33,
7036,
16,
1353,
33,
7036,
4672,
468,
309,
326,
733,
711,
279,
652,
4141,
296,
3535,
2187,
1034,
596,
777,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
4422,
16,
729,
16,
833,
16,
1384,
33,
20,
16,
1800,
33,
7036,
16,
1353,
33,
7036,
4672,
468,
309,
326,
733,
711,
279,
652,
4141,
296,
3535,
2187,
1034,
596,
777,
... |
if result == e[1]: | if re.match(e[1], result): | def strftest(now): if verbose: print "strftime test for", time.ctime(now) nowsecs = str(long(now))[:-1] gmt = time.gmtime(now) now = time.localtime(now) if now[3] < 12: ampm='AM' else: ampm='PM' jan1 = time.localtime(time.mktime((now[0], 1, 1) + (0,)*6)) try: if now[8]: tz = time.tzname[1] else: tz = time.tzname[0] except AttributeError: tz = '' if now[3] > 12: clock12 = now[3] - 12 elif now[3] > 0: clock12 = now[3] else: clock12 = 12 expectations = ( ('%a', calendar.day_abbr[now[6]], 'abbreviated weekday name'), ('%A', calendar.day_name[now[6]], 'full weekday name'), ('%b', calendar.month_abbr[now[1]], 'abbreviated month name'), ('%B', calendar.month_name[now[1]], 'full month name'), # %c see below ('%d', '%02d' % now[2], 'day of month as number (00-31)'), ('%H', '%02d' % now[3], 'hour (00-23)'), ('%I', '%02d' % clock12, 'hour (01-12)'), ('%j', '%03d' % now[7], 'julian day (001-366)'), ('%m', '%02d' % now[1], 'month as number (01-12)'), ('%M', '%02d' % now[4], 'minute, (00-59)'), ('%p', ampm, 'AM or PM as appropriate'), ('%S', '%02d' % now[5], 'seconds of current time (00-60)'), ('%U', '%02d' % ((now[7] + jan1[6])/7), 'week number of the year (Sun 1st)'), ('%w', '%d' % ((1+now[6]) % 7), 'weekday as a number (Sun 1st)'), ('%W', '%02d' % ((now[7] + (jan1[6] - 1)%7)/7), 'week number of the year (Mon 1st)'), # %x see below ('%X', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'), ('%y', '%02d' % (now[0]%100), 'year without century'), ('%Y', '%d' % now[0], 'year with century'), # %Z see below ('%%', '%', 'single percent sign'), ) nonstandard_expectations = ( # These are standard but don't have predictable output ('%c', fixasctime(time.asctime(now)), 'near-asctime() format'), ('%x', '%02d/%02d/%02d' % (now[1], now[2], (now[0]%100)), '%m/%d/%y %H:%M:%S'), ('(%Z)', '(%s)' % tz, 'time zone name'), # These are some platform specific extensions ('%D', '%02d/%02d/%02d' % (now[1], now[2], (now[0]%100)), 'mm/dd/yy'), ('%e', '%2d' % now[2], 'day of month as number, blank padded ( 0-31)'), ('%h', calendar.month_abbr[now[1]], 'abbreviated month name'), ('%k', '%2d' % now[3], 'hour, blank padded ( 0-23)'), ('%n', '\n', 'newline character'), ('%r', '%02d:%02d:%02d %s' % (clock12, now[4], now[5], ampm), '%I:%M:%S %p'), ('%R', '%02d:%02d' % (now[3], now[4]), '%H:%M'), ('%s', nowsecs, 'seconds since the Epoch in UCT'), ('%t', '\t', 'tab character'), ('%T', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'), ('%3y', '%03d' % (now[0]%100), 'year without century rendered using fieldwidth'), ) if verbose: print "Strftime test, platform: %s, Python version: %s" % \ (sys.platform, string.split(sys.version)[0]) for e in expectations: try: result = time.strftime(e[0], now) except ValueError, error: print "Standard '%s' format gave error:" % e[0], error continue if result == e[1]: continue if result[0] == '%': print "Does not support standard '%s' format (%s)" % (e[0], e[2]) else: print "Conflict for %s (%s):" % (e[0], e[2]) print " Expected %s, but got %s" % (e[1], result) for e in nonstandard_expectations: try: result = time.strftime(e[0], now) except ValueError, result: if verbose: print "Error for nonstandard '%s' format (%s): %s" % \ (e[0], e[2], str(result)) continue if result == e[1]: if verbose: print "Supports nonstandard '%s' format (%s)" % (e[0], e[2]) elif result[0] == '%': if verbose: print "Does not appear to support '%s' format (%s)" % (e[0], e[2]) else: if verbose: print "Conflict for nonstandard '%s' format (%s):" % (e[0], e[2]) print " Expected %s, but got %s" % (e[1], result) | b6d075a4c9e64b4f0dc9adec846ababbabe32686 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b6d075a4c9e64b4f0dc9adec846ababbabe32686/test_strftime.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
1222,
395,
12,
3338,
4672,
309,
3988,
30,
1172,
315,
701,
9982,
1842,
364,
3113,
813,
18,
21261,
12,
3338,
13,
2037,
21317,
273,
609,
12,
5748,
12,
3338,
3719,
10531,
17,
21,
65,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
1222,
395,
12,
3338,
4672,
309,
3988,
30,
1172,
315,
701,
9982,
1842,
364,
3113,
813,
18,
21261,
12,
3338,
13,
2037,
21317,
273,
609,
12,
5748,
12,
3338,
3719,
10531,
17,
21,
65,
... |
table.attach(self.colplot, 0, 1, 2, 3) | table.attach(self.colplot, 0, 1, 2, 3, xoptions=0, yoptions=0) | def __init__(self, data, dim_names=[], title="sliceview", cmap=p.cm.bone): self.data = p.asarray(data) | 12103a63872d82631066300b2fbb6fbbaf4d63ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7241/12103a63872d82631066300b2fbb6fbbaf4d63ee/new_sliceview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
16,
2464,
67,
1973,
22850,
6487,
2077,
1546,
6665,
1945,
3113,
11136,
33,
84,
18,
7670,
18,
19930,
4672,
365,
18,
892,
273,
293,
18,
345,
1126,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
501,
16,
2464,
67,
1973,
22850,
6487,
2077,
1546,
6665,
1945,
3113,
11136,
33,
84,
18,
7670,
18,
19930,
4672,
365,
18,
892,
273,
293,
18,
345,
1126,
12,
... |
def doTemplateInfo(aFile, options): if not options.doReverse: basename, extension = os.path.splitext(aFile) encoding = ENCODINGS.get(extension, lambda fn:None)(aFile) doFileSubstitution(aFile, encoding, FORWARDTRANSLATOR) | def doTemplateInfo(aFile, options, translator): basename, extension = os.path.splitext(aFile) encoding = ENCODINGS.get(extension, lambda fn:None)(aFile) doFileSubstitution(aFile, encoding, translator) | def doTemplateInfo(aFile, options): if not options.doReverse: basename, extension = os.path.splitext(aFile) encoding = ENCODINGS.get(extension, lambda fn:None)(aFile) doFileSubstitution(aFile, encoding, FORWARDTRANSLATOR) | b6e5074f4c6128a4009be73bb572556666294b22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/97/b6e5074f4c6128a4009be73bb572556666294b22/clean.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
2283,
966,
12,
69,
812,
16,
702,
16,
8333,
4672,
4882,
16,
2710,
273,
1140,
18,
803,
18,
4939,
408,
12,
69,
812,
13,
2688,
273,
22810,
55,
18,
588,
12,
6447,
16,
3195,
2295,
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,
741,
2283,
966,
12,
69,
812,
16,
702,
16,
8333,
4672,
4882,
16,
2710,
273,
1140,
18,
803,
18,
4939,
408,
12,
69,
812,
13,
2688,
273,
22810,
55,
18,
588,
12,
6447,
16,
3195,
2295,
3... |
icon = colorbar_bitmap(map,16,thickness=16) | icon = colorbar_bitmap(map,bar_length,thickness=16) | def __init__(self, mapper=None, canvas=None, callback=None): """ Define a context menu for selecting colormaps. | b1e395342d4674c0ba11318ab2138ac77c258f4c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13135/b1e395342d4674c0ba11318ab2138ac77c258f4c/cmapmenu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5815,
33,
7036,
16,
5953,
33,
7036,
16,
1348,
33,
7036,
4672,
3536,
13184,
279,
819,
3824,
364,
24674,
645,
535,
6679,
18,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
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,
5815,
33,
7036,
16,
5953,
33,
7036,
16,
1348,
33,
7036,
4672,
3536,
13184,
279,
819,
3824,
364,
24674,
645,
535,
6679,
18,
2,
-100,
-100,
-100,
-100,
-10... |
if rc + 0.5 > self.rc: self.rc = rc + 0.5 | def initialize(self, atoms): self.par = {} self.rc = 0.0 self.numbers = atoms.get_atomic_numbers() for Z in self.numbers: if Z not in self.par: p = parameters[chemical_symbols[Z]] s0 = p[1] * Bohr eta2 = p[3] / Bohr kappa = p[4] / Bohr rc = beta * s0 * 0.5 * (sqrt(3) + sqrt(4)) x = eta2 * beta * s0 gamma1 = 0.0 gamma2 = 0.0 if p[7] == 'fcc': for i, n in enumerate([12, 6, 24, 12]): r = s0 * beta * sqrt(i + 1) x = n / (12 * (1.0 + exp(acut * (r - rc)))) gamma1 += x * exp(-eta2 * (r - beta * s0)) gamma2 += x * exp(-kappa / beta * (r - beta * s0)) elif p[7] == 'dimer': r = s0 * beta n = 1 x = n / (12 * (1.0 + exp(acut * (r - rc)))) gamma1 += x * exp(-eta2 * (r - beta * s0)) gamma2 += x * exp(-kappa / beta * (r - beta * s0)) else: raise RuntimeError self.par[Z] = {'E0': p[0], 's0': s0, 'V0': p[2], 'eta2': eta2, 'kappa': kappa, 'lambda': p[5] / Bohr, 'n0': p[6] / Bohr**3, 'rc': rc, 'gamma1': gamma1, 'gamma2': gamma2} if rc + 0.5 > self.rc: self.rc = rc + 0.5 | 1d1e9034a00e074335b5193cf30cd09bb456808c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5735/1d1e9034a00e074335b5193cf30cd09bb456808c/emt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
16,
9006,
4672,
365,
18,
1065,
273,
2618,
365,
18,
1310,
273,
374,
18,
20,
365,
18,
13851,
273,
9006,
18,
588,
67,
27718,
67,
13851,
1435,
364,
2285,
316,
365,
18,
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,
4046,
12,
2890,
16,
9006,
4672,
365,
18,
1065,
273,
2618,
365,
18,
1310,
273,
374,
18,
20,
365,
18,
13851,
273,
9006,
18,
588,
67,
27718,
67,
13851,
1435,
364,
2285,
316,
365,
18,
13... | |
if re.search(value, item[field].search): | if re.search(value, item[field]): | def _rulepass(rule, item): field, op, value = rule #TODO: is this ok? if field in FIELD_MAP: field = FIELD_MAP[field] #map to universal feedparser's normalised names if field not in item: return True #todo check which of these should be case insensitive if op == "contains": if value.lower() in item[field].lower(): #todo use regex? return True if op == "doesnotcontain": if value.lower() not in item[field].lower(): #todo use regex? return True if op == "matches": if re.search(value, item[field].search): return True if op == "is": if item[field] == value: return True if op == "greater": if item[field] > value: return True if op == "less": if item[field] < value: return True if op == "after": #todo handle partial datetime values if datetime.datetime(*item[field][:7]) > datetime.datetime.strptime(value, DATE_FORMAT): return True if op == "before": #todo handle partial datetime values if datetime.datetime(*item[field][:7]) < datetime.datetime.strptime(value, DATE_FORMAT): return True return False | f4d5d41b7b41c57cacab751f3775dd83134a6383 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2209/f4d5d41b7b41c57cacab751f3775dd83134a6383/pipefilter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5345,
5466,
12,
5345,
16,
761,
4672,
652,
16,
1061,
16,
460,
273,
1720,
225,
468,
6241,
30,
353,
333,
1529,
35,
309,
652,
316,
9921,
67,
8352,
30,
652,
273,
9921,
67,
8352,
63,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5345,
5466,
12,
5345,
16,
761,
4672,
652,
16,
1061,
16,
460,
273,
1720,
225,
468,
6241,
30,
353,
333,
1529,
35,
309,
652,
316,
9921,
67,
8352,
30,
652,
273,
9921,
67,
8352,
63,
... |
license = pkg.license.as_dict().get('title') assert license in res, res | if pkg.license: license = pkg.license.as_dict().get('title') assert license in res, res | def check_page(path, required_contents, status=200): print "* Checking page '%s%s'" % (self.wui_address, path) res = self.app.get(path, status=status) if type(required_contents) is type(()): for required in required_contents: print ' ...checking for %r' % required assert required in res, res else: assert required_contents in res, res return res | 629780332135f9491e9fdcf4bee68e9f38da8c34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/265/629780332135f9491e9fdcf4bee68e9f38da8c34/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
2433,
12,
803,
16,
1931,
67,
3980,
16,
1267,
33,
6976,
4672,
1172,
15902,
24471,
1363,
1995,
87,
9,
87,
4970,
738,
261,
2890,
18,
91,
4881,
67,
2867,
16,
589,
13,
400,
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,
866,
67,
2433,
12,
803,
16,
1931,
67,
3980,
16,
1267,
33,
6976,
4672,
1172,
15902,
24471,
1363,
1995,
87,
9,
87,
4970,
738,
261,
2890,
18,
91,
4881,
67,
2867,
16,
589,
13,
400,
273,
... |
@bigmemtest(minsize=_2G + 20, memuse=8) | @bigmemtest(minsize=_2G // 5 + 4, memuse=8 * 5) | def test_insert(self, size): l = [1.0] * size l.insert(size - 1, "A") size += 1 self.assertEquals(len(l), size) self.assertEquals(l[-3:], [1.0, "A", 1.0]) | 2b6fe565c924c2484fedcdb9e497475584b0716e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2b6fe565c924c2484fedcdb9e497475584b0716e/test_bigmem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
6387,
12,
2890,
16,
963,
4672,
328,
273,
306,
21,
18,
20,
65,
380,
963,
328,
18,
6387,
12,
1467,
300,
404,
16,
315,
37,
7923,
963,
1011,
404,
365,
18,
11231,
8867,
12,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
6387,
12,
2890,
16,
963,
4672,
328,
273,
306,
21,
18,
20,
65,
380,
963,
328,
18,
6387,
12,
1467,
300,
404,
16,
315,
37,
7923,
963,
1011,
404,
365,
18,
11231,
8867,
12,
18... |
print | def interpolation(src): print print "Testing value interpolation..." cf = ConfigParser.ConfigParser({"getname": "%(__name__)s"}) sio = StringIO.StringIO(src) cf.readfp(sio) print `cf.get("Foo", "getname")` print `cf.get("Foo", "bar")` print `cf.get("Foo", "bar9")` print `cf.get("Foo", "bar10")` expect_get_error(cf, ConfigParser.InterpolationDepthError, "Foo", "bar11") | 8dc634b98696d12e0c4314fb0e0c8e5c2afc1666 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/8dc634b98696d12e0c4314fb0e0c8e5c2afc1666/test_cfgparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12851,
12,
4816,
4672,
315,
22218,
460,
12851,
7070,
6080,
273,
25076,
18,
809,
2678,
12590,
6,
588,
529,
6877,
22061,
972,
529,
972,
13,
87,
6,
6792,
272,
1594,
273,
15777,
18,
780,
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,
12851,
12,
4816,
4672,
315,
22218,
460,
12851,
7070,
6080,
273,
25076,
18,
809,
2678,
12590,
6,
588,
529,
6877,
22061,
972,
529,
972,
13,
87,
6,
6792,
272,
1594,
273,
15777,
18,
780,
4... | |
amount = price * from_unit.factor | amount = price / from_unit.factor | def _compute_price(self, cr, uid, from_uom_id, price, to_uom_id=False): if not from_uom_id or not price or not to_uom_id: return price uoms = self.browse(cr, uid, [from_uom_id, to_uom_id]) if uoms[0].id == from_uom_id: from_unit, to_unit = uoms[0], uoms[-1] else: from_unit, to_unit = uoms[-1], uoms[0] if from_unit.category_id.id <> to_unit.category_id.id: return price amount = price * from_unit.factor if to_uom_id: amount = amount / to_unit.factor return amount | 13d5db21a25802c368d46dbed26d0d89d1890200 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/13d5db21a25802c368d46dbed26d0d89d1890200/product.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9200,
67,
8694,
12,
2890,
16,
4422,
16,
4555,
16,
628,
67,
89,
362,
67,
350,
16,
6205,
16,
358,
67,
89,
362,
67,
350,
33,
8381,
4672,
309,
486,
628,
67,
89,
362,
67,
350,
57... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9200,
67,
8694,
12,
2890,
16,
4422,
16,
4555,
16,
628,
67,
89,
362,
67,
350,
16,
6205,
16,
358,
67,
89,
362,
67,
350,
33,
8381,
4672,
309,
486,
628,
67,
89,
362,
67,
350,
57... |
gv.render(gvg, "dot", "/dev/null") | gv.render(gvg, "dot", "/dev/null") | def graph_draw(g, pos=None, size=(15, 15), pin=False, layout= "neato", maxiter=None, ratio= "fill", overlap="prism", sep=None, splines=False, vsize=0.1, penwidth=1.0, elen=None, gprops={}, vprops={}, eprops={}, vcolor=None, ecolor=None, vcmap=matplotlib.cm.jet, vnorm=True, ecmap=matplotlib.cm.jet, enorm=True, output= "", output_format= "auto", returngv=False, fork=False, seed=0): r"""Draw a graph using graphviz. Parameters ---------- g : Graph Graph to be used. pos : PropertyMap or tuple of PropertyMaps (optional, default: None) Vertex property maps containing the x and y coordinates of the vertices. size : tuple of scalars (optional, default: (15,15)) Size (in centimeters) of the canvas. pin : bool (default: False) If True, the vertices are not moved from their initial position. layout : string (default: "neato") Layout engine to be used. Possible values are "neato", "fdp", "dot", "circo", "twopi" and "arf". maxiter : int (default: None) If specified, limits the maximum number of iterations. ratio : string or float (default: "fill") Sets the aspect ratio (drawing height/drawing width) for the drawing. Note that this is adjusted before the 'size' attribute constraints are enforced. If ratio is numeric, it is taken as the desired aspect ratio. Then, if the actual aspect ratio is less than the desired ratio, the drawing height is scaled up to achieve the desired ratio; if the actual ratio is greater than that desired ratio, the drawing width is scaled up. If ratio = "fill" and the size attribute is set, node positions are scaled, separately in both x and y, so that the final drawing exactly fills the specified size. If ratio = "compress" and the size attribute is set, dot attempts to compress the initial layout to fit in the given size. This achieves a tighter packing of nodes but reduces the balance and symmetry. This feature only works in dot. If ratio = "expand", the size attribute is set, and both the width and the height of the graph are less than the value in size, node positions are scaled uniformly until at least one dimension fits size exactly. Note that this is distinct from using size as the desired size, as here the drawing is expanded before edges are generated and all node and text sizes remain unchanged. If ratio = "auto", the page attribute is set and the graph cannot be drawn on a single page, then size is set to an ``ideal'' value. In particular, the size in a given dimension will be the smallest integral multiple of the page size in that dimension which is at least half the current size. The two dimensions are then scaled independently to the new size. This feature only works in dot. overlap : bool or string (default: "prism") Determines if and how node overlaps should be removed. Nodes are first enlarged using the sep attribute. If True, overlaps are retained. If the value is "scale", overlaps are removed by uniformly scaling in x and y. If the value is False, node overlaps are removed by a Voronoi-based technique. If the value is "scalexy", x and y are separately scaled to remove overlaps. If sfdp is available, one can set overlap to "prism" to use a proximity graph-based algorithm for overlap removal. This is the preferred technique, though "scale" and False can work well with small graphs. This technique starts with a small scaling up, controlled by the overlap_scaling attribute, which can remove a significant portion of the overlap. The prism option also accepts an optional non-negative integer suffix. This can be used to control the number of attempts made at overlap removal. By default, overlap="prism" is equivalent to overlap="prism1000". Setting overlap="prism0" causes only the scaling phase to be run. If the value is "compress", the layout will be scaled down as much as possible without introducing any overlaps, obviously assuming there are none to begin with. sep : float (default: None) Specifies margin to leave around nodes when removing node overlap. This guarantees a minimal non-zero distance between nodes. splines : bool (default: False) If True, the edges are drawn as splines and routed around the vertices. vsize : float, PropertyMap, or tuple (default: 0.1) Default vertex size (width and height). If a tuple is specified, the first value should be a property map, and the second is a scale factor. penwidth : float, PropertyMap or tuple (default: 1.0) Specifies the width of the pen, in points, used to draw lines and curves, including the boundaries of edges and clusters. It has no effect on text. Default vertex size (width and height). If a tuple is specified, the first value should be a property map, and the second is a scale factor. elen : float or PropertyMap (default: None) Preferred edge length, in inches. gprops : dict (default: {}) Additional graph properties, as a dictionary. The keys are the property names, and the values must be convertible to string. vprops : dict (default: {}) Additional vertex properties, as a dictionary. The keys are the property names, and the values must be convertible to string, or vertex property maps, with values convertible to strings. eprops : dict (default: {}) Additional edge properties, as a dictionary. The keys are the property names, and the values must be convertible to string, or edge property maps, with values convertible to strings. vcolor : string or PropertyMap (default: None) Drawing color for vertices. If the valued supplied is a property map, the values must be scalar types, whose color values are obtained from the 'vcmap' argument. ecolor : string or PropertyMap (default: None) Drawing color for edges. If the valued supplied is a property map, the values must be scalar types, whose color values are obtained from the 'ecmap' argument. vcmap : matplotlib.colors.Colormap (default: matplotlib.cm.jet) Vertex color map. vnorm : bool (default: True) Normalize vertex color values to the [0,1] range. ecmap : matplotlib.colors.Colormap (default: matplotlib.cm.jet) Edge color map. enorm : bool (default: True) Normalize edge color values to the [0,1] range. output : string (default: "") Output file name. output_format : string (default: "auto") Output file format. Possible values are "auto", "xlib", "ps", "svg", "svgz", "fig", "mif", "hpgl", "pcl", "png", "gif", "dia", "imap", "cmapx". If the value is "auto", the format is guessed from the 'output' parameter, or 'xlib' if it is empty. If the value is None, no output is produced. returngv : bool (default: False) Return the graph object used internally with the gv module. fork : bool (default: False) If true, the program is forked before drawing. This is used as a work-around for a bug in graphviz, where the exit() function is called, which would cause the calling program to end. This is always assumed 'True', if output_format = 'xlib'. seed : int (default: 0) Seed for the random number generator. If the value 0, a different random value is used each time. Returns ------- pos : PropertyMap Vector vertex property map with the x and y coordinates of the vertices. gv : gv.digraph or gv.graph (optional, only if returngv == True) Internally used graphviz graph. Notes ----- This function is a wrapper for the [graphviz] python routines. Extensive additional documentation for the graph, vertex and edge properties is available at: http://www.graphviz.org/doc/info/attrs.html. Examples -------- >>> from numpy import * >>> from numpy.random import seed, zipf >>> seed(42) >>> g = gt.random_graph(1000, lambda: min(zipf(2.4), 40), ... lambda i,j: exp(abs(i-j)), directed=False) >>> # extract largest component >>> comp = gt.label_components(g) >>> h = gt.vertex_hist(g, comp) >>> max_comp = h[1][list(h[0]).index(max(h[0]))] >>> g.remove_vertex_if(lambda v: comp[v] != max_comp) >>> >>> deg = g.degree_property_map("out") >>> deg.get_array()[:] = 2*(sqrt(deg.get_array()[:])*0.5 + 0.4) >>> ebet = gt.betweenness(g)[1] >>> ebet.get_array()[:] *= 4000 >>> ebet.get_array()[:] += 10 >>> gt.graph_draw(g, vsize=deg, vcolor=deg, elen=10, ecolor=ebet, ... penwidth=ebet, overlap="prism", output="graph-draw.png") <...> .. figure:: graph-draw.png :align: center Kamada-Kawai force-directed layout of a graph with a power-law degree distribution, and dissortative degree correlation. The vertex size and color indicate the degree, and the edge color and width the edge betweeness centrality. References ---------- .. [graphviz] http://www.graphviz.org """ if output != "" and output != None: output = os.path.expanduser(output) # check opening file for writing, since graphviz will bork if it is not # possible to open file if os.path.dirname(output) != "" and \ not os.access(os.path.dirname(output), os.W_OK): raise IOError("cannot write to " + os.path.dirname(output)) if g.is_directed(): gvg = gv.digraph("G") else: gvg = gv.graph("G") if layout == "arf": layout = "neato" pos = arf_layout(g, pos=pos) pin = True if pos != None: # copy user-supplied property if isinstance(pos, PropertyMap): pos = ungroup_vector_property(g, pos, [0,1]) else: pos = (g.copy_property(pos[0]), g.copy_property(pos[1])) if type(vsize) == tuple: s = g.new_vertex_property("double") g.copy_property(vsize[0], s) s.a *= vsize[1] vsize = s if type(penwidth) == tuple: s = g.new_vertex_property("double") g.copy_property(penwidth[0], s) s.a *= penwidth[1] penwidth = s # main graph properties gv.setv(gvg,"outputorder", "edgesfirst") gv.setv(gvg,"mode", "major") if overlap == False: overlap = "false" else: overlap = "true" if isinstance(overlap,str): gv.setv(gvg,"overlap", overlap) if sep != None: gv.setv(gvg,"sep", str(sep)) if splines: gv.setv(gvg,"splines", "true") gv.setv(gvg,"ratio", str(ratio)) gv.setv(gvg,"size", "%f,%f" % (size[0]/2.54,size[1]/2.54)) # centimeters if maxiter != None: gv.setv(gvg,"maxiter", str(maxiter)) if seed == 0: seed = numpy.random.randint(sys.maxint) if type(seed) == int: gv.setv(gvg, "start", "%d" % seed) else: gv.setv(gvg, "start", seed) # apply all user supplied properties for k,val in gprops.iteritems(): if isinstance(val, PropertyMap): gv.setv(gvg, k, str(val[g])) else: gv.setv(gvg, k, str(val)) # normalize color properties if vcolor != None and not isinstance(vcolor, str): minmax = [float("inf"), -float("inf")] for v in g.vertices(): c = vcolor[v] minmax[0] = min(c,minmax[0]) minmax[1] = max(c,minmax[1]) if minmax[0] == minmax[1]: minmax[1] += 1 if vnorm: vnorm = matplotlib.colors.normalize(vmin=minmax[0], vmax=minmax[1]) else: vnorm = lambda x: x if ecolor != None and not isinstance(ecolor, str): minmax = [float("inf"), -float("inf")] for e in g.edges(): c = ecolor[e] minmax[0] = min(c,minmax[0]) minmax[1] = max(c,minmax[1]) if minmax[0] == minmax[1]: minmax[1] += 1 if enorm: enorm = matplotlib.colors.normalize(vmin=minmax[0], vmax=minmax[1]) else: enorm = lambda x: x nodes = [] edges = [] # add nodes for v in g.vertices(): n = gv.node(gvg,str(g.vertex_index[v])) if type(vsize) == PropertyMap: vw = vh = vsize[v] else: vw = vh = vsize gv.setv(n, "width", "%g" % vw) gv.setv(n, "height", "%g" % vh) gv.setv(n, "style", "filled") gv.setv(n, "color", "black") # apply color if vcolor != None: if isinstance(vcolor,str): gv.setv(n, "fillcolor", vcolor) else: color = tuple([int(c*255.0) for c in vcmap(vnorm(vcolor[v]))]) gv.setv(n, "fillcolor", "#%.2x%.2x%.2x%.2x" % color) else: gv.setv(n, "fillcolor", "red") gv.setv(n, "label", "") # user supplied position if pos != None: gv.setv(n, "pos", "%f,%f" % (pos[0][v],pos[1][v])) gv.setv(n, "pin", str(pin)) # apply all user supplied properties for k,val in vprops.iteritems(): if isinstance(val, PropertyMap): gv.setv(n, k, str(val[v])) else: gv.setv(n, k, str(val)) nodes.append(n) for e in g.edges(): ge = gv.edge(nodes[g.vertex_index[e.source()]], nodes[g.vertex_index[e.target()]]) gv.setv(ge, "arrowsize", "0.3") if g.is_directed(): gv.setv(ge, "arrowhead", "vee") # apply color if ecolor != None: if isinstance(ecolor,str): gv.setv(ge, "color", ecolor) else: color = tuple([int(c*255.0) for c in ecmap(enorm(ecolor[e]))]) gv.setv(ge, "color", "#%.2x%.2x%.2x%.2x" % color) # apply edge length if elen != None: if isinstance(elen, PropertyMap): gv.setv(ge, "len", str(elen[e])) else: gv.setv(ge, "len", str(elen)) # apply width if penwidth != None: if isinstance(penwidth, PropertyMap): gv.setv(ge, "penwidth", str(penwidth[e])) else: gv.setv(ge, "penwidth", str(penwidth)) # apply all user supplied properties for k,v in eprops.iteritems(): if isinstance(v, PropertyMap): gv.setv(ge, k, str(v[e])) else: gv.setv(ge, k, str(v)) edges.append(ge) gv.layout(gvg, layout) gv.render(gvg, "dot", "/dev/null") # retrieve postitions if pos == None: pos = (g.new_vertex_property("double"), g.new_vertex_property("double")) for n in xrange(0, len(nodes)): p = gv.getv(nodes[n], "pos") p = p.split(",") pos[0][g.vertex(n)] = float(p[0]) pos[1][g.vertex(n)] = float(p[1]) if output_format == "auto": if output == "": output_format = "xlib" elif output != None: output_format = output.split(".")[-1] # if using xlib we need to fork the process, otherwise good ol' graphviz # will call exit() when the window is closed if output_format == "xlib" or fork: pid = os.fork() if pid == 0: gv.render(gvg, output_format, output) os._exit(0) # since we forked, it's good to be sure if output_format != "xlib": os.wait() elif output != None: gv.render(gvg, output_format, output) # I don't get this, but it seems necessary pos[0].get_array()[:] /= 100 pos[1].get_array()[:] /= 100 pos = group_vector_property(g, pos) if returngv: return pos, gv else: gv.rm(gvg) del gvg return pos | 8aba5e7282e52633fc33c3f52f10d5a5e4ca18b3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3516/8aba5e7282e52633fc33c3f52f10d5a5e4ca18b3/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2667,
67,
9446,
12,
75,
16,
949,
33,
7036,
16,
963,
28657,
3600,
16,
4711,
3631,
7092,
33,
8381,
16,
3511,
33,
315,
4644,
31093,
3113,
25743,
33,
7036,
16,
7169,
33,
315,
5935,
3113,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2667,
67,
9446,
12,
75,
16,
949,
33,
7036,
16,
963,
28657,
3600,
16,
4711,
3631,
7092,
33,
8381,
16,
3511,
33,
315,
4644,
31093,
3113,
25743,
33,
7036,
16,
7169,
33,
315,
5935,
3113,
... |
self.trace += " - - External update of %s\n" %tid | if DEBUG: self.trace += " - - External update of %s\n" %tid | def __execution_loop(self): while len(self.__updating_queue) > 0: tid,action = self.__updating_queue.pop(0) | 3ea21cb81161e3d09b3e56c7f94d1f9b5e0adf83 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8234/3ea21cb81161e3d09b3e56c7f94d1f9b5e0adf83/filteredtree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16414,
67,
6498,
12,
2890,
4672,
1323,
562,
12,
2890,
16186,
5533,
1776,
67,
4000,
13,
405,
374,
30,
11594,
16,
1128,
273,
365,
16186,
5533,
1776,
67,
4000,
18,
5120,
12,
20,
13,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16414,
67,
6498,
12,
2890,
4672,
1323,
562,
12,
2890,
16186,
5533,
1776,
67,
4000,
13,
405,
374,
30,
11594,
16,
1128,
273,
365,
16186,
5533,
1776,
67,
4000,
18,
5120,
12,
20,
13,... |
upload_form(pagename, request, msg=_("Attachment '%(filename)s' already exists.") % { 'filename': new_attachment}) | upload_form(pagename, request, msg=_("Attachment '%(new_pagename)s/%(new_filename)s' already exists.") % { 'new_pagename': new_pagename, 'new_filename': new_attachment}) | def move_file(request, pagename, new_pagename, attachment, new_attachment): _ = request.getText newpage = Page(request, new_pagename) if newpage.exists(includeDeleted=1) and request.user.may.write(new_pagename) and request.user.may.delete(pagename): new_attachment_path = os.path.join(getAttachDir(request, new_pagename, create=1), new_attachment).encode(config.charset) attachment_path = os.path.join(getAttachDir(request, pagename), attachment).encode(config.charset) if os.path.exists(new_attachment_path): upload_form(pagename, request, msg=_("Attachment '%(filename)s' already exists.") % { 'filename': new_attachment}) return if new_attachment_path != attachment_path: # move file filesys.rename(attachment_path, new_attachment_path) _addLogEntry(request, 'ATTDEL', pagename, attachment) _addLogEntry(request, 'ATTNEW', new_pagename, new_attachment) upload_form(pagename, request, msg=_("Attachment '%(filename)s' moved to %(page)s.") % { 'filename': new_attachment, 'page': new_pagename}) else: upload_form(pagename, request, msg=_("Nothing changed")) else: upload_form(pagename, request, msg=_("Page %(newpagename)s does not exists or you don't have enough rights.") % { 'newpagename': new_pagename}) | 2cfeb118962f3d68f52f7fdb20123d8cb896505f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/2cfeb118962f3d68f52f7fdb20123d8cb896505f/AttachFile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
67,
768,
12,
2293,
16,
4262,
1069,
16,
394,
67,
9095,
1069,
16,
6042,
16,
394,
67,
11461,
4672,
389,
273,
590,
18,
588,
1528,
225,
394,
2433,
273,
3460,
12,
2293,
16,
394,
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,
3635,
67,
768,
12,
2293,
16,
4262,
1069,
16,
394,
67,
9095,
1069,
16,
6042,
16,
394,
67,
11461,
4672,
389,
273,
590,
18,
588,
1528,
225,
394,
2433,
273,
3460,
12,
2293,
16,
394,
67,
... |
if line[:11]=="com_error: ": try: import win32api, win32con det = eval(string.strip(line[string.find(line,":")+1:])) win32ui.SetStatusText("Opening help file on OLE error..."); win32api.WinHelp(win32ui.GetMainFrame().GetSafeHwnd(),det[2][3],win32con.HELP_CONTEXT, det[2][4]) return 1 except win32api.error, details: try: msg = details[2] except: msg = str(details) win32ui.SetStatusText("The help file could not be opened - %s" % msg) return 1 except: win32ui.SetStatusText("Line is a COM error, but no WinHelp details can be parsed"); | def HandleSpecialLine(self): import scriptutils line = self.GetLine() matchResult = self.patErrorMessage.match(line) if matchResult<=0: # No match - try the next line lineNo = self.LineFromChar() if lineNo > 0: line = self.GetLine(lineNo-1) matchResult = self.patErrorMessage.match(line) if matchResult>0: # we have an error line. fileName = self.patErrorMessage.group(1) if fileName[0]=="<": win32ui.SetStatusText("Can not load this file") return 1 # still was an error message. else: lineNoString = self.patErrorMessage.group(2) # Attempt to locate the file (in case it is a relative spec) fileNameSpec = fileName fileName = scriptutils.LocatePythonFile(fileName) if fileName is None: # Dont force update, so it replaces the idle prompt. win32ui.SetStatusText("Cant locate the file '%s'" % (fileNameSpec), 0) return 1 | 35d8ae392ce55ae6c6bb2c0bec1da9fc1ba22a7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/35d8ae392ce55ae6c6bb2c0bec1da9fc1ba22a7d/winout.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5004,
12193,
1670,
12,
2890,
4672,
1930,
2728,
5471,
980,
273,
365,
18,
967,
1670,
1435,
845,
1253,
273,
365,
18,
16330,
14935,
18,
1916,
12,
1369,
13,
309,
845,
1253,
32,
33,
20,
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,
5004,
12193,
1670,
12,
2890,
4672,
1930,
2728,
5471,
980,
273,
365,
18,
967,
1670,
1435,
845,
1253,
273,
365,
18,
16330,
14935,
18,
1916,
12,
1369,
13,
309,
845,
1253,
32,
33,
20,
30,
... | |
if self.InterestDebug: print 'INTEREST DEBUG: alterInterest(): handle=%s, parent=%s, zoneIds=%s, description=%s, event=%s' % ( | if self.__verbose(): print 'CR::INTEREST.alterInterest(handle=%s, parentId=%s, zoneIdList=%s, description=%s, event=%s)' % ( | def alterInterest(self, handle, parentId, zoneIdList, description=None, event=None): """ Removes old interests and adds new interests. | 0ad3bac423d39b998827d489a97d947c4e85743a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8543/0ad3bac423d39b998827d489a97d947c4e85743a/DoInterestManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10182,
29281,
12,
2890,
16,
1640,
16,
11582,
16,
4157,
22117,
16,
2477,
33,
7036,
16,
871,
33,
7036,
4672,
3536,
20284,
1592,
16513,
87,
471,
4831,
394,
16513,
87,
18,
2,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10182,
29281,
12,
2890,
16,
1640,
16,
11582,
16,
4157,
22117,
16,
2477,
33,
7036,
16,
871,
33,
7036,
4672,
3536,
20284,
1592,
16513,
87,
471,
4831,
394,
16513,
87,
18,
2,
-100,
-100,
-... |
... | ... | def test_personPhotoView(): r"""Test for PersonPhotoView Let's create a new person: >>> from schoolbell.app.app import Person >>> person = Person() >>> person.__name__ = "Jonas" >>> person.title = "Jonas Petraitis" >>> person.photo = "I am a photo!" Let's create a person photo view >>> request = TestRequest() >>> from schoolbell.app.browser.app import PersonPhotoView >>> view = PersonPhotoView(person, request) We should see the photo >>> view.__call__() 'I am a photo!' The photo should be jpeg >>> request.response.getHeader("Content-Type") 'image/jpeg' But if a person has no photo >>> person.photo = None We should get an exception >>> view.__call__() # doctest: +ELLIPSIS Traceback (most recent call last): ... NotFound: Object: <...Person object at ...>, name: u'photo' >>> setup.placelessTearDown() """ | 5d1e5d9e4f62357cff332e9f67f2986d9f474f5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/5d1e5d9e4f62357cff332e9f67f2986d9f474f5f/test_app.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
12479,
19934,
1767,
13332,
436,
8395,
4709,
364,
11573,
19934,
1767,
225,
10559,
1807,
752,
279,
394,
6175,
30,
225,
4080,
628,
18551,
1371,
70,
1165,
18,
2910,
18,
2910,
1930,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
12479,
19934,
1767,
13332,
436,
8395,
4709,
364,
11573,
19934,
1767,
225,
10559,
1807,
752,
279,
394,
6175,
30,
225,
4080,
628,
18551,
1371,
70,
1165,
18,
2910,
18,
2910,
1930,
... |
set_tilt_profile([1.05, -.7, 1.05], [0.0, 1.8, 2.0125 + .3]) configure_laser() | set_tilt_profile([1.05, -.7, 1.05], [0.0, 1.8, 2.0125 + .3]) configure_laser() | def execute_cb(goal): rospy.loginfo("Received a goal") if not set_tilt_profile([1.05, -.7, 1.05], [0.0, 1.8, 2.0125 + .3]): server.set_aborted(MoveBaseResult(), "Couldn't set the profile on the laser") return configure_laser() configure_head() move_base_client.send_goal(goal, None, None, feedback_cb) while not move_base_client.wait_for_result(rospy.Duration(0.1)): if server.is_preempt_requested(): if server.is_new_goal_available(): goal = server.accept_new_goal() move_base_client.send_goal(goal, None, None, feedback_cb) else: move_base_client.cancel_goal() terminal_state = move_base_client.get_state() result = move_base_client.get_result() if terminal_state == GoalStatus.PREEMPTED: server.set_preempted(result) elif terminal_state == GoalStatus.SUCCEEDED: server.set_succeeded(result) elif terminal_state == GoalStatus.ABORTED: server.set_aborted(result) else: server.set_aborted(result, "Unknown result from move_base") | 122c6f7455ce682a4e43ae2b05805de7bdb5d781 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9426/122c6f7455ce682a4e43ae2b05805de7bdb5d781/pr2_move_base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
7358,
12,
27354,
4672,
721,
30884,
18,
1330,
1376,
2932,
8872,
279,
17683,
7923,
309,
486,
444,
67,
29419,
67,
5040,
3816,
21,
18,
6260,
16,
225,
300,
18,
27,
16,
404,
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,
1836,
67,
7358,
12,
27354,
4672,
721,
30884,
18,
1330,
1376,
2932,
8872,
279,
17683,
7923,
309,
486,
444,
67,
29419,
67,
5040,
3816,
21,
18,
6260,
16,
225,
300,
18,
27,
16,
404,
18,
... |
self.add_line("Left Team: WinRate Standard Deviation %.4f" % (self.win_rate_standard_deviation)) | def do_some_formatting(self): self.add_line(self.title, color=Color.BLUE) self.add_newline() | e55b170b1a9addbc47463d05ad1ef4ba45479570 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/600/e55b170b1a9addbc47463d05ad1ef4ba45479570/process.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
19068,
67,
2139,
1787,
12,
2890,
4672,
365,
18,
1289,
67,
1369,
12,
2890,
18,
2649,
16,
2036,
33,
2957,
18,
14618,
1821,
13,
365,
18,
1289,
67,
22861,
1435,
2,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
19068,
67,
2139,
1787,
12,
2890,
4672,
365,
18,
1289,
67,
1369,
12,
2890,
18,
2649,
16,
2036,
33,
2957,
18,
14618,
1821,
13,
365,
18,
1289,
67,
22861,
1435,
2,
-100,
-100,
-... | |
except: | except ValueError: | def content(self, k): """ Returns the content of ``k`` in a standard tableau. That is, if ``k`` appears in row `r` and column `c` of the tableau then we return `c-r`. EXAMPLES: sage: StandardTableau([[1,2],[3,4]]).content(3) -1 """ for r in range(len(self)): try: c=self[r].index(k) return c-r except: pass raise ValueError, '%d does not appear in tableau'%k | ceae499df5f502fc0e0150cdf8a6a2c713f1339a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/ceae499df5f502fc0e0150cdf8a6a2c713f1339a/tableau.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
913,
12,
2890,
16,
417,
4672,
3536,
2860,
326,
913,
434,
12176,
79,
10335,
316,
279,
4529,
1014,
8377,
18,
12466,
353,
16,
309,
12176,
79,
10335,
14606,
316,
1027,
1375,
86,
68,
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,
913,
12,
2890,
16,
417,
4672,
3536,
2860,
326,
913,
434,
12176,
79,
10335,
316,
279,
4529,
1014,
8377,
18,
12466,
353,
16,
309,
12176,
79,
10335,
14606,
316,
1027,
1375,
86,
68,
471,
1... |
def test_layout(self): | def _go_package_home(self): | def test_layout(self): # test sidebar and minor navigation offset = url_for(controller='package') url = self.siteurl + offset web.go(url) web.code(200) # sidebar web.find('Packages section') # minor navigation # TODO: make this a bit more rigorous! web.find('List') | d34073e4851f2db2b8592575f22de268bf7c54ed /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/265/d34073e4851f2db2b8592575f22de268bf7c54ed/test_package.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
6741,
12,
2890,
4672,
468,
1842,
23364,
471,
8439,
10394,
1384,
273,
880,
67,
1884,
12,
5723,
2218,
5610,
6134,
880,
273,
365,
18,
4256,
718,
397,
1384,
3311,
18,
3240,
12,
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,
1842,
67,
6741,
12,
2890,
4672,
468,
1842,
23364,
471,
8439,
10394,
1384,
273,
880,
67,
1884,
12,
5723,
2218,
5610,
6134,
880,
273,
365,
18,
4256,
718,
397,
1384,
3311,
18,
3240,
12,
7... |
gdaltest.dods_grid_ds = gdal.Open( 'http://ingrid.ldeo.columbia.edu/SOURCES/.ARCTIC/.STATION/dods?Theta[x][y]') | gdaltest.dods_grid_ds = gdal.Open('http://disc1.sci.gsfc.nasa.gov/opendap/tovs/TOVSAMNF/1985/032/TOVS_MONTHLY_PM_8502_NF.HDF.Z?Data-Set-11[y][x]') | def dods_1(): gdaltest.dods_ds = None gdaltest.dods_dr = None try: gdaltest.dods_dr = gdal.GetDriverByName( 'DODS' ) except: return 'skip' if gdaltest.dods_dr is None: return 'skip' gdaltest.dods_grid_ds = gdal.Open( 'http://ingrid.ldeo.columbia.edu/SOURCES/.ARCTIC/.STATION/dods?Theta[x][y]') if gdaltest.dods_grid_ds is None: gdaltest.dods_dr = None return 'fail' return 'success' | e9cdc708e48c7833e1f33a4a42400d8084ae2c87 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10289/e9cdc708e48c7833e1f33a4a42400d8084ae2c87/dods.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
369,
87,
67,
21,
13332,
15551,
2390,
395,
18,
72,
369,
87,
67,
2377,
273,
599,
15551,
2390,
395,
18,
72,
369,
87,
67,
3069,
273,
599,
225,
775,
30,
15551,
2390,
395,
18,
72,
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,
302,
369,
87,
67,
21,
13332,
15551,
2390,
395,
18,
72,
369,
87,
67,
2377,
273,
599,
15551,
2390,
395,
18,
72,
369,
87,
67,
3069,
273,
599,
225,
775,
30,
15551,
2390,
395,
18,
72,
3... |
f=open(self.__getpicklefile(self.path), 'w') | f=open(self.__getpicklefile(path), 'w') | def __saveproperties(self, path, properties): f=open(self.__getpicklefile(self.path), 'w') fd=f.fileno() fcntl.flock(fd, fcntl.LOCK_EX) cPickle.dump, properties, f, 1) fcntl.flock(fd, fcntl.LOCK_UN) f.close() | afd073c5afc0866feaab4a818715a1683c69b971 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5832/afd073c5afc0866feaab4a818715a1683c69b971/pickleProps.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
5688,
4738,
12,
2890,
16,
589,
16,
1790,
4672,
284,
33,
3190,
12,
2890,
16186,
588,
20847,
768,
12,
803,
3631,
296,
91,
6134,
5194,
33,
74,
18,
7540,
5764,
1435,
30894,
18,
74,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
5688,
4738,
12,
2890,
16,
589,
16,
1790,
4672,
284,
33,
3190,
12,
2890,
16186,
588,
20847,
768,
12,
803,
3631,
296,
91,
6134,
5194,
33,
74,
18,
7540,
5764,
1435,
30894,
18,
74,
... |
GraphicsImportComponent = OpaqueByValueType('GraphicsImportComponent', 'CmpObj') GraphicsExportComponent = OpaqueByValueType('GraphicsExportComponent', 'CmpObj') ImageTranscoderComponent = OpaqueByValueType('ImageTranscoderComponent', 'CmpObj') DataCodecComponent = OpaqueByValueType('DataCodecComponent', 'CmpObj') GraphicImageMovieImportComponent = OpaqueByValueType('GraphicImageMovieImportComponent', 'CmpObj') MovieExportComponent = OpaqueByValueType('MovieExportComponent', 'CmpObj') MovieImportComponent = OpaqueByValueType('MovieImportComponent', 'CmpObj') QTVideoOutputComponent = OpaqueByValueType('QTVideoOutputComponent', 'CmpObj') SeqGrabComponent = OpaqueByValueType('SeqGrabComponent', 'CmpObj') TextExportComponent = OpaqueByValueType('TextExportComponent', 'CmpObj') TweenerComponent = OpaqueByValueType('TweenerComponent', 'CmpObj') pnotComponent = OpaqueByValueType('pnotComponent', 'CmpObj') VideoDigitizerComponent = OpaqueByValueType('VideoDigitizerComponent', 'CmpObj') | GraphicsImportComponent = OpaqueByValueType('GraphicsImportComponent', 'CmpInstObj') GraphicsExportComponent = OpaqueByValueType('GraphicsExportComponent', 'CmpInstObj') ImageTranscoderComponent = OpaqueByValueType('ImageTranscoderComponent', 'CmpInstObj') MovieImportComponent = OpaqueByValueType('MovieImportComponent', 'CmpInstObj') MovieExportComponent = OpaqueByValueType('MovieExportComponent', 'CmpInstObj') TextExportComponent = OpaqueByValueType('TextExportComponent', 'CmpInstObj') GraphicImageMovieImportComponent = OpaqueByValueType('GraphicImageMovieImportComponent', 'CmpInstObj') pnotComponent = OpaqueByValueType('pnotComponent', 'CmpInstObj') DataCodecComponent = OpaqueByValueType('DataCodecComponent', 'CmpInstObj') TweenerComponent = OpaqueByValueType('TweenerComponent', 'CmpInstObj') QTVideoOutputComponent = OpaqueByValueType('QTVideoOutputComponent', 'CmpInstObj') SeqGrabComponent = OpaqueByValueType('SeqGrabComponent', 'CmpInstObj') VideoDigitizerComponent = OpaqueByValueType('VideoDigitizerComponent', 'CmpInstObj') | #ifdef USE_TOOLBOX_OBJECT_GLUE | 7a3732007a0aaddb558fcdb0ee3afa15a9420279 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/7a3732007a0aaddb558fcdb0ee3afa15a9420279/qtsupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
430,
536,
14988,
67,
26263,
16876,
67,
9422,
67,
11261,
1821,
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,
468,
430,
536,
14988,
67,
26263,
16876,
67,
9422,
67,
11261,
1821,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ConditionalField(StrFixedLenField("Padding", "\x00", length_from=lambda x:(x.SecurityBlobLength+1)%2), lambda x:x.underlayer.Flags2 & SMB_FLAGS2_UNICODE), | ConditionalField(StrLenField("Padding", "\x00", length_from=lambda x:(x.SecurityBlobLength+1)%2), lambda x:x.underlayer.Flags2 & SMB_FLAGS2_UNICODE), | def post_build(self, p, pay): self.LENGTH = len(pay) p = self.do_build() return p+pay | 18e32d515fc34c7faf8b46fe62296641847de8f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8801/18e32d515fc34c7faf8b46fe62296641847de8f2/smbfields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
67,
3510,
12,
2890,
16,
293,
16,
8843,
4672,
365,
18,
7096,
273,
562,
12,
10239,
13,
293,
273,
365,
18,
2896,
67,
3510,
1435,
327,
293,
15,
10239,
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,
1603,
67,
3510,
12,
2890,
16,
293,
16,
8843,
4672,
365,
18,
7096,
273,
562,
12,
10239,
13,
293,
273,
365,
18,
2896,
67,
3510,
1435,
327,
293,
15,
10239,
2,
-100,
-100,
-100,
-100,
-1... |
data={'shipping' : form.shipping_dict.values()[0]['final']}) | data={'shipping' : form.shipping_dict.keys()[0]}) | def _get_form(request, payment_module, *args, **kwargs): processor = payment_module.MODULE.load_module('processor') log.debug('processor=%s', processor) if hasattr(processor, 'FORM'): log.debug('getting form from module') formclass = processor.FORM else: log.debug('using default form') formclass = CreditPayShipForm form = formclass(request, payment_module, *args, **kwargs) return form | 837e854592ee2f3b738ac265f36dcc4161e3cb65 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13656/837e854592ee2f3b738ac265f36dcc4161e3cb65/payship.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
687,
12,
2293,
16,
5184,
67,
2978,
16,
380,
1968,
16,
2826,
4333,
4672,
6659,
273,
5184,
67,
2978,
18,
12194,
18,
945,
67,
2978,
2668,
8700,
6134,
613,
18,
4148,
2668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
687,
12,
2293,
16,
5184,
67,
2978,
16,
380,
1968,
16,
2826,
4333,
4672,
6659,
273,
5184,
67,
2978,
18,
12194,
18,
945,
67,
2978,
2668,
8700,
6134,
613,
18,
4148,
2668,
... |
b_sol=b_sol) | b_sol=b_sol) | def outlier_utils(args): if len(args)==0: print_help() elif ( "--help" in args ): print_help() elif ( "--h" in args ): print_help() elif ("-h" in args ): print_help() else: log = multi_out() if (not "--quiet" in args): log.register(label="stdout", file_object=sys.stdout) string_buffer = StringIO() string_buffer_plots = StringIO() log.register(label="log_buffer", file_object=string_buffer) phil_objects = [] argument_interpreter = libtbx.phil.command_line.argument_interpreter( master_params=master_params, home_scope="outlier_detection") for arg in args: command_line_params = None arg_is_processed = False # is it a file? if arg=="--quiet": arg_is_processed = True if (os.path.isfile(arg)): ## is this a file name? # check if it is a phil file try: command_line_params = iotbx.phil.parse(file_name=arg) if command_line_params is not None: phil_objects.append(command_line_params) arg_is_processed = True except KeyboardInterrupt: raise except : pass else: try: command_line_params = argument_interpreter.process(arg=arg) if command_line_params is not None: phil_objects.append(command_line_params) arg_is_processed = True except KeyboardInterrupt: raise except : pass if not arg_is_processed: print >> log, "##----------------------------------------------##" print >> log, "## Unknown file or keyword:", arg print >> log, "##----------------------------------------------##" print >> log raise Sorry("Unknown file or keyword: %s" % arg) effective_params = master_params.fetch(sources=phil_objects) params = effective_params.extract() # now get the unit cell from the pdb file hkl_xs = None if params.outlier_utils.input.xray_data.file_name is not None: hkl_xs = crystal_symmetry_from_any.extract_from( file_name=params.outlier_utils.input.xray_data.file_name) pdb_xs = None if params.outlier_utils.input.model.file_name is not None: pdb_xs = crystal_symmetry_from_any.extract_from( file_name=params.outlier_utils.input.model.file_name) phil_xs = crystal.symmetry( unit_cell=params.outlier_utils.input.unit_cell, space_group_info=params.outlier_utils.input.space_group ) combined_xs = select_crystal_symmetry( None,phil_xs, [pdb_xs],[hkl_xs]) # inject the unit cell and symmetry in the phil scope please params.outlier_utils.input.unit_cell = combined_xs.unit_cell() params.outlier_utils.input.space_group = \ sgtbx.space_group_info( group = combined_xs.space_group() ) new_params = master_params.format(python_object=params) new_params.show(out=log) if params.outlier_utils.input.unit_cell is None: raise Sorry("unit cell not specified") if params.outlier_utils.input.space_group is None: raise Sorry("space group not specified") if params.outlier_utils.input.xray_data.file_name is None: raise Sorry("Xray data not specified") if params.outlier_utils.input.model.file_name is None: print "PDB file not specified. Basic wilson outlier rejections only." #----------------------------------------------------------- # # step 1: read in the reflection file # phil_xs = crystal.symmetry( unit_cell=params.outlier_utils.input.unit_cell, space_group_info=params.outlier_utils.input.space_group ) xray_data_server = reflection_file_utils.reflection_file_server( crystal_symmetry = phil_xs, force_symmetry = True, reflection_files=[]) miller_array = None miller_array = xray_data_server.get_xray_data( file_name = params.outlier_utils.input.xray_data.file_name, labels = params.outlier_utils.input.xray_data.obs_labels, ignore_all_zeros = True, parameter_scope = 'outlier_utils.input.xray_data', parameter_name = 'obs_labels' ) info = miller_array.info() miller_array = miller_array.map_to_asu() miller_array = miller_array.select( miller_array.indices() != (0,0,0)) miller_array = miller_array.select( miller_array.data() > 0 ) if miller_array.sigmas() is not None: miller_array = miller_array.select( miller_array.sigmas() > 0 ) if (miller_array.is_xray_intensity_array()): miller_array = miller_array.f_sq_as_f() elif (miller_array.is_complex_array()): miller_array = abs(miller_array) miller_array.set_info(info) merged_anomalous=False if miller_array.anomalous_flag(): miller_array = miller_array.average_bijvoet_mates().set_observation_type( miller_array ) merged_anomalous=True miller_array = miller_array.map_to_asu() # get the free reflections please free_flags = None if params.outlier_utils.input.xray_data.free_flags is None: free_flags = miller_array.generate_r_free_flags( fraction=params.outlier_utils.\ additional_parameters.free_flag_generation.fraction, max_free=params.outlier_utils.\ additional_parameters.free_flag_generation.max_number, lattice_symmetry_max_delta=params.outlier_utils.\ additional_parameters.free_flag_generation.lattice_symmetry_max_delta, use_lattice_symmetry=params.outlier_utils.\ additional_parameters.free_flag_generation.use_lattice_symmetry ) else: free_flags = xray_data_server.get_xray_data( file_name = params.outlier_utils.input.xray_data.file_name, labels = params.outlier_utils.input.xray_data.free_flags, ignore_all_zeros = True, parameter_scope = 'outlier_utils.input.xray_data', parameter_name = 'free_flags' ) if miller_array.anomalous_flag(): free_flags = free_flags.miller_array.average_bijvoet_mates() merged_anomalous=True free_flags = free_flags.common_set( miller_array ) free_flags = free_flags.customized_copy( data = flex.bool( free_flags.data()== 1 )) free_flags = free_flags.common_set( miller_array ).map_to_asu() free_flags, miller_array = free_flags.common_sets( miller_array ) print >> log print >> log, "Summary info of observed data" print >> log, "=============================" miller_array.show_summary(f=log) if merged_anomalous: print >> log, "For outlier detection purposes, the Bijvoet pairs have been merged." print >> log print >> log, "Constructing an outlier manager" print >> log, "===============================" print >> log outlier_manager = outlier_rejection.outlier_manager( miller_array, out=log) basic_array = None extreme_array = None model_based_array = None basic_array = outlier_manager.basic_wilson_outliers( p_basic_wilson = params.outlier_utils.outlier_detection.\ parameters.basic_wilson.level, return_array = True) extreme_array = outlier_manager.extreme_wilson_outliers( p_extreme_wilson = params.outlier_utils.outlier_detection.parameters.\ extreme_wilson.level, return_array = True) #---------------------------------------------------------------- # Step 2: get an xray structure from the PDB file # if params.outlier_utils.input.model.file_name is not None: model = xray_structure.from_pdb( file_name=params.outlier_utils.input.model.file_name, crystal_symmetry=phil_xs, force_symmetry=True) print >> log, "Atomic model summary" print >> log, "====================" model.show_summary(f=log) print >> log # please make an f_model object for bulk solvent scaling etc etc f_model_object = f_model.manager( f_obs = miller_array, r_free_flags = free_flags, xray_structure = model ) print >> log, "Bulk solvent scaling of the data" print >> log, "================================" print >> log, "Maximum likelihood bulk solvent scaling." print >> log f_model_object.update_solvent_and_scale(out=log) b_cart = f_model_object.b_cart() k_sol = f_model_object.k_sol() b_sol = f_model_object.b_sol() ls_scale = 1.0/f_model_object.scale_k1() print >> log print >> log, "The observed data is scaled by a multiplier" print >> log, "equal to %5.2e"%(ls_scale) print >> log, "This brings the data to an approximate absolute scale." # update the outlier object please outlier_manager.apply_scale_to_original_data( ls_scale) free_flags = free_flags.common_set( outlier_manager.miller_obs ) # redo the f model object please f_model_object = f_model.manager( f_obs = outlier_manager.miller_obs, r_free_flags = free_flags, xray_structure = model) # reset the bulk solvent parameters please f_model_object.update_core(b_cart=b_cart, k_sol=k_sol, b_sol=b_sol) f_model_data = f_model_object.f_model() plot_out = StringIO() # get alphas and betas please alpha,beta = f_model_object.alpha_beta() # get suspected outliers model_based_array = outlier_manager.model_based_outliers( f_model_data, alpha, beta, level=params.outlier_utils.outlier_detection.parameters.model_based.level, return_array=True, plot_out=plot_out) #check what needs to be put out please if params.outlier_utils.output.hklout is not None: if params.outlier_utils.outlier_detection.protocol == "model": if params.outlier_utils.input.model.file_name == None: print >> log, "Model based rejections requested. No model was supplied." print >> log, "Switching to writing out rejections based on extreme value Wilson statistics." params.outlier_utils.outlier_detection.protocol="extreme" output_array = None print >> log if params.outlier_utils.outlier_detection.protocol == "basic": print >> log, "Outliers found by the basic wilson statistics" print >> log, "protocol will be written out." output_array = basic_array new_set_of_free_flags = free_flags.common_set( basic_array ) if params.outlier_utils.outlier_detection.protocol == "extreme": print >> log, "Outliers found by the extreme value wilson statistics" print >> log, "protocol will be written out." output_array = extreme_array new_set_of_free_flags = free_flags.common_set( extreme_array ) if params.outlier_utils.outlier_detection.protocol == "model": print >> log, "Outliers found by the model based" print >> log, "protocol will be written out to the file:" print >> log, params.outlier_utils.output.hklout print >> log output_array = model_based_array new_set_of_free_flags = free_flags.common_set( model_based_array ) mtz_dataset = output_array.as_mtz_dataset( column_root_label="FOBS") mtz_dataset = mtz_dataset.add_miller_array( miller_array = new_set_of_free_flags, column_root_label = "Free_R_Flag" ) mtz_dataset.mtz_object().write( file_name=params.outlier_utils.output.hklout) if params.outlier_utils.output.logfile is not None: final_log = StringIO() print >> final_log, string_buffer.getvalue() print >> final_log print >> final_log, plot_out.getvalue() outfile = open( params.outlier_utils.output.logfile, 'w' ) outfile.write( final_log.getvalue() ) print >> log print >> log, "A logfile named %s was created."%( params.outlier_utils.output.logfile) print >> log, "This logfile contains the screen output and" print >> log, "(possibly) some ccp4 style loggraph plots" | 95ea40706150efdd497c59bd7453515caa13e6e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/95ea40706150efdd497c59bd7453515caa13e6e4/remove_outliers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
596,
9800,
67,
5471,
12,
1968,
4672,
309,
562,
12,
1968,
13,
631,
20,
30,
1172,
67,
5201,
1435,
1327,
261,
5238,
5201,
6,
316,
833,
262,
30,
1172,
67,
5201,
1435,
1327,
261,
5238,
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,
596,
9800,
67,
5471,
12,
1968,
4672,
309,
562,
12,
1968,
13,
631,
20,
30,
1172,
67,
5201,
1435,
1327,
261,
5238,
5201,
6,
316,
833,
262,
30,
1172,
67,
5201,
1435,
1327,
261,
5238,
76... |
We illustrate changing the ymax value: | Note that changing ymax doesn't change the output of get_minmax_data: | def get_minmax_data(self): """ Return a dictionary whose keys give the xmin, xmax, ymin, and ymax data for this graphic. | e6943e8553d1dd6ca0e171babad6dbe3ff4864a0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/e6943e8553d1dd6ca0e171babad6dbe3ff4864a0/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1154,
1896,
67,
892,
12,
2890,
4672,
3536,
2000,
279,
3880,
8272,
1311,
8492,
326,
13777,
16,
14016,
16,
15763,
16,
471,
15275,
501,
364,
333,
19548,
18,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1154,
1896,
67,
892,
12,
2890,
4672,
3536,
2000,
279,
3880,
8272,
1311,
8492,
326,
13777,
16,
14016,
16,
15763,
16,
471,
15275,
501,
364,
333,
19548,
18,
2,
-100,
-100,
-100,
... |
else: self.total = int(value) | def set_id(self, id): self.run_id = id | def parse_item(self, key, value): if key == 'passed': self.passed = int(value) | f809f388ba16b0d594155c0b3703be8316710995 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13126/f809f388ba16b0d594155c0b3703be8316710995/sqlite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1726,
12,
2890,
16,
498,
16,
460,
4672,
309,
498,
422,
296,
23603,
4278,
365,
18,
23603,
273,
509,
12,
1132,
13,
2,
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,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1726,
12,
2890,
16,
498,
16,
460,
4672,
309,
498,
422,
296,
23603,
4278,
365,
18,
23603,
273,
509,
12,
1132,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if not key_type or not key_type in ['ssh']: raise PLCInvalidArgument, "Invalid key type" | if key_type not in KeyTypes(self.api): raise PLCInvalidArgument, "Invalid key type" | def validate_key_type(self, key_type): | 6a15f46cfce003d21ee8ba0bee213df66250e60e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7598/6a15f46cfce003d21ee8ba0bee213df66250e60e/Keys.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
856,
67,
723,
12,
2890,
16,
498,
67,
723,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
856,
67,
723,
12,
2890,
16,
498,
67,
723,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
@return: -1 - the slot doesn't contain a marked address | @return: BADADDR - the slot doesn't contain a marked address | def GetMarkedPos(slot): """ Get marked position @param slot: slot number: 1..1024 if the specifed value is <= 0 range, IDA will ask the user to select slot. @return: -1 - the slot doesn't contain a marked address otherwise returns the marked address """ curloc = idaapi.curloc() intp = idaapi.int_pointer() intp.assign(slot) return curloc.markedpos(intp) | 4059c6ec72ac8ff39743489acf0d938a5edebdfa /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4773/4059c6ec72ac8ff39743489acf0d938a5edebdfa/idc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
21486,
1616,
12,
14194,
4672,
3536,
968,
9350,
1754,
225,
632,
891,
4694,
30,
4694,
1300,
30,
404,
838,
2163,
3247,
309,
326,
857,
430,
329,
460,
353,
1648,
374,
1048,
16,
1599,
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,
968,
21486,
1616,
12,
14194,
4672,
3536,
968,
9350,
1754,
225,
632,
891,
4694,
30,
4694,
1300,
30,
404,
838,
2163,
3247,
309,
326,
857,
430,
329,
460,
353,
1648,
374,
1048,
16,
1599,
3... |
def parse_bug_id(self): for line in self.message_lines: match = re.search("http\://webkit\.org/b/(?P<bug_id>\d+)", line) if match: return match.group('bug_id') match = re.search(Bugzilla.bug_server_regex + "show_bug\.cgi\?id=(?P<bug_id>\d+)", line) if match: return match.group('bug_id') return None | def message(self): return "\n".join(self.message_lines) + "\n" | 0e450162597964eb30800c6edd7dc31d7bb832b3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/0e450162597964eb30800c6edd7dc31d7bb832b3/scm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
883,
12,
2890,
4672,
327,
1548,
82,
9654,
5701,
12,
2890,
18,
2150,
67,
3548,
13,
397,
1548,
82,
6,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
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,
883,
12,
2890,
4672,
327,
1548,
82,
9654,
5701,
12,
2890,
18,
2150,
67,
3548,
13,
397,
1548,
82,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
newresult = [] for row in rows: d = {} for item, desc in map(None, row, colnames): a = attributes[desc] if _isDateKind(a): d[desc] = _dateConvertFromDB(item) elif _isNumber(a): if a in ('FLOAT4', 'FLOAT8'): f = float else: if item is None: f = lambda x: x else: f = lambda x: x is None and None or int(float(x)) d[desc] = f(item) else: d[desc] = item newresult.append(d) return newresult | newresult = [] for row in rows: d = {} for item, desc in map(None, row, colnames): a = attributes[desc].upper() if _isIntervalKind(a): d[desc]=_intervalConvertFromDB(item) elif _isTimeKind(a): d[desc]=_timeConvertFromDB(item) elif _isDateKind(a): d[desc] = _dateConvertFromDB(item) elif _isNumber(a) and not item is None: if a in ('FLOAT4', 'FLOAT8'): f = float elif a == 'INT8': f = lambda x: long(float(x)) else: f = lambda x: int(float(x)) d[desc] = f(item) else: d[desc] = item newresult.append(d) return newresult | def convertResultRows(self, colnames, attributes, rows): newresult = [] for row in rows: d = {} for item, desc in map(None, row, colnames): #do dbtype->python type conversions here a = attributes[desc] if _isDateKind(a): d[desc] = _dateConvertFromDB(item) elif _isNumber(a): if a in ('FLOAT4', 'FLOAT8'): f = float else: if item is None: f = lambda x: x else: f = lambda x: x is None and None or int(float(x)) d[desc] = f(item) else: d[desc] = item newresult.append(d) | 8830b586a28ef3b620195c52bc3c48e7f3cd50dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5832/8830b586a28ef3b620195c52bc3c48e7f3cd50dc/postconn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
1253,
4300,
12,
2890,
16,
645,
1973,
16,
1677,
16,
2595,
4672,
394,
2088,
273,
5378,
364,
1027,
316,
2595,
30,
302,
273,
2618,
364,
761,
16,
3044,
316,
852,
12,
7036,
16,
1027,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1253,
4300,
12,
2890,
16,
645,
1973,
16,
1677,
16,
2595,
4672,
394,
2088,
273,
5378,
364,
1027,
316,
2595,
30,
302,
273,
2618,
364,
761,
16,
3044,
316,
852,
12,
7036,
16,
1027,
... |
def testEmbeddedIPv4(self): ipv4_string = '254.254.254.254' | def testEmbeddedIpv4(self): ipv4_string = '192.168.0.1' | def testEmbeddedIPv4(self): ipv4_string = '254.254.254.254' ipv4 = ipaddr.IPv4(ipv4_string) v4compat_ipv6 = ipaddr.IPv6('::%s' % ipv4_string) self.assertEquals(v4compat_ipv6.ip, ipv4.ip) v4mapped_ipv6 = ipaddr.IPv6('::ffff:%s' % ipv4_string) self.assertNotEquals(v4mapped_ipv6.ip, ipv4.ip) self.assertRaises(ipaddr.IPv6IpValidationError, ipaddr.IPv6, '2001:1.1.1.1:1.1.1.1') | a0b9e91b24633f81e07c72a82a6b327941f6dcaa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3510/a0b9e91b24633f81e07c72a82a6b327941f6dcaa/ipaddr_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
14980,
24024,
24,
12,
2890,
4672,
9205,
24,
67,
1080,
273,
296,
15561,
18,
23329,
18,
20,
18,
21,
11,
9205,
24,
273,
2359,
4793,
18,
12775,
24,
12,
10834,
24,
67,
1080,
13,
331... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14980,
24024,
24,
12,
2890,
4672,
9205,
24,
67,
1080,
273,
296,
15561,
18,
23329,
18,
20,
18,
21,
11,
9205,
24,
273,
2359,
4793,
18,
12775,
24,
12,
10834,
24,
67,
1080,
13,
331... |
CppText += IndentText + "if (tt_PenPaint == true)\n" CppText += NextIndent + "glColor3ubv(tt_ColorPen);\n" | def GetCppBuiltInInstruction(self, pInstruct, iIndent): IndentText = " " * (iIndent * self.IndentSize) NextIndent = " " * ((iIndent+1) * self.IndentSize) NumTypeGL = self.LogoState.NumType[0] NumTypeMath = "" if self.LogoState.NumType == 'float': NumTypeMath = "f" CppText = "" # get the C++ code for each argument in this instruction ArgText = [] for arg in pInstruct.Arguments: if arg.ArgType == ParamType.LISTCODE: ArgText.append("") else: text = self.GetCppArgument(arg) if text is None: return None ArgText.append(text) # now handle the particular instruction if pInstruct.pProc.FullName == ".setspecial": # .SETSPECIAL return "" elif pInstruct.pProc.FullName == "abs": # ABS CppText += "fabs%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "and": # AND bFirst = True for argtext in ArgText: if bFirst is True: bFirst = False else: CppText += " && " CppText += "(%s)" % argtext elif pInstruct.pProc.FullName == "arctan": # ARCTAN if len(ArgText) == 1: CppText += "atan%s(%s) * tt_DegreeRad" % (NumTypeMath, ArgText[0]) else: CppText += "atan2%s(%s, %s) * tt_DegreeRad" % (NumTypeMath, ArgText[1], ArgText[0]) elif pInstruct.pProc.FullName == "array": # ARRAY CppText += "CArray<%s,1>(" % self.LogoState.NumType if len(pInstruct.Arguments) == 1: CppText += "(int) (%s), 1" % ArgText[0] else: CppText += "(int) (%s), (int) (%s)" % (ArgText[0], ArgText[1]) CppText += ")" elif pInstruct.pProc.FullName == "back": # BACK return self.GetCppBuiltinMove(IndentText, pInstruct.Arguments[0], "-") elif pInstruct.pProc.FullName == "butfirst": # BUTFIRST CppText += "%s.ButFirst()" % ArgText[0] elif pInstruct.pProc.FullName == "butlast": # BUTLAST CppText += "%s.ButLast()" % ArgText[0] elif pInstruct.pProc.FullName == "clean": # CLEAN CppText += IndentText + "wrapper_Clean();\n" elif pInstruct.pProc.FullName == "clearscreen": # CLEARSCREEN # just move to HOME position and call clean CppText += IndentText + "tt_TurtlePos[0] = tt_TurtlePos[1] = 0.5;\n" CppText += IndentText + "tt_TurtleDir = 0.0;\n" CppText += IndentText + "wrapper_Clean();\n" elif pInstruct.pProc.FullName == "cos": # COS CppText += "cos%s((%s) * tt_RadDegree)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "count": # COUNT CppText += "%s.Length()" % ArgText[0] elif pInstruct.pProc.FullName == "difference": # DIFFERENCE CppText += "(%s) - (%s)" % (ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName in ("do.while", "do.until"): # DO.WHILE, DO.UNTIL CppText += IndentText + "do {\n" for instruct in pInstruct.Arguments[0].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext if pInstruct.pProc.FullName == "do.while": CppText += IndentText + "} while (%s);\n" % ArgText[1] else: CppText += IndentText + "} while (!(%s));\n" % ArgText[1] elif pInstruct.pProc.FullName == "emptyp": # EMPTYP CppText += "%s.Length() == 0" % ArgText[0] elif pInstruct.pProc.FullName == "erasescreen": # ERASESCREEN CppText += IndentText + "wrapper_Erase();\n" elif pInstruct.pProc.FullName == "exp": # EXP CppText += "exp%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "first": # FIRST CppText += "%s[0]" % ArgText[0] elif pInstruct.pProc.FullName == "for": # FOR my_temp = self.LogoState.TempIdx self.LogoState.TempIdx += 1 varname = pInstruct.pMakeVar.CppName # write code to set the start and limit values for the FOR loop CppText += IndentText + "%s start%02i = %s;\n" % (self.LogoState.NumType, my_temp, ArgText[1]) CppText += IndentText + "%s limit%02i = %s;\n" % (self.LogoState.NumType, my_temp, ArgText[2]) # write code to set the step size if pInstruct.Arguments[3].ArgType == ParamType.NUMBER: CodeList = pInstruct.Arguments[4].Elements[0].pInstruct CppText += IndentText + "%s step%02i = %s;\n" % (self.LogoState.NumType, my_temp, ArgText[3]) else: CodeList = pInstruct.Arguments[3].Elements[0].pInstruct CppText += IndentText + "%s step%02i = start%02i <= limit%02i ? 1.0 : -1.0;\n" % (self.LogoState.NumType, my_temp, my_temp, my_temp) # now write the FOR loop CppText += IndentText + "for (%s = start%02i; (%s - limit%02i) * step%02i <= 0.0; %s += step%02i)\n" % (varname, my_temp, varname, my_temp, my_temp, varname, my_temp) CppText += IndentText + "{\n" for instruct in CodeList: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" elif pInstruct.pProc.FullName == "forever": # FOREVER my_counter = self.LogoState.LoopIdx self.LogoState.LoopIdx += 1 CppText += IndentText + "for (int loop%02i=1; ; loop%02i++)\n%s{\n" % (my_counter, my_counter, IndentText) for instruct in pInstruct.Arguments[0].Elements[0].pInstruct: self.LogoState.InnerLoopIdx = my_counter codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" self.LogoState.InnerLoopIdx = -1 elif pInstruct.pProc.FullName == "forward": # FORWARD return self.GetCppBuiltinMove(IndentText, pInstruct.Arguments[0], "+") elif pInstruct.pProc.FullName == "fput": # FPUT CppText += "CList<%s>(%s, %s)" % (self.LogoState.NumType, ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "gaussian": # GAUSSIAN CppText += "tt_Gaussian()" elif pInstruct.pProc.FullName == "goto": # GOTO CppText += IndentText + "goto tag_%s;\n" % ArgText[0][1:-1] elif pInstruct.pProc.FullName == "heading": # HEADING CppText += "(tt_TurtleDir < 0.0 ? 360.0+fmod(tt_TurtleDir,360.0) : fmod(tt_TurtleDir,360.0))" elif pInstruct.pProc.FullName == "home": # HOME CppText += IndentText + "tt_TurtlePos[0] = tt_TurtlePos[1] = 0.5;\n" CppText += IndentText + "tt_TurtleDir = 0.0;\n" elif pInstruct.pProc.FullName in ("if", "ifelse"): # IF, IFELSE CppText += IndentText + "if (%s)\n" % ArgText[0] + IndentText + "{\n" for instruct in pInstruct.Arguments[1].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext if pInstruct.pProc.FullName == "if": CppText += IndentText + "}\n" else: CppText += IndentText + "} else {\n" for instruct in pInstruct.Arguments[2].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" elif pInstruct.pProc.FullName in ("iftrue", "iffalse"): # IFTRUE, IFFALSE if pInstruct.pProc.FullName == "iftrue": CppText += IndentText + "if (tt_TestValue)\n" + IndentText + "{\n" else: CppText += IndentText + "if (!tt_TestValue)\n" + IndentText + "{\n" for instruct in pInstruct.Arguments[0].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" elif pInstruct.pProc.FullName == "int": # INT CppText += "(int) (%s)" % ArgText[0] elif pInstruct.pProc.FullName == "item": # ITEM if pInstruct.Arguments[1].ArgType == ParamType.LISTNUM: CppText += "%s[(int) (%s)-1]" % (ArgText[1], ArgText[0]) elif pInstruct.Arguments[1].ArgType == ParamType.ARRAY: CppText += "%s.Get((int) (%s))" % (ArgText[1], ArgText[0]) elif pInstruct.pProc.FullName == "label": # LABEL CppText += IndentText + "glEnd();\n" CppText += IndentText + "sprintf(tt_LabelText, \"" bFirst = True for arg in pInstruct.Arguments: if bFirst is True: bFirst = False else: CppText += " " if arg.ArgType == ParamType.QUOTEDWORD or arg.ArgType == ParamType.BOOLEAN: CppText += "%s" elif arg.ArgType == ParamType.NUMBER: CppText += "%g" else: print "Syntax error: Invalid parameter type %i (%s) in LABEL instruction." % (arg.ArgType, ParamType.Names[arg.ArgType]) return None CppText += "\"" for i in range(len(pInstruct.Arguments)): arg = pInstruct.Arguments[i] CppText += ", " if arg.ArgType == ParamType.QUOTEDWORD: CppText += ArgText[i] elif arg.ArgType == ParamType.NUMBER: CppText += "(double) (%s)" % ArgText[i] elif arg.ArgType == ParamType.BOOLEAN: CppText += '(%s) ? "True" : "False"' % ArgText[i] CppText += ");\n" CppText += IndentText + "DrawPointText(tt_Font, tt_JustifyVert, tt_JustifyHorz, tt_FontHeight, tt_TurtlePos[0], tt_TurtlePos[1], tt_LabelText);\n" CppText += IndentText + "glBegin(GL_LINES);\n" elif pInstruct.pProc.FullName == "last": # LAST CppText += "%s.Last()" % ArgText[0] elif pInstruct.pProc.FullName == "left": # LEFT CppText += IndentText + "tt_TurtleDir -= %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "list": # LIST CppText += "CList<%s>(" % self.LogoState.NumType if len(pInstruct.Arguments) <= 4: for i in range(len(pInstruct.Arguments)): if i != 0: CppText += ", " CppText += ArgText[i] else: CppText += "%i" % len(pInstruct.Arguments) for i in range(len(pInstruct.Arguments)): CppText += ", (double) %s" % ArgText[i] CppText += ")" elif pInstruct.pProc.FullName == "ln": # LN CppText += "log%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName in ("localmake", "make"): # LOCALMAKE, MAKE CppText += IndentText + pInstruct.pMakeVar.CppName + " = " + ArgText[1] + ";\n" elif pInstruct.pProc.FullName == "log10": # LOG10 CppText += "log10%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "lput": # FPUT CppText += "CList<%s>(%s, %s)" % (self.LogoState.NumType, ArgText[1], ArgText[0]) elif pInstruct.pProc.FullName == "mdarray": # MDARRAY if pInstruct.ReturnArrayDim is None: print "Internal error: unknown array dimensions for 'MDARRAY %s'" % ArgText[0] return None if pInstruct.ReturnArrayDim < 2 or pInstruct.ReturnArrayDim > 3: print "Logical error: MDARRAY cannot create an array with %i dimensions" % pInstruct.ReturnArrayDim return None listargtext = self.GetCppListnumExpansion(pInstruct.Arguments[0], pInstruct.ReturnArrayDim, "MDARRAY") if listargtext == None: return None CppText += "CArray<%s,%i>(%s)" % (self.LogoState.NumType, pInstruct.ReturnArrayDim, listargtext) elif pInstruct.pProc.FullName == "mditem": # MDITEM if pInstruct.Arguments[1].Elements[0].Type != ElemType.VAR_VALUE: print "Syntax error: MDITEM requires a variable for the array input, but '%s' was given" % pInstruct.Arguments[1].Elements[0].Text return None ArrayDim = pInstruct.Arguments[1].Elements[0].pVariable.ArrayDim if ArrayDim < 2: print "Logical error: Array '%s' in MDITEM instruction has fewer than 2 dimensions" % pInstruct.Arguments[1].Elements[0].Text return None listargtext = self.GetCppListnumExpansion(pInstruct.Arguments[0], ArrayDim, "MDITEM") if listargtext == None: return None CppText += "%s.Get(%s)" % (ArgText[1], listargtext) elif pInstruct.pProc.FullName == "mdsetitem": # MDSETITEM if pInstruct.Arguments[1].Elements[0].Type != ElemType.VAR_VALUE: print "Syntax error: MDSETITEM requires a variable for the array input, but '%s' was given" % pInstruct.Arguments[1].Elements[0].Text return None ArrayDim = pInstruct.Arguments[1].Elements[0].pVariable.ArrayDim if ArrayDim < 2: print "Logical error: Array '%s' in MDSETITEM instruction has fewer than 2 dimensions" % pInstruct.Arguments[1].Elements[0].Text return None listargtext = self.GetCppListnumExpansion(pInstruct.Arguments[0], ArrayDim, "MDSETITEM") if listargtext == None: return None CppText += IndentText + "%s.Set(%s, %s);\n" % (ArgText[1], ArgText[2], listargtext) elif pInstruct.pProc.FullName == "minus": # MINUS CppText += "-(%s)" % ArgText[0] elif pInstruct.pProc.FullName == "not": # NOT CppText += "!(%s)" % ArgText[0] elif pInstruct.pProc.FullName == "or": # OR bFirst = True for argtext in ArgText: if bFirst is True: bFirst = False else: CppText += " || " CppText += "(%s)" % argtext elif pInstruct.pProc.FullName == "output": # OUTPUT CppText += IndentText + "return %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "penup": # PENUP CppText += IndentText + "tt_PenDown = false;\n" elif pInstruct.pProc.FullName == "pendown": # PENDOWN CppText += IndentText + "tt_PenDown = true;\n" elif pInstruct.pProc.FullName == "penerase": # PENERASE CppText += IndentText + "tt_PenPaint = false;\n" CppText += IndentText + "glColor3ubv(tt_ColorBackground);\n" elif pInstruct.pProc.FullName == "penpaint": # PENPAINT CppText += IndentText + "tt_PenPaint = true;\n" CppText += IndentText + "glColor3ubv(tt_ColorPen);\n" elif pInstruct.pProc.FullName == "pick": # PICK CppText += "%s.Pick()" % ArgText[0] elif pInstruct.pProc.FullName == "pos": # POS CppText += "CList<%s>(tt_TurtlePos[0], tt_TurtlePos[1])" % self.LogoState.NumType elif pInstruct.pProc.FullName == "power": # POWER CppText += "pow%s(%s, %s)" % (NumTypeMath, ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "product": # PRODUCT CppText += "(%s)" % ArgText[0] for argtext in ArgText[1:]: CppText += " * (%s)" % argtext elif pInstruct.pProc.FullName == "quotient": # QUOTIENT if len(ArgText) == 1: CppText += "1.0 / (%s)" % ArgText[0] else: CppText += "(%s) / (%s)" % (ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "radarctan": # RADARCTAN if len(ArgText) == 1: CppText += "atan%s(%s)" % (NumTypeMath, ArgText[0]) else: CppText += "atan2%s(%s, %s)" % (NumTypeMath, ArgText[1], ArgText[0]) elif pInstruct.pProc.FullName == "radcos": # RADCOS CppText += "cos%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "radsin": # RADSIN CppText += "sin%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "random": # RANDOM if len(ArgText) == 1: CppText += "tt_Random((int) (%s))" % ArgText[0] else: CppText += "tt_Random((int) (%s), (int) (%s))" % (ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "remainder": # REMAINDER CppText += "(int) (%s) %% (int) (%s)" % (ArgText[0], ArgText[1]) elif pInstruct.pProc.FullName == "repcount": # REPCOUNT if self.LogoState.InnerLoopIdx == -1: print "Syntax error: REPCOUNT instruction used outside of a FOREVER or REPEAT loop" return None CppText += "loop%02i" % self.LogoState.InnerLoopIdx elif pInstruct.pProc.FullName == "repeat": # REPEAT my_counter = self.LogoState.LoopIdx self.LogoState.LoopIdx += 1 CppText += IndentText + "for (int loop%02i=1; loop%02i <= %s; loop%02i++)\n" % (my_counter, my_counter, ArgText[0], my_counter) CppText += IndentText + "{\n" for instruct in pInstruct.Arguments[1].Elements[0].pInstruct: self.LogoState.InnerLoopIdx = my_counter codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" self.LogoState.InnerLoopIdx = -1 elif pInstruct.pProc.FullName == "rerandom": # RERANDOM if len(ArgText) == 0: CppText += IndentText + "srand(0);\n" else: CppText += IndentText + "srand((int) (%s));\n" % ArgText[0] elif pInstruct.pProc.FullName == "reverse": # REVERSE CppText += "%s.Reverse()" % ArgText[0] elif pInstruct.pProc.FullName == "right": # RIGHT CppText += IndentText + "tt_TurtleDir += %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "round": # ROUND CppText += "round%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "setbackground": # SETBACKGROUND codetext = self.GetCppBuiltinSetColor(IndentText, pInstruct.Arguments[0], "tt_ColorBackground") if codetext is None: return None CppText += codetext CppText += IndentText + "if (tt_PenPaint == false)\n" CppText += IndentText + " " * self.IndentSize + "glColor3ubv(tt_ColorBackground);\n" elif pInstruct.pProc.FullName == "setfont": # SETFONT CppText += IndentText + "tt_Font = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setfontheight": # SETFONTHEIGHT CppText += IndentText + "tt_FontHeight = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setheading": # SETHEADING CppText += IndentText + "tt_TurtleDir = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setitem": # SETITEM if pInstruct.Arguments[1].Elements[0].Type != ElemType.VAR_VALUE: print "Syntax error: destination array for SETITEM instruction can only be a variable" return None if pInstruct.Arguments[1].Elements[0].pVariable.ArrayDim != 1: print "Logical error: Array '%s' in SETITEM instruction is not 1-dimensional" % pInstruct.Arguments[1].Elements[0].Text return None CppText += IndentText + "%s.Set(%s, (int) (%s));\n" % (ArgText[1], ArgText[2], ArgText[0]) elif pInstruct.pProc.FullName == "setjustifyvert": # SETJUSTIFYVERT CppText += IndentText + "tt_JustifyVert = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setjustifyhorz": # SETJUSTIFYHORZ CppText += IndentText + "tt_JustifyHorz = %s;\n" % ArgText[0] elif pInstruct.pProc.FullName == "setpencolor": # SETPENCOLOR codetext = self.GetCppBuiltinSetColor(IndentText, pInstruct.Arguments[0], "tt_ColorPen") if codetext is None: return None CppText += codetext CppText += IndentText + "if (tt_PenPaint == true)\n" CppText += NextIndent + "glColor3ubv(tt_ColorPen);\n" elif pInstruct.pProc.FullName == "setpensize": # SETPENSIZE CppText += IndentText + "glEnd();\n" CppText += IndentText + "glLineWidth(%s);\n" % ArgText[0] CppText += IndentText + "glBegin(GL_LINES);\n" elif pInstruct.pProc.FullName == "setpos": # SETPOS Arg = pInstruct.Arguments[0] elem0type = Arg.Elements[0].Type UpdateTurtle = "" if elem0type == ElemType.NUMBER: if len(Arg.Elements) != 2: print "Syntax error: SETPOS instruction takes an immediate list with exactly 2 numbers, but %i were given." % len(Arg.Elements) return None for i in range(2): UpdateTurtle += NextIndent + "tt_TurtlePos[%i] = %s;\n" % (i, Arg.Elements[i].Text) elif elem0type == ElemType.VAR_VALUE: UpdateTurtle += NextIndent + "tt_TurtlePos[0] = %s[0];\n" % (Arg.Elements[0].pVariable.CppName) UpdateTurtle += NextIndent + "tt_TurtlePos[1] = %s[1];\n" % (Arg.Elements[0].pVariable.CppName) elif elem0type == ElemType.FUNC_CALL: my_temp = self.LogoState.TempIdx self.LogoState.TempIdx += 1 codetext = self.GetCppInstruction(Arg.Elements[0].pInstruct, 0, False) if codetext is None: return None UpdateTurtle += NextIndent + "CList<%s> templist%02i = %s;\n" % (self.LogoState.NumType, my_temp, codetext) UpdateTurtle += NextIndent + "tt_TurtlePos[0] = templist%02i[0];\n" % my_temp UpdateTurtle += NextIndent + "tt_TurtlePos[1] = templist%02i[1];\n" % my_temp else: print "Internal error: invalid element type %i '%s' in a List argument for SETPOS." % (elem0type, ElemType.Names[elem0type]) return None CppText += self.GetCppBuiltinJump(IndentText, UpdateTurtle) elif pInstruct.pProc.FullName == "setscrunch": # SETSCRUNCH CppText += IndentText + "tt_ScrunchXY[0] = %s;\n" % ArgText[0] CppText += IndentText + "tt_ScrunchXY[1] = %s;\n" % ArgText[1] elif pInstruct.pProc.FullName == "setxy": # SETXY UpdateTurtle = NextIndent + "tt_TurtlePos[0] = %s;\n" % ArgText[0] UpdateTurtle += NextIndent + "tt_TurtlePos[1] = %s;\n" % ArgText[1] CppText += self.GetCppBuiltinJump(IndentText, UpdateTurtle) elif pInstruct.pProc.FullName == "setx": # SETX UpdateTurtle = NextIndent + "tt_TurtlePos[0] = %s;\n" % ArgText[0] CppText += self.GetCppBuiltinJump(IndentText, UpdateTurtle) elif pInstruct.pProc.FullName == "sety": # SETY UpdateTurtle = NextIndent + "tt_TurtlePos[1] = %s;\n" % ArgText[0] CppText += self.GetCppBuiltinJump(IndentText, UpdateTurtle) elif pInstruct.pProc.FullName == "sin": # SIN CppText += "sin%s((%s) * tt_RadDegree)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "sqrt": # SQRT CppText += "sqrt%s(%s)" % (NumTypeMath, ArgText[0]) elif pInstruct.pProc.FullName == "stop": # STOP CppText += IndentText + "return;\n" elif pInstruct.pProc.FullName == "sum": # SUM CppText += "(%s)" % ArgText[0] for argtext in ArgText[1:]: CppText += " + (%s)" % argtext elif pInstruct.pProc.FullName == "tag": # TAG CppText += "tag_%s:\n" % ArgText[0][1:-1] elif pInstruct.pProc.FullName == "test": # TEST CppText += IndentText + "tt_TestValue = (bool) (%s);\n" % ArgText[0] elif pInstruct.pProc.FullName == "towards": # TOWARDS Arg = pInstruct.Arguments[0] elem0type = Arg.Elements[0].Type if elem0type == ElemType.NUMBER: if len(Arg.Elements) != 2: print "Syntax error: TOWARDS instruction takes an immediate list with exactly 2 numbers, but %i were given." % len(Arg.Elements) return None CppText += "(atan2(%s - tt_TurtlePos[0], %s - tt_TurtlePos[1])*tt_DegreeRad)" % (Arg.Elements[0].Text, Arg.Elements[1].Text) elif elem0type == ElemType.VAR_VALUE: CppText += "tt_Towards(%s)" % Arg.Elements[0].pVariable.CppName elif elem0type == ElemType.FUNC_CALL: codetext = self.GetCppInstruction(Arg.Elements[0].pInstruct, 0, False) if codetext is None: return None CppText += "tt_Towards(%s)" % codetext else: print "Internal error: invalid element type %i '%s' in a List argument for TOWARDS." % (elem0type, ElemType.Names[elem0type]) return None elif pInstruct.pProc.FullName == "wait": # WAIT CppText += IndentText + "SDL_Delay((int) ((%s) * 1000 / 60));\n" % ArgText[0] elif pInstruct.pProc.FullName in ("while", "until"): # WHILE, UNTIL if pInstruct.pProc.FullName == "while": CppText += IndentText + "while (%s) {\n" % ArgText[0] else: CppText += IndentText + "while (!(%s)) {\n" % ArgText[0] for instruct in pInstruct.Arguments[1].Elements[0].pInstruct: codetext = self.GetCppInstruction(instruct, iIndent + 1, True) if codetext is None: return None CppText += codetext CppText += IndentText + "}\n" elif pInstruct.pProc.FullName == "window": # WINDOW CppText += IndentText + "tt_UseWrap = false;\n" elif pInstruct.pProc.FullName == "wrap": # WRAP CppText += IndentText + "tt_UseWrap = true;\n" elif pInstruct.pProc.FullName == "xcor": # XCOR CppText += "tt_TurtlePos[0]" elif pInstruct.pProc.FullName == "ycor": # YCOR CppText += "tt_TurtlePos[1]" else: print "Internal error: built-in instruction named '%s' is not implemented" % pInstruct.Name return None return CppText | bababbffcfffb2cb7b8c7a966a17e88685da5c1d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2419/bababbffcfffb2cb7b8c7a966a17e88685da5c1d/tt_cppwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
39,
11858,
16409,
382,
11983,
12,
2890,
16,
293,
382,
1697,
16,
277,
7790,
4672,
28653,
1528,
273,
315,
315,
380,
261,
77,
7790,
380,
365,
18,
7790,
1225,
13,
4804,
7790,
273,
315... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
39,
11858,
16409,
382,
11983,
12,
2890,
16,
293,
382,
1697,
16,
277,
7790,
4672,
28653,
1528,
273,
315,
315,
380,
261,
77,
7790,
380,
365,
18,
7790,
1225,
13,
4804,
7790,
273,
315... | |
sys.stderr.write("Could not connect to server, or password mismatch!\r\n") | sys.stderr.write("Could not connect to server, or password mismatch!\r") | def xmpp_presence(self, conn, presence_node): #print presence_node if presence_node.getFrom().bareMatch(self.remotejid): if presence_node.getType() == 'subscribe': replypres=xmpp.Presence(typ='subscribed',to=presence_node.getFrom()) conn.send(replypres) replypres.setType('subscribe') conn.send(replypres) elif presence_node.getType() == 'probe': replypres = xmpp.Presence(to=presence_node.getFrom(), show='chat', status=self.presencestr) conn.send(replypres) elif ((not presence_node.getShow() is None) and \ presence_node.getShow != '') : pass #sys.stdout.write("*** Status: " + presence_node.getShow() + "\n") | dc14f2283f43a8418f2c4f7f0bd9fa7e12949100 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14053/dc14f2283f43a8418f2c4f7f0bd9fa7e12949100/ax25xmpp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
24109,
67,
21731,
12,
2890,
16,
1487,
16,
9805,
67,
2159,
4672,
468,
1188,
9805,
67,
2159,
309,
9805,
67,
2159,
18,
588,
1265,
7675,
70,
834,
2060,
12,
2890,
18,
7222,
18252,
4672... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
24109,
67,
21731,
12,
2890,
16,
1487,
16,
9805,
67,
2159,
4672,
468,
1188,
9805,
67,
2159,
309,
9805,
67,
2159,
18,
588,
1265,
7675,
70,
834,
2060,
12,
2890,
18,
7222,
18252,
4672... |
print e print tb_s | def run(self): import traceback import time import select self.running = True try: ts = tiny_socket.mysocket(self.sock) except: self.sock.close() self.threads.remove(self) return False while self.running: try: msg = ts.myreceive() except: self.sock.close() self.threads.remove(self) return False try: s = LocalService(msg[0]) m = getattr(s, msg[1]) s._service._response = None r = m(*msg[2:]) res = s._service._response if res != None: r = res ts.mysend(r) except Exception, e: tb_s = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback)) print e print tb_s import tools if tools.config['debug_mode']: import pdb tb = sys.exc_info()[2] pdb.post_mortem(tb) e = Exception(e.message) ts.mysend(e, exception=True, traceback=tb_s) except: pass self.sock.close() self.threads.remove(self) return True | e2e28edc2e3c6009f116252e2a7af8f591eda5b4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/e2e28edc2e3c6009f116252e2a7af8f591eda5b4/netsvc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
1930,
10820,
1930,
813,
1930,
2027,
365,
18,
8704,
273,
1053,
775,
30,
3742,
273,
24405,
67,
7814,
18,
81,
1900,
1861,
12,
2890,
18,
15031,
13,
1335,
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,
1086,
12,
2890,
4672,
1930,
10820,
1930,
813,
1930,
2027,
365,
18,
8704,
273,
1053,
775,
30,
3742,
273,
24405,
67,
7814,
18,
81,
1900,
1861,
12,
2890,
18,
15031,
13,
1335,
30,
365,
18,... | |
openflags |= os.O_NOFOLLOW | openflags |= os.O_NOFOLLOW | #cdef S_ISSOCK(int mode): | e88bd7c78ae123c185f17919515d68d29510e836 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1143/e88bd7c78ae123c185f17919515d68d29510e836/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
71,
536,
348,
67,
25689,
51,
3507,
12,
474,
1965,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
468,
71,
536,
348,
67,
25689,
51,
3507,
12,
474,
1965,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.err.stopReading() self.err.connectionLost(None) | self.err.stopReading() self.err.connectionLost(None) | def closeStderr(self): """Close stderr.""" if hasattr(self, "err"): self.err.stopReading() self.err.connectionLost(None) | 2ece81b335005f8b6a5f96b848531357fd18aeb5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2ece81b335005f8b6a5f96b848531357fd18aeb5/process.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
31781,
12,
2890,
4672,
3536,
4605,
4514,
12123,
309,
3859,
12,
2890,
16,
315,
370,
6,
4672,
365,
18,
370,
18,
5681,
15714,
1435,
365,
18,
370,
18,
4071,
19024,
12,
7036,
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,
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,
1746,
31781,
12,
2890,
4672,
3536,
4605,
4514,
12123,
309,
3859,
12,
2890,
16,
315,
370,
6,
4672,
365,
18,
370,
18,
5681,
15714,
1435,
365,
18,
370,
18,
4071,
19024,
12,
7036,
13,
2,
... |
zip_arch_file = self._archive_files(data_files, False) zip_arch_file_name = zip_arch_file.split("/")[-1] | if len(data_files) > 0: zip_arch_file = self._archive_files(data_files, False) zip_arch_file_name = zip_arch_file.split("/")[-1] else: zip_arch_file = None zip_arch_file_name = None | def submit_task(self, executable, input_data=None, modules=(), dep_funcs=(), data_files=(), input_from_file=False): """Creates and submits a task to the internal list for execution. Returns the created task for later use. executable can be either a filename (Python script) or a function.""" # Check if the executable is a Python function or a script if callable(executable): task_name = str(executable.func_name)+"_"+str(self._cur_task_num) exec_file_name = self._task_dir_name+"/"+str(executable.func_name) elif isinstance(executable, str): # TODO: test here for existence of script task_name = str(executable)+"_"+str(self._cur_task_num) exec_file_name = executable else: raise TaskException("Executable must be a filename or function") self._cur_task_num += 1 # Create a zip archive containing the files of data_files zip_arch_file = self._archive_files(data_files, False) zip_arch_file_name = zip_arch_file.split("/")[-1] # Setup the necessary files if callable(executable): self._setup_exec_file(exec_file_name, executable, modules, dep_funcs, input_from_file, zip_arch_file_name) try: store_func = self._interface.pymw_master_write get_result_func = self._interface.pymw_master_read except AttributeError: store_func = self.pymw_master_write get_result_func = self.pymw_master_read new_task = PyMW_Task(task_name=task_name, executable=exec_file_name, store_data_func=store_func, get_result_func=get_result_func, finished_queue=self._finished_tasks, input_data=input_data, file_loc=self._task_dir_name, data_file_zip=zip_arch_file, file_input=input_from_file) self._submitted_tasks.append(new_task) self._queued_tasks.append(item=new_task) self._scheduler._start_scheduler() return new_task | b17a940bde144296ac213d6d704407397afb8bf8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8868/b17a940bde144296ac213d6d704407397afb8bf8/pymw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4879,
67,
4146,
12,
2890,
16,
9070,
16,
810,
67,
892,
33,
7036,
16,
4381,
33,
9334,
5993,
67,
17728,
33,
9334,
501,
67,
2354,
33,
9334,
810,
67,
2080,
67,
768,
33,
8381,
4672,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4879,
67,
4146,
12,
2890,
16,
9070,
16,
810,
67,
892,
33,
7036,
16,
4381,
33,
9334,
5993,
67,
17728,
33,
9334,
501,
67,
2354,
33,
9334,
810,
67,
2080,
67,
768,
33,
8381,
4672,
3536,
... |
stopcomm = False | stopSocketReader = False | def toString(self): """ <Purpose> Converts the frame to a string. | 802ffb0e90c264395b89f378837f0cc01b983c79 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/802ffb0e90c264395b89f378837f0cc01b983c79/NATLayer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1762,
12,
2890,
4672,
3536,
411,
10262,
4150,
34,
20377,
326,
2623,
358,
279,
533,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
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,
1762,
12,
2890,
4672,
3536,
411,
10262,
4150,
34,
20377,
326,
2623,
358,
279,
533,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
data = mseed.plotMSFile(mseed_file, format = 'pdf',\ size = (50, 50),\ minmaxlist = minmaxlist) | data = mseed.plotMSFile(mseed_file, format='pdf', \ size=(50, 50), \ minmaxlist=minmaxlist) | def test_PlotOutputFormats(self): """ Test various output formats. """ mseed = libmseed() mseed_file = os.path.join(self.path, 'BW.BGLD..EHE.D.2008.001.first_record') # calculate full minmaxlist only once minmaxlist = mseed._getMinMaxList(mseed_file, 50) # PDF data = mseed.plotMSFile(mseed_file, format = 'pdf',\ size = (50, 50),\ minmaxlist = minmaxlist) self.assertEqual(data[0:4], "%PDF") # PS data = mseed.plotMSFile(mseed_file, format = 'ps',\ size = (50, 50),\ minmaxlist = minmaxlist) self.assertEqual(data[0:4], "%!PS") # PNG data = mseed.plotMSFile(mseed_file, format = 'png',\ size = (50, 50),\ minmaxlist = minmaxlist) self.assertEqual(data[1:4], "PNG") # SVG data = mseed.plotMSFile(mseed_file, format = 'svg',\ size = (50, 50),\ minmaxlist = minmaxlist) self.assertEqual(data[0:5], "<?xml") | 86891c3b02b856fac5ffaeae1fd61c5974df3489 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10470/86891c3b02b856fac5ffaeae1fd61c5974df3489/test_plotting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
11532,
1447,
8976,
12,
2890,
4672,
3536,
7766,
11191,
876,
6449,
18,
3536,
312,
12407,
273,
2561,
81,
12407,
1435,
312,
12407,
67,
768,
273,
1140,
18,
803,
18,
5701,
12,
2890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
11532,
1447,
8976,
12,
2890,
4672,
3536,
7766,
11191,
876,
6449,
18,
3536,
312,
12407,
273,
2561,
81,
12407,
1435,
312,
12407,
67,
768,
273,
1140,
18,
803,
18,
5701,
12,
2890,
... |
self.adjustVideoWindowFrame() self.window().orderFront_(nil) | if not self.videoWindow.isFullScreen: self.adjustVideoWindowFrame() self.window().makeKeyAndOrderFront_(nil) | def windowDidBecomeKey_(self, notification): self.adjustVideoWindowFrame() self.window().orderFront_(nil) | 6b05faa045110dc4aa622e86ef7924628308a1ed /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/6b05faa045110dc4aa622e86ef7924628308a1ed/VideoDisplay.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2742,
18250,
38,
557,
1742,
653,
67,
12,
2890,
16,
3851,
4672,
309,
486,
365,
18,
9115,
3829,
18,
291,
5080,
7956,
30,
365,
18,
13362,
10083,
3829,
3219,
1435,
365,
18,
5668,
7675,
654... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2742,
18250,
38,
557,
1742,
653,
67,
12,
2890,
16,
3851,
4672,
309,
486,
365,
18,
9115,
3829,
18,
291,
5080,
7956,
30,
365,
18,
13362,
10083,
3829,
3219,
1435,
365,
18,
5668,
7675,
654... |
def get_licence(self): return self.licence or "UNKNOWN" | def get_license(self): return self.license or "UNKNOWN" get_licence = get_license | def get_licence(self): return self.licence or "UNKNOWN" | 45ce5ee58e9269aa155c4ee33e313089f162540a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/45ce5ee58e9269aa155c4ee33e313089f162540a/dist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
80,
335,
802,
12,
2890,
4672,
327,
365,
18,
80,
335,
802,
578,
315,
14737,
6,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
336,
67,
80,
335,
802,
12,
2890,
4672,
327,
365,
18,
80,
335,
802,
578,
315,
14737,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
videosink = "ximagesink" self.sink = gst.element_factory_make(videosink, "sink") | videosink = "xvimagesink" self.videosink = gst.element_factory_make(videosink, "videosink") | def __init__(self): Renderer.__init__(self) logging.info("GStreamer version: %s", gst.version_string()) | 408cbef61fa2e462355ba48311f7bbb6475c06f6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/408cbef61fa2e462355ba48311f7bbb6475c06f6/gstreamerrenderer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
17589,
16186,
2738,
972,
12,
2890,
13,
2907,
18,
1376,
2932,
43,
1228,
264,
1177,
30,
738,
87,
3113,
314,
334,
18,
1589,
67,
1080,
10756,
2,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
17589,
16186,
2738,
972,
12,
2890,
13,
2907,
18,
1376,
2932,
43,
1228,
264,
1177,
30,
738,
87,
3113,
314,
334,
18,
1589,
67,
1080,
10756,
2,
-100,
-100... |
self.driver.Delete( new_filename ) | if gdal.GetConfigOption( 'CPL_DEBUG', 'OFF' ) != 'ON': self.driver.Delete( new_filename ) | def testSetDescription(self): | 71b35e954aa0c31acce12a648a5b2e1343a865e7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10289/71b35e954aa0c31acce12a648a5b2e1343a865e7/gdaltest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
30644,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
30644,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for name, val_doc in root.items(): | for name, val_doc in self._root_items: | def __init__(self, root): """ Create a new documentation index, based on the given root set of C{ValueDoc}s. If any C{APIDoc}s reachable from the root set does not have a canonical name, then it will be assigned one. etc. @param root: A dictionary mapping from names to C{ValueDoc}s. """ #: A list of (name, ValueDoc) pairs. self._root_items = [] self._root_dict = dict(root) #: The set of all C{ValueDoc}s that are directly or indirectly #: reachable from the root set. In particular, this set contains #: all C{ValueDoc}s that can be reached from the root set by #: following I{any} sequence of pointers to C{ValueDoc}s or #: C{VariableDoc}s. self.reachable_valdocs = Set() | cb70208f4299493ff118a4b93801bee1eb6ef977 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/cb70208f4299493ff118a4b93801bee1eb6ef977/docindexer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1365,
4672,
3536,
1788,
279,
394,
7323,
770,
16,
2511,
603,
326,
864,
1365,
444,
434,
385,
95,
620,
1759,
97,
87,
18,
225,
971,
1281,
385,
95,
2203,
73... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1365,
4672,
3536,
1788,
279,
394,
7323,
770,
16,
2511,
603,
326,
864,
1365,
444,
434,
385,
95,
620,
1759,
97,
87,
18,
225,
971,
1281,
385,
95,
2203,
73... |
if bad_parent.parent: self.report('moved', node, 'from', bad_parent) bad_parent.parent.replaceChild(bad_parent, new_tree) | self.report('moved', node, 'from', bad_parent) parent = bad_parent.parent parent.replaceChild(bad_parent, new_tree) self._cleanUpMarks(parent) | def _fixNesting(self, node): """Nesting of nodes is corrected. | 09312d800951f5fded0c333b3c44d7a31fd20211 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/09312d800951f5fded0c333b3c44d7a31fd20211/treecleaner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
904,
50,
10100,
12,
2890,
16,
756,
4672,
3536,
50,
10100,
434,
2199,
353,
19864,
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,
389,
904,
50,
10100,
12,
2890,
16,
756,
4672,
3536,
50,
10100,
434,
2199,
353,
19864,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.bot("^1KICKING ^3%s" % self._victim.exactName) | self._parent.bot("^1KICKING ^3%s" % self._victim.exactName) | def end_vote_yes(self, yes, no): if yes < self.min_votes: self.console.say(self._parent.getMessage('novotes')) return if self._victim.connected: self.bot("^1KICKING ^3%s" % self._victim.exactName) self.console.say("^1KICKING ^3%s" % self._victim.exactName) self._victim.kick("by popular vote (%s)" % self._reason, None) | e711e4e64b3337ea463f63d170b1d1c626bc0e01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12909/e711e4e64b3337ea463f63d170b1d1c626bc0e01/voting2g.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
67,
25911,
67,
9707,
12,
2890,
16,
225,
12465,
16,
225,
1158,
4672,
309,
12465,
411,
365,
18,
1154,
67,
27800,
30,
365,
18,
8698,
18,
87,
528,
12,
2890,
6315,
2938,
18,
24906,
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,
679,
67,
25911,
67,
9707,
12,
2890,
16,
225,
12465,
16,
225,
1158,
4672,
309,
12465,
411,
365,
18,
1154,
67,
27800,
30,
365,
18,
8698,
18,
87,
528,
12,
2890,
6315,
2938,
18,
24906,
2... |
mlist.HandleRequest(id, 2, None) | mlist.HandleRequest(id, 3, None, None, None, None) | def PrintPostRequest(mlist, id, info, total, count, form): # For backwards compatibility with pre 2.0beta3 if len(info) == 5: ptime, sender, subject, reason, filename = info msgdata = {} else: ptime, sender, subject, reason, filename, msgdata = info form.AddItem('<hr>') msg = 'Posting Held for Approval' if total <> 1: msg = msg + ' (%d of %d)' % (count, total) form.AddItem(Center(Header(2, msg))) try: fp = open(os.path.join(mm_cfg.DATA_DIR, filename)) msg = Message.Message(fp) fp.close() text = msg.body[:mm_cfg.ADMINDB_PAGE_TEXT_LIMIT] except IOError, (code, msg): if code == ENOENT: form.AddItem('<em>Message with id #%d was lost.' % id) form.AddItem('<p>') # TBD: kludge to remove id from requests.db. value==2 means # discard the message. try: mlist.HandleRequest(id, 2, None) except Errors.LostHeldMessage: pass return raise t = Table(cellspacing=0, cellpadding=0, width='100%') t.AddRow([Bold('From:'), sender]) row, col = t.GetCurrentRowIndex(), t.GetCurrentCellIndex() t.AddCellInfo(row, col-1, align='right') t.AddRow([Bold('Subject:'), subject]) t.AddCellInfo(row+1, col-1, align='right') t.AddRow([Bold('Reason:'), reason]) t.AddCellInfo(row+2, col-1, align='right') t.AddRow([ Bold('Action:'), RadioButtonArray(id, ('Defer', 'Approve', 'Reject', 'Discard'), checked=0) ]) t.AddCellInfo(row+3, col-1, align='right') t.AddRow([' ', CheckBox('preserve-%d' % id, 'on', 0).Format() + ' Preserve message for site administrator' ]) t.AddRow([' ', CheckBox('forward-%d' % id, 'on', 0).Format() + ' Additionally, forward this message to: ' + TextBox('forward-addr-%d' % id, size=47, value=mlist.GetAdminEmail()).Format() ]) t.AddRow([ Bold('If you reject this post,<br>please explain (optional):'), TextArea('comment-%d' % id, rows=4, cols=80, text = Utils.wrap(msgdata.get('rejection-notice', '[No explanation given]'), column=80)) ]) row, col = t.GetCurrentRowIndex(), t.GetCurrentCellIndex() t.AddCellInfo(row, col-1, align='right') t.AddRow([Bold('Message Headers:'), TextArea('headers-%d' % id, string.join(msg.headers, ''), rows=10, cols=80)]) row, col = t.GetCurrentRowIndex(), t.GetCurrentCellIndex() t.AddCellInfo(row, col-1, align='right') t.AddRow([Bold('Message Excerpt:'), TextArea('fulltext-%d' % id, text, rows=10, cols=80)]) t.AddCellInfo(row+1, col-1, align='right') form.AddItem(t) form.AddItem('<p>') | bc6029a16968c2e938da320bc9764edea08d5da2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/bc6029a16968c2e938da320bc9764edea08d5da2/admindb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3038,
3349,
691,
12,
781,
376,
16,
612,
16,
1123,
16,
2078,
16,
1056,
16,
646,
4672,
468,
2457,
12727,
8926,
598,
675,
576,
18,
20,
5758,
23,
309,
562,
12,
1376,
13,
422,
1381,
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,
3038,
3349,
691,
12,
781,
376,
16,
612,
16,
1123,
16,
2078,
16,
1056,
16,
646,
4672,
468,
2457,
12727,
8926,
598,
675,
576,
18,
20,
5758,
23,
309,
562,
12,
1376,
13,
422,
1381,
30,
... |
log('Reloading transform %s' % self) | log('Reloading transform %s' % self.module) | def reload(self): """ reload the module where the transformation class is defined """ log('Reloading transform %s' % self) m = import_from_name(self.module) reload(m) | fbae3bc2ec3ea581262ffa23fd93b8193c306488 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/fbae3bc2ec3ea581262ffa23fd93b8193c306488/TransformTool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7749,
12,
2890,
4672,
3536,
7749,
326,
1605,
1625,
326,
8620,
667,
353,
2553,
3536,
613,
2668,
13013,
310,
2510,
738,
87,
11,
738,
365,
18,
2978,
13,
312,
273,
1930,
67,
2080,
67,
529,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7749,
12,
2890,
4672,
3536,
7749,
326,
1605,
1625,
326,
8620,
667,
353,
2553,
3536,
613,
2668,
13013,
310,
2510,
738,
87,
11,
738,
365,
18,
2978,
13,
312,
273,
1930,
67,
2080,
67,
529,... |
command += " -q" (pout, pin, perr) = popen2.popen3(command) | command += ["-q"] try: process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) except OSError: file_conclusion.decode.status = Status.ERROR file_conclusion.decode.message = "Dekoder wurde nicht gefunden." continue | def decode(self, file_conclusions): # no decoder if not "decode" in self.config.get('decoder'): # no decoder specified # dialog box: no decoder self.__gui.message_error_box("Es ist kein korrekter Dekoder angegeben!") return False # retrieve email and password email = self.config.get('email') password = base64.b64decode(self.config.get('password')) | 33efacc82d660dd2698bed46dd4ed4bd57488bc9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11048/33efacc82d660dd2698bed46dd4ed4bd57488bc9/decodeorcut.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
12,
2890,
16,
585,
67,
591,
25364,
4672,
225,
468,
1158,
8320,
309,
486,
315,
3922,
6,
316,
365,
18,
1425,
18,
588,
2668,
21070,
11,
4672,
468,
1158,
8320,
1269,
468,
6176,
3919,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
12,
2890,
16,
585,
67,
591,
25364,
4672,
225,
468,
1158,
8320,
309,
486,
315,
3922,
6,
316,
365,
18,
1425,
18,
588,
2668,
21070,
11,
4672,
468,
1158,
8320,
1269,
468,
6176,
3919,... |
__import_file(patch, patchfile, options) | __import_file(patchfile, options, patch) | def __import_series(filename, options): """Import a series of patches """ applied = crt_series.get_applied() if filename: f = file(filename) patchdir = os.path.dirname(filename) else: f = sys.stdin patchdir = '' for line in f: patch = re.sub('#.*$', '', line).strip() if not patch: continue patchfile = os.path.join(patchdir, patch) if options.strip: patch = __strip_patch_name(patch) patch = __replace_slashes_with_dashes(patch); __import_file(patch, patchfile, options) if filename: f.close() | fd1c0cfca390f57dd37024b677de9b707916a8d5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12366/fd1c0cfca390f57dd37024b677de9b707916a8d5/imprt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
5666,
67,
10222,
12,
3459,
16,
702,
4672,
3536,
5010,
279,
4166,
434,
16482,
3536,
6754,
273,
30677,
67,
10222,
18,
588,
67,
438,
3110,
1435,
225,
309,
1544,
30,
284,
273,
585,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5666,
67,
10222,
12,
3459,
16,
702,
4672,
3536,
5010,
279,
4166,
434,
16482,
3536,
6754,
273,
30677,
67,
10222,
18,
588,
67,
438,
3110,
1435,
225,
309,
1544,
30,
284,
273,
585,
1... |
value = queue.pop (); | value = queue.pop () if value != 1: error ("Expected to find 1 but found: " + str(value)) return False value = queue.pop () if value != 2: error ("Expected to find 2 but found: " + str(value)) return False value = queue.pop () | def test_00_a(): ########## # create a queue queue = vortex.AsyncQueue (); # call to terminate queue del queue; ######### # create a queue queue = vortex.AsyncQueue (); # call to unref iterator = 0 while iterator < 100: # unref queue.unref (); # next operation iterator += 1; # and now finish del queue; ######### now check data storage queue = vortex.AsyncQueue (); # push items queue.push (1); queue.push (2); queue.push (3); # get items value = queue.pop (); if value != 3: error ("Expected to find 3 but found: " + value); return False; if value != 2: error ("Expected to find 2 but found: " + value); return False; if value != 1: error ("Expected to find 1 but found: " + value); return False; # call to unref queue.unref (); return True; | 44bc361f3b497230e1d601079e2df89085d4b1cd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1306/44bc361f3b497230e1d601079e2df89085d4b1cd/vortex-regression-client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
713,
67,
69,
13332,
468,
3228,
7,
468,
752,
279,
2389,
2389,
273,
331,
20873,
18,
2771,
3183,
261,
1769,
225,
468,
745,
358,
10850,
2389,
1464,
2389,
31,
225,
468,
3228,
225,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
713,
67,
69,
13332,
468,
3228,
7,
468,
752,
279,
2389,
2389,
273,
331,
20873,
18,
2771,
3183,
261,
1769,
225,
468,
745,
358,
10850,
2389,
1464,
2389,
31,
225,
468,
3228,
225,... |
self.randomlist = [] if self.curr_img_in_list < len(self.image_list) - 1: self.curr_img_in_list += 1 else: if self.listwrap_mode == 0: if self.slideshow_mode == True: self.toggle_slideshow(None) return elif self.listwrap_mode == 1: self.curr_img_in_list = 0 else: if self.fullscreen_mode == True: self.change_cursor(None) dialog = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, _("You are viewing the last image in the list. Wrap around to the first image?")) dialog.set_default_response(gtk.RESPONSE_YES) self.user_prompt_visible = True response = dialog.run() if response == gtk.RESPONSE_YES: self.curr_img_in_list = 0 dialog.destroy() self.user_prompt_visible = False if self.fullscreen_mode == True: self.hide_cursor else: dialog.destroy() self.user_prompt_visible = False if self.fullscreen_mode == True: self.hide_cursor if self.slideshow_mode == True: self.toggle_slideshow(None) return if self.fullscreen_mode == False and (self.slideshow_mode == False or (self.slideshow_mode == True and action != "ss")): self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) gtk.main_iteration() | self.randomlist = [] if self.curr_img_in_list < len(self.image_list) - 1: self.curr_img_in_list += 1 else: if self.listwrap_mode == 0: if self.slideshow_mode == True: self.toggle_slideshow(None) return elif self.listwrap_mode == 1: self.curr_img_in_list = 0 else: if self.fullscreen_mode == True: self.change_cursor(None) dialog = gtk.MessageDialog(self.window, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, _("You are viewing the last image in the list. Wrap around to the first image?")) dialog.set_default_response(gtk.RESPONSE_YES) self.user_prompt_visible = True response = dialog.run() if response == gtk.RESPONSE_YES: self.curr_img_in_list = 0 dialog.destroy() self.user_prompt_visible = False if self.fullscreen_mode == True: self.hide_cursor else: dialog.destroy() self.user_prompt_visible = False if self.fullscreen_mode == True: self.hide_cursor if self.slideshow_mode == True: self.toggle_slideshow(None) return if self.fullscreen_mode == False and (self.slideshow_mode == False or (self.slideshow_mode == True and action != "ss")): self.change_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) gtk.main_iteration() | def next_img_in_list(self, action): if self.slideshow_mode == True and action != "ss": gobject.source_remove(self.timer_delay) if len(self.image_list) > 1: | a4d6024d09d807bd2a142bf54daca1a7d1873c7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/a4d6024d09d807bd2a142bf54daca1a7d1873c7f/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
67,
6081,
67,
267,
67,
1098,
12,
2890,
16,
1301,
4672,
309,
365,
18,
2069,
4369,
13606,
67,
3188,
422,
1053,
471,
1301,
480,
315,
1049,
6877,
314,
1612,
18,
3168,
67,
4479,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
67,
6081,
67,
267,
67,
1098,
12,
2890,
16,
1301,
4672,
309,
365,
18,
2069,
4369,
13606,
67,
3188,
422,
1053,
471,
1301,
480,
315,
1049,
6877,
314,
1612,
18,
3168,
67,
4479,
12,
... |
cmd = [ options.runpython[mode], test ] | cmd = options.runpython[mode][:] cmd += [test] | def runSingleUnitTest(options, mode, test, params=None): cmd = [ options.runpython[mode], test ] if options.verbose: cmd.append('-v') if params is not None: cmd += [ params ] if options.params: cmd += [ options.params ] if options.verbose: log(' '.join(cmd)) if options.dryrun: result = 0 else: result = build_lib.runCommand(cmd, timeout=600) return result | 134ce2a6ff32b988db479ade6fcf70a08aac23f5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/134ce2a6ff32b988db479ade6fcf70a08aac23f5/rt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
5281,
2802,
4709,
12,
2116,
16,
1965,
16,
1842,
16,
859,
33,
7036,
4672,
1797,
225,
273,
702,
18,
2681,
8103,
63,
3188,
6362,
26894,
1797,
1011,
306,
3813,
65,
225,
309,
702,
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,
1086,
5281,
2802,
4709,
12,
2116,
16,
1965,
16,
1842,
16,
859,
33,
7036,
4672,
1797,
225,
273,
702,
18,
2681,
8103,
63,
3188,
6362,
26894,
1797,
1011,
306,
3813,
65,
225,
309,
702,
18,... |
self.locoHorn.focusGained = self.whenLocoHornOn self.locoHorn.focusLost = self.whenLocoHornOff | self.locoHorn.mousePressed = self.whenLocoHornOn self.locoHorn.mouseReleased = self.whenLocoHornOff | def setup(self) : # get other setup things | 9b2cca9b4b4b60ff6b3b43cc62a91b1f742b8a5c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1660/9b2cca9b4b4b60ff6b3b43cc62a91b1f742b8a5c/RobotThrottle2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
13,
294,
225,
468,
336,
1308,
3875,
9198,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
13,
294,
225,
468,
336,
1308,
3875,
9198,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
padding.length = length data = MetadataBlocks.writeblocks(self.metadata_blocks) | padding.length = newlength data = MetadataBlock.writeblocks(self.metadata_blocks) | def save(self, filename=None): if filename is None: filename = self.filename try: f = open(filename, 'rb+') except IOError, err: from errno import ENOENT if err.errno != ENOENT: raise f = open(filename, 'ab') # create, then reopen f = open(filename, 'rb+') | 3fe489e26a9a29350adfacac2b5ec6dde6fda951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1845/3fe489e26a9a29350adfacac2b5ec6dde6fda951/flac.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
1544,
33,
7036,
4672,
309,
1544,
353,
599,
30,
1544,
273,
365,
18,
3459,
775,
30,
284,
273,
1696,
12,
3459,
16,
296,
6731,
15,
6134,
1335,
8340,
16,
393,
30,
628,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
1544,
33,
7036,
4672,
309,
1544,
353,
599,
30,
1544,
273,
365,
18,
3459,
775,
30,
284,
273,
1696,
12,
3459,
16,
296,
6731,
15,
6134,
1335,
8340,
16,
393,
30,
628,... |
def CompileEventHandler(self, name, argNames, body, url, lineno): | def CompileEventHandler(self, name, argNames, body, url, lineno, version): | def CompileEventHandler(self, name, argNames, body, url, lineno): if __debug__: logger.debug("%s.CompileEventHandler %s %s:%s ('%s')", self, name, url, lineno, body[:100]) co = domcompile.compile_function(body, url, name, argNames, lineno=lineno-1) g = {} exec co in g handler = g[name] # Flag that this function started life as inline script code, # so we later ensure the correct globals are used when the event fires handler._nsdom_compiled = True return g[name] | 77e8f880cba524795829c224e9da1907b861133d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13067/77e8f880cba524795829c224e9da1907b861133d/context.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16143,
16402,
12,
2890,
16,
508,
16,
1501,
1557,
16,
1417,
16,
880,
16,
7586,
16,
1177,
4672,
309,
1001,
4148,
972,
30,
1194,
18,
4148,
27188,
87,
18,
9937,
16402,
738,
87,
738,
87,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16143,
16402,
12,
2890,
16,
508,
16,
1501,
1557,
16,
1417,
16,
880,
16,
7586,
16,
1177,
4672,
309,
1001,
4148,
972,
30,
1194,
18,
4148,
27188,
87,
18,
9937,
16402,
738,
87,
738,
87,
... |
if not res: | if res is None: | def parse_doctype(self, res): rawdata = self.rawdata n = len(rawdata) name = res.group('name') pubid, syslit = res.group('pubid', 'syslit') if pubid is not None: pubid = pubid[1:-1] # remove quotes pubid = string.join(string.split(pubid)) # normalize if syslit is not None: syslit = syslit[1:-1] # remove quotes j = k = res.end(0) if k >= n: return -1 if rawdata[k] == '[': level = 0 k = k+1 dq = sq = 0 while k < n: c = rawdata[k] if not sq and c == '"': dq = not dq elif not dq and c == "'": sq = not sq elif sq or dq: pass elif level <= 0 and c == ']': res = endbracket.match(rawdata, k+1) if not res: return -1 self.handle_doctype(name, pubid, syslit, rawdata[j+1:k]) return res.end(0) elif c == '<': level = level + 1 elif c == '>': level = level - 1 if level < 0: self.syntax_error("bogus `>' in DOCTYPE") k = k+1 res = endbracket.search(rawdata, k) if not res: return -1 if res.start(0) != k: self.syntax_error('garbage in DOCTYPE') self.handle_doctype(name, pubid, syslit, None) return res.end(0) | a410d6a227cd319b6aaccb60dced4660f1be0df3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a410d6a227cd319b6aaccb60dced4660f1be0df3/xmllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
2896,
12387,
12,
2890,
16,
400,
4672,
1831,
892,
273,
365,
18,
1899,
892,
290,
273,
562,
12,
1899,
892,
13,
508,
273,
400,
18,
1655,
2668,
529,
6134,
5634,
350,
16,
1393,
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,
1109,
67,
2896,
12387,
12,
2890,
16,
400,
4672,
1831,
892,
273,
365,
18,
1899,
892,
290,
273,
562,
12,
1899,
892,
13,
508,
273,
400,
18,
1655,
2668,
529,
6134,
5634,
350,
16,
1393,
2... |
hilightEnd = text.find(emEnd) hilightStyle = wx.TextAttr("black") self.SetStyle(hilightStart, hilightEnd, hilightStyle) | while hilightStart >= 0: hilightEnd = text.find(emEnd, hilightStart) self.SetStyle(hilightStart, hilightEnd, hilightStyle) hilightStart = text.find(emStart, hilightEnd) | def Hilight(self, emStart, emEnd): # Hilight the emStart..emEnd text. Note that it is assumed there is only one # set of emStart/emEnd strings in the text. text = self.GetValue() textLen = len(text) | d2b5307c1131d630121d5aa6ebcc6b6929079c45 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/d2b5307c1131d630121d5aa6ebcc6b6929079c45/ConflictDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
670,
330,
750,
12,
2890,
16,
801,
1685,
16,
801,
1638,
4672,
468,
670,
330,
750,
326,
801,
1685,
838,
351,
1638,
977,
18,
3609,
716,
518,
353,
12034,
1915,
353,
1338,
1245,
468,
444,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
670,
330,
750,
12,
2890,
16,
801,
1685,
16,
801,
1638,
4672,
468,
670,
330,
750,
326,
801,
1685,
838,
351,
1638,
977,
18,
3609,
716,
518,
353,
12034,
1915,
353,
1338,
1245,
468,
444,
... |
if len(prev_misc_txt) > 0: count_misc += 1 | def convert_processed_reference_line_to_marc_xml(line): """Given a processed reference line, convert it to MARC XML. @param line: (string) - the processed reference line, in which the recognised citations have been tagged. @return: (tuple) - + xml_line (string) - the reference line with all of its identified citations marked up into the various subfields. + count_misc (integer) - number of sections of miscellaneous found in the line + count_title (integer) - number of title-citations found in the line + count_reportnum (integer) - number of report numbers found in the line + count_url (integer) - number of URLs found in the line """ count_misc = count_title = count_reportnum = count_url = 0 xml_line = "" previously_cited_item = None processed_line = line.lstrip() ## 1. Extract reference line marker (e.g. [1]) from start of line and tag it: ## get patterns to identify numeration markers at the start of lines: marker_patterns = get_reference_line_numeration_marker_patterns() marker_match = perform_regex_search_upon_line_with_pattern_list(processed_line, marker_patterns) if marker_match is not None: ## found a marker: marker_val = marker_match.group(u'mark') ## trim the marker from the start of the line: processed_line = processed_line[marker_match.end():].lstrip() else: marker_val = u" " ## Now display the marker in marked-up XML: xml_line += _refextract_markup_reference_line_marker_as_marcxml(marker_val) ## 2. Loop through remaining identified segments in line and tag them into MARC XML segments: cur_misc_txt = u"" ## a marker to hold gathered miscellaneous text before a citation tag_match = sre_tagged_citation.search(processed_line) while tag_match is not None: ## found a tag - process it: tag_match_start = tag_match.start() tag_match_end = tag_match.end() tag_type = tag_match.group(1) if tag_type == "TITLE": ## This tag is an identified journal TITLE. It should be followed by VOLUME, ## YEAR and PAGE tags. cur_misc_txt += processed_line[0:tag_match_start] ## extract the title from the line: idx_closing_tag = processed_line.find(CFG_REFEXTRACT_MARKER_CLOSING_TITLE, tag_match_end) ## Sanity check - did we find a closing TITLE tag? if idx_closing_tag == -1: ## no closing </cds.TITLE> tag found - strip the opening tag and move past it processed_line = processed_line[tag_match_end:] else: ## Closing tag was found: title_text = processed_line[tag_match_end:idx_closing_tag] ## Now trim this matched title and its tags from the start of the line: processed_line = processed_line[idx_closing_tag+len(CFG_REFEXTRACT_MARKER_CLOSING_TITLE):] ## Was this title followed by the tags of recognised VOLUME, YEAR and PAGE objects? numeration_match = sre_recognised_numeration_for_title.match(processed_line) if numeration_match is not None: ## recognised numeration immediately after the title - extract it: reference_volume = numeration_match.group(2) reference_year = numeration_match.group(3) reference_page = numeration_match.group(4) ## Skip past the matched numeration in the working line: processed_line = processed_line[numeration_match.end():] if previously_cited_item is None: ## There is no previously cited item - this should be added as the previously ## cited item: previously_cited_item = { 'type' : "TITLE", 'misc_txt' : cur_misc_txt, 'title' : title_text, 'volume' : reference_volume, 'year' : reference_year, 'page' : reference_page, } ## Now empty the miscellaneous text and title components: cur_misc_txt = "" title_text = "" reference_volume = "" reference_year = "" reference_page = "" elif (previously_cited_item is not None) and \ (previously_cited_item['type'] == "REPORTNUMBER") and \ (len(cur_misc_txt.lower().replace("arxiv", "").strip(".,:;- []")) == 0): ## This TITLE belongs with the REPORT NUMBER before it - add them both into ## the same datafield tag (REPORT NUMBER first, TITLE second): prev_report_num = previously_cited_item['report_num'] prev_misc_txt = previously_cited_item['misc_txt'].lstrip(".;, ").rstrip() xml_line += \ _refextract_markup_title_followed_by_report_number_as_marcxml(title_text, reference_volume, reference_year, reference_page, prev_report_num, prev_misc_txt) ## Increment the stats counters: if len(prev_misc_txt) > 0: count_misc += 1 count_title += 1 count_reportnum += 1 ## reset the various variables: previously_cited_item = None cur_misc_txt = u"" title_text = "" reference_volume = "" reference_year = "" reference_page = "" else: ## either the previously cited item is NOT a REPORT NUMBER, or this cited TITLE ## is preceeded by miscellaneous text. In either case, the two cited objects are ## not the same and do not belong together in the same datafield. if previously_cited_item['type'] == "REPORTNUMBER": ## previously cited item was a REPORT NUMBER. ## Add previously cited REPORT NUMBER to XML string: prev_report_num = previously_cited_item['report_num'] prev_misc_txt = previously_cited_item['misc_txt'].lstrip(".;, ").rstrip() xml_line += _refextract_markup_reportnumber_as_marcxml(prev_report_num, prev_misc_txt) ## Increment the stats counters: if len(prev_misc_txt) > 0: count_misc += 1 count_reportnum += 1 elif previously_cited_item['type'] == "TITLE": ## previously cited item was a TITLE. ## Add previously cited TITLE to XML string: prev_title = previously_cited_item['title'] prev_volume = previously_cited_item['volume'] prev_year = previously_cited_item['year'] prev_page = previously_cited_item['page'] prev_misc_txt = previously_cited_item['misc_txt'].lstrip(".;, ").rstrip() xml_line += _refextract_markup_title_as_marcxml(prev_title, prev_volume, prev_year, prev_page, prev_misc_txt) ## Increment the stats counters: if len(prev_misc_txt) > 0: count_misc += 1 count_title += 1 ## Now add the current cited item into the previously cited item marker previously_cited_item = { 'type' : "TITLE", 'misc_txt' : cur_misc_txt, 'title' : title_text, 'volume' : reference_volume, 'year' : reference_year, 'page' : reference_page, } ## empty miscellaneous text cur_misc_txt = u"" title_text = "" reference_volume = "" reference_year = "" reference_page = "" else: ## No numeration was recognised after the title. Add the title into misc and carry on: cur_misc_txt += " %s" % title_text elif tag_type == "REPORTNUMBER": ## This tag is an identified institutional report number: ## Account for the miscellaneous text before the citation: cur_misc_txt += processed_line[0:tag_match_start] ## extract the institutional report-number from the line: idx_closing_tag = processed_line.find(CFG_REFEXTRACT_MARKER_CLOSING_REPORT_NUM, tag_match_end) ## Sanity check - did we find a closing report-number tag? if idx_closing_tag == -1: ## no closing </cds.REPORTNUMBER> tag found - strip the opening tag and move past this ## recognised reportnumber as it is unreliable: processed_line = processed_line[tag_match_end:] else: ## closing tag was found report_num = processed_line[tag_match_end:idx_closing_tag] ## now trim this matched institutional report-number and its tags from the start of the line: processed_line = processed_line[idx_closing_tag+len(CFG_REFEXTRACT_MARKER_CLOSING_REPORT_NUM):] ## Now, if there was a previous TITLE citation and this REPORT NUMBER citation one has no ## miscellaneous text after punctuation has been stripped, the two refer to the same object, ## so group them under the same datafield: if previously_cited_item is None: ## There is no previously cited item - this should be added as the previously ## cited item: previously_cited_item = { 'type' : "REPORTNUMBER", 'misc_txt' : "%s" % cur_misc_txt, 'report_num' : "%s" % report_num, } ## empty miscellaneous text cur_misc_txt = u"" report_num = u"" elif (previously_cited_item is not None) and \ (previously_cited_item['type'] == "TITLE") and \ (len(cur_misc_txt.lower().replace("arxiv", "").strip(".,:;- []")) == 0): ## This REPORT NUMBER belongs with the title before it - add them both into ## the same datafield tag (TITLE first, REPORT NUMBER second): prev_title = previously_cited_item['title'] prev_volume = previously_cited_item['volume'] prev_year = previously_cited_item['year'] prev_page = previously_cited_item['page'] prev_misc_txt = previously_cited_item['misc_txt'].lstrip(".;, ").rstrip() xml_line += \ _refextract_markup_title_followed_by_report_number_as_marcxml(prev_title, prev_volume, prev_year, prev_page, report_num, prev_misc_txt) ## Increment the stats counters: if len(prev_misc_txt) > 0: count_misc += 1 count_title += 1 count_reportnum += 1 ## Reset variables: previously_cited_item = None cur_misc_txt = u"" else: ## either the previously cited item is NOT a TITLE, or this cited REPORT NUMBER ## is preceeded by miscellaneous text. In either case, the two cited objects are ## not the same and do not belong together in the same datafield. if previously_cited_item['type'] == "REPORTNUMBER": ## previously cited item was a REPORT NUMBER. ## Add previously cited REPORT NUMBER to XML string: prev_report_num = previously_cited_item['report_num'] prev_misc_txt = previously_cited_item['misc_txt'].lstrip(".;, ").rstrip() xml_line += _refextract_markup_reportnumber_as_marcxml(prev_report_num, prev_misc_txt) ## Increment the stats counters: if len(prev_misc_txt) > 0: count_misc += 1 count_reportnum += 1 elif previously_cited_item['type'] == "TITLE": ## previously cited item was a TITLE. ## Add previously cited TITLE to XML string: prev_title = previously_cited_item['title'] prev_volume = previously_cited_item['volume'] prev_year = previously_cited_item['year'] prev_page = previously_cited_item['page'] prev_misc_txt = previously_cited_item['misc_txt'].lstrip(".;, ").rstrip() xml_line += _refextract_markup_title_as_marcxml(prev_title, prev_volume, prev_year, prev_page, prev_misc_txt) ## Increment the stats counters: if len(prev_misc_txt) > 0: count_misc += 1 count_title += 1 ## Now add the current cited item into the previously cited item marker previously_cited_item = { 'type' : "REPORTNUMBER", 'misc_txt' : "%s" % cur_misc_txt, 'report_num' : "%s" % report_num, } ## empty miscellaneous text cur_misc_txt = u"" report_num = u"" elif tag_type == "URL": ## This tag is an identified URL: ## Account for the miscellaneous text before the URL: cur_misc_txt += processed_line[0:tag_match_start] ## extract the URL information from within the tags in the line: idx_closing_tag = processed_line.find(CFG_REFEXTRACT_MARKER_CLOSING_URL, tag_match_end) ## Sanity check - did we find a closing URL tag? if idx_closing_tag == -1: ## no closing </cds.URL> tag found - strip the opening tag and move past it processed_line = processed_line[tag_match_end:] else: ## Closing tag was found: ## First, get the URL string from between the tags: url_string = processed_line[tag_match_end:idx_closing_tag] ## Now, get the URL description string from within the opening cds tag. E.g.: ## from <cds.URL description="abc"> get the "abc" value: opening_url_tag = processed_line[tag_match_start:tag_match_end] if opening_url_tag.find(u"""<cds.URL description=\"""") != -1: ## the description is present - extract it: ## (Stop 2 characters before the end of the string - we assume they are the ## closing characters '">'. url_descr = opening_url_tag[22:-2] else: ## There is no description - description should now be the url string: url_descr = url_string ## now trim this URL and its tags from the start of the line: processed_line = processed_line[idx_closing_tag+len(CFG_REFEXTRACT_MARKER_CLOSING_URL):] ## Build the MARC XML representation of this identified URL: if previously_cited_item is not None: ## There was a previously cited item. We must convert it to XML before we can ## convert this URL to XML: if previously_cited_item['type'] == "REPORTNUMBER": ## previously cited item was a REPORT NUMBER. ## Add previously cited REPORT NUMBER to XML string: prev_report_num = previously_cited_item['report_num'] prev_misc_txt = previously_cited_item['misc_txt'].lstrip(".;, ").rstrip() xml_line += _refextract_markup_reportnumber_as_marcxml(prev_report_num, prev_misc_txt) ## Increment the stats counters: if len(prev_misc_txt) > 0: count_misc += 1 count_reportnum += 1 elif previously_cited_item['type'] == "TITLE": ## previously cited item was a TITLE. ## Add previously cited TITLE to XML string: prev_title = previously_cited_item['title'] prev_volume = previously_cited_item['volume'] prev_year = previously_cited_item['year'] prev_page = previously_cited_item['page'] prev_misc_txt = previously_cited_item['misc_txt'].lstrip(".;, ").rstrip() xml_line += _refextract_markup_title_as_marcxml(prev_title, prev_volume, prev_year, prev_page, prev_misc_txt) ## Increment the stats counters: if len(prev_misc_txt) > 0: count_misc += 1 count_title += 1 ## Empty the previously-cited item place-holder: previously_cited_item = None ## Now convert this URL to MARC XML cur_misc_txt = cur_misc_txt.lstrip(".;, ").rstrip() if url_string.find("http //") == 0: url_string = u"http://" + url_string[7:] elif url_string.find("ftp //") == 0: url_string = u"ftp://" + url_string[6:] if url_descr.find("http //") == 0: url_descr = u"http://" + url_descr[7:] elif url_descr.find("ftp //") == 0: url_descr = u"ftp://" + url_descr[6:] xml_line += \ _refextract_markup_url_as_marcxml(url_string, url_descr, cur_misc_txt) ## Increment the stats counters: if len(cur_misc_txt) > 0: count_misc += 1 count_url += 1 cur_misc_txt = u"" elif tag_type == "SER": ## This tag is a SERIES tag; Since it was not preceeded by a TITLE tag, ## it is useless - strip the tag and put it into miscellaneous: (cur_misc_txt, processed_line) = \ _convert_unusable_tag_to_misc(processed_line, cur_misc_txt, \ tag_match_start,tag_match_end, CFG_REFEXTRACT_MARKER_CLOSING_SERIES) elif tag_type == "VOL": ## This tag is a VOLUME tag; Since it was not preceeded by a TITLE tag, ## it is useless - strip the tag and put it into miscellaneous: (cur_misc_txt, processed_line) = \ _convert_unusable_tag_to_misc(processed_line, cur_misc_txt, \ tag_match_start,tag_match_end, CFG_REFEXTRACT_MARKER_CLOSING_VOLUME) elif tag_type == "YR": ## This tag is a YEAR tag; Since it's not preceeded by TITLE and VOLUME tags, it ## is useless - strip the tag and put the contents into miscellaneous: (cur_misc_txt, processed_line) = \ _convert_unusable_tag_to_misc(processed_line, cur_misc_txt, \ tag_match_start,tag_match_end, CFG_REFEXTRACT_MARKER_CLOSING_YEAR) elif tag_type == "PG": ## This tag is a PAGE tag; Since it's not preceeded by TITLE, VOLUME and YEAR tags, ## it is useless - strip the tag and put the contents into miscellaneous: (cur_misc_txt, processed_line) = \ _convert_unusable_tag_to_misc(processed_line, cur_misc_txt, \ tag_match_start,tag_match_end, CFG_REFEXTRACT_MARKER_CLOSING_PAGE) else: ## Unknown tag - discard as miscellaneous text: cur_misc_txt += processed_line[0:tag_match.end()] processed_line = processed_line[tag_match.end():] ## Look for the next tag in the processed line: tag_match = sre_tagged_citation.search(processed_line) ## If a previously cited item remains, convert it into MARC XML: if previously_cited_item is not None: if previously_cited_item['type'] == "REPORTNUMBER": ## previously cited item was a REPORT NUMBER. ## Add previously cited REPORT NUMBER to XML string: prev_report_num = previously_cited_item['report_num'] prev_misc_txt = previously_cited_item['misc_txt'].lstrip(".;, ").rstrip() xml_line += _refextract_markup_reportnumber_as_marcxml(prev_report_num, prev_misc_txt) ## Increment the stats counters: if len(prev_misc_txt) > 0: count_misc += 1 count_reportnum += 1 elif previously_cited_item['type'] == "TITLE": ## previously cited item was a TITLE. ## Add previously cited TITLE to XML string: prev_title = previously_cited_item['title'] prev_volume = previously_cited_item['volume'] prev_year = previously_cited_item['year'] prev_page = previously_cited_item['page'] prev_misc_txt = previously_cited_item['misc_txt'].lstrip(".;, ").rstrip() xml_line += _refextract_markup_title_as_marcxml(prev_title, prev_volume, prev_year, prev_page, prev_misc_txt) ## Increment the stats counters: if len(prev_misc_txt) > 0: count_misc += 1 count_title += 1 ## free up previously_cited_item: previously_cited_item = None ## place any remaining miscellaneous text into the appropriate MARC XML fields: cur_misc_txt += processed_line if len(cur_misc_txt.strip(" .;,")) > 0: ## The remaining misc text is not just a full-stop or semi-colon. Add it: xml_line += _refextract_markup_miscellaneous_text_as_marcxml(cur_misc_txt) ## Increment the stats counters: count_misc += 1 ## return the reference-line as MARC XML: return (xml_line, count_misc, count_title, count_reportnum, count_url) | 6258c992576ce615917d5d2bfa3f925bb23de3b5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/6258c992576ce615917d5d2bfa3f925bb23de3b5/refextract.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
11005,
67,
6180,
67,
1369,
67,
869,
67,
3684,
71,
67,
2902,
12,
1369,
4672,
3536,
6083,
279,
5204,
2114,
980,
16,
1765,
518,
358,
490,
27206,
3167,
18,
632,
891,
980,
30,
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,
1765,
67,
11005,
67,
6180,
67,
1369,
67,
869,
67,
3684,
71,
67,
2902,
12,
1369,
4672,
3536,
6083,
279,
5204,
2114,
980,
16,
1765,
518,
358,
490,
27206,
3167,
18,
632,
891,
980,
30,
2... | |
(filelist.dirname LIKE '?' \ OR (filelist.dirname LIKE '?' AND\ filelist.filenames LIKE '?'))\ | (filelist.dirname LIKE ? \ OR (filelist.dirname LIKE ? AND\ filelist.filenames LIKE ?))\ | def searchPrco(self, name, prcotype): """return list of packages having prcotype name (any evr and flag)""" results = [] for (rep,cache) in self.primarydb.items(): cur = cache.cursor() executeSQL(cur, "select * from %s where name=?" %(prcotype,), (name,)) prcos = cur.fetchall() for res in prcos: executeSQL(cur, "select * from packages where pkgKey = ?" , (res['pkgKey'],)) for x in cur.fetchall(): pkg = self.db2class(x) if (self.excludes[rep].has_key(pkg.pkgId)): continue # Add this provides to prco otherwise yum doesn't understand # that it matches pkg.prco = {prcotype: [ { 'name': res['name'], 'flags': res['flags'], 'rel': res['release'], 'ver': res['version'], 'epoch': res['epoch'] } ] } results.append(self.pc(rep,pkg)) | 2959486064efcadc2422f80c9cf200cfce8a4558 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/2959486064efcadc2422f80c9cf200cfce8a4558/sqlitesack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
28763,
83,
12,
2890,
16,
508,
16,
846,
71,
10570,
4672,
3536,
2463,
666,
434,
5907,
7999,
846,
71,
10570,
508,
261,
2273,
2113,
86,
471,
2982,
15574,
1686,
273,
5378,
364,
261,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
28763,
83,
12,
2890,
16,
508,
16,
846,
71,
10570,
4672,
3536,
2463,
666,
434,
5907,
7999,
846,
71,
10570,
508,
261,
2273,
2113,
86,
471,
2982,
15574,
1686,
273,
5378,
364,
261,
1... |
ys = linspace(ybounds[0,0],ybounds[-1,0],array_data.shape[0]) | ys = ybounds[:,0] | def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object. | 1e2431fcd42684676163acf6b275c1ef4d5fd87b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13167/1e2431fcd42684676163acf6b275c1ef4d5fd87b/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15332,
67,
4032,
12,
2890,
16,
501,
16,
618,
1546,
1369,
3113,
508,
33,
7036,
16,
7573,
67,
22738,
33,
7036,
16,
619,
10576,
33,
7036,
16,
677,
10576,
33,
7036,
16,
4026,
33,
7036,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15332,
67,
4032,
12,
2890,
16,
501,
16,
618,
1546,
1369,
3113,
508,
33,
7036,
16,
7573,
67,
22738,
33,
7036,
16,
619,
10576,
33,
7036,
16,
677,
10576,
33,
7036,
16,
4026,
33,
7036,
1... |
(\s*<.*?>\s+) | (\s*<.*?>\s*) | def analyse_text(text): if text[:7] == 'Index: ': return True if text[:5] == 'diff ': return True if text[:4] == '--- ': return 0.9 | 2553b49d5b289ed84b943f6a71a4940944f6c520 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6148/2553b49d5b289ed84b943f6a71a4940944f6c520/text.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31087,
67,
955,
12,
955,
4672,
309,
977,
10531,
27,
65,
422,
296,
1016,
30,
4290,
327,
1053,
309,
977,
10531,
25,
65,
422,
296,
5413,
4290,
327,
1053,
309,
977,
10531,
24,
65,
422,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31087,
67,
955,
12,
955,
4672,
309,
977,
10531,
27,
65,
422,
296,
1016,
30,
4290,
327,
1053,
309,
977,
10531,
25,
65,
422,
296,
5413,
4290,
327,
1053,
309,
977,
10531,
24,
65,
422,
3... |
raise | def use(device=None): if use.device_number is None: # No successful call to use() has been made yet if device is None: device = os.getenv("THEANO_GPU",0) if device=="-1" or device=="CPU": return device=int(device) try: cuda_ndarray.gpu_init(device) handle_shared_float32(True) use.device_number = device except RuntimeError, e: logging.getLogger('theano_cuda_ndarray').warning("WARNING: Won't use the GPU as the initialisation of device %i failed. %s" %(device, e)) raise elif use.device_number != device: logging.getLogger('theano_cuda_ndarray').warning("WARNING: ignoring call to use(%s), GPU number %i is already in use." %(str(device), use.device_number)) | ed86748d2e494c669691e37133f9ed8a04cb7ba7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/ed86748d2e494c669691e37133f9ed8a04cb7ba7/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
999,
12,
5964,
33,
7036,
4672,
309,
999,
18,
5964,
67,
2696,
353,
599,
30,
468,
2631,
6873,
745,
358,
999,
1435,
711,
2118,
7165,
4671,
309,
2346,
353,
599,
30,
2346,
273,
1140,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
999,
12,
5964,
33,
7036,
4672,
309,
999,
18,
5964,
67,
2696,
353,
599,
30,
468,
2631,
6873,
745,
358,
999,
1435,
711,
2118,
7165,
4671,
309,
2346,
353,
599,
30,
2346,
273,
1140,
18,
... | |
institute_name = m_institute_name.group(1) | def _add_institute_preprint_patterns(preprint_classifications, preprint_numeration_ptns,\ preprint_reference_search_regexp_patterns, \ standardised_preprint_reference_categories, kb_line_num): """For a list of preprint category strings and preprint numeration patterns for a given institute, create the regexp patterns for each of the preprint types. Add the regexp patterns to the dictionary of search patterns (preprint_reference_search_regexp_patterns), keyed by the line number of the institute in the KB, and the preprint category search string. Also add the standardised preprint category string to another dictionary, keyed by the line number of its position in the KB and its non-standardised version. @param preprint_classifications: (list) of tuples whereby each tuple contains a preprint category search string and the line number of the name of institute to which it belongs in the KB. E.g.: (45, 'ASTRO PH'). @param preprint_numeration_ptns: (list) of preprint reference numeration search patterns (strings) @param preprint_reference_search_regexp_patterns: (dictionary) of regexp patterns used to search in document lines. @param standardised_preprint_reference_categories: (dictionary) containing the standardised strings for preprint reference categories. (E.g. 'astro-ph'.) @param kb_line_num: (integer) - the line number int the KB at which a given institute name was found. @return: None """ if len(preprint_classifications) > 0 and \ len(preprint_numeration_ptns) > 0: ## the previous institute had both numeration styles and categories for preprint references. ## build regexps and add them for this institute: ## First, order the numeration styles by line-length, and build a grouped regexp for recognising numeration: ordered_patterns = _order_institute_preprint_reference_numeration_patterns_by_length(preprint_numeration_ptns) ## create a grouped regexp for numeration part of preprint reference: numeration_regexp = create_institute_numeration_group_regexp_pattern(ordered_patterns) | f27c33ed484fff3d879cd5ea200133c9647129c4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/f27c33ed484fff3d879cd5ea200133c9647129c4/refextract.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
67,
267,
17207,
67,
1484,
1188,
67,
13317,
12,
1484,
1188,
67,
1106,
6640,
16,
675,
1188,
67,
2107,
7067,
67,
337,
2387,
17211,
675,
1188,
67,
6180,
67,
3072,
67,
17745,
67,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
67,
267,
17207,
67,
1484,
1188,
67,
13317,
12,
1484,
1188,
67,
1106,
6640,
16,
675,
1188,
67,
2107,
7067,
67,
337,
2387,
17211,
675,
1188,
67,
6180,
67,
3072,
67,
17745,
67,... | |
def item_rotate_relative(self, item, angle): bounds = self.get_bounds(item) (cx, cy) = ( (bounds[2]+bounds[0])/2 , (bounds[3]+bounds[1])/2) t = math.radians(angle) mat = ( math.cos(t), math.sin(t), -math.sin(t), math.cos(t), (1-math.cos(t))*cx + math.sin(t)*cy, -math.sin(t)*cx + (1 - math.cos(t))*cy) item.get_property("parent").affine_relative(mat) | def select_item(self, group): if (self.selected != None): self.selected.item_list[1].hide() self.selected = None | c356af9a540925b5581acdec4c888c86b80cfd54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11306/c356af9a540925b5581acdec4c888c86b80cfd54/anim.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
67,
1726,
12,
2890,
16,
1041,
4672,
309,
261,
2890,
18,
8109,
480,
599,
4672,
365,
18,
8109,
18,
1726,
67,
1098,
63,
21,
8009,
11248,
1435,
365,
18,
8109,
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,
2027,
67,
1726,
12,
2890,
16,
1041,
4672,
309,
261,
2890,
18,
8109,
480,
599,
4672,
365,
18,
8109,
18,
1726,
67,
1098,
63,
21,
8009,
11248,
1435,
365,
18,
8109,
273,
599,
2,
-100,
-1... | |
def write_class_tree(self, out): """ Write HTML code for a nested list showing the base/subclass relationships between all documented classes. Each element of the top-level list is a class with no (documented) bases; and under each class is listed all of its subclasses. Note that in the case of multiple inheritance, a class may appear multiple times. This is used by L{write_trees} to write the class hierarchy. @todo: For multiple inheritance, don't repeat subclasses the second time a class is mentioned; instead, link to the first mention. """ if not self.class_list: return class_set = self.class_set.copy() for doc in self.class_list: if doc.bases != UNKNOWN: for base in doc.bases: if base not in class_set: if isinstance(base, ClassDoc): class_set.update(base.mro()) else: pass out('<ul>\n') for doc in sorted(class_set): if doc.bases != UNKNOWN and len(doc.bases)==0: self.write_class_tree_item(out, doc, class_set) out('</ul>\n') | def write_module_tree_item(self, out, doc, package=None): # If it's a private variable, then mark its <li>. var = package and package.variables.get(doc.canonical_name[-1]) if var is not None: priv = var.is_public is False else: priv = doc.canonical_name[-1].startswith('_') out(' <li%s> <strong class="uidlink">%s</strong>' % (priv and ' class="private"' or '', self.href(doc))) if doc.summary not in (None, UNKNOWN): out(': <em class="summary">'+ self.description(doc.summary, doc, 8)+'</em>') out('</li>\n') if doc.submodules != UNKNOWN and doc.submodules: out(' <ul%s>\n' % (priv and ' class="private"' or '')) for submodule in doc.submodules: self.write_module_tree_item(out, submodule, package=doc) out(' </ul>\n </li>\n') | ead96d86090e18fdeec64a06319b925d20efd2b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/ead96d86090e18fdeec64a06319b925d20efd2b2/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
2978,
67,
3413,
67,
1726,
12,
2890,
16,
596,
16,
997,
16,
2181,
33,
7036,
4672,
468,
971,
518,
1807,
279,
3238,
2190,
16,
1508,
2267,
2097,
411,
549,
18652,
569,
273,
2181,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2978,
67,
3413,
67,
1726,
12,
2890,
16,
596,
16,
997,
16,
2181,
33,
7036,
4672,
468,
971,
518,
1807,
279,
3238,
2190,
16,
1508,
2267,
2097,
411,
549,
18652,
569,
273,
2181,
... | |
LOFI_SUPPORT = get('LOFI_SUPPORT', True) | LOFI_SUPPORT = get('DJANGOBB_LOFI_SUPPORT', True) | def get(key, default): return getattr(settings, key, default) | ec838de748db1f3ae64fe1ca517d112349fff91a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13701/ec838de748db1f3ae64fe1ca517d112349fff91a/settings.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
856,
16,
805,
4672,
327,
3869,
12,
4272,
16,
498,
16,
805,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
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,
336,
12,
856,
16,
805,
4672,
327,
3869,
12,
4272,
16,
498,
16,
805,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
except: | except Exception, exc: | def _http_decoder(self, mpkt): payload = mpkt.get_field('raw.load') | 968802cc3fd7bddc23804216cfc04928b9bb40d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11468/968802cc3fd7bddc23804216cfc04928b9bb40d9/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2505,
67,
21070,
12,
2890,
16,
312,
5465,
88,
4672,
2385,
273,
312,
5465,
88,
18,
588,
67,
1518,
2668,
1899,
18,
945,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
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,
2505,
67,
21070,
12,
2890,
16,
312,
5465,
88,
4672,
2385,
273,
312,
5465,
88,
18,
588,
67,
1518,
2668,
1899,
18,
945,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
True returns a dictionary keyed by node labels | True returns a dictionary keyed by vertex labels | def cliques_containing_node(self, nodes=None, cliques=None, with_labels=False): """ Returns the cliques containing each node, represented as a list of lists. (Returns a single list if only one input node). Currently only implemented for undirected graphs. Use to_undirected to convert a digraph to an undirected graph. (See examples below). INPUT: -- nodes - the nodes to inspect (default is entire graph) -- with_labels - (boolean) default False returns list as above True returns a dictionary keyed by node labels -- cliques - list of cliques (if already computed) EXAMPLES: sage: C = Graph('DJ{') sage: C.cliques_containing_node() [[[4, 0]], [[4, 1, 2, 3]], [[4, 1, 2, 3]], [[4, 1, 2, 3]], [[4, 1, 2, 3], [4, 0]]] sage: E = C.cliques() sage: E [[4, 1, 2, 3], [4, 0]] sage: C.cliques_containing_node(cliques=E) [[[4, 0]], [[4, 1, 2, 3]], [[4, 1, 2, 3]], [[4, 1, 2, 3]], [[4, 1, 2, 3], [4, 0]]] sage: F = graphs.Grid2dGraph(2,3) sage: F.cliques_containing_node(with_labels=True) {(0, 1): [[(0, 1), (0, 0)], [(0, 1), (0, 2)], [(0, 1), (1, 1)]], (1, 2): [[(1, 2), (0, 2)], [(1, 2), (1, 1)]], (0, 0): [[(0, 1), (0, 0)], [(1, 0), (0, 0)]], (1, 1): [[(0, 1), (1, 1)], [(1, 2), (1, 1)], [(1, 0), (1, 1)]], (1, 0): [[(1, 0), (0, 0)], [(1, 0), (1, 1)]], (0, 2): [[(0, 1), (0, 2)], [(1, 2), (0, 2)]]} sage: F.cliques_containing_node(nodes=[(0, 1), (1, 2)]) [[[(0, 1), (0, 0)], [(0, 1), (0, 2)], [(0, 1), (1, 1)]], [[(1, 2), (0, 2)], [(1, 2), (1, 1)]]] sage: D = DiGraph({0:[1,2,3], 1:[2], 3:[0,1]}) sage.: D.show(figsize=[2,2]) sage: D.cliques_containing_node() Traceback (most recent call last): ... TypeError: Function defined for undirected graphs only. See documentation. sage: D = D.to_undirected() sage.: D.show(figsize=[2,2]) sage: D.cliques_containing_node() [[[0, 1, 2], [0, 1, 3]], [[0, 1, 2], [0, 1, 3]], [[0, 1, 2]], [[0, 1, 3]]] """ if (self.is_directed()): raise TypeError('Function defined for undirected graphs only. See documentation.') else: import networkx.cliques return networkx.cliques.cliques_containing_node(self._nxg, nodes, cliques, with_labels) | a520fa15cff86fbbd1335f8b6f9d36203c74d574 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/a520fa15cff86fbbd1335f8b6f9d36203c74d574/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4942,
29896,
67,
1213,
3280,
67,
2159,
12,
2890,
16,
2199,
33,
7036,
16,
4942,
29896,
33,
7036,
16,
598,
67,
5336,
33,
8381,
4672,
3536,
2860,
326,
4942,
29896,
4191,
1517,
756,
16,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4942,
29896,
67,
1213,
3280,
67,
2159,
12,
2890,
16,
2199,
33,
7036,
16,
4942,
29896,
33,
7036,
16,
598,
67,
5336,
33,
8381,
4672,
3536,
2860,
326,
4942,
29896,
4191,
1517,
756,
16,
10... |
case PyArray_SBYTE: *(signed char *)(arr->data)=*v; break;\\ | case PyArray_BYTE: *(signed char *)(arr->data)=*v; break;\\ | #ifdef NUMARRAY | e976023c94992967c9e8060117a5f6795102525d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/e976023c94992967c9e8060117a5f6795102525d/cfuncs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
430,
536,
9443,
8552,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
430,
536,
9443,
8552,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
yield UInt64(parent, "value") | yield Int64(parent, "value") | def parseInt64(parent): yield UInt64(parent, "value") | 1fe24045b845f0bc4c65d7cfd362b863c461642a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/1fe24045b845f0bc4c65d7cfd362b863c461642a/python.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5395,
1105,
12,
2938,
4672,
2824,
3094,
1105,
12,
2938,
16,
315,
1132,
7923,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
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,
5395,
1105,
12,
2938,
4672,
2824,
3094,
1105,
12,
2938,
16,
315,
1132,
7923,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for name,node in g.result.items(): | result = g.result_get() node_res = {} for node in nodes: node_res[node] = result[node] for name,node in node_res.items(): | def result_get(self): return self.result | 64fb43920c0a78d65263aa37b7d6c2d5460cc5fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/64fb43920c0a78d65263aa37b7d6c2d5460cc5fe/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
563,
67,
588,
12,
2890,
4672,
327,
365,
18,
2088,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
563,
67,
588,
12,
2890,
4672,
327,
365,
18,
2088,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
file += 'KEY_RENEWAL_DATE="%s"\n' % time.strftime('%Y-%m-%d at %H:%M:%S +0000',time.gmtime()) | file += 'KEY_RENEWAL_DATE="%s"\n' % time.strftime('%Y/%m/%d at %H:%M +0000',time.gmtime()) | def floppy_contents (self, node, renew_key): | f3c9e56d0c9427ff4cd8551e3d037531843fc033 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7598/f3c9e56d0c9427ff4cd8551e3d037531843fc033/GetBootMedium.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
16884,
2074,
67,
3980,
261,
2890,
16,
756,
16,
15723,
67,
856,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
284,
16884,
2074,
67,
3980,
261,
2890,
16,
756,
16,
15723,
67,
856,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
ushcn = read_USHCN(path) | ushcn = read_USHCN(path, meta) | def read_USHCN_converted(path, stations, meta=None): """Read the USHCN data in the file *path*, converting each record to degrees Celsius, and converting their station identifiers to use the 12-digit GHCN identifiers specified in the *stations* dict. """ ushcn = read_USHCN(path) celsius = convert_F_to_C(ushcn) ghcn_ids = convert_USHCN_id(celsius, stations, meta) return ghcn_ids | 8a689debd22be0c065d230aaf4f1d72b3989ae3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6890/8a689debd22be0c065d230aaf4f1d72b3989ae3c/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
57,
2664,
12821,
67,
6283,
329,
12,
803,
16,
29719,
16,
2191,
33,
7036,
4672,
3536,
1994,
326,
587,
2664,
12821,
501,
316,
326,
585,
380,
803,
14,
16,
14540,
1517,
1409,
358,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
57,
2664,
12821,
67,
6283,
329,
12,
803,
16,
29719,
16,
2191,
33,
7036,
4672,
3536,
1994,
326,
587,
2664,
12821,
501,
316,
326,
585,
380,
803,
14,
16,
14540,
1517,
1409,
358,
... |
document.body[i + 6:i + 6] = subst | document.body[i - 3:i - 3] = subst | def revert_multirow(document): " Revert multirow cells in tables " i = 0 multirow = False while True: # cell type 3 is multirow begin cell i = find_token(document.body, '<cell multirow="3"', i) if i == -1: break # a multirow cell was found multirow = True # remove the multirow tag, set the valignment to top # and remove the bottom line document.body[i] = document.body[i].replace(' multirow="3" ', ' ') document.body[i] = document.body[i].replace('valignment="middle"', 'valignment="top"') document.body[i] = document.body[i].replace(' bottomline="true" ', ' ') # write ERT to create the multirow cell # use 2 rows and 2cm as default with because the multirow span # and the column width is only hardly accessible subst = [put_cmd_in_ert("\\multirow{2}{2cm}{")] document.body[i + 4:i + 4] = subst subst = [put_cmd_in_ert("}")] document.body[i + 6:i + 6] = subst # cell type 4 is multirow part cell i = find_token(document.body, '<cell multirow="4"', i) if i == -1: break # remove the multirow tag, set the valignment to top # and remove the bottom line document.body[i] = document.body[i].replace(' multirow="4" ', ' ') document.body[i] = document.body[i].replace('valignment="middle"', 'valignment="top"') document.body[i] = document.body[i].replace(' topline="true" ', ' ') i = i + 1 if multirow == True: add_to_preamble(document, ["% this command was inserted by lyx2lyx"]) add_to_preamble(document, ["\\usepackage{multirow}"]) | 59d0045a72d266c7d2687ace54aa0461119e04d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7514/59d0045a72d266c7d2687ace54aa0461119e04d1/lyx_2_0.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15226,
67,
7027,
492,
12,
5457,
4672,
315,
868,
1097,
3309,
492,
5983,
316,
4606,
315,
277,
273,
374,
3309,
492,
273,
1083,
1323,
1053,
30,
468,
2484,
618,
890,
353,
3309,
492,
2376,
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,
15226,
67,
7027,
492,
12,
5457,
4672,
315,
868,
1097,
3309,
492,
5983,
316,
4606,
315,
277,
273,
374,
3309,
492,
273,
1083,
1323,
1053,
30,
468,
2484,
618,
890,
353,
3309,
492,
2376,
2... |
url = "<a href='%s/full_output.txt' class='file_link'>full_output.txt</a>"%( | url = "<a target='_new' href='%s/full_output.txt' class='file_link'>full_output.txt</a>"%( | def set_output_text(self, output, html, sage=None): if output.count('<?__SAGE__TEXT>') > 1: html = '<h3><font color="red">WARNING: multiple @interacts in one cell disabled (not yet implemented).</font></h3>' output = '' | e50d2e8cd2fd8f25b8934627d6321a2ed08e1d37 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/e50d2e8cd2fd8f25b8934627d6321a2ed08e1d37/cell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2844,
67,
955,
12,
2890,
16,
876,
16,
1729,
16,
272,
410,
33,
7036,
4672,
309,
876,
18,
1883,
2668,
12880,
972,
55,
2833,
972,
5151,
1870,
13,
405,
404,
30,
1729,
273,
2368,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2844,
67,
955,
12,
2890,
16,
876,
16,
1729,
16,
272,
410,
33,
7036,
4672,
309,
876,
18,
1883,
2668,
12880,
972,
55,
2833,
972,
5151,
1870,
13,
405,
404,
30,
1729,
273,
2368,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.