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 |
|---|---|---|---|---|---|---|
cherrypy.response.headers['Content-Type'] = 'text/xml' | cherrypy.response.headers['Content-Type'] = 'application/atom+xml' | def __init__(self, text, count): self.text, self.count = text, count | 8b78f63d3295a8fa9a1c923385d6b2d3b34ab811 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/8b78f63d3295a8fa9a1c923385d6b2d3b34ab811/opds.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
977,
16,
1056,
4672,
365,
18,
955,
16,
365,
18,
1883,
273,
977,
16,
1056,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
977,
16,
1056,
4672,
365,
18,
955,
16,
365,
18,
1883,
273,
977,
16,
1056,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if func.GetInfo('expection') == False: test = self._remove_expected_call_re.sub('', test) | def WriteValidUnitTest(self, func, file, test, extra = {}): """Writes a valid unit test.""" if func.GetInfo('expection') == False: test = self._remove_expected_call_re.sub('', test) name = func.name arg_strings = [] count = 0 for arg in func.GetOriginalArgs(): arg_strings.append(arg.GetValidArg(count, 0)) count += 1 gl_arg_strings = [] count = 0 for arg in func.GetOriginalArgs(): gl_arg_strings.append(arg.GetValidGLArg(count, 0)) count += 1 gl_func_name = func.GetGLTestFunctionName() vars = { 'test_name': 'GLES2DecoderTest%d' % file.file_num, 'name':name, 'gl_func_name': gl_func_name, 'args': ", ".join(arg_strings), 'gl_args': ", ".join(gl_arg_strings), } vars.update(extra) file.Write(test % vars) | b8fb1c2876060305792c0b72943407a8dd011c60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b8fb1c2876060305792c0b72943407a8dd011c60/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
1556,
2802,
4709,
12,
2890,
16,
1326,
16,
585,
16,
1842,
16,
2870,
273,
2618,
4672,
3536,
8368,
279,
923,
2836,
1842,
12123,
508,
273,
1326,
18,
529,
1501,
67,
10219,
273,
5378,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
1556,
2802,
4709,
12,
2890,
16,
1326,
16,
585,
16,
1842,
16,
2870,
273,
2618,
4672,
3536,
8368,
279,
923,
2836,
1842,
12123,
508,
273,
1326,
18,
529,
1501,
67,
10219,
273,
5378,
... | |
Suppress("=") + tagAttrValue ))) + \ | Optional( Suppress("=") + tagAttrValue ) ))) + \ | def _makeTags(tagStr, xml): """Internal helper to construct opening and closing tag expressions, given a tag name""" if isinstance(tagStr,basestring): resname = tagStr tagStr = Keyword(tagStr, caseless=not xml) else: resname = tagStr.name tagAttrName = Word(alphas,alphanums+"_-:") if (xml): tagAttrValue = dblQuotedString.copy().setParseAction( removeQuotes ) openTag = Suppress("<") + tagStr + \ Dict(ZeroOrMore(Group( tagAttrName + Suppress("=") + tagAttrValue ))) + \ Optional("/",default=[False]).setResultsName("empty").setParseAction(lambda s,l,t:t[0]=='/') + Suppress(">") else: printablesLessRAbrack = "".join( [ c for c in printables if c not in ">" ] ) tagAttrValue = quotedString.copy().setParseAction( removeQuotes ) | Word(printablesLessRAbrack) openTag = Suppress("<") + tagStr + \ Dict(ZeroOrMore(Group( tagAttrName.setParseAction(downcaseTokens) + \ Suppress("=") + tagAttrValue ))) + \ Optional("/",default=[False]).setResultsName("empty").setParseAction(lambda s,l,t:t[0]=='/') + Suppress(">") closeTag = Combine("</" + tagStr + ">") openTag = openTag.setResultsName("start"+"".join(resname.replace(":"," ").title().split())).setName("<%s>" % tagStr) closeTag = closeTag.setResultsName("end"+"".join(resname.replace(":"," ").title().split())).setName("</%s>" % tagStr) return openTag, closeTag | 7d89fb1beaf7f067ec5ef53ab3737427e5622b39 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12364/7d89fb1beaf7f067ec5ef53ab3737427e5622b39/pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
3453,
12,
2692,
1585,
16,
2025,
4672,
3536,
3061,
4222,
358,
4872,
10890,
471,
7647,
1047,
8041,
16,
864,
279,
1047,
508,
8395,
309,
1549,
12,
2692,
1585,
16,
18602,
371,
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,
389,
6540,
3453,
12,
2692,
1585,
16,
2025,
4672,
3536,
3061,
4222,
358,
4872,
10890,
471,
7647,
1047,
8041,
16,
864,
279,
1047,
508,
8395,
309,
1549,
12,
2692,
1585,
16,
18602,
371,
4672... |
r""" Bipartite graph. INPUT: 1. Empty: creates a zero vertex bipartite graph. sage: B = BipartiteGraph() sage: type(B) <class 'sage.graphs.bipartite_graph.BipartiteGraph'> sage: B.order() 0 2. From a graph: without any more information, finds a bipartition. sage: B = BipartiteGraph( graphs.CycleGraph(4) ) sage: B = BipartiteGraph( graphs.CycleGraph(5) ) Traceback (most recent call last): ... TypeError: Input graph is not bipartite! 3. From a NetworkX bipartite graph. sage: import networkx sage: G = graphs.OctahedralGraph() sage: N = networkx.cliques.make_clique_bipartite(G.networkx_graph()) sage: B = BipartiteGraph(N) 4. From a graph and a partition. Note that if the input graph is not bipartite, then Sage will raise an error. However, if one specifies check = False, the offending edges are simply deleted (along with those vertices not appearing in either list). sage: P = graphs.PetersenGraph() sage: partition = [range(5), range(5,10)] sage: B = BipartiteGraph(P, partition) Traceback (most recent call last): ... TypeError: Input graph is not bipartite with respect to the given partition! sage: B = BipartiteGraph(P, partition, check=False) sage: B.left [0, 1, 2, 3, 4] sage: B.show() EXAMPLES: Test for arbitrary argument handled by Graph class sage: B = BipartiteGraph(None) sage: B Bipartite graph on 0 vertices Copy constructor sage: G = Graph({0:[5,6], 1:[4,5], 2:[4,6], 3:[4,5,6]}) sage: B = BipartiteGraph(G) sage: B2 = BipartiteGraph(B) sage: B == B2 True sage: B3 = BipartiteGraph(G, range(4), range(4,7)) sage: B3 Bipartite graph on 7 vertices sage: B3 == B2 True Make sure "copy constructor" returns the same partition for no edges sage: G = Graph({0:[], 1:[], 2:[]}) sage: part = (range(2), [2]) sage: B = BipartiteGraph(G, part) sage: B2 = BipartiteGraph(B) sage: B == B2 True """ | def __init__(self, *args, **kwds): r""" Bipartite graph. | f6eeb9e61e177ed9383a6fc234d70325c93a0fa9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/f6eeb9e61e177ed9383a6fc234d70325c93a0fa9/bipartite_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
605,
5762,
1137,
2667,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
605,
5762,
1137,
2667,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
base = self.supercall(node.node, func) | base = self.supercall(node, func) | def visitCallFunc(self, node, func=None): # XXX clean up!! newnode = cnode(node, parent=func) | 1d2e66a4fd565969867f2d2f295bec347147771b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6661/1d2e66a4fd565969867f2d2f295bec347147771b/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
1477,
2622,
12,
2890,
16,
756,
16,
1326,
33,
7036,
4672,
468,
11329,
2721,
731,
8548,
29267,
273,
276,
2159,
12,
2159,
16,
982,
33,
644,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
1477,
2622,
12,
2890,
16,
756,
16,
1326,
33,
7036,
4672,
468,
11329,
2721,
731,
8548,
29267,
273,
276,
2159,
12,
2159,
16,
982,
33,
644,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100... |
this = apply(_quickfix.new_SideFillStationCd, args) | this = _quickfix.new_SideFillStationCd(*args) | def __init__(self, *args): this = apply(_quickfix.new_SideFillStationCd, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
8895,
8026,
16672,
19728,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
8895,
8026,
16672,
19728,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335... |
if nickMatch(op, self.registryValue('commentRequest.ignore'): | if nickMatch(op, self.registryValue('commentRequest.ignore')): | def reviewBans(self): try: self.log.debug('Checking for bans that need review ...') now = time.mktime(time.gmtime()) lastreview = self.registryValue('reviewTime') reviewAfterTime = self.registryValue('reviewAfterTime') * 60 # time in mins if not lastreview: # initialize last time reviewed timestamp lastreview = now - reviewAfterTime for channel, bans in self.bans.iteritems(): for ban in bans: banTime = now - ban.when reviewTime = lastreview - ban.when self.log.debug(' channel %s ban %s (%s/%s/%s)', channel, ban.mask, reviewTime, reviewAfterTime, banTime) if reviewTime <= reviewAfterTime < banTime: # ban is old enough, and inside the "review window" op = ban.who # ban.who can be a nick or IRC hostmask if ircutils.isUserHostmask(op): op = op[:op.find('!')] elif not ircutils.isNick(op, strictRfc=True): # probably a ban restored by IRC server continue if nickMatch(op, self.registryValue('commentRequest.ignore'): # in the ignore list continue s = "Please review ban '%s' in %s" %(ban.mask, channel) msg = ircmsgs.privmsg(op, s) self.log.debug(' adding ban to the pending review list ...') if op in self.pendingReviews: self.pendingReviews[op].append(msg) else: self.pendingReviews[op] = [msg] elif banTime < reviewAfterTime: # the bans left are even more recent break self.setRegistryValue('reviewTime', now) # update last time reviewed except Exception, e: # I need to catch exceptions as they are silenced self.log.debug('Except: %s' %e) | 2f804a02637686cbbac8414b4c9e49b986d41e01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3106/2f804a02637686cbbac8414b4c9e49b986d41e01/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10725,
38,
634,
12,
2890,
4672,
775,
30,
365,
18,
1330,
18,
4148,
2668,
14294,
364,
324,
634,
716,
1608,
10725,
1372,
6134,
2037,
273,
813,
18,
24816,
957,
12,
957,
18,
75,
10838,
1075... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10725,
38,
634,
12,
2890,
4672,
775,
30,
365,
18,
1330,
18,
4148,
2668,
14294,
364,
324,
634,
716,
1608,
10725,
1372,
6134,
2037,
273,
813,
18,
24816,
957,
12,
957,
18,
75,
10838,
1075... |
invalidate_cache = not getattr(request.cfg.cache, "antispam_blacklist", None) | latest_mtime = 0 | def save(self, editor, newtext, rev, **kw): BLACKLISTPAGES = ["BadContent", "LocalBadContent"] if not editor.page_name in BLACKLISTPAGES: request = editor.request | 529b2b5fbb08f1b46831d636d6dfa32c500abf87 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/888/529b2b5fbb08f1b46831d636d6dfa32c500abf87/antispam.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
4858,
16,
394,
955,
16,
5588,
16,
2826,
9987,
4672,
19238,
3649,
7085,
11219,
55,
273,
8247,
6434,
1350,
3113,
315,
2042,
6434,
1350,
11929,
309,
486,
4858,
18,
2433,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
4858,
16,
394,
955,
16,
5588,
16,
2826,
9987,
4672,
19238,
3649,
7085,
11219,
55,
273,
8247,
6434,
1350,
3113,
315,
2042,
6434,
1350,
11929,
309,
486,
4858,
18,
2433,... |
result = cl.create(**props) except (TypeError, IndexError, ValueError), message: raise UsageError, message | try: result = cl.create(**props) except (TypeError, IndexError, ValueError), message: raise UsageError, message | def create(self, username, password, classname, *args): | d77fbc78c7700367d5ca8553670215519c387c13 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1906/d77fbc78c7700367d5ca8553670215519c387c13/xmlrpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
2718,
16,
2201,
16,
7479,
16,
380,
1968,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
2718,
16,
2201,
16,
7479,
16,
380,
1968,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
def complete(self, metadata, packages, unresolved): | def complete(self, metadata, packages, unresolved, debug=False): | def complete(self, metadata, packages, unresolved): # perhaps cache arch? #arch = [a for a in self.arches if a in metadata.groups][0] # return newpkg, unknown newpkg = set(packages) unknown = set() work = set(unresolved) seen = set() while work: item = work.pop() seen.add(item) if self.is_package(metadata, item): newpkg.add(item) try: work.update(self.get_deps(metadata, item)) except NoData: continue else: # provides dep try: pset = self.get_provides(metadata, item) if len(pset) == 1: work.update(pset) else: if True not in [p in newpkg for p in pset]: # FIXME: still hacky; unchosen multiple provides still not handled unknown.add(item) except NoData: unknown.add(item) work = work.difference(seen) return (newpkg, unknown) | 40dfb90f7e74529c55f68f0d132f19bcc8419615 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11867/40dfb90f7e74529c55f68f0d132f19bcc8419615/Packages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3912,
12,
2890,
16,
1982,
16,
5907,
16,
20573,
16,
1198,
33,
8381,
4672,
468,
26282,
1247,
6637,
35,
468,
991,
273,
306,
69,
364,
279,
316,
365,
18,
991,
281,
309,
279,
316,
1982,
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,
3912,
12,
2890,
16,
1982,
16,
5907,
16,
20573,
16,
1198,
33,
8381,
4672,
468,
26282,
1247,
6637,
35,
468,
991,
273,
306,
69,
364,
279,
316,
365,
18,
991,
281,
309,
279,
316,
1982,
18... |
err_msg = "The number of arrays does not match the number of names" raise ValueError(err_msg) | msg = "The number of arrays does not match the number of names" raise ValueError(msg) | def append_fields(base, names, data=None, dtypes=None, fill_value= -1, usemask=True, asrecarray=False): """ Add new fields to an existing array. The names of the fields are given with the `names` arguments, the corresponding values with the `data` arguments. If a single field is appended, `names`, `data` and `dtypes` do not have to be lists but just values. Parameters ---------- base : array Input array to extend. names : string, sequence String or sequence of strings corresponding to the names of the new fields. data : array or sequence of arrays Array or sequence of arrays storing the fields to add to the base. dtypes : sequence of datatypes Datatype or sequence of datatypes. If None, the datatypes are estimated from the `data`. fill_value : {float}, optional Filling value used to pad missing data on the shorter arrays. usemask : {False, True}, optional Whether to return a masked array or not. asrecarray : {False, True}, optional Whether to return a recarray (MaskedRecords) or not. """ # Check the names if isinstance(names, (tuple, list)): if len(names) != len(data): err_msg = "The number of arrays does not match the number of names" raise ValueError(err_msg) elif isinstance(names, basestring): names = [names, ] data = [data, ] # if dtypes is None: data = [np.array(a, copy=False, subok=True) for a in data] data = [a.view([(name, a.dtype)]) for (name, a) in zip(names, data)] else : if not hasattr(dtypes, '__iter__'): dtypes = [dtypes, ] if len(data) != len(dtypes): if len(dtypes) == 1: dtypes = dtypes * len(data) else: msg = "The dtypes argument must be None, "\ "a single dtype or a list." raise ValueError(msg) data = [np.array(a, copy=False, subok=True, dtype=d).view([(n, d)]) for (a, n, d) in zip(data, names, dtypes)] # base = merge_arrays(base, usemask=usemask, fill_value=fill_value) if len(data) > 1: data = merge_arrays(data, flatten=True, usemask=usemask, fill_value=fill_value) else: data = data.pop() # output = ma.masked_all(max(len(base), len(data)), dtype=base.dtype.descr + data.dtype.descr) output = recursive_fill_fields(base, output) output = recursive_fill_fields(data, output) # return _fix_output(output, usemask=usemask, asrecarray=asrecarray) | f0c3443b27391efb1b14161729e2df8ec24b5fcc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14925/f0c3443b27391efb1b14161729e2df8ec24b5fcc/recfunctions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
67,
2821,
12,
1969,
16,
1257,
16,
501,
33,
7036,
16,
22441,
33,
7036,
16,
3636,
67,
1132,
33,
300,
21,
16,
999,
4455,
33,
5510,
16,
487,
3927,
1126,
33,
8381,
4672,
3536,
1436,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
67,
2821,
12,
1969,
16,
1257,
16,
501,
33,
7036,
16,
22441,
33,
7036,
16,
3636,
67,
1132,
33,
300,
21,
16,
999,
4455,
33,
5510,
16,
487,
3927,
1126,
33,
8381,
4672,
3536,
1436,
... |
self.hboxlayout31.addWidget(self.dnaRestoreFactoryDefaultsPushButton) self.vboxlayout15.addLayout(self.hboxlayout31) self.hboxlayout30.addWidget(self.groupBox) spacerItem30 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) self.hboxlayout30.addItem(spacerItem30) self.gridlayout17.addLayout(self.hboxlayout30,0,0,1,1) | self.hboxlayout34.addWidget(self.dnaRestoreFactoryDefaultsPushButton) self.vboxlayout15.addLayout(self.hboxlayout34) self.hboxlayout33.addWidget(self.groupBox) spacerItem32 = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum) self.hboxlayout33.addItem(spacerItem32) self.gridlayout17.addLayout(self.hboxlayout33,0,0,1,1) | def setupUi(self, UserPrefsDialog): UserPrefsDialog.setObjectName("UserPrefsDialog") UserPrefsDialog.resize(QtCore.QSize(QtCore.QRect(0,0,609,642).size()).expandedTo(UserPrefsDialog.minimumSizeHint())) | 30deb2219e016847d91b37e801c50b75fbd1c3cf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/30deb2219e016847d91b37e801c50b75fbd1c3cf/UserPrefsDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13943,
12,
2890,
16,
2177,
1386,
2556,
6353,
4672,
2177,
1386,
2556,
6353,
18,
542,
16707,
2932,
1299,
1386,
2556,
6353,
7923,
2177,
1386,
2556,
6353,
18,
15169,
12,
23310,
4670,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13943,
12,
2890,
16,
2177,
1386,
2556,
6353,
4672,
2177,
1386,
2556,
6353,
18,
542,
16707,
2932,
1299,
1386,
2556,
6353,
7923,
2177,
1386,
2556,
6353,
18,
15169,
12,
23310,
4670,
18,... |
self.headers = headers | self.headers = headers.copy() | def __init__(self, metalinkfile, headers = {}): Manager.__init__(self) self.local_file = metalinkfile.filename self.size = metalinkfile.size self.chunksums = metalinkfile.get_piece_dict() self.checksums = metalinkfile.hashlist self.urllist = start_sort(metalinkfile.get_url_dict()) self.start_number = 0 self.number = 0 self.count = 1 self.headers = headers | 7c5559704a08cf33830fb1e794a2390e5d401eda /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6425/7c5559704a08cf33830fb1e794a2390e5d401eda/download.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5100,
16194,
768,
16,
1607,
273,
2618,
4672,
8558,
16186,
2738,
972,
12,
2890,
13,
365,
18,
3729,
67,
768,
273,
5100,
16194,
768,
18,
3459,
365,
18,
1467... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5100,
16194,
768,
16,
1607,
273,
2618,
4672,
8558,
16186,
2738,
972,
12,
2890,
13,
365,
18,
3729,
67,
768,
273,
5100,
16194,
768,
18,
3459,
365,
18,
1467... |
s.stdin = self.restricted_stdin s.stdout = self.restricted_stdout s.stderr = self.restricted_stderr sys.stdin = self.delegate_stdin sys.stdout = self.delegate_stdout sys.stderr = self.delegate_stderr | s.stdin = self.restricted_stdin s.stdout = self.restricted_stdout s.stderr = self.restricted_stderr sys.stdin = self.delegate_stdin sys.stdout = self.delegate_stdout sys.stderr = self.delegate_stderr | def set_files(self): | 3ec38f0ee48b31c80510c60b3df0e6bc4dfb89f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3ec38f0ee48b31c80510c60b3df0e6bc4dfb89f9/rexec.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2354,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2354,
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... |
not used. | not used and is hidden by default. | def removeTab(self, index): res = QTabWidget.removeTab(self, index) # note: AFAIK, res is always None if index != -1: # -1 happens! glpane = self._glpane glpane.gl_update_confcorner() # fix bug 2522 (try 2) return res | 78cee7d87681716c89c16ba27c2643c4f3449af4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/78cee7d87681716c89c16ba27c2643c4f3449af4/Ui_PartWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
5661,
12,
2890,
16,
770,
4672,
400,
273,
2238,
5661,
4609,
18,
4479,
5661,
12,
2890,
16,
770,
13,
468,
4721,
30,
432,
2046,
45,
47,
16,
400,
353,
3712,
599,
309,
770,
480,
300,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
5661,
12,
2890,
16,
770,
4672,
400,
273,
2238,
5661,
4609,
18,
4479,
5661,
12,
2890,
16,
770,
13,
468,
4721,
30,
432,
2046,
45,
47,
16,
400,
353,
3712,
599,
309,
770,
480,
300,... |
out += '</record>\n' | else: out += '<datafield tag="FFT" ind1=" " ind2=" "></datafield>\n' out += '</record>\n' | def ffts_to_xml(ffts): """Transform a dictionary: recid -> ffts where ffts is a list of fft dictionary into xml. """ out = '' for recid, ffts in ffts.iteritems(): if ffts: out += '<record>\n' out += '\t<controlfield tag="001">%i</controlfield>\n' % recid for fft in ffts: out += _xml_fft_creator(fft) out += '</record>\n' return out | acdcae7bb74ad7ea78514285c104b3e3b2770626 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/acdcae7bb74ad7ea78514285c104b3e3b2770626/bibdocfilecli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15741,
87,
67,
869,
67,
2902,
12,
25174,
87,
4672,
3536,
4059,
279,
3880,
30,
1950,
350,
317,
15741,
87,
1625,
15741,
87,
353,
279,
666,
434,
15741,
3880,
1368,
2025,
18,
3536,
596,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15741,
87,
67,
869,
67,
2902,
12,
25174,
87,
4672,
3536,
4059,
279,
3880,
30,
1950,
350,
317,
15741,
87,
1625,
15741,
87,
353,
279,
666,
434,
15741,
3880,
1368,
2025,
18,
3536,
596,
27... |
buffer = _makebuf(ovfcheck(mul*input_len)) except (MemoryError,OverflowError,ValueError): raise OperationError( space.w_OverflowError, space.wrap("repeated string is too long: %d %d" % (input_len,mul) )) pos = 0 for i in range(mul): for j in range(len(input)): buffer[pos] = input[j] pos = pos + 1 return space.wrap("".join(buffer)) | buflen = ovfcheck(mul * input_len) except OverflowError: raise OperationError( space.w_OverflowError, space.wrap("repeated string is too long: %d %d" % (input_len, mul))) return space.wrap(''.join([input] * mul)) | def mul_string_times(space, w_str, w_times): try: mul = space.int_w(w_times) except OperationError, e: if e.match(space, space.w_TypeError): raise FailedToImplement raise input = w_str._value if mul < 0: return space.wrap("") input_len = len(input) try: buffer = _makebuf(ovfcheck(mul*input_len)) except (MemoryError,OverflowError,ValueError): # ugh. ValueError is what you get on 64-bit machines for # integers in range(2**31, 2**63). raise OperationError( space.w_OverflowError, space.wrap("repeated string is too long: %d %d" % (input_len,mul) )) pos = 0 for i in range(mul): for j in range(len(input)): buffer[pos] = input[j] pos = pos + 1 return space.wrap("".join(buffer)) | 6da629e347d5d606ed547274bdf79bb4dc1856ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/6da629e347d5d606ed547274bdf79bb4dc1856ae/stringobject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14064,
67,
1080,
67,
8293,
12,
2981,
16,
341,
67,
701,
16,
341,
67,
8293,
4672,
775,
30,
14064,
273,
3476,
18,
474,
67,
91,
12,
91,
67,
8293,
13,
1335,
4189,
668,
16,
425,
30,
309,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14064,
67,
1080,
67,
8293,
12,
2981,
16,
341,
67,
701,
16,
341,
67,
8293,
4672,
775,
30,
14064,
273,
3476,
18,
474,
67,
91,
12,
91,
67,
8293,
13,
1335,
4189,
668,
16,
425,
30,
309,... |
self.oobeVis.arc().setFinal(1) | if self.oobeVis: self.oobeVis.arc().setFinal(1) | def oobe(self): """ Enable a special "out-of-body experience" mouse-interface mode. This can be used when a "god" camera is needed; it moves the camera node out from under its normal node and sets the world up in trackball state. Button events are still sent to the normal mouse action node (e.g. the DriveInterface), and mouse events, if needed, may be sent to the normal node by holding down the Control key. | b102477dcd67d9ba637169911f4021cf587028d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/b102477dcd67d9ba637169911f4021cf587028d6/ShowBase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
320,
947,
73,
12,
2890,
4672,
3536,
9677,
279,
4582,
315,
659,
17,
792,
17,
3432,
31207,
6,
7644,
17,
5831,
1965,
18,
225,
1220,
848,
506,
1399,
1347,
279,
315,
75,
369,
6,
10836,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
320,
947,
73,
12,
2890,
4672,
3536,
9677,
279,
4582,
315,
659,
17,
792,
17,
3432,
31207,
6,
7644,
17,
5831,
1965,
18,
225,
1220,
848,
506,
1399,
1347,
279,
315,
75,
369,
6,
10836,
35... |
for s in xrange(1, signal.NSIG): name = signals_to_names[s] | for s, name in sorted(signals_to_names.items()): | def alarm_received(n, stack): return | a2f3cbb2554a4c572c7164eb53f79b15b815d925 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1534/a2f3cbb2554a4c572c7164eb53f79b15b815d925/signal_getsignal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13721,
67,
15213,
12,
82,
16,
2110,
4672,
327,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
13721,
67,
15213,
12,
82,
16,
2110,
4672,
327,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.__name = templates.normalize( name ) | self.__name = templates.normalize( name ) | def _set_name( self, name ): self.__name = name if not self.__name: self.__opt_is_tmpl_inst = None self.__opt_tmpl_name = None self.__opt_is_full_name = None self.__decl_name_only = None else: self.__opt_is_tmpl_inst = templates.is_instantiation( self.__name ) self.__opt_tmpl_name = templates.name( self.__name ) if self.__opt_is_tmpl_inst: if '::' in self.__opt_tmpl_name: self.__opt_is_full_name = True self.__decl_name_only = self.__opt_tmpl_name.split('::')[-1] else: self.__opt_is_full_name = False self.__decl_name_only = self.__opt_tmpl_name self.__name = templates.normalize( name ) else: if '::' in self.__name: self.__opt_is_full_name = True self.__decl_name_only = self.__name.split('::')[-1] else: self.__opt_is_full_name = False self.__decl_name_only = self.__name | f9adb8fae0e0bf72feac78421db41d3ecaffa3fb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7398/f9adb8fae0e0bf72feac78421db41d3ecaffa3fb/matchers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
529,
12,
365,
16,
508,
262,
30,
365,
16186,
529,
273,
508,
309,
486,
365,
16186,
529,
30,
365,
16186,
3838,
67,
291,
67,
24717,
67,
8591,
273,
599,
365,
16186,
3838,
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,
542,
67,
529,
12,
365,
16,
508,
262,
30,
365,
16186,
529,
273,
508,
309,
486,
365,
16186,
529,
30,
365,
16186,
3838,
67,
291,
67,
24717,
67,
8591,
273,
599,
365,
16186,
3838,
67... |
def on_metadata (self, event, metadata): | def on_metadata(self, event, metadata): | def on_metadata (self, event, metadata): print >> sys.stderr, metadata | 016aec4a85d3438c0d49f1f8b2012e23eb7805ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2207/016aec4a85d3438c0d49f1f8b2012e23eb7805ec/audio.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
4165,
12,
2890,
16,
871,
16,
1982,
4672,
1172,
1671,
2589,
18,
11241,
16,
1982,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
4165,
12,
2890,
16,
871,
16,
1982,
4672,
1172,
1671,
2589,
18,
11241,
16,
1982,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
def init(self, dirname=None): | def init(self, dirname=None, verbose=True): | def init(self, dirname=None): """ Initialize package manager If dirname is None, find wralea files on the system else load directory """ | 08e0221992eac2787b5d06e45ff651f8132f2c6a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11338/08e0221992eac2787b5d06e45ff651f8132f2c6a/pkgmanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
16,
4283,
33,
7036,
16,
3988,
33,
5510,
4672,
3536,
9190,
2181,
3301,
971,
4283,
353,
599,
16,
1104,
12408,
5349,
69,
1390,
603,
326,
2619,
469,
1262,
1867,
3536,
2,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
16,
4283,
33,
7036,
16,
3988,
33,
5510,
4672,
3536,
9190,
2181,
3301,
971,
4283,
353,
599,
16,
1104,
12408,
5349,
69,
1390,
603,
326,
2619,
469,
1262,
1867,
3536,
2,
-1... |
if not options.has_key( "--results-dir" ): options[ "--results-dir" ] = options[ "--locate-root" ] | if not options.has_key( '--results-dir' ): options[ '--results-dir' ] = options[ '--locate-root' ] | def accept_args( args ): ( option_pairs, rest_args ) = getopt.getopt( sys.argv[1:], "", [ "locate-root=" , "tag=" , "expected-results=" , "failures-markup=" , "comment=" , "results-dir=" , "results-prefix=" , "xsltproc=" , "dont-collect-logs" , "reports=" , "help" ] ) options = { "--comment": "" , "--expected-results": "" , "--failures-markup": "" , "--reports" : string.join( report_types, "," ) } map( lambda x: options.__setitem__( x[0], x[1] ), option_pairs ) if ( options.has_key( "--help" ) or len( options.keys() ) == 4 ): usage() sys.exit( 1 ) if not options.has_key( "--results-dir" ): options[ "--results-dir" ] = options[ "--locate-root" ] return ( options[ "--locate-root" ] , options[ "--tag" ] , options[ "--expected-results" ] , options[ "--failures-markup" ] , options[ "--comment" ] , options[ "--results-dir" ] , options[ "--results-prefix" ] , options[ "--xsltproc" ] , options.has_key( '--dont-collect-logs' ) , options[ "--reports" ].split( "," ) ) | 032bc19415907e1c169b60349b3cd5a706b5789e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7959/032bc19415907e1c169b60349b3cd5a706b5789e/report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2791,
67,
1968,
12,
833,
262,
30,
261,
1456,
67,
11545,
16,
3127,
67,
1968,
262,
273,
336,
3838,
18,
588,
3838,
12,
2589,
18,
19485,
63,
21,
30,
6487,
23453,
306,
315,
25450,
17,
308... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2791,
67,
1968,
12,
833,
262,
30,
261,
1456,
67,
11545,
16,
3127,
67,
1968,
262,
273,
336,
3838,
18,
588,
3838,
12,
2589,
18,
19485,
63,
21,
30,
6487,
23453,
306,
315,
25450,
17,
308... |
u"Status: %(Status)s. More information available at %(Show URL)s." | u"Status: %(Status)s. - %(Show URL)s" | def tvshow(self, event, show): retr_info = self.remote_tvrage(show) message = u"Show: %(Show Name)s. Premiered: %(Premiered)s. " \ u"Latest Episode: %(Latest Episode)s. Next Episode: %(Next Episode)s. " \ u"Airtime: %(Airtime)s on %(Network)s. Genres: %(Genres)s." \ u"Status: %(Status)s. More information available at %(Show URL)s." event.addresponse(message, retr_info) | 6e7b20272007b268ab4abc9436afc53c4a8e58f7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12048/6e7b20272007b268ab4abc9436afc53c4a8e58f7/lookup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13521,
4500,
12,
2890,
16,
871,
16,
2405,
4672,
17343,
67,
1376,
273,
365,
18,
7222,
67,
88,
18090,
410,
12,
4500,
13,
225,
883,
273,
582,
6,
5706,
30,
8975,
5706,
1770,
13,
87,
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,
13521,
4500,
12,
2890,
16,
871,
16,
2405,
4672,
17343,
67,
1376,
273,
365,
18,
7222,
67,
88,
18090,
410,
12,
4500,
13,
225,
883,
273,
582,
6,
5706,
30,
8975,
5706,
1770,
13,
87,
18,
... |
if self.series.currentIndex() > -1: mi.series = unicode(self.series.currentText()).strip() | series = unicode(self.series.currentText()).strip() if series: mi.series = series | def get_metadata(self): title, authors = self.get_title_and_authors() mi = MetaInformation(title, authors) publisher = unicode(self.publisher.text()).strip() if publisher: mi.publisher = publisher author_sort = unicode(self.author_sort.text()).strip() if author_sort: mi.author_sort = author_sort comments = unicode(self.comment.toPlainText()).strip() if comments: mi.comments = comments mi.series_index = float(self.series_index.value()) if self.series.currentIndex() > -1: mi.series = unicode(self.series.currentText()).strip() tags = [t.strip() for t in unicode(self.tags.text()).strip().split(',')] if tags: mi.tags = tags | 294556038bf502ee273cb1454aa92b4faecf53b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/294556038bf502ee273cb1454aa92b4faecf53b2/metadata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4165,
12,
2890,
4672,
2077,
16,
14494,
273,
365,
18,
588,
67,
2649,
67,
464,
67,
19368,
1435,
12837,
273,
6565,
5369,
12,
2649,
16,
14494,
13,
12855,
273,
5252,
12,
2890,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4165,
12,
2890,
4672,
2077,
16,
14494,
273,
365,
18,
588,
67,
2649,
67,
464,
67,
19368,
1435,
12837,
273,
6565,
5369,
12,
2649,
16,
14494,
13,
12855,
273,
5252,
12,
2890,
18,
... |
factoid = factoids[0][0] | factoid = session.query(Factoid).get(factoids[0][0].id) | def forget(self, event, name, number, pattern): session = ibid.databases.ibid() factoids = get_factoid(session, name, number, pattern, True) if factoids: factoidadmin = auth_responses(event, u'factoidadmin') identities = get_identities(event, session) factoid = factoids[0][0] | f124ab089dae73ac881b8ce99840d1ea41a5a697 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12048/f124ab089dae73ac881b8ce99840d1ea41a5a697/factoid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13776,
12,
2890,
16,
871,
16,
508,
16,
1300,
16,
1936,
4672,
1339,
273,
9834,
350,
18,
3404,
19684,
18,
495,
350,
1435,
5410,
21061,
273,
336,
67,
3493,
839,
12,
3184,
16,
508,
16,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13776,
12,
2890,
16,
871,
16,
508,
16,
1300,
16,
1936,
4672,
1339,
273,
9834,
350,
18,
3404,
19684,
18,
495,
350,
1435,
5410,
21061,
273,
336,
67,
3493,
839,
12,
3184,
16,
508,
16,
1... |
box.connect_after("size-allocate", lambda b,a: | box.connect_after("size-allocate", lambda box,a: | def on_box_expose_event (box, event): allocation = box.allocation box.style.paint_flat_box (box.window, gtk.STATE_NORMAL, gtk.SHADOW_NONE, None, box, "tooltip", allocation.x, allocation.y, allocation.width, allocation.height) if not hasattr(box, "hasHadFirstDraw") or not box.hasHadFirstDraw: box.queue_draw() box.hasHadFirstDraw = True | 2ff715102e82e3c6a9c59fd27410ef9d6afcf9d2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5339/2ff715102e82e3c6a9c59fd27410ef9d6afcf9d2/uistuff.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
2147,
67,
338,
4150,
67,
2575,
261,
2147,
16,
871,
4672,
13481,
273,
3919,
18,
29299,
3919,
18,
4060,
18,
84,
1598,
67,
15401,
67,
2147,
261,
2147,
18,
5668,
16,
22718,
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,
603,
67,
2147,
67,
338,
4150,
67,
2575,
261,
2147,
16,
871,
4672,
13481,
273,
3919,
18,
29299,
3919,
18,
4060,
18,
84,
1598,
67,
15401,
67,
2147,
261,
2147,
18,
5668,
16,
22718,
18,
... |
softspace = f.softspace | def testAttributes(self): # verify expected attributes exist f = self.f softspace = f.softspace f.name # merely shouldn't blow up f.mode # ditto f.closed # ditto | dfe2107481a50de707af046a34288b80182b013f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/dfe2107481a50de707af046a34288b80182b013f/test_file.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2498,
12,
2890,
4672,
468,
3929,
2665,
1677,
1005,
284,
273,
365,
18,
74,
225,
284,
18,
529,
377,
468,
4045,
2357,
12044,
1404,
324,
821,
731,
284,
18,
3188,
377,
468,
302,
305,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1842,
2498,
12,
2890,
4672,
468,
3929,
2665,
1677,
1005,
284,
273,
365,
18,
74,
225,
284,
18,
529,
377,
468,
4045,
2357,
12044,
1404,
324,
821,
731,
284,
18,
3188,
377,
468,
302,
305,
... | |
if is_a_non_log_line(line): currentLine.append_non_log_line(line.raw.strip()) else: currentLine.append_text(line.raw) | if line.raw.strip(): if is_a_non_log_line(line): currentLine.append_non_log_line(line.raw.strip()) else: currentLine.append_text(line.raw) | def translate_lines(translated_lines): translatedLines = [] currentLine = None for line in translated_lines: if line_is_a_new_entry(line): if currentLine != None: translatedLines.append(currentLine) set_timestamp_speaker_and_text(line) currentLine = line elif currentLine != None: if is_a_non_log_line(line): currentLine.append_non_log_line(line.raw.strip()) else: currentLine.append_text(line.raw) else: errors.append("Encountered An initial Line without nominal timestamp: \n%s" % line.raw) translatedLines.append(currentLine) return translatedLines | 593d2914061a32a2df36daf4cf6fd11f1e653da5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13780/593d2914061a32a2df36daf4cf6fd11f1e653da5/MCShred.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
67,
3548,
12,
22899,
67,
3548,
4672,
9955,
5763,
273,
5378,
22325,
273,
599,
225,
364,
980,
316,
9955,
67,
3548,
30,
309,
980,
67,
291,
67,
69,
67,
2704,
67,
4099,
12,
1369,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4204,
67,
3548,
12,
22899,
67,
3548,
4672,
9955,
5763,
273,
5378,
22325,
273,
599,
225,
364,
980,
316,
9955,
67,
3548,
30,
309,
980,
67,
291,
67,
69,
67,
2704,
67,
4099,
12,
1369,
46... |
"HH21": atom_info("H", 0, "H'"), | "HH21": atom_info("H", 0, "H"), | def keys(self): return ("element_symbol", "ionic_state", "scattering_label") | 46b20303e8ed53745807da84c39cb29f25aa3911 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/46b20303e8ed53745807da84c39cb29f25aa3911/residue_info.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1311,
12,
2890,
4672,
327,
7566,
2956,
67,
7175,
3113,
315,
285,
335,
67,
2019,
3113,
315,
31320,
310,
67,
1925,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1311,
12,
2890,
4672,
327,
7566,
2956,
67,
7175,
3113,
315,
285,
335,
67,
2019,
3113,
315,
31320,
310,
67,
1925,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
for proposed_encoding in (result['encoding'], xml_encoding, sniffed_xml_encoding, 'utf-8', 'windows-1252'): | for proposed_encoding in (result['encoding'], xml_encoding, sniffed_xml_encoding): if not proposed_encoding: continue | def parse(url_file_stream_or_string, etag=None, modified=None, agent=None, referrer=None, handlers=[]): '''Parse a feed from a URL, file, stream, or string''' result = FeedParserDict() result['feed'] = FeedParserDict() result['entries'] = [] if _XML_AVAILABLE: result['bozo'] = 0 if type(handlers) == types.InstanceType: handlers = [handlers] try: f = _open_resource(url_file_stream_or_string, etag, modified, agent, referrer, handlers) data = f.read() except Exception, e: result['bozo'] = 1 result['bozo_exception'] = e data = '' f = None # if feed is gzip-compressed, decompress it if f and data and hasattr(f, 'headers'): if gzip and f.headers.get('content-encoding', '') == 'gzip': try: data = gzip.GzipFile(fileobj=_StringIO(data)).read() except Exception, e: # Some feeds claim to be gzipped but they're not, so # we get garbage. Ideally, we should re-request the # feed without the 'Accept-encoding: gzip' header, # but we don't. result['bozo'] = 1 result['bozo_exception'] = e data = '' elif zlib and f.headers.get('content-encoding', '') == 'deflate': try: data = zlib.decompress(data, -zlib.MAX_WBITS) except Exception, e: result['bozo'] = 1 result['bozo_exception'] = e data = '' # save HTTP headers if hasattr(f, 'info'): info = f.info() result['etag'] = info.getheader('ETag') last_modified = info.getheader('Last-Modified') if last_modified: result['modified'] = _parse_date(last_modified) if hasattr(f, 'url'): result['href'] = f.url result['status'] = 200 if hasattr(f, 'status'): result['status'] = f.status if hasattr(f, 'headers'): result['headers'] = f.headers.dict if hasattr(f, 'close'): f.close() # there are four encodings to keep track of: # - http_encoding is the encoding declared in the Content-Type HTTP header # - xml_encoding is the encoding declared in the <?xml declaration # - sniffed_encoding is the encoding sniffed from the first 4 bytes of the XML data # - result['encoding'] is the actual encoding, as per RFC 3023 and a variety of other conflicting specifications http_headers = result.get('headers', {}) result['encoding'], http_encoding, xml_encoding, sniffed_xml_encoding, acceptable_content_type = \ _getCharacterEncoding(http_headers, data) if http_headers and (not acceptable_content_type): if http_headers.has_key('content-type'): bozo_message = '%s is not an XML media type' % http_headers['content-type'] else: bozo_message = 'no Content-type specified' result['bozo'] = 1 result['bozo_exception'] = NonXMLContentType(bozo_message) result['version'], data = _stripDoctype(data) baseuri = http_headers.get('content-location', result.get('href')) baselang = http_headers.get('content-language', None) # if server sent 304, we're done if result.get('status', 0) == 304: result['version'] = '' result['debug_message'] = 'The feed has not changed since you last checked, ' + \ 'so the server sent no data. This is a feature, not a bug!' return result # if there was a problem downloading, we're done if not data: return result # determine character encoding use_strict_parser = 0 known_encoding = 0 tried_encodings = [] for proposed_encoding in (result['encoding'], xml_encoding, sniffed_xml_encoding, 'utf-8', 'windows-1252'): if proposed_encoding in tried_encodings: continue if not proposed_encoding: continue try: data = _toUTF8(data, proposed_encoding) known_encoding = 1 use_strict_parser = 1 break except: pass tried_encodings.append(proposed_encoding) if not known_encoding: result['bozo'] = 1 result['bozo_exception'] = CharacterEncodingUnknown( \ 'document encoding unknown, I tried ' + \ '%s, %s, utf-8, and windows-1252 but nothing worked' % \ (result['encoding'], xml_encoding)) result['encoding'] = '' elif proposed_encoding != result['encoding']: result['bozo'] = 1 result['bozo_exception'] = CharacterEncodingOverride( \ 'documented declared as %s, but parsed as %s' % \ (result['encoding'], proposed_encoding)) result['encoding'] = proposed_encoding if not _XML_AVAILABLE: use_strict_parser = 0 if use_strict_parser: # initialize the SAX parser feedparser = _StrictFeedParser(baseuri, baselang, 'utf-8') saxparser = xml.sax.make_parser(PREFERRED_XML_PARSERS) saxparser.setFeature(xml.sax.handler.feature_namespaces, 1) saxparser.setContentHandler(feedparser) saxparser.setErrorHandler(feedparser) source = xml.sax.xmlreader.InputSource() source.setByteStream(_StringIO(data)) if hasattr(saxparser, '_ns_stack'): # work around bug in built-in SAX parser (doesn't recognize xml: namespace) # PyXML doesn't have this problem, and it doesn't have _ns_stack either saxparser._ns_stack.append({'http://www.w3.org/XML/1998/namespace':'xml'}) try: saxparser.parse(source) except Exception, e: if _debug: import traceback traceback.print_stack() traceback.print_exc() sys.stderr.write('xml parsing failed\n') result['bozo'] = 1 result['bozo_exception'] = feedparser.exc or e use_strict_parser = 0 if not use_strict_parser: feedparser = _LooseFeedParser(baseuri, baselang, known_encoding and 'utf-8' or '') feedparser.feed(data) result['feed'] = feedparser.feeddata result['entries'] = feedparser.entries result['version'] = result['version'] or feedparser.version result['namespaces'] = feedparser.namespacesInUse return result | 4ba0ae4f5103ae0c0855788bb03943581b869ce2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/4ba0ae4f5103ae0c0855788bb03943581b869ce2/feedparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
718,
67,
768,
67,
3256,
67,
280,
67,
1080,
16,
13655,
33,
7036,
16,
4358,
33,
7036,
16,
4040,
33,
7036,
16,
14502,
33,
7036,
16,
4919,
33,
8526,
4672,
9163,
3201,
279,
4746... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
718,
67,
768,
67,
3256,
67,
280,
67,
1080,
16,
13655,
33,
7036,
16,
4358,
33,
7036,
16,
4040,
33,
7036,
16,
14502,
33,
7036,
16,
4919,
33,
8526,
4672,
9163,
3201,
279,
4746... |
coinc_event_id = coinc_event_id_base + str(UID) | def populate_inspiral_tables(MBTA_frame, UID, set_keys = MBTA_set_keys, \ process_id = 'process:process_id:0', \ event_id_dict = insp_event_id_dict, \ coinc_event_id_base=InspiralCoincIdBase): """ create xml file and populate the SnglInspiral and CoincInspiral tables from a coinc .gwf file from MBTA xmldoc: xml file to append the tables to MBTA_frame: frame file to get info about triggers from set_keys: columns in the SnglInspiral Table to set process_id: process_id event_id_dict: {ifo:event_id} dictionary to assign event_id's coinc_event_id: coinc_event_id detectors: detectors participating in the coinc returns xmldoc and contents of the comment field """ #initialize xml document xmldoc = ligolw.Document() xmldoc.appendChild(ligolw.LIGO_LW()) #dictionaries to store about individual triggers end_time_s = {} end_time_ns = {} snr = {} mass1 = {} mass2 = {} Deff = {} mchirp = {} eta = {} #extract the information from the frame file events = Fr.frgetevent(MBTA_frame) #get the ifos from the event name for event in events: if 'MbtaHLV' in event['name']: detectors = H1L1V1_detlist elif 'MbtaHL' in event['name']: detectors = H1L1_detlist elif 'MbtaHV' in event['name']: detectors = H1V1_detlist elif 'MbtaH' in event['name']: detectors = H1_detlist elif 'MbtaLV' in event['name']: detectors = L1V1_detlist elif 'MbtaL' in event['name']: detectors = L1_detlist elif 'MbtaV' in event['name']: detectors = V1_detlist else: raise ValueError, "Invalid FrEvent name" log_data = event['comment'] + '\n' far = [line.split(':')[1].split()[0] for line in log_data.splitlines() if \ 'False Alarm Rate' in line][0] for ifo in detectors: end_time_s[ifo], end_time_ns[ifo] = str(event[ifo+':end_time']).split('.') snr[ifo] = float(event[ifo+':SNR']) mass1[ifo] = float(event[ifo+':mass1']) mass2[ifo] = float(event[ifo+':mass2']) mchirp[ifo], eta[ifo] = compute_mchirp_eta(mass1[ifo],mass2[ifo]) Deff[ifo] = float(event[ifo+':eff_distance']) #fill the SnglInspiralTable sin_table = lsctables.New(lsctables.SnglInspiralTable) xmldoc.childNodes[0].appendChild(sin_table) for ifo in detectors: row = sin_table.RowType() row.ifo = ifo row.search = 'MBTA' row.end_time = int(end_time_s[ifo]) row.end_time_ns = int(end_time_ns[ifo]) row.mass1 = mass1[ifo] row.mass2 = mass2[ifo] row.mchirp = mchirp[ifo] row.mtotal = mass1[ifo] + mass2[ifo] row.eta = eta[ifo] row.snr = snr[ifo] row.eff_distance = Deff[ifo] row.event_id = event_id_dict[ifo] row.process_id = process_id row.channel = '' #zero out the rest of the columns #should work in chi2 and chi2cut for key in sin_table.validcolumns.keys(): if key not in set_keys: setattr(row,key,None) sin_table.append(row) #CoincInspiralTable #using the conventions found in: #https://www.lsc-group.phys.uwm.edu/ligovirgo/cbcnote/S6Plan/ #090505160219S6PlanningNotebookCoinc_and_Experiment_Tables_ihope_implementation? #highlight=%28coinc%29|%28table%29 if len(detectors) < 2: return xmldoc, log_data, detectors coinc_event_id = coinc_event_id_base + str(UID) cin_table = lsctables.New(lsctables.CoincInspiralTable) xmldoc.childNodes[0].appendChild(cin_table) row = cin_table.RowType() row.set_ifos(detectors) row.coinc_event_id = coinc_event_id row.end_time = int(end_time_s['H1']) row.end_time_ns = int(end_time_ns['H1']) row.mass = (sum(mass1.values()) + sum(mass2.values()))/3 row.mchirp = sum(mchirp.values())/3 #the snr here is really the snr NOT effective snr row.snr = pow(sum([x*x for x in snr.values()]),0.5) #far is triggers/day row.false_alarm_rate = float(far) row.combined_far = 0 cin_table.append(row) return xmldoc, log_data, detectors | eef4ba73b78b2df6877b14e65982a2b0927a899b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3589/eef4ba73b78b2df6877b14e65982a2b0927a899b/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
67,
267,
1752,
481,
287,
67,
9373,
12,
7969,
9833,
67,
3789,
16,
10034,
16,
444,
67,
2452,
273,
17897,
9833,
67,
542,
67,
2452,
16,
521,
1207,
67,
350,
273,
296,
2567,
30,
2567... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
67,
267,
1752,
481,
287,
67,
9373,
12,
7969,
9833,
67,
3789,
16,
10034,
16,
444,
67,
2452,
273,
17897,
9833,
67,
542,
67,
2452,
16,
521,
1207,
67,
350,
273,
296,
2567,
30,
2567... | |
self.directory=self.args["ComponentDir"] self.loadDict(self.failedJobsPublished,"failedJobsPublished") self.loadDict(self.cmsErrorJobs,"cmsErrorJobs") | def __init__(self, **args): self.args = {} self.args.setdefault("PollInterval", 10 ) self.args.setdefault("jobsToPoll", 100) self.args.setdefault("ComponentDir","/tmp") | b299645affb60052912599346c5588880cf6034e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8887/b299645affb60052912599346c5588880cf6034e/TrackingComponent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2826,
1968,
4672,
225,
365,
18,
1968,
273,
2618,
365,
18,
1968,
18,
542,
1886,
2932,
19085,
4006,
3113,
1728,
262,
365,
18,
1968,
18,
542,
1886,
2932,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2826,
1968,
4672,
225,
365,
18,
1968,
273,
2618,
365,
18,
1968,
18,
542,
1886,
2932,
19085,
4006,
3113,
1728,
262,
365,
18,
1968,
18,
542,
1886,
2932,
10... | |
return images[index] | if isinstance(index, int): return images[0] else: return images | def read_netcdf(filename, index=-1): nc = NetCDFFile(filename) dims = nc.dimensions vars = nc.variables positions = vars['CartesianPositions'] numbers = vars['AtomicNumbers'][:] pbc = vars['BoundaryConditions'][:] cell = vars['UnitCell'] tags = vars['Tags'][:] if not tags.any(): tags = None magmoms = vars['MagneticMoments'][:] if not magmoms.any(): magmoms = None nimages = positions.shape[0] attach_calculator = False if 'PotentialEnergy' in vars: energy = vars['PotentialEnergy'] attach_calculator = True else: energy = nimages * [None] if 'CartesianForces' in vars: forces = vars['CartesianForces'] attach_calculator = True else: forces = nimages * [None] if 'Stress' in vars: stress = vars['Stress'] attach_calculator = True else: stress = nimages * [None] if isinstance(index, int): indices = [index] else: indices = range(nimages)[index] images = [] for i in indices: atoms = Atoms(positions=positions[i], numbers=numbers, cell=cell[i], pbc=pbc, tags=tags, magmoms=magmoms) if attach_calculator: calc = SinglePointCalculator(energy[i], forces[i], stress[i], None, atoms) ### Fixme magmoms atoms.set_calculator(calc) images.append(atoms) return images[index] | 922cf40ce45cb84325dd44057bcdedd1b19d0aeb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1380/922cf40ce45cb84325dd44057bcdedd1b19d0aeb/netcdf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
2758,
24799,
12,
3459,
16,
770,
29711,
21,
4672,
8194,
273,
8503,
39,
4577,
812,
12,
3459,
13,
9914,
273,
8194,
18,
14797,
4153,
273,
8194,
18,
7528,
225,
6865,
273,
4153,
329... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2758,
24799,
12,
3459,
16,
770,
29711,
21,
4672,
8194,
273,
8503,
39,
4577,
812,
12,
3459,
13,
9914,
273,
8194,
18,
14797,
4153,
273,
8194,
18,
7528,
225,
6865,
273,
4153,
329... |
c = COWBase | c = COWBase.copy() | def testCow(self): from bb.COW import COWBase c = COWBase c['123'] = 1027 c['other'] = 4711 c['d'] = { 'abc' : 10, 'bcd' : 20 } | abb0b687bc0cc376745617c7c266fa82570e3cc6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2672/abb0b687bc0cc376745617c7c266fa82570e3cc6/cowtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
39,
543,
12,
2890,
4672,
628,
7129,
18,
3865,
59,
1930,
385,
7306,
2171,
276,
273,
385,
7306,
2171,
18,
3530,
1435,
276,
3292,
12936,
3546,
273,
1728,
5324,
276,
3292,
3011,
3546,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
39,
543,
12,
2890,
4672,
628,
7129,
18,
3865,
59,
1930,
385,
7306,
2171,
276,
273,
385,
7306,
2171,
18,
3530,
1435,
276,
3292,
12936,
3546,
273,
1728,
5324,
276,
3292,
3011,
3546,
... |
if stack[-1][0][1] > 0: | if stack[-1][0].register > 0: | def compile(pattern, flags=0): stack = [] index = 0 label = 0 register = 1 groupindex = {} callouts = [] while (index < len(pattern)): char = pattern[index] index = index + 1 if char == '\\': if index < len(pattern): next = pattern[index] index = index + 1 if next == 't': stack.append([Exact(chr(9))]) elif next == 'n': stack.append([Exact(chr(10))]) elif next == 'r': stack.append([Exact(chr(13))]) elif next == 'f': stack.append([Exact(chr(12))]) elif next == 'a': stack.append([Exact(chr(7))]) elif next == 'e': stack.append([Exact(chr(27))]) elif next in '0123456789': value = next while (index < len(pattern)) and \ (pattern[index] in string.digits): value = value + pattern[index] index = index + 1 if (len(value) == 3) or \ ((len(value) == 2) and (value[0] == '0')): value = string.atoi(value, 8) if value > 255: raise error, 'octal char out of range' stack.append([Exact(chr(value))]) elif value == '0': stack.append([Exact(chr(0))]) elif len(value) > 3: raise error, 'too many digits' else: value = string.atoi(value) if value >= register: raise error, ('cannot reference a register ' 'not yet used') elif value == 0: raise error, ('register 0 cannot be used ' 'during match') stack.append([MatchMemory(value)]) elif next == 'x': value = '' while (index < len(pattern)) and \ (pattern[index] in string.hexdigits): value = value + pattern[index] index = index + 1 value = string.atoi(value, 16) if value > 255: raise error, 'hex char out of range' stack.append([Exact(chr(value))]) elif next == 'c': if index >= len(pattern): raise error, '\\c at end of re' elif pattern[index] in 'abcdefghijklmnopqrstuvwxyz': stack.append(Exact(chr(ord(pattern[index]) - ord('a') + 1))) else: stack.append(Exact(chr(ord(pattern[index]) ^ 64))) index = index + 1 elif next == 'A': stack.append([BegBuf()]) elif next == 'Z': stack.append([EndBuf()]) elif next == 'b': stack.append([WordBound()]) elif next == 'B': stack.append([NotWordBound()]) elif next == 'w': stack.append([SyntaxSpec('word')]) elif next == 'W': stack.append([NotSyntaxSpec('word')]) elif next == 's': stack.append([SyntaxSpec('whitespace')]) elif next == 'S': stack.append([NotSyntaxSpec('whitespace')]) elif next == 'd': stack.append([SyntaxSpec('digit')]) elif next == 'D': stack.append([NotSyntaxSpec('digit')]) elif next in 'GluLUQE': # some perl-isms that we don't support raise error, '\\' + next + ' not supported' else: stack.append([Exact(pattern[index])]) else: raise error, 'backslash at the end of a string' elif char == '|': if len(stack) == 0: raise error, 'nothing to alternate' expr = [] while (len(stack) != 0) and \ (stack[-1][0].name != '(') and \ (stack[-1][0].name != '|'): expr = stack[-1] + expr del stack[-1] stack.append([FailureJump(label)] + \ expr + \ [Jump(-1), Label(label)]) stack.append([('|',)]) label = label + 1 elif char == '(': if index >= len(pattern): raise error, 'no matching close paren' elif pattern[index] == '?': # Perl style (?...) extensions index = index + 1 if index >= len(pattern): raise error, 'extension ends prematurely' elif pattern[index] == 'P': # Python extensions index = index + 1 if index >= len(pattern): raise error, 'extension ends prematurely' elif pattern[index] == '<': # Handle Python symbolic group names (?<...>...) index = index + 1 end = string.find(pattern, '>', index) if end == -1: raise error, 'no end to symbolic group name' name = pattern[index:end] # XXX check syntax of name index = end + 1 groupindex[name] = register stack.append([OpenParen(register)]) register = register + 1 elif pattern[index] == '=': # backreference to symbolic group name if index >= len(pattern): raise error, '(?P= at the end of the pattern' start = index + 1 end = string.find(pattern, ')', start) if end == -1: raise error, 'no ) to end symbolic group name' name = pattern[start:end] if name not in groupindex: raise error, ('symbolic group name ' + name + \ ' has not been used yet') stack.append([MatchMemory(groupindex[name])]) index = end + 1 elif pattern[index] == '!': # function callout if index >= len(pattern): raise error, 'no function callout name' start = index + 1 end = string.find(pattern, ')', start) if end == -1: raise error, 'no ) to end function callout name' name = pattern[start:end] if name not in callouts: raise error, ('function callout name not listed ' 'in callouts dict') stack.append([FunctionCallout(name)]) else: raise error, 'unknown Python extension' elif pattern[index] == ':': # grouping, but no registers index = index + 1 stack.append([('(', -1)]) elif pattern[index] == '#': # comment index = index + 1 end = string.find(pattern, ')', index) if end == -1: raise error, 'no end to comment' index = end + 1 elif pattern[index] == '=': raise error, ('zero-width positive lookahead ' 'assertion is unsupported') elif pattern[index] == '!': raise error, ('zero-width negative lookahead ' 'assertion is unsupported') elif pattern[index] in 'iImMsSxX': while (index < len(pattern)) and (pattern[index] != ')'): if pattern[index] == 'iI': flags = flags | IGNORECASE elif pattern[index] == 'mM': flags = flags | MULTILINE elif pattern[index] == 'sS': flags = flags | DOTALL elif pattern[index] in 'xX': flags = flags | VERBOSE else: raise error, 'unknown flag' index = index + 1 index = index + 1 else: raise error, 'unknown extension' else: stack.append([OpenParen(register)]) register = register + 1 elif char == ')': # make one expression out of everything on the stack up to # the marker left by the last parenthesis expr = [] while (len(stack) > 0) and (stack[-1][0].name != '('): expr = stack[-1] + expr del stack[-1] if len(stack) == 0: raise error, 'too many close parens' if len(expr) == 0: raise error, 'nothing inside parens' # check to see if alternation used correctly if (expr[-1].name == '|'): raise error, 'alternation with nothing on the right' # remove markers left by alternation expr = filter(lambda x: x.name != '|', expr) # clean up jumps inserted by alternation need_label = 0 for i in range(len(expr)): if (expr[i].name == 'jump') and (expr[i].label == -1): expr[i] = JumpOpcode(label) need_label = 1 if need_label: expr.append(Label(label)) label = label + 1 if stack[-1][0][1] > 0: expr = [StartMemory(stack[-1][0].register)] + \ expr + \ [EndMemory(stack[-1][0].register)] del stack[-1] stack.append(expr) elif char == '{': if len(stack) == 0: raise error, 'no expression to repeat' end = string.find(pattern, '}', index) if end == -1: raise error, ('no close curly bracket to match' ' open curly bracket') fields = map(string.strip, string.split(pattern[index:end], ',')) index = end + 1 minimal = 0 if (index < len(pattern)) and (pattern[index] == '?'): minimal = 1 index = index + 1 if len(fields) == 1: # {n} or {n}? (there's really no difference) try: count = string.atoi(fields[0]) except ValueError: raise error, ('count must be an integer ' 'inside curly braces') if count > 65535: raise error, 'repeat count out of range' expr = [] while count > 0: expr = expr + stack[-1] count = count - 1 del stack[-1] stack.append(expr) elif len(fields) == 2: # {n,} or {n,m} if fields[1] == '': # {n,} try: min = string.atoi(fields[0]) except ValueError: raise error, ('minimum must be an integer ' 'inside curly braces') if min > 65535: raise error, 'minimum repeat count out of range' expr = [] while min > 0: expr = expr + stack[-1] min = min - 1 registers = registers_used(stack[-1]) if minimal: expr = expr + \ ([Jump(label + 1), Label(label)] + \ stack[-1] + \ [Label(label + 1), FailureJump(label, registers)]) else: expr = expr + \ ([Label(label), FailureJump(label + 1, registers)] + stack[-1] + [StarJump(label), Label(label + 1)]) del stack[-1] stack.append(expr) label = label + 2 else: # {n,m} try: min = string.atoi(fields[0]) except ValueError: raise error, ('minimum must be an integer ' 'inside curly braces') try: max = string.atoi(fields[1]) except ValueError: raise error, ('maximum must be an integer ' 'inside curly braces') if min > 65535: raise error, ('minumim repeat count out ' 'of range') if max > 65535: raise error, ('maximum repeat count out ' 'of range') if min > max: raise error, ('minimum repeat count must be ' 'less than the maximum ' 'repeat count') expr = [] while min > 0: expr = expr + stack[-1] min = min - 1 max = max - 1 if minimal: while max > 0: expr = expr + \ [FailureJump(label), Jump(label + 1), Label(label)] + \ stack[-1] + \ [Label(label + 1)] label = label + 2 del stack[-1] stack.append(expr) else: while max > 0: expr = expr + \ [FailureJump(label)] + \ stack[-1] max = max - 1 del stack[-1] stack.append(expr + [Label(label)]) label = label + 1 else: raise error, ('there need to be one or two fields ' 'in a {} expression') index = end + 1 elif char == '}': raise error, 'unbalanced close curly brace' elif char == '*': # Kleene closure if len(stack) == 0: raise error, 'the Kleene closure needs something to repeat' registers = registers_used(stack[-1]) if (index < len(pattern)) and (pattern[index] == '?'): # non-greedy matching expr = [JumpInstructions(label + 1), Label(label)] + \ stack[-1] + \ [Label(label + 1), FailureJump(label)] index = index + 1 else: # greedy matching expr = [Label(label), FailureJump(label + 1)] + \ stack[-1] + \ [StarJump(label), Label(label + 1)] del stack[-1] stack.append(expr) label = label + 2 elif char == '+': # positive closure if len(stack) == 0: raise error, 'the positive closure needs something to repeat' registers = registers_used(stack[-1]) if (index < len(pattern)) and (pattern[index] == '?'): # non-greedy expr = [Label(label)] + \ stack[-1] + \ [FailureJump(label)] label = label + 1 index = index + 1 else: # greedy expr = [DummyFailureJump(label + 1), Label(label), FailureJump(label + 2), Label(label + 1)] + \ stack[-1] + \ [StarJump(label), Label(label + 2)] label = label + 3 del stack[-1] stack.append(expr) elif char == '?': if len(stack) == 0: raise error, 'need something to be optional' registers = registers_used(stack[-1]) if (index < len(pattern)) and (pattern[index] == '?'): # non-greedy matching expr = [FailureJump(label), Jump(label + 1), Label(label)] + \ stack[-1] + \ [Label(label + 1)] label = label + 2 index = index + 1 else: # greedy matching expr = [FailureJump(label)] + \ stack[-1] + \ [Label(label)] label = label + 1 del stack[-1] stack.append(expr) elif char == '.': if flags & DOTALL: stack.append(Set(map(chr, range(256)))) else: stack.append([AnyChar()]) elif char == '^': if flags & MULTILINE: stack.append([Bol()]) else: stack.append([BegBuf()]) elif char == '$': if flags & MULTILINE: stack.append([Eol()]) else: stack.append([EndBuf()]) elif char == '#': if flags & VERBOSE: # comment index = index + 1 end = string.find(pattern, '\n', index) if end == -1: index = len(pattern) else: index = end + 1 else: stack.append([Exact(char)]) elif char in string.whitespace: if flags & VERBOSE: stack.append([Exact(char)]) elif char == '[': if index >= len(pattern): raise error, 'incomplete set' negate = 0 last = '' set = [] if pattern[index] == '^': negate = 1 index = index + 1 if index >= len(pattern): raise error, 'incomplete set' if pattern[index] in ']-': set.append(pattern[index]) last = pattern[index] index = index + 1 while (index < len(pattern)) and (pattern[index] != ']'): next = pattern[index] index = index + 1 if next == '-': if (index >= len(pattern)) or (pattern[index] == ']'): raise error, 'incomplete range in set' if last > pattern[index]: raise error, 'range arguments out of order in set' for next in map(chr, \ range(ord(last), \ ord(pattern[index]) + 1)): if next not in set: set.append(next) last = '' index = index + 1 elif next == '\\': # expand syntax meta-characters and add to set if index >= len(pattern): raise error, 'incomplete set' elif (pattern[index] == ']'): raise error, 'backslash at the end of a set' elif pattern[index] == 'w': for next in syntax_table.keys(): if 'word' in syntax_table[next]: set.append(next) elif pattern[index] == 'W': for next in syntax_table.keys(): if 'word' not in syntax_table[next]: set.append(next) elif pattern[index] == 'd': for next in syntax_table.keys(): if 'digit' in syntax_table[next]: set.append(next) elif pattern[index] == 'D': for next in syntax_table.keys(): if 'digit' not in syntax_table[next]: set.append(next) elif pattern[index] == 's': for next in syntax_table.keys(): if 'whitespace' in syntax_table[next]: set.append(next) elif pattern[index] == 'S': for next in syntax_table.keys(): if 'whitespace' not in syntax_table[next]: set.append(next) else: raise error, 'unknown meta in set' last = '' index = index + 1 else: if next not in set: set.append(next) last = next if pattern[index] != ']': raise error, 'incomplete set' index = index + 1 if negate: notset = [] for char in map(chr, range(256)): if char not in set: notset.append(char) stack.append([Set(notset)]) else: stack.append([Set(set)]) else: stack.append([Exact(char)]) code = [] while len(stack) > 0: if stack[-1][0].name == '(': raise error, 'too many open parens' code = stack[-1] + code del stack[-1] if len(code) == 0: raise error, 'no code generated' if (code[-1].name == '|'): raise error, 'alternation with nothing on the right' code = filter(lambda x: x.name != '|', code) need_label = 0 for i in range(len(code)): if (code[i].name == 'jump') and (code[i].label == -1): code[i] = Jump(label) need_label = 1 if need_label: code.append(Label(label)) label = label + 1 code.append(End()) return RegexObject(pattern, flags, code, register, groupindex, callouts) | 63e18195b8b7a064488d106537703861f08aa415 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/63e18195b8b7a064488d106537703861f08aa415/re.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
12,
4951,
16,
2943,
33,
20,
4672,
2110,
273,
5378,
770,
273,
374,
1433,
273,
374,
1744,
273,
404,
1041,
1615,
273,
2618,
1443,
383,
12940,
273,
5378,
1323,
261,
1615,
411,
562,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
12,
4951,
16,
2943,
33,
20,
4672,
2110,
273,
5378,
770,
273,
374,
1433,
273,
374,
1744,
273,
404,
1041,
1615,
273,
2618,
1443,
383,
12940,
273,
5378,
1323,
261,
1615,
411,
562,
1... |
This header is ``start-stop/length``, where stop and length can be ``*`` (represented as None in the attributes). | This header is ``start-stop/length``, where start-stop and length can be ``*`` (represented as None in the attributes). | def parse_bytes(header): """ Parse a Range header into (bytes, list_of_ranges). ranges in list_of_ranges are non-inclusive (unlike the HTTP header). | 0ce404fed71cb51ab19f2aa8a8a788bb693b7f53 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12287/0ce404fed71cb51ab19f2aa8a8a788bb693b7f53/byterange.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
3890,
12,
3374,
4672,
3536,
2884,
279,
8086,
1446,
1368,
261,
3890,
16,
666,
67,
792,
67,
14530,
2934,
7322,
316,
666,
67,
792,
67,
14530,
854,
1661,
17,
267,
9173,
261,
318,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
3890,
12,
3374,
4672,
3536,
2884,
279,
8086,
1446,
1368,
261,
3890,
16,
666,
67,
792,
67,
14530,
2934,
7322,
316,
666,
67,
792,
67,
14530,
854,
1661,
17,
267,
9173,
261,
318,... |
sys.stdout = self.stdout self.stdout = None | sys.stdout = self.stdout.pop(0) | def end(self): if self.stdout: sys.stdout = self.stdout self.stdout = None | 0b51b745c8040c36bb45a85570254bf78ece4547 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11821/0b51b745c8040c36bb45a85570254bf78ece4547/capture.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
12,
2890,
4672,
309,
365,
18,
10283,
30,
2589,
18,
10283,
273,
365,
18,
10283,
365,
18,
10283,
273,
599,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
12,
2890,
4672,
309,
365,
18,
10283,
30,
2589,
18,
10283,
273,
365,
18,
10283,
365,
18,
10283,
273,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"".join(map(lambda i: "0123456789ABCDEF"[i], digits)) + "L" | "".join(map(lambda i: "0123456789abcdef"[i], digits)) + "L" | def slow_format(self, x, base): if (x, base) == (0, 8): # this is an oddball! return "0L" digits = [] sign = 0 if x < 0: sign, x = 1, -x while x: x, r = divmod(x, base) digits.append(int(r)) digits.reverse() digits = digits or [0] return '-'[:sign] + \ {8: '0', 10: '', 16: '0x'}[base] + \ "".join(map(lambda i: "0123456789ABCDEF"[i], digits)) + "L" | 6f9103816dbdd707d93b8f679a090fc2dcd92cae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/6f9103816dbdd707d93b8f679a090fc2dcd92cae/test_long.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11816,
67,
2139,
12,
2890,
16,
619,
16,
1026,
4672,
309,
261,
92,
16,
1026,
13,
422,
261,
20,
16,
1725,
4672,
468,
333,
353,
392,
14800,
19067,
5,
327,
315,
20,
48,
6,
6815,
273,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11816,
67,
2139,
12,
2890,
16,
619,
16,
1026,
4672,
309,
261,
92,
16,
1026,
13,
422,
261,
20,
16,
1725,
4672,
468,
333,
353,
392,
14800,
19067,
5,
327,
315,
20,
48,
6,
6815,
273,
5... |
" disabled.\r\n\r\n" + problem + \ "\r\n\r\nDo you wish to re-configure?" | " disabled.\r\n\r\n%s" \ "\r\n\r\nDo you wish to re-configure?") % (problem,) | def OnClicked(self, id): problem = self.window.manager.GetDisabledReason() if problem: q = "There appears to be a problem with SpamBayes' configuration" \ "\r\nIf you do not fix this problem, SpamBayes will be" \ " disabled.\r\n\r\n" + problem + \ "\r\n\r\nDo you wish to re-configure?" if self.window.manager.AskQuestion(q): return win32gui.EndDialog(self.window.hwnd, id) | ff0ccd51155f8bb6ce0da78ca0bcbbe88011570f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9857/ff0ccd51155f8bb6ce0da78ca0bcbbe88011570f/processors.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
27633,
12,
2890,
16,
612,
4672,
6199,
273,
365,
18,
5668,
18,
4181,
18,
967,
8853,
8385,
1435,
309,
6199,
30,
1043,
273,
315,
9828,
14606,
358,
506,
279,
6199,
598,
5878,
301,
38... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
27633,
12,
2890,
16,
612,
4672,
6199,
273,
365,
18,
5668,
18,
4181,
18,
967,
8853,
8385,
1435,
309,
6199,
30,
1043,
273,
315,
9828,
14606,
358,
506,
279,
6199,
598,
5878,
301,
38... |
and socket.gethostbyname(host) in (localhost(), thishost()): | and socket.gethostbyname(host) in (localhost(), thishost()): | def open_local_file(self, url): """Use local file.""" import mimetypes, mimetools, StringIO mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( 'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) if not host: urlfile = file if file[:1] == '/': urlfile = 'file://' + file return addinfourl(open(url2pathname(file), 'rb'), headers, urlfile) host, port = splitport(host) if not port \ and socket.gethostbyname(host) in (localhost(), thishost()): urlfile = file if file[:1] == '/': urlfile = 'file://' + file return addinfourl(open(url2pathname(file), 'rb'), headers, urlfile) raise IOError, ('local file error', 'not on local host') | 29172830e643eeb95ca32bcea860dd53f9815f25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/29172830e643eeb95ca32bcea860dd53f9815f25/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
3729,
67,
768,
12,
2890,
16,
880,
4672,
3536,
3727,
1191,
585,
12123,
1930,
20369,
15180,
16,
20369,
278,
8192,
16,
15777,
22189,
273,
20369,
15180,
18,
20885,
67,
723,
12,
718... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
3729,
67,
768,
12,
2890,
16,
880,
4672,
3536,
3727,
1191,
585,
12123,
1930,
20369,
15180,
16,
20369,
278,
8192,
16,
15777,
22189,
273,
20369,
15180,
18,
20885,
67,
723,
12,
718... |
if ROA_DJANGO_ERRORS: self.msg = exception.message | if ROA_DJANGO_ERRORS and 'message' in exception \ and 'status_code' in exception: self.msg = force_unicode(exception.message) | def __init__(self, exception): if ROA_DJANGO_ERRORS: self.msg = exception.message self.status_code = exception.status_code else: self.msg = force_unicode(exception) | 5dc695c0f28795a76a3f20eb747450b93671a1ed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8248/5dc695c0f28795a76a3f20eb747450b93671a1ed/exceptions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1520,
4672,
309,
6525,
37,
67,
40,
46,
31630,
67,
29127,
471,
296,
2150,
11,
316,
1520,
521,
471,
296,
2327,
67,
710,
11,
316,
1520,
30,
365,
18,
3576,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1520,
4672,
309,
6525,
37,
67,
40,
46,
31630,
67,
29127,
471,
296,
2150,
11,
316,
1520,
521,
471,
296,
2327,
67,
710,
11,
316,
1520,
30,
365,
18,
3576,... |
objectId = (args, tuple(kargs.items())) | objectId = self.getKey(*args, **kargs) | def fetch(self, fetch_function, *args, **kargs): """ fetches the object with the given id, querying a) the cache and b) the fetch_function if the fetch_function is called, the functions result is saved in the cache | 6d561154982ff2f5faf46fc2a6cee2719f87da8d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6604/6d561154982ff2f5faf46fc2a6cee2719f87da8d/cache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
12,
2890,
16,
2158,
67,
915,
16,
380,
1968,
16,
2826,
79,
1968,
4672,
3536,
17675,
326,
733,
598,
326,
864,
612,
16,
23936,
279,
13,
326,
1247,
471,
324,
13,
326,
2158,
67,
915... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2158,
12,
2890,
16,
2158,
67,
915,
16,
380,
1968,
16,
2826,
79,
1968,
4672,
3536,
17675,
326,
733,
598,
326,
864,
612,
16,
23936,
279,
13,
326,
1247,
471,
324,
13,
326,
2158,
67,
915... |
TERMIOS.ECHOCTL|TERMIOS.ECHOKE|TERMIOS.ISIG|TERMIOS.IEXTEN) | TERMIOS.ISIG|TERMIOS.IEXTEN) for flag in ('ECHOCTL', 'ECHOKE'): if hasattr(TERMIOS, flag): lflag &= ~getattr(TERMIOS, flag) | def _reconfigurePort(self): """Set commuication parameters on opened port.""" if self.fd is None: raise SerialException("Can only operate on a valid port handle") vmin = vtime = 0 #timeout is done via select try: iflag, oflag, cflag, lflag, ispeed, ospeed, cc = termios.tcgetattr(self.fd) except termios.error, msg: #if a port is nonexistent but has a /dev file, it'll fail here raise SerialException("Could not configure port: %s" % msg) #set up raw mode / no echo / binary cflag |= (TERMIOS.CLOCAL|TERMIOS.CREAD) lflag &= ~(TERMIOS.ICANON|TERMIOS.ECHO|TERMIOS.ECHOE|TERMIOS.ECHOK|TERMIOS.ECHONL| TERMIOS.ECHOCTL|TERMIOS.ECHOKE|TERMIOS.ISIG|TERMIOS.IEXTEN) #|TERMIOS.ECHOPRT oflag &= ~(TERMIOS.OPOST) iflag &= ~(TERMIOS.INLCR|TERMIOS.IGNCR|TERMIOS.ICRNL|TERMIOS.IGNBRK) if hasattr(TERMIOS, 'IUCLC'): iflag &= ~TERMIOS.IUCLC #setup baudrate try: ispeed = ospeed = getattr(TERMIOS,'B%s' % (self._baudrate)) except AttributeError: raise ValueError('Invalid baud rate: %r' % self._baudrate) #setup char len cflag &= ~TERMIOS.CSIZE if self._bytesize == 8: cflag |= TERMIOS.CS8 elif self._bytesize == 7: cflag |= TERMIOS.CS7 elif self._bytesize == 6: cflag |= TERMIOS.CS6 elif self._bytesize == 5: cflag |= TERMIOS.CS5 else: raise ValueError('Invalid char len: %r' % self._bytesize) #setup stopbits if self._stopbits == STOPBITS_ONE: cflag &= ~(TERMIOS.CSTOPB) elif self._stopbits == STOPBITS_TWO: cflag |= (TERMIOS.CSTOPB) else: raise ValueError('Invalid stopit specification: %r' % self._stopbits) #setup parity iflag &= ~(TERMIOS.INPCK|TERMIOS.ISTRIP) if self._parity == PARITY_NONE: cflag &= ~(TERMIOS.PARENB|TERMIOS.PARODD) elif self._parity == PARITY_EVEN: cflag &= ~(TERMIOS.PARODD) cflag |= (TERMIOS.PARENB) elif self._parity == PARITY_ODD: cflag |= (TERMIOS.PARENB|TERMIOS.PARODD) else: raise ValueError('Invalid parity: %r' % self._parity) #setup flow control #xonxoff if hasattr(TERMIOS, 'IXANY'): if self._xonxoff: iflag |= (TERMIOS.IXON|TERMIOS.IXOFF) #|TERMIOS.IXANY) else: iflag &= ~(TERMIOS.IXON|TERMIOS.IXOFF|TERMIOS.IXANY) else: if self._xonxoff: iflag |= (TERMIOS.IXON|TERMIOS.IXOFF) else: iflag &= ~(TERMIOS.IXON|TERMIOS.IXOFF) #rtscts if hasattr(TERMIOS, 'CRTSCTS'): if self._rtscts: cflag |= (TERMIOS.CRTSCTS) else: cflag &= ~(TERMIOS.CRTSCTS) elif hasattr(TERMIOS, 'CNEW_RTSCTS'): #try it with alternate constant name if self._rtscts: cflag |= (TERMIOS.CNEW_RTSCTS) else: cflag &= ~(TERMIOS.CNEW_RTSCTS) #XXX should there be a warning if setting up rtscts (and xonxoff etc) fails?? #buffer #vmin "minimal number of characters to be read. = for non blocking" if vmin < 0 or vmin > 255: raise ValueError('Invalid vmin: %r ' % vmin) cc[TERMIOS.VMIN] = vmin #vtime if vtime < 0 or vtime > 255: raise ValueError('Invalid vtime: %r' % vtime) cc[TERMIOS.VTIME] = vtime #activate settings termios.tcsetattr(self.fd, TERMIOS.TCSANOW, [iflag, oflag, cflag, lflag, ispeed, ospeed, cc]) | 947b15037c1a15f9a0dc8a63f230bab1cb53be65 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10955/947b15037c1a15f9a0dc8a63f230bab1cb53be65/serialposix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
266,
14895,
2617,
12,
2890,
4672,
3536,
694,
1543,
89,
829,
1472,
603,
10191,
1756,
12123,
309,
365,
18,
8313,
353,
599,
30,
1002,
7366,
503,
2932,
2568,
1338,
20829,
603,
279,
923,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
266,
14895,
2617,
12,
2890,
4672,
3536,
694,
1543,
89,
829,
1472,
603,
10191,
1756,
12123,
309,
365,
18,
8313,
353,
599,
30,
1002,
7366,
503,
2932,
2568,
1338,
20829,
603,
279,
923,... |
self.search_options[k]=v(self.context) return self.search_options | v = v(self.context) options[k] = v return options | def _search_options(self): for k,v in self.search_options.items(): if callable(v): self.search_options[k]=v(self.context) return self.search_options | 59a03f2faeb790c895f55991d69ebacda873f6fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11908/59a03f2faeb790c895f55991d69ebacda873f6fe/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3072,
67,
2116,
12,
2890,
4672,
364,
417,
16,
90,
316,
365,
18,
3072,
67,
2116,
18,
3319,
13332,
309,
4140,
12,
90,
4672,
365,
18,
3072,
67,
2116,
63,
79,
65,
33,
90,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3072,
67,
2116,
12,
2890,
4672,
364,
417,
16,
90,
316,
365,
18,
3072,
67,
2116,
18,
3319,
13332,
309,
4140,
12,
90,
4672,
365,
18,
3072,
67,
2116,
63,
79,
65,
33,
90,
12,
2890... |
d = parse_qs(e) assert d == [('a', None), ('b', None), ('c', ''), ('d', '1')] | d = parse_querystring(e) assert d == [('a', ''), ('b', ''), ('c', ''), ('d', '1')] | def test_parse_qs(): e = {'QUERY_STRING': 'a=1&b=2&c=3&b=4'} d = parse_qs(e) assert d == [('a', '1'), ('b', '2'), ('c', '3'), ('b', '4')] assert e['paste._cached_parse_qs'] == ( (e['QUERY_STRING'], d)) e = {'QUERY_STRING': 'a&b&c=&d=1'} d = parse_qs(e) assert d == [('a', None), ('b', None), ('c', ''), ('d', '1')] | 76da4633eae92f618adf40d530f340fa27a71d98 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2097/76da4633eae92f618adf40d530f340fa27a71d98/test_request_form.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2670,
67,
12926,
13332,
425,
273,
13666,
10753,
67,
5804,
4278,
296,
69,
33,
21,
10,
70,
33,
22,
10,
71,
33,
23,
10,
70,
33,
24,
11,
97,
302,
273,
1109,
67,
12926,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2670,
67,
12926,
13332,
425,
273,
13666,
10753,
67,
5804,
4278,
296,
69,
33,
21,
10,
70,
33,
22,
10,
71,
33,
23,
10,
70,
33,
24,
11,
97,
302,
273,
1109,
67,
12926,
12,
... |
sage: H = PermutationGroup([[(1,2,3,4)], [(1,2),(3,4)]]) | sage: H = PermutationGroup([[(1,2,3,4)], [(1,2),(3,4)]]) | def __contains__(self, item): """ Returns boolean value of "item in self" EXAMPLES:: sage: G = SymmetricGroup(16) sage: g = G.gen(0) sage: h = G.gen(1) sage: g^7*h*g*h in G True sage: G = SymmetricGroup(4) sage: g = G((1,2,3,4)) sage: h = G((1,2)) sage: H = PermutationGroup([[(1,2,3,4)], [(1,2),(3,4)]]) sage: g in H True sage: h in H False """ try: item = self(item, check=True) except: return False return True | 3d7a2db17ef7b85af951b4c4b603c8139fb89c43 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/3d7a2db17ef7b85af951b4c4b603c8139fb89c43/permgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12298,
972,
12,
2890,
16,
761,
4672,
3536,
2860,
1250,
460,
434,
315,
1726,
316,
365,
6,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
611,
273,
10042,
6899,
1114,
12,
2313,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12298,
972,
12,
2890,
16,
761,
4672,
3536,
2860,
1250,
460,
434,
315,
1726,
316,
365,
6,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
611,
273,
10042,
6899,
1114,
12,
2313,
1... |
p_frame.pack(side = 'right', fill = Y) palette_frame = TFrame(p_frame, style='FlatFrame', borderwidth=3) palette_frame.pack(side = 'right', fill = Y) | p_frame.pack(side='right', fill=Y) palette_frame = TFrame(p_frame, style='FlatFrame') palette_frame.pack(side='right', fill=Y, pady=5, padx=5) | def build_window(self): root = self.application.root p_frame = TFrame(root, style='FlatFrame') p_frame.pack(side = 'right', fill = Y) palette_frame = TFrame(p_frame, style='FlatFrame', borderwidth=3) palette_frame.pack(side = 'right', fill = Y) b = TLabel(p_frame, style='VLine3') self.pc=PluginContainer(p_frame,self.root, self) self.pc.rborder=b b = TLabel(root, style='VLine2') b.pack(side = 'right', fill = Y) | 5bd05aab08ecc99debb8be46af1003105e4183ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3123/5bd05aab08ecc99debb8be46af1003105e4183ab/mainwindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
5668,
12,
2890,
4672,
1365,
273,
365,
18,
3685,
18,
3085,
225,
293,
67,
3789,
273,
399,
3219,
12,
3085,
16,
2154,
2218,
16384,
3219,
6134,
293,
67,
3789,
18,
2920,
12,
5564,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
5668,
12,
2890,
4672,
1365,
273,
365,
18,
3685,
18,
3085,
225,
293,
67,
3789,
273,
399,
3219,
12,
3085,
16,
2154,
2218,
16384,
3219,
6134,
293,
67,
3789,
18,
2920,
12,
5564,
... |
exc_data = collector.collect_exception(*exc_info) debug_info = DebugInfo(count, exc_info, exc_data, base_path, environ) assert count not in self.debug_infos self.debug_infos[count] = debug_info | def detect_start_response(status, headers, exc_info=None): try: return start_response(status, headers, exc_info) except: raise else: started.append(True) | 716647d2cc92a0a6ec1b13946df1d45df584289a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11400/716647d2cc92a0a6ec1b13946df1d45df584289a/middleware.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
1937,
67,
2740,
12,
2327,
16,
1607,
16,
3533,
67,
1376,
33,
7036,
4672,
775,
30,
327,
787,
67,
2740,
12,
2327,
16,
1607,
16,
3533,
67,
1376,
13,
1335,
30,
1002,
469,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
1937,
67,
2740,
12,
2327,
16,
1607,
16,
3533,
67,
1376,
33,
7036,
4672,
775,
30,
327,
787,
67,
2740,
12,
2327,
16,
1607,
16,
3533,
67,
1376,
13,
1335,
30,
1002,
469,
30,
... | |
for key,prop in self.properties.items(): if propvalues.has_key(str(key)): | for key, prop in self.properties.items(): if propvalues.has_key(key): | def create(self, **propvalues): """Create a new node of this class and return its id. | f585d0fd8b97406c94bbd0235dd528198f965caf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/f585d0fd8b97406c94bbd0235dd528198f965caf/hyperdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
2826,
5986,
2372,
4672,
3536,
1684,
279,
394,
756,
434,
333,
667,
471,
327,
2097,
612,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
2826,
5986,
2372,
4672,
3536,
1684,
279,
394,
756,
434,
333,
667,
471,
327,
2097,
612,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def format_call(self, have_write_back, prefix): | def format_call(self, return_directly, prefix): | def format_call(self, have_write_back, prefix): s = "" if (self.return_type != "void"): if (not have_write_back): s += "return " else: s += self.return_type + " result = " s += self.function_name+"(" s += ", ".join([arg.name for arg in self.args]) s += ");" result = [] indent = "" for line in line_breaker(s, 70): result.append(prefix+indent+line) indent = " " return result | f9fe2424d81ac0cebc2a6dcb7e793dac6b5fbcf3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/f9fe2424d81ac0cebc2a6dcb7e793dac6b5fbcf3/generate_functions_bpl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
1991,
12,
2890,
16,
327,
67,
7205,
715,
16,
1633,
4672,
272,
273,
1408,
309,
261,
2890,
18,
2463,
67,
723,
480,
315,
6459,
6,
4672,
309,
261,
902,
1240,
67,
2626,
67,
823,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
1991,
12,
2890,
16,
327,
67,
7205,
715,
16,
1633,
4672,
272,
273,
1408,
309,
261,
2890,
18,
2463,
67,
723,
480,
315,
6459,
6,
4672,
309,
261,
902,
1240,
67,
2626,
67,
823,
... |
self._outputStatement(sink, (context, self.store.forSome, context, list)) | if list not in listList: self._outputStatement(sink, (context, self.store.forSome, context, list)) listList[list] = 1 | def dumpLists(self): | 73daa6ecdb2180d22753e4c3616560c4663307a6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/73daa6ecdb2180d22753e4c3616560c4663307a6/pretty.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
7432,
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,
4657,
7432,
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,
-... |
message = _("Can't save config file, I/O error: %s") % e print message if self.frame: self.frame.logMessage(message) | log.addwarning(_("Can't save config file, I/O error: %s") % e) | def writeConfig(self): self.config_lock.acquire() for i in self.sections.keys(): if not self.parser.has_section(i): self.parser.add_section(i) for j in self.sections[i].keys(): if j not in ["sharedfiles", "sharedfilesstreams", "wordindex", "fileindex", "sharedmtimes", "bsharedfiles", "bsharedfilesstreams", "bwordindex", "bfileindex", "bsharedmtimes"]: self.parser.set(i, j, self.sections[i][j]) else: self.parser.remove_option(i, j) path, fn = os.path.split(self.filename) try: if not os.path.isdir(path): os.makedirs(path) except OSError, msg: message = _("Can't create directory '%(path)s', reported error: %(error)s") % {'path':path, 'error':msg} print message if self.frame: self.frame.logMessage(message) oldumask = os.umask(0077) try: f = open(self.filename + ".new", "w") except IOError, e: message = _("Can't save config file, I/O error: %s") % e print message if self.frame: self.frame.logMessage(message) self.config_lock.release() return else: try: self.parser.write(f) except IOError, e: message = _("Can't save config file, I/O error: %s") % e print message if self.frame: self.frame.logMessage(message) self.config_lock.release() return else: f.close() os.umask(oldumask) # A paranoid precaution since config contains the password try: os.chmod(self.filename, 0600) except: pass try: s = os.stat(self.filename) if s.st_size > 0: try: if os.path.exists(self.filename + ".old"): os.remove(self.filename + ".old") except OSError, error: message = _("Can't remove %s" % self.filename + ".old") print message if self.frame: self.frame.logMessage(message) try: os.rename(self.filename, self.filename + ".old") except OSError, error: message = _("Can't back config file up, error: %s") % error print message if self.frame: self.frame.logMessage(message) except OSError: pass try: os.rename(self.filename + ".new", self.filename) except OSError, error: message = _("Can't rename config file, error: %s") % error print message if self.frame: self.frame.logMessage(message) self.config_lock.release() | d03b1060449a904912df2e17c0cce7abc6348d8f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8738/d03b1060449a904912df2e17c0cce7abc6348d8f/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
809,
12,
2890,
4672,
365,
18,
1425,
67,
739,
18,
1077,
1039,
1435,
364,
277,
316,
365,
18,
11657,
18,
2452,
13332,
309,
486,
365,
18,
4288,
18,
5332,
67,
3464,
12,
77,
4672,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
809,
12,
2890,
4672,
365,
18,
1425,
67,
739,
18,
1077,
1039,
1435,
364,
277,
316,
365,
18,
11657,
18,
2452,
13332,
309,
486,
365,
18,
4288,
18,
5332,
67,
3464,
12,
77,
4672,
36... |
return None | source_root_parts = self.source_root_path.split(os.path.sep) target_parts = abs_path.split(os.path.sep) for i in range(min(len(source_root_parts), len(target_parts))): if source_root_parts[i] <> target_parts[i]: break else: i += 1 rel_parts = [os.path.pardir] * (len(source_root_parts) - i) rel_parts.extend(target_parts[i:]) return os.path.join(*rel_parts) | def RelativeSourceRootPath(self, abs_path): """Convert a path to one relative to the project's SOURCE_ROOT if possible. Generally this follows Xcode semantics, that is, a path is only converted if it is a subpath of SOURCE_ROOT. | 7eeeba6707c614f566f305aeb7a9a953e7a4e042 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/7eeeba6707c614f566f305aeb7a9a953e7a4e042/xcodebodge.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19873,
1830,
21302,
12,
2890,
16,
2417,
67,
803,
4672,
3536,
2723,
279,
589,
358,
1245,
3632,
358,
326,
1984,
1807,
16088,
67,
9185,
309,
3323,
18,
3055,
1230,
333,
13040,
1139,
710,
172... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19873,
1830,
21302,
12,
2890,
16,
2417,
67,
803,
4672,
3536,
2723,
279,
589,
358,
1245,
3632,
358,
326,
1984,
1807,
16088,
67,
9185,
309,
3323,
18,
3055,
1230,
333,
13040,
1139,
710,
172... |
try: self.connect((ip, port)) except socket.error: self.cmd_channel.respond("425 Can't connect to %s:%s." %(ip, port)) self.close() | self.connect((ip, port)) | def __init__(self, ip, port, cmd_channel): asyncore.dispatcher.__init__(self) self.cmd_channel = cmd_channel self.create_socket(socket.AF_INET, socket.SOCK_STREAM) try: self.connect((ip, port)) except socket.error: self.cmd_channel.respond("425 Can't connect to %s:%s." %(ip, port)) self.close() | ed7711e92ee8d112e2451cf1f9f0d70b304c6cc8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3782/ed7711e92ee8d112e2451cf1f9f0d70b304c6cc8/ftpserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2359,
16,
1756,
16,
1797,
67,
4327,
4672,
4326,
479,
18,
18495,
16186,
2738,
972,
12,
2890,
13,
365,
18,
4172,
67,
4327,
273,
1797,
67,
4327,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2359,
16,
1756,
16,
1797,
67,
4327,
4672,
4326,
479,
18,
18495,
16186,
2738,
972,
12,
2890,
13,
365,
18,
4172,
67,
4327,
273,
1797,
67,
4327,
365,
18,
... |
@type shared: int | @type shared: integer (0/1) used as a boolean | def acquire(self, shared=0, timeout=None, test_notify=None): """Acquire a shared lock. | ec44d89309841ae554b6dea41de2ada1923d8515 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7542/ec44d89309841ae554b6dea41de2ada1923d8515/locking.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10533,
12,
2890,
16,
5116,
33,
20,
16,
2021,
33,
7036,
16,
1842,
67,
12336,
33,
7036,
4672,
3536,
27761,
279,
5116,
2176,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10533,
12,
2890,
16,
5116,
33,
20,
16,
2021,
33,
7036,
16,
1842,
67,
12336,
33,
7036,
4672,
3536,
27761,
279,
5116,
2176,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
numlbls = -1 for inst in code._instructions: if isinstance(inst, spe.Label): numlbls += 1 print "run ret", ret, (ret - code_lsa) / 4 - len(code._prologue) + numlbls return (ret - code_lsa) / 4 - len(code._prologue) + numlbls | offset = ((ret - code_lsa) / 4) - (len(code._prologue) - 1) print "offset after exec", offset off = 0 if offset == 0: print "offset 0, returning 0" return 0 for i, inst in enumerate(code._instructions): print "post exec inst", type(inst) if not isinstance(inst, spe.Label): off += 1 if off == offset: print "i, offset", i, offset return i + 1 print "ERROR ERROR" return 0 | def ExecuteStream(self, code, start): """Start executing code at instruction number start, and return the stop instruction number""" | cf013bab7c33c5cf5c8ea8c9da41740bf84bf29e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9699/cf013bab7c33c5cf5c8ea8c9da41740bf84bf29e/ispugui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7903,
1228,
12,
2890,
16,
981,
16,
787,
4672,
3536,
1685,
11274,
981,
622,
7592,
1300,
787,
16,
471,
327,
326,
2132,
7592,
1300,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7903,
1228,
12,
2890,
16,
981,
16,
787,
4672,
3536,
1685,
11274,
981,
622,
7592,
1300,
787,
16,
471,
327,
326,
2132,
7592,
1300,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return | return True | def getcd(isprobe, akey): # get course and distance irowq=game.quadrant.x; icolq=game.quadrant.y; key=0 navmode = "unspecified" itemp = "curt" incr = coord() iprompt = False # Get course direction and distance. If user types bad values, return # with DIREC = -1.0. game.direc = -1.0 if game.landed and not isprobe: prout(_("Dummy! You can't leave standard orbit until you")) proutn(_("are back aboard the ship.")) chew() return while navmode == "unspecified": if damaged(DNAVSYS): if isprobe: prout(_("Computer damaged; manual navigation only")) else: prout(_("Computer damaged; manual movement only")) chew() navmode = "manual" key = IHEOL break if isprobe and akey != -1: # For probe launch, use pre-scanned value first time key = akey akey = -1 else: key = scan() if key == IHEOL: proutn(_("Manual or automatic- ")) iprompt = True chew() elif key == IHALPHA: if isit("manual"): navmode = "manual" key = scan() break elif isit("automatic"): navmode = "automatic" key = scan() break else: huh() chew() return else: # numeric if isprobe: prout(_("(Manual navigation assumed.)")) else: prout(_("(Manual movement assumed.)")) navmode = "manual" break if navmode == "automatic": while key == IHEOL: if isprobe: proutn(_("Target quadrant or quadrant§or- ")) else: proutn(_("Destination sector or quadrant§or- ")) chew() iprompt = True key = scan() if key != IHREAL: huh() return xi = int(aaitem-0.05) key = scan() if key != IHREAL: huh() return xj = int(aaitem-0.5) key = scan() if key == IHREAL: # both quadrant and sector specified xk = aaitem key = scan() if key != IHREAL: huh() return xl = aaitem irowq = xi + 0.5 icolq = xj + 0.5 incr.y = xk + 0.5 incr.x = xl + 0.5 else: if isprobe: # only quadrant specified -- go to center of dest quad irowq = xi + 0.5 icolq = xj + 0.5 incr.y = incr.x = 5 else: incr.y = xi + 0.5 incr.x = xj + 0.5 itemp = "normal" if not VALID_QUADRANT(icolq,irowq) or not VALID_SECTOR(incr.x,incr.y): huh() return skip(1) if not isprobe: if itemp > "curt": if iprompt: prout(_("Helmsman Sulu- \"Course locked in for Sector %s.\"") % incr) else: prout(_("Ensign Chekov- \"Course laid in, Captain.\"")) deltax = icolq - game.quadrant.y + 0.1*(incr.x-game.sector.y) deltay = game.quadrant.x - irowq + 0.1*(game.sector.x-incr.y) else: # manual while key == IHEOL: proutn(_("X and Y displacements- ")) chew() iprompt = True key = scan() itemp = "verbose" if key != IHREAL: huh() return deltax = aaitem key = scan() if key != IHREAL: huh() return deltay = aaitem # Check for zero movement if deltax == 0 and deltay == 0: chew() return if itemp == "verbose" and not isprobe: skip(1) prout(_("Helmsman Sulu- \"Aye, Sir.\"")) game.dist = math.sqrt(deltax*deltax + deltay*deltay) game.direc = math.atan2(deltax, deltay)*1.90985932 if game.direc < 0.0: game.direc += 12.0 chew() return | b1c9c5334f08ac7846e441ce750b7e9ad119b37d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/b1c9c5334f08ac7846e441ce750b7e9ad119b37d/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
4315,
12,
291,
27230,
16,
279,
856,
4672,
468,
336,
4362,
471,
3888,
277,
492,
85,
33,
13957,
18,
21733,
6890,
18,
92,
31,
277,
1293,
85,
33,
13957,
18,
21733,
6890,
18,
93,
31,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
4315,
12,
291,
27230,
16,
279,
856,
4672,
468,
336,
4362,
471,
3888,
277,
492,
85,
33,
13957,
18,
21733,
6890,
18,
92,
31,
277,
1293,
85,
33,
13957,
18,
21733,
6890,
18,
93,
31,... |
positional.append(args[key]) | for k in intkeys: if k < 1 or k >= i: named[str(k)] = intkeys[k] break | def templatesWithParams(self): """Iterate templates used on this Page. | fd8b8e502014adf7d3b58dfa6bd933b2259fb758 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9005/fd8b8e502014adf7d3b58dfa6bd933b2259fb758/page.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5539,
19591,
12,
2890,
4672,
3536,
14916,
5539,
1399,
603,
333,
3460,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5539,
19591,
12,
2890,
4672,
3536,
14916,
5539,
1399,
603,
333,
3460,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
response = urllib2.urlopen(req) try: mirror.response_code = response.code except AttributeError: if response.url.startswith('ftp://'): mirror.response_code = 200 logging.debug('mirror %s redirects to ftp:// URL' % mirror.identifier) logging.debug('%s got response for %s: %s' % (threading.currentThread().getName(), mirror.identifier, getattr(response, 'code', None))) mirror.response = response.read() mirror.status_baseurl_new = True except ValueError, e: if str(e).startswith('invalid literal for int()'): mirror.response = 'response not read due to http://bugs.python.org/issue1205' logging.info('mirror %s sends broken chunked reply, see http://bugs.python.org/issue1205' % mirror.identifier) except socket.timeout, e: mirror.response = 'socket timeout in reading response: %s' % e except socket.error, e: mirror.response = "socket error: %s" % e except httplib.BadStatusLine: | logging.debug("%s probing %s" % (threading.currentThread().getName(), mirror.identifier)) req = urllib2.Request(mirror.baseurl) req.add_header('User-Agent', USER_AGENT) mirror.status_baseurl_new = False mirror.timed_out = True | def probe_http(mirror): """Try to reach host at baseurl. Set status_baseurl_new.""" logging.debug("%s probing %s" % (threading.currentThread().getName(), mirror.identifier)) #req = urllib2.Request('http://old-cherry.suse.de') # never works #req = urllib2.Request('http://doozer.poeml.de/') # always works req = urllib2.Request(mirror.baseurl) req.add_header('User-Agent', USER_AGENT) #req.get_method = lambda: "HEAD" mirror.status_baseurl_new = False mirror.timed_out = True mirror.response_code = None mirror.response = None if mirror.baseurl == '': return None try: response = urllib2.urlopen(req) try: mirror.response_code = response.code # if the web server redirects to an ftp:// URL, our response won't have a code attribute # (except we are going via a proxy) except AttributeError: if response.url.startswith('ftp://'): # count as success mirror.response_code = 200 logging.debug('mirror %s redirects to ftp:// URL' % mirror.identifier) logging.debug('%s got response for %s: %s' % (threading.currentThread().getName(), mirror.identifier, getattr(response, 'code', None))) mirror.response = response.read() mirror.status_baseurl_new = True except ValueError, e: if str(e).startswith('invalid literal for int()'): mirror.response = 'response not read due to http://bugs.python.org/issue1205' logging.info('mirror %s sends broken chunked reply, see http://bugs.python.org/issue1205' % mirror.identifier) except socket.timeout, e: mirror.response = 'socket timeout in reading response: %s' % e except socket.error, e: #errno, errstr = sys.exc_info()[:2] mirror.response = "socket error: %s" % e except httplib.BadStatusLine: mirror.response_code = None mirror.response = None except urllib2.HTTPError, e: mirror.response_code = e.code mirror.response = e.read() except urllib2.URLError, e: mirror.response_code = 0 mirror.response = "%s" % e.reason except IOError, e: # IOError: [Errno ftp error] (111, 'Connection refused') if e.errno == 'ftp error': mirror.response_code = 0 mirror.response = "%s: %s" % (e.errno, e.strerror) else: print mirror.identifier, mirror.baseurl, 'errno:', e.errno raise except: print mirror.identifier, mirror.baseurl raise # not reached, if the timeout goes off mirror.timed_out = False | b20f288cec1c1dc546330c2c42363394bd60eca2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3890/b20f288cec1c1dc546330c2c42363394bd60eca2/mirrorprobe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10695,
67,
2505,
12,
27197,
4672,
3536,
7833,
358,
9287,
1479,
622,
25427,
18,
1000,
1267,
67,
1969,
718,
67,
2704,
12123,
225,
2907,
18,
4148,
27188,
87,
3137,
310,
738,
87,
6,
738,
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,
10695,
67,
2505,
12,
27197,
4672,
3536,
7833,
358,
9287,
1479,
622,
25427,
18,
1000,
1267,
67,
1969,
718,
67,
2704,
12123,
225,
2907,
18,
4148,
27188,
87,
3137,
310,
738,
87,
6,
738,
2... |
mock = self.mocker({name: 'path/to/mod'}) | mock = self.mocker({name: os.path.join('path', 'to', 'mod')}) | def test_state_after_failure(self): name = "mod" module = imp.new_module(name) module.blah = None mock = self.mocker({name: 'path/to/mod'}) mock.source = b"1/0" with util.uncache(name): sys.modules[name] = module self.assertRaises(ZeroDivisionError, mock.load_module, name) self.assert_(sys.modules[name] is module) self.assert_(hasattr(module, 'blah')) return mock | 1f5dd752f4d6cb8dff4cf083a6e7c9587747a2d7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/1f5dd752f4d6cb8dff4cf083a6e7c9587747a2d7/test_abc_loader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2019,
67,
5205,
67,
12251,
12,
2890,
4672,
508,
273,
315,
1711,
6,
1605,
273,
1646,
18,
2704,
67,
2978,
12,
529,
13,
1605,
18,
3083,
9795,
273,
599,
5416,
273,
365,
18,
81,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2019,
67,
5205,
67,
12251,
12,
2890,
4672,
508,
273,
315,
1711,
6,
1605,
273,
1646,
18,
2704,
67,
2978,
12,
529,
13,
1605,
18,
3083,
9795,
273,
599,
5416,
273,
365,
18,
81,... |
home1_xyz=(90,-90,village_height) | directions = [[0,1,0],[1,0,0],[0,-1,0],[-1,0,0], [0.7,0.7,0],[0.7,-0.7,0],[-0.7,-0.7,0],[-0.7,0.7,0]] home1_xyz=(90,-90,settlement_height) | def default(mapeditor): | 6bdd58dfdd1a3af7fac09b4b31a0e9971c80df9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12932/6bdd58dfdd1a3af7fac09b4b31a0e9971c80df9e/define_world.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
12,
1458,
9177,
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,
805,
12,
1458,
9177,
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,
-1... |
if ser: self.toggle2.state_set(1) else: self.toggle2.state_set(0) | def BtmodGUIupdate(self): s = self.btmc.getPower() v = self.btmc.getVisibility() ser = self.btmc.getService() obex = self.btmc.getServiceObex() print "BT BtmodGUIupdate [info] power:"+str(s)+"; visibility:"+str(v)+" services:"+str(ser)+" obxeftpd:"+str(obex) if s == 1: self.toggle1.show() if v: self.toggle1.state_set(1) else: self.toggle1.state_set(0) | 96df52ecbc51e86f029c1e5a29cf17a34ae92540 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11428/96df52ecbc51e86f029c1e5a29cf17a34ae92540/shr_bt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
605,
88,
1711,
43,
5370,
2725,
12,
2890,
4672,
272,
273,
365,
18,
23602,
13952,
18,
588,
13788,
1435,
331,
273,
365,
18,
23602,
13952,
18,
588,
10135,
1435,
703,
273,
365,
18,
23602,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
605,
88,
1711,
43,
5370,
2725,
12,
2890,
4672,
272,
273,
365,
18,
23602,
13952,
18,
588,
13788,
1435,
331,
273,
365,
18,
23602,
13952,
18,
588,
10135,
1435,
703,
273,
365,
18,
23602,
1... | |
Torsion subgroup of Jacobian of the modular curve associated to the congruence subgroup Gamma0(42) | Torsion subgroup of Abelian variety J0(42) of dimension 5 | def _generators(self): """ Return a tuple of vectors that define elements of the rational homology that generate this finite subgroup. | 815586779cc2c13231bc1338a2d2284b366f83d0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/815586779cc2c13231bc1338a2d2284b366f83d0/finite_subgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
25959,
12,
2890,
4672,
3536,
2000,
279,
3193,
434,
10046,
716,
4426,
2186,
434,
326,
436,
8371,
13995,
4676,
716,
2103,
333,
25922,
720,
1655,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
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,
25959,
12,
2890,
4672,
3536,
2000,
279,
3193,
434,
10046,
716,
4426,
2186,
434,
326,
436,
8371,
13995,
4676,
716,
2103,
333,
25922,
720,
1655,
18,
2,
-100,
-100,
-100,
-100,
-100,
-... |
sizer.AddSpacer(5) | sizer.AddSpacer((5,5)) | def getGUI(self, parent, taskPanel): """ Created: 13.04.2006, KP Description: Return the GUI for this filter """ gui = ProcessingFilter.ProcessingFilter.getGUI(self, parent, taskPanel) if not self.reportGUI: self.reportGUI = WatershedObjectList(self.gui, -1) self.totalGUI = WatershedTotalsList(self.gui, -1) self.exportBtn = wx.Button(self.gui, -1, "Export statistics") self.exportBtn.Bind(wx.EVT_BUTTON, self.onExportStatistics) if self.values: n = len(self.values) avgints = float(MeasureVolumeFilter.averageValue(self.avgIntList)) ums = [x[1] for x in self.values] # Remove the objects 0 and 1 because hey will distort the values avgums = float(MeasureVolumeFilter.averageValue(ums)) pxs = [x[0] for x in self.values] avgpxs = float(MeasureVolumeFilter.averageValue(pxs)) self.totalGUI.setStats([n, avgums, avgpxs, avgints]) self.reportGUI.setVolumes(self.values) self.reportGUI.setCentersOfMass(self.centersofmass) self.reportGUI.setAverageIntensities(self.avgIntList) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.reportGUI, 1) sizer.Add(self.totalGUI) sizer.AddSpacer(5) sizer.Add(self.exportBtn) sizer.AddSpacer(5) gui.sizer.Add(sizer, (1, 0), flag = wx.EXPAND | wx.ALL) return gui | 36e478e97a86b11f368c6729548d641ce0af2c72 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2877/36e478e97a86b11f368c6729548d641ce0af2c72/SegmentationFilters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7162,
5370,
12,
2890,
16,
982,
16,
1562,
5537,
4672,
3536,
12953,
30,
5958,
18,
3028,
18,
6976,
26,
16,
1475,
52,
6507,
30,
2000,
326,
10978,
364,
333,
1034,
3536,
13238,
273,
19652,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7162,
5370,
12,
2890,
16,
982,
16,
1562,
5537,
4672,
3536,
12953,
30,
5958,
18,
3028,
18,
6976,
26,
16,
1475,
52,
6507,
30,
2000,
326,
10978,
364,
333,
1034,
3536,
13238,
273,
19652,
1... |
self._playback_event_db.add_event(self._playback_key, "play", "system") | if self._playback_event_db: self._playback_event_db.add_event(self._playback_key, "play", "system") | def start( self, bytepos = 0, force = False ): """ Initialise to start playing at position `bytepos'. """ self._playback_event_db.add_event(self._playback_key, "play", "system") | b5e90d0f89e924a6cefcd967ce8e1e4f198dc1ad /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9686/b5e90d0f89e924a6cefcd967ce8e1e4f198dc1ad/VideoOnDemand.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
365,
16,
1160,
917,
273,
374,
16,
2944,
273,
1083,
262,
30,
3536,
31739,
358,
787,
23982,
622,
1754,
1375,
7229,
917,
10332,
3536,
365,
6315,
1601,
823,
67,
2575,
67,
1966,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
365,
16,
1160,
917,
273,
374,
16,
2944,
273,
1083,
262,
30,
3536,
31739,
358,
787,
23982,
622,
1754,
1375,
7229,
917,
10332,
3536,
365,
6315,
1601,
823,
67,
2575,
67,
1966,
18... |
self._console.info("Generating boot script...") bootBlocks = [] bootBlocks.append(self.generateSettingsCode(settings, format)) bootBlocks.append(self.generateVariantsCode(variants, format)) bootBlocks.append(self.generateLibInfoCode(libs, format, forceUri)) bootBlocks.append(self.generateResourceInfoCode(settings, libs, format)) bootBlocks.append(self.generateLocalesCode(translationMaps, format)) bootBlocks.append(self.generateCompiledPackageCode(fileUri, parts, packages, boot, variants, settings, format)) if format: bootContent = "\n\n".join(bootBlocks) else: bootContent = "".join(bootBlocks) resolvedFilePath = self._resolveFileName(filePath, variants, settings) filetool.save(resolvedFilePath, bootContent) if compConf.get("paths/gzip"): filetool.gzip(resolvedFilePath, bootContent) self._console.debug("Done: %s" % self._computeContentSize(bootContent)) self._console.debug("") | def getFileUri(scriptUri): appfile = os.path.basename(fileRelPath) fileUri = os.path.join(scriptUri, appfile) # make complete with file name fileUri = Path.posifyPath(fileUri) return fileUri | 40fa5abdd8d8cd646075b063479420d44c1e2b8c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/40fa5abdd8d8cd646075b063479420d44c1e2b8c/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6034,
3006,
12,
4263,
3006,
4672,
595,
768,
273,
1140,
18,
803,
18,
13909,
12,
768,
1971,
743,
13,
585,
3006,
273,
1140,
18,
803,
18,
5701,
12,
4263,
3006,
16,
595,
768,
13,
225,
468... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6034,
3006,
12,
4263,
3006,
4672,
595,
768,
273,
1140,
18,
803,
18,
13909,
12,
768,
1971,
743,
13,
585,
3006,
273,
1140,
18,
803,
18,
5701,
12,
4263,
3006,
16,
595,
768,
13,
225,
468... | |
"""operator.imul(%s)""" | def _irepeat(self, node, results): """operator.imul(%s)""" return self._handle_rename(node, results, "imul") | 8a9bd94c15c0cef83f794ebf9993ac545096e00a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/8a9bd94c15c0cef83f794ebf9993ac545096e00a/fix_operator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
577,
4780,
12,
2890,
16,
756,
16,
1686,
4672,
327,
365,
6315,
4110,
67,
18539,
12,
2159,
16,
1686,
16,
315,
381,
332,
7923,
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,
577,
4780,
12,
2890,
16,
756,
16,
1686,
4672,
327,
365,
6315,
4110,
67,
18539,
12,
2159,
16,
1686,
16,
315,
381,
332,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
"""returns a particlar races stardate to day ration""" return daysinYear(monthsystem) / 1000.0 | """returns a particlar races stardate to day ratio""" return daysinYear(monthsystem) / 1000.0 | def getStarToDay(monthsystem): """returns a particlar races stardate to day ration""" return daysinYear(monthsystem) / 1000.0 #FIXME: make faction dependent | ce8594f6b6b9596941263c25b363f792ed1ac1eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/ce8594f6b6b9596941263c25b363f792ed1ac1eb/stardate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
18379,
774,
4245,
12,
7496,
4299,
4672,
3536,
6154,
279,
5168,
7901,
767,
764,
10443,
712,
358,
2548,
436,
367,
8395,
327,
4681,
267,
5593,
12,
7496,
4299,
13,
342,
4336,
18,
20,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
18379,
774,
4245,
12,
7496,
4299,
4672,
3536,
6154,
279,
5168,
7901,
767,
764,
10443,
712,
358,
2548,
436,
367,
8395,
327,
4681,
267,
5593,
12,
7496,
4299,
13,
342,
4336,
18,
20,
... |
ns = self.attributes[XMLSchemaComponent.xmlns].get(prefix) | ns = self.attributes[XMLSchemaComponent.xmlns].get(prefix or\ XMLSchemaComponent.xmlns_key) | def getXMLNS(self, prefix=None): """retrieve contents empty string returns 'xmlns' """ parent = self ns = self.attributes[XMLSchemaComponent.xmlns].get(prefix) while not ns: parent = parent._parent() ns = parent.attributes[XMLSchemaComponent.xmlns].get(prefix or XMLSchemaComponent.xmlns_key) return ns | 36f34bdb62c4299586877f31abafd4a91e255843 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/36f34bdb62c4299586877f31abafd4a91e255843/XMLSchema.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
4201,
3156,
12,
2890,
16,
1633,
33,
7036,
4672,
3536,
17466,
2939,
1008,
533,
1135,
296,
16741,
11,
3536,
982,
273,
365,
3153,
273,
365,
18,
4350,
63,
4201,
3078,
1841,
18,
16741,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
4201,
3156,
12,
2890,
16,
1633,
33,
7036,
4672,
3536,
17466,
2939,
1008,
533,
1135,
296,
16741,
11,
3536,
982,
273,
365,
3153,
273,
365,
18,
4350,
63,
4201,
3078,
1841,
18,
16741,
... |
if engine == 'sqlite3': try: | if engine == 'sqlite3': try: | def delete_db(settings): """Delete the old database.""" engine = settings.DATABASE_ENGINE if engine == 'sqlite3': try: os.unlink(settings.DATABASE_NAME) except OSError: pass elif engine == 'mysql': import _mysql s = _mysql.connect(host=settings.DATABASE_HOST, user=settings.DATABASE_USER, passwd=settings.DATABASE_PASSWORD) for cmd in ['drop database if exists %s', 'create database %s CHARACTER SET utf8 COLLATE utf8_general_ci']: s.query(cmd % settings.DATABASE_NAME) elif engine in ('postgresql', 'postgresql_psycopg2'): if settings.DATABASE_NAME == '': raise AssertionError, "You must specified a value for DATABASE_NAME in local_settings.py." if settings.DATABASE_USER == '': raise AssertionError, "You must specified a value for DATABASE_USER in local_settings.py." params=" --username=%s --password" % settings.DATABASE_USER if settings.DATABASE_HOST: params += " --host=%s" % settings.DATABASE_HOST if settings.DATABASE_PORT: params += " --port=%s" % settings.DATABASE_PORT params += " %s" % settings.DATABASE_NAME print """You will be prompted for the password for the user '%s' twice. Once to drop an existing database and then a second time for create the database """ % settings.DATABASE_USER for cmd in ['dropdb %s', 'createdb %s']: os.system(cmd % params) else: raise AssertionError, "Unknown database engine %s" % engine | 6bb4ee4e3413db8bff6866226b96bc305a1c8cd3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/171/6bb4ee4e3413db8bff6866226b96bc305a1c8cd3/load_data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
1966,
12,
4272,
4672,
3536,
2613,
326,
1592,
2063,
12123,
4073,
273,
1947,
18,
22366,
67,
28980,
309,
4073,
422,
296,
19460,
23,
4278,
775,
30,
1140,
18,
318,
1232,
12,
4272,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
1966,
12,
4272,
4672,
3536,
2613,
326,
1592,
2063,
12123,
4073,
273,
1947,
18,
22366,
67,
28980,
309,
4073,
422,
296,
19460,
23,
4278,
775,
30,
1140,
18,
318,
1232,
12,
4272,
... |
self.verbose('Client Found: %s' % client.name) data = match.group('text') | self.verbose('Client Found: %s on slot %s' % (client.name, client.cid)) | def OnSayteam(self, action, data, match=None): #2:28 sayteam: 12 New_UrT_Player_v4.1: wokele client = self.getByCidOrJoinPlayer(match.group('cid')) | 8be17802b60bcda2d50efa553c1d9b18fe9e769d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12909/8be17802b60bcda2d50efa553c1d9b18fe9e769d/iourt41.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
55,
528,
10035,
12,
2890,
16,
1301,
16,
501,
16,
845,
33,
7036,
4672,
468,
22,
30,
6030,
12532,
10035,
30,
2593,
1166,
67,
57,
86,
56,
67,
12148,
67,
90,
24,
18,
21,
30,
341,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
55,
528,
10035,
12,
2890,
16,
1301,
16,
501,
16,
845,
33,
7036,
4672,
468,
22,
30,
6030,
12532,
10035,
30,
2593,
1166,
67,
57,
86,
56,
67,
12148,
67,
90,
24,
18,
21,
30,
341,... |
f = urlopen(url, req) | f = urlopen(url, req, TIMEOUT) | def _test_urls(self, urls, handlers, retry=True): import time import logging debug = logging.getLogger("test_urllib2").debug | b76030ae2244b53a21c2f951d570488d52ebc006 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/b76030ae2244b53a21c2f951d570488d52ebc006/test_urllib2net.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3813,
67,
10518,
12,
2890,
16,
6903,
16,
4919,
16,
3300,
33,
5510,
4672,
1930,
813,
1930,
2907,
1198,
273,
2907,
18,
588,
3328,
2932,
3813,
67,
718,
2941,
22,
20387,
4148,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3813,
67,
10518,
12,
2890,
16,
6903,
16,
4919,
16,
3300,
33,
5510,
4672,
1930,
813,
1930,
2907,
1198,
273,
2907,
18,
588,
3328,
2932,
3813,
67,
718,
2941,
22,
20387,
4148,
2,
-100... |
libs = mysql_config("libmysqld_libs") | libs = mysql_config("libmysqld-libs") | def enabled(option): value = options[option] s = value.lower() if s in ('yes','true','1','y'): return True elif s in ('no', 'false', '0', 'n'): return False else: raise Abort, "Unknown value %s for option %s" % (value, option) | 5e867b6f181a82f18c68d783ec01248c5ca394c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10477/5e867b6f181a82f18c68d783ec01248c5ca394c5/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3696,
12,
3482,
4672,
460,
273,
702,
63,
3482,
65,
272,
273,
460,
18,
8167,
1435,
309,
272,
316,
7707,
9707,
17023,
3767,
17023,
21,
17023,
93,
11,
4672,
327,
1053,
1327,
272,
316,
770... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3696,
12,
3482,
4672,
460,
273,
702,
63,
3482,
65,
272,
273,
460,
18,
8167,
1435,
309,
272,
316,
7707,
9707,
17023,
3767,
17023,
21,
17023,
93,
11,
4672,
327,
1053,
1327,
272,
316,
770... |
self.positions[:,:,-1].max(axis=0)>180, self.positions[:,:,-1].min(axis=0)<280 | self.positions[:,:,-1].max(axis=0)>bottom, self.positions[:,:,-1].min(axis=0)<top | def z_slab(self, bottom, top, allTimes=True): """remove all trajectories that are not in the slab defined by [bottom, top]""" if allTimes: selection = np.unique1d(np.where( np.bitwise_and( self.positions[:,:,-1]>180, self.positions[:,:,-1]<280 ))[1]) else: selection = np.unique1d(np.where( np.bitwise_and( self.positions[:,:,-1].max(axis=0)>180, self.positions[:,:,-1].min(axis=0)<280 ))) self.trajs = self.trajs[selection] self.positions = self.positions[:,selection] | f6b41338b974c6729411daaeac37e1cd5466224c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3150/f6b41338b974c6729411daaeac37e1cd5466224c/experiment.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
998,
67,
2069,
378,
12,
2890,
16,
5469,
16,
1760,
16,
777,
10694,
33,
5510,
4672,
3536,
4479,
777,
1284,
937,
2401,
716,
854,
486,
316,
326,
27679,
2553,
635,
306,
9176,
16,
1760,
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,
998,
67,
2069,
378,
12,
2890,
16,
5469,
16,
1760,
16,
777,
10694,
33,
5510,
4672,
3536,
4479,
777,
1284,
937,
2401,
716,
854,
486,
316,
326,
27679,
2553,
635,
306,
9176,
16,
1760,
65,
... |
self.session.openWithCallback(self.callback, MessageBox, _("Test-Messagebox?")) | self.session.openWithCallback(self.mycallback, MessageBox, _("Test-Messagebox?")) | def openTest(self): self.session.openWithCallback(self.callback, MessageBox, _("Test-Messagebox?")) | e21f1d8fb1bc528bf05adbb827295bd5dbf3ebc9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6652/e21f1d8fb1bc528bf05adbb827295bd5dbf3ebc9/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
4709,
12,
2890,
4672,
365,
18,
3184,
18,
3190,
1190,
2428,
12,
2890,
18,
3394,
16,
2350,
3514,
16,
389,
2932,
4709,
17,
1079,
2147,
7225,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
4709,
12,
2890,
4672,
365,
18,
3184,
18,
3190,
1190,
2428,
12,
2890,
18,
3394,
16,
2350,
3514,
16,
389,
2932,
4709,
17,
1079,
2147,
7225,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-... |
status['indexCounters']['btree']['accessesPS'] = float(status['indexCounters']['btree']['accesses'] - self.mongoDBStore['indexCounters']['btree']['accesses']) / 60 status['indexCounters']['btree']['hitsPS'] = float(status['indexCounters']['btree']['hits'] - self.mongoDBStore['indexCounters']['btree']['hits']) / 60 status['indexCounters']['btree']['missesPS'] = float(status['indexCounters']['btree']['misses'] - self.mongoDBStore['indexCounters']['btree']['misses']) / 60 status['indexCounters']['btree']['missRatioPS'] = float(status['indexCounters']['btree']['missRatio'] - self.mongoDBStore['indexCounters']['btree']['missRatio']) / 60 status['opcounters']['insertPS'] = float(status['opcounters']['insert'] - self.mongoDBStore['opcounters']['insert']) / 60 status['opcounters']['queryPS'] = float(status['opcounters']['query'] - self.mongoDBStore['opcounters']['query']) / 60 status['opcounters']['updatePS'] = float(status['opcounters']['update'] - self.mongoDBStore['opcounters']['update']) / 60 status['opcounters']['deletePS'] = float(status['opcounters']['delete'] - self.mongoDBStore['opcounters']['delete']) / 60 status['opcounters']['getmorePS'] = float(status['opcounters']['getmore'] - self.mongoDBStore['opcounters']['getmore']) / 60 status['opcounters']['commandPS'] = float(status['opcounters']['command'] - self.mongoDBStore['opcounters']['command']) / 60 status['asserts']['regularPS'] = float(status['asserts']['regular'] - self.mongoDBStore['asserts']['regular']) / 60 status['asserts']['warningPS'] = float(status['asserts']['warning'] - self.mongoDBStore['asserts']['warning']) / 60 status['asserts']['msgPS'] = float(status['asserts']['msg'] - self.mongoDBStore['asserts']['msg']) / 60 status['asserts']['userPS'] = float(status['asserts']['user'] - self.mongoDBStore['asserts']['user']) / 60 status['asserts']['rolloversPS'] = float(status['asserts']['rollovers'] - self.mongoDBStore['asserts']['rollovers']) / 60 | accessesPS = float(status['indexCounters']['btree']['accesses'] - self.mongoDBStore['indexCounters']['btree']['accesses']) / 60 if accessesPS >= 0: status['indexCounters']['btree']['accessesPS'] = accessesPS status['indexCounters']['btree']['hitsPS'] = float(status['indexCounters']['btree']['hits'] - self.mongoDBStore['indexCounters']['btree']['hits']) / 60 status['indexCounters']['btree']['missesPS'] = float(status['indexCounters']['btree']['misses'] - self.mongoDBStore['indexCounters']['btree']['misses']) / 60 status['indexCounters']['btree']['missRatioPS'] = float(status['indexCounters']['btree']['missRatio'] - self.mongoDBStore['indexCounters']['btree']['missRatio']) / 60 status['opcounters']['insertPS'] = float(status['opcounters']['insert'] - self.mongoDBStore['opcounters']['insert']) / 60 status['opcounters']['queryPS'] = float(status['opcounters']['query'] - self.mongoDBStore['opcounters']['query']) / 60 status['opcounters']['updatePS'] = float(status['opcounters']['update'] - self.mongoDBStore['opcounters']['update']) / 60 status['opcounters']['deletePS'] = float(status['opcounters']['delete'] - self.mongoDBStore['opcounters']['delete']) / 60 status['opcounters']['getmorePS'] = float(status['opcounters']['getmore'] - self.mongoDBStore['opcounters']['getmore']) / 60 status['opcounters']['commandPS'] = float(status['opcounters']['command'] - self.mongoDBStore['opcounters']['command']) / 60 status['asserts']['regularPS'] = float(status['asserts']['regular'] - self.mongoDBStore['asserts']['regular']) / 60 status['asserts']['warningPS'] = float(status['asserts']['warning'] - self.mongoDBStore['asserts']['warning']) / 60 status['asserts']['msgPS'] = float(status['asserts']['msg'] - self.mongoDBStore['asserts']['msg']) / 60 status['asserts']['userPS'] = float(status['asserts']['user'] - self.mongoDBStore['asserts']['user']) / 60 status['asserts']['rolloversPS'] = float(status['asserts']['rollovers'] - self.mongoDBStore['asserts']['rollovers']) / 60 else: self.checksLogger.debug('getMongoDBStatus: negative value calculated, mongod likely restarted, so clearing cache') self.clearMongoDBStatus(status) | def getMongoDBStatus(self): self.checksLogger.debug('getMongoDBStatus: start') | 18075788401719b0c7f4ea331929b7bed8c12313 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13266/18075788401719b0c7f4ea331929b7bed8c12313/checks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2108,
5409,
2290,
1482,
12,
2890,
4672,
365,
18,
12366,
3328,
18,
4148,
2668,
588,
16578,
2290,
1482,
30,
787,
6134,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2108,
5409,
2290,
1482,
12,
2890,
4672,
365,
18,
12366,
3328,
18,
4148,
2668,
588,
16578,
2290,
1482,
30,
787,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
xsorted = numpy.sort(data.compressed().view(ndarray)) | xsorted = numpy.squeeze(numpy.sort(data.compressed().view(ndarray))) | def _hd_1D(data,prob,var): "Computes the HD quantiles for a 1D array." xsorted = numpy.sort(data.compressed().view(ndarray)) n = len(xsorted) #......... hd = empty((2,len(prob)), float_) if n < 2: hd.flat = numpy.nan return hd #......... v = arange(n+1) / float(n) betacdf = beta.cdf for (i,p) in enumerate(prob): _w = betacdf(v, (n+1)*p, (n+1)*(1-p)) w = _w[1:] - _w[:-1] hd_mean = dot(w, xsorted) hd[0,i] = hd_mean # hd[1,i] = dot(w, (xsorted-hd_mean)**2) # hd[0, prob == 0] = xsorted[0] hd[0, prob == 1] = xsorted[-1] if var: hd[1, prob == 0] = hd[1, prob == 1] = numpy.nan return hd return hd[0] | 98f1ac0fb0c066c16e677eaf94180201c79d6b1d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/98f1ac0fb0c066c16e677eaf94180201c79d6b1d/morestats.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
22057,
67,
21,
40,
12,
892,
16,
7748,
16,
1401,
4672,
315,
10743,
326,
670,
40,
10251,
1449,
364,
279,
404,
40,
526,
1199,
619,
10350,
273,
3972,
18,
87,
14652,
12,
15974,
18,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
22057,
67,
21,
40,
12,
892,
16,
7748,
16,
1401,
4672,
315,
10743,
326,
670,
40,
10251,
1449,
364,
279,
404,
40,
526,
1199,
619,
10350,
273,
3972,
18,
87,
14652,
12,
15974,
18,
3... |
self.startedEvent = Event | self.startedEvent = Event() | def __init__(self, fn, args): self.fn = fn self.args = args #self.startedEvent = threading.Event() from gevent.event import Event self.startedEvent = Event threading.Thread.__init__(self) | ce16f232915fa69a3fb90c91be1e5b5b97d66ce1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10423/ce16f232915fa69a3fb90c91be1e5b5b97d66ce1/test_queue.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2295,
16,
833,
4672,
365,
18,
4293,
273,
2295,
365,
18,
1968,
273,
833,
468,
2890,
18,
14561,
1133,
273,
17254,
18,
1133,
1435,
628,
314,
2575,
18,
2575,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
2295,
16,
833,
4672,
365,
18,
4293,
273,
2295,
365,
18,
1968,
273,
833,
468,
2890,
18,
14561,
1133,
273,
17254,
18,
1133,
1435,
628,
314,
2575,
18,
2575,... |
def test_loadConfig(self): | def test_load_config(self): | def test_loadConfig(self): # Setup origFile = '../../etc/pulp.ini' overrideFile = './data/test-override-pulp.ini' # Test & Verify config = loadConfig(origFile) self.assertEqual(config.get('paths', 'http_mount'), '/var/www/pulp') | 229c124ea41f8e0597c5d27df37d7bcc680eb620 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10692/229c124ea41f8e0597c5d27df37d7bcc680eb620/test_util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
945,
67,
1425,
12,
2890,
4672,
468,
10939,
1647,
812,
273,
296,
16644,
14175,
19,
84,
14290,
18,
8767,
11,
3849,
812,
273,
12871,
892,
19,
3813,
17,
10601,
17,
84,
14290,
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,
945,
67,
1425,
12,
2890,
4672,
468,
10939,
1647,
812,
273,
296,
16644,
14175,
19,
84,
14290,
18,
8767,
11,
3849,
812,
273,
12871,
892,
19,
3813,
17,
10601,
17,
84,
14290,
18,... |
widget.setPosHpr(state.base, state.pos, state.hpr) else: base.direct.widget.setPosHpr(state.base, state.pos, state.hpr) | if self.worldSpaceManip: widget.setPos(state.base, state.pos) widget.setHpr(render, VBase3(0)) else: widget.setPosHpr(state.base, state.pos, state.hpr) else: if self.worldSpaceManip: widget.setPos(state.base, state.pos) widget.setHpr(render, VBase3(0)) else: base.direct.widget.setPosHpr(state.base, state.pos, state.hpr) | def followSelectedNodePathTask(self, state): if hasattr(base.direct, "manipulationControl") and base.direct.manipulationControl.fMultiView: for widget in base.direct.manipulationControl.widgetList: widget.setPosHpr(state.base, state.pos, state.hpr) else: base.direct.widget.setPosHpr(state.base, state.pos, state.hpr) return Task.cont | b66a795efbe737fd1c72c92a17e4de984a14e0f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8543/b66a795efbe737fd1c72c92a17e4de984a14e0f7/DirectManipulation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2805,
7416,
907,
743,
2174,
12,
2890,
16,
919,
4672,
309,
3859,
12,
1969,
18,
7205,
16,
315,
4728,
625,
6234,
3367,
7923,
471,
1026,
18,
7205,
18,
4728,
625,
6234,
3367,
18,
74,
5002,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2805,
7416,
907,
743,
2174,
12,
2890,
16,
919,
4672,
309,
3859,
12,
1969,
18,
7205,
16,
315,
4728,
625,
6234,
3367,
7923,
471,
1026,
18,
7205,
18,
4728,
625,
6234,
3367,
18,
74,
5002,
... |
str += I+'<TH CLASS="navbar"> '+\ '<A CLASS="navbar" HREF="'+`uid.module()`+'.html">'+\ 'Module</A> </TH>\n' | str += I+'<th class="navbar"> ' str += '<a class="navbar" href="'+`uid.module()`+'.html">' str += 'Module</a> </th>\n' | def _navbar(self, where, uid=None): """ @param where: What page the navbar is being displayed on.. """ str = self._start_of('Navbar') str += '<TABLE CLASS="navbar" BORDER="0" WIDTH="100%"' str += ' CELLPADDING="0" BGCOLOR="#a0c0ff" CELLSPACING="0">\n' str += ' <TR>\n' str += ' <TD WIDTH="100%">\n' str += ' <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">\n' str += ' <TR VALIGN="top">\n' | 89bd16eaf8c7e556babe42c6a92621dbc9b8a7e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/89bd16eaf8c7e556babe42c6a92621dbc9b8a7e9/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11589,
3215,
12,
2890,
16,
1625,
16,
4555,
33,
7036,
4672,
3536,
632,
891,
1625,
30,
18734,
1363,
326,
8775,
3215,
353,
3832,
10453,
603,
838,
3536,
609,
273,
365,
6315,
1937,
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,
11589,
3215,
12,
2890,
16,
1625,
16,
4555,
33,
7036,
4672,
3536,
632,
891,
1625,
30,
18734,
1363,
326,
8775,
3215,
353,
3832,
10453,
603,
838,
3536,
609,
273,
365,
6315,
1937,
67,
... |
infoStr = "StorageElement.putFile%s" % res['Message'] gLogger.error(infoStr) | errStr = "StorageElement.putFile: Completely failed to put file: %s" % res['Message'] gLogger.error(errStr,"%s with protocol %s" % (destUrl,protocolName)) | def putFile(self,file,alternativePath=None,desiredProtocol=None): """ This method will upload a local file to the SE | 7103ee9939a5a7ab45b51df34eb263621ec53a2c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12864/7103ee9939a5a7ab45b51df34eb263621ec53a2c/StorageElement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
812,
12,
2890,
16,
768,
16,
27071,
743,
33,
7036,
16,
30458,
5752,
33,
7036,
4672,
3536,
1220,
707,
903,
3617,
279,
1191,
585,
358,
326,
3174,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
812,
12,
2890,
16,
768,
16,
27071,
743,
33,
7036,
16,
30458,
5752,
33,
7036,
4672,
3536,
1220,
707,
903,
3617,
279,
1191,
585,
358,
326,
3174,
2,
-100,
-100,
-100,
-100,
-100,
-1... |
size = self.getFileInfo(source, opt)[0] | result = self.getFileInfo(source, opt) if result.__type__ is list: if result[0].__type__ is list: raise OperationException("Error: not a file but a not empty directory!") else: return result[0] else: raise OperationException("Error: not a file but a not empty directory!") | def getFileSize(self, source, opt = ""): """ file size """ size = self.getFileInfo(source, opt)[0] return int(size) | 36738c853ae6fa7e85807f523d02ebd2d470933f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/36738c853ae6fa7e85807f523d02ebd2d470933f/ProtocolRfio.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6034,
1225,
12,
2890,
16,
1084,
16,
2153,
273,
1408,
4672,
3536,
585,
963,
3536,
563,
273,
365,
18,
588,
11995,
12,
3168,
16,
2153,
13,
309,
563,
16186,
723,
972,
353,
666,
30,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6034,
1225,
12,
2890,
16,
1084,
16,
2153,
273,
1408,
4672,
3536,
585,
963,
3536,
563,
273,
365,
18,
588,
11995,
12,
3168,
16,
2153,
13,
309,
563,
16186,
723,
972,
353,
666,
30,
309,
... |
spec['parentEntId'] = parentEntId | if parentEntId != 'unspecified': spec['parentEntId'] = parentEntId | def insertEntity(self, entId, entType, parentEntId): LevelSpec.notify.info('inserting entity %s (%s)' % (entId, entType)) assert entId not in self.entId2specDict assert self.entTypeReg is not None globalEnts = self.privGetGlobalEntityDict() self.entId2specDict[entId] = globalEnts | 6aaa15f2f2242bf3d0d0b846af96ddf08f07748e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/6aaa15f2f2242bf3d0d0b846af96ddf08f07748e/LevelSpec.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2243,
1943,
12,
2890,
16,
3281,
548,
16,
3281,
559,
16,
982,
14199,
548,
4672,
4557,
1990,
18,
12336,
18,
1376,
2668,
6387,
310,
1522,
738,
87,
6142,
87,
2506,
738,
261,
319,
548,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2243,
1943,
12,
2890,
16,
3281,
548,
16,
3281,
559,
16,
982,
14199,
548,
4672,
4557,
1990,
18,
12336,
18,
1376,
2668,
6387,
310,
1522,
738,
87,
6142,
87,
2506,
738,
261,
319,
548,
16,
... |
"""set associate mode as a normal user, you will get a 'Operation not permitted' | """ Set the association mode. As a normal user, you will get an 'Operation not permitted' | def setEncryption(self, mode): """set associate mode | 05b40a3d0b9e46299ea3a7ddfd32be4a1e2ba258 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3159/05b40a3d0b9e46299ea3a7ddfd32be4a1e2ba258/iwlibs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
7894,
12,
2890,
16,
1965,
4672,
3536,
542,
13251,
1965,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
7894,
12,
2890,
16,
1965,
4672,
3536,
542,
13251,
1965,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mod_data_dict[(mod_list[mod_column_name_row_num]).strip()] = map(float, mod_list[mod_data_row_num:]) | mod_data_dict[mod_list[mod_column_name_row_num].strip()] = map(float, mod_list[mod_data_row_num:]) | def find_start_stop_index(data_dict,col_name,start_time_data,stop_time_data,start_time_comp,stop_time_comp): #This function is used to find index numbers for start and stop points in plotting and min-max values. rowcounter1 = 0 for time_value1 in data_dict[col_name]: if time_value1 >= (float(start_time_data)*60): #print "Set #1" #print "Time Starts at row #:", str(rowcounter1) #print "With a value of:", str(time_value1) time_start_index = rowcounter1 break rowcounter1 += 1 rowcounter2 = 0 for time_value2 in data_dict[col_name]: if float(data_dict[col_name][(len(data_dict[col_name])-1)]) < (float(stop_time_data)*60): #print "Specified end of plot time is greater than end of time in the data set. \nUsing last value in the time column.\n" #print "Time used is: "+str(float(data_dict[col_name][(len(data_dict[col_name])-1)]))+"\n" time_end_index = (len(data_dict[col_name])-1) break else: row_number2 = (rowcounter2 - 1) #print "Set #2" #print "Time Ends at row #: "+str(row_number2) #print "With a value of: "+str(data_dict[col_name][row_number2]) time_end_index = row_number2 break | 93e8fdd038707661dcc82494e49803ca362e12a7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12/93e8fdd038707661dcc82494e49803ca362e12a7/Validation_Data_Processor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
1937,
67,
5681,
67,
1615,
12,
892,
67,
1576,
16,
1293,
67,
529,
16,
1937,
67,
957,
67,
892,
16,
5681,
67,
957,
67,
892,
16,
1937,
67,
957,
67,
2919,
16,
5681,
67,
957,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
1937,
67,
5681,
67,
1615,
12,
892,
67,
1576,
16,
1293,
67,
529,
16,
1937,
67,
957,
67,
892,
16,
5681,
67,
957,
67,
892,
16,
1937,
67,
957,
67,
2919,
16,
5681,
67,
957,
... |
for i in xrange(len(data)): if data[i]['permid'] == permid: return i | try: for i in xrange(len(data)): if data[i]['permid'] == permid: return i except: return -1 | def getPeerDataIndex(self, permid, filter_name='all'): """same as getPeerData only that returns the index of the item in the list provided by filter_name useful for index optimization""" if self.filtered_data.get(filter_name) is None: return -1 data = self.filtered_data[filter_name] for i in xrange(len(data)): if data[i]['permid'] == permid: return i return -1 | 33a65b14d6210f42b61e1d5f47eb28e06273d11b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9686/33a65b14d6210f42b61e1d5f47eb28e06273d11b/peermanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29875,
751,
1016,
12,
2890,
16,
4641,
350,
16,
1034,
67,
529,
2218,
454,
11,
4672,
3536,
14307,
487,
29875,
751,
1338,
716,
1135,
326,
770,
434,
326,
761,
316,
326,
666,
2112,
635,
103... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29875,
751,
1016,
12,
2890,
16,
4641,
350,
16,
1034,
67,
529,
2218,
454,
11,
4672,
3536,
14307,
487,
29875,
751,
1338,
716,
1135,
326,
770,
434,
326,
761,
316,
326,
666,
2112,
635,
103... |
else | else: | def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 844) else quickfix.IntField.__init__(self, 844, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
1725,
6334,
13,
469,
30,
9549,
904,
18,
1702,
974,
16186,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
1725,
6334,
13,
469,
30,
9549,
904,
18,
1702,
974,
16186,
27... |
self.grid[self.counter, 0] = float(words[0]) self.grid[self.counter, 1] = float(words[1]) self.grid[self.counter, 2] = float(words[2]) self.grid[self.counter, 3] = float(words[3]) self.counter += 1 def result(self): return self.grid | if len(words) == 4: try: self.grid.append([ float(words[0]), float(words[1]), float(words[2]), float(words[3]) ]) except ValueError: self.active = False else: self.active = False elif len(self.grid) == 0: if line == self.trigger: self.active = True def result(self): return numpy.array(self.grid, float) | def parse(self, line): if self.grid is None: if line[:21] == "# Number of records: ": num = int(line[21:]) self.grid = numpy.zeros((num, 4), float) else: words = line.split() self.grid[self.counter, 0] = float(words[0]) self.grid[self.counter, 1] = float(words[1]) self.grid[self.counter, 2] = float(words[2]) self.grid[self.counter, 3] = float(words[3]) self.counter += 1 | df6409ad85dfe3891d12c2c83e1fc571a4ca3db2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11053/df6409ad85dfe3891d12c2c83e1fc571a4ca3db2/file_parsers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
980,
4672,
309,
365,
18,
5222,
353,
599,
30,
309,
980,
10531,
5340,
65,
422,
6619,
3588,
434,
3853,
30,
6398,
818,
273,
509,
12,
1369,
63,
5340,
30,
5717,
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,
1109,
12,
2890,
16,
980,
4672,
309,
365,
18,
5222,
353,
599,
30,
309,
980,
10531,
5340,
65,
422,
6619,
3588,
434,
3853,
30,
6398,
818,
273,
509,
12,
1369,
63,
5340,
30,
5717,
365,
18... |
try: self.current_target = self.iter.next() if debug_prints: print "next target is %s" % HexDump.address(self.current_target) if self.options.output: print "Trying: %s" % HexDump.address(self.current_target) except StopIteration: self.stopTesting() return | def nextAddress(self): if debug_prints: print "continue testing" self.removeBreakpoint() try: self.current_target = self.iter.next() if debug_prints: print "next target is %s" % HexDump.address(self.current_target) if self.options.output: print "Trying: %s" % HexDump.address(self.current_target) except StopIteration: self.stopTesting() return self.restoreSnapshot() self.changeExceptionHandler() self.setBreakpoint() | 6d6079c7bcc0ba519b666a5d46e251aede9525d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7261/6d6079c7bcc0ba519b666a5d46e251aede9525d0/sehtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
1887,
12,
2890,
4672,
309,
1198,
67,
1188,
87,
30,
1172,
315,
17143,
7769,
6,
365,
18,
4479,
20552,
1435,
365,
18,
13991,
4568,
1435,
365,
18,
3427,
18894,
1435,
365,
18,
542,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1024,
1887,
12,
2890,
4672,
309,
1198,
67,
1188,
87,
30,
1172,
315,
17143,
7769,
6,
365,
18,
4479,
20552,
1435,
365,
18,
13991,
4568,
1435,
365,
18,
3427,
18894,
1435,
365,
18,
542,
20... | |
if req.method == 'POST' and 'owner' in req.args and \ | if req.method == 'POST' and 'field_owner' in req.args and \ | def process_newticket_request(self, req): req.perm.require('TICKET_CREATE') data = {} db = self.env.get_db_cnx() | daeaacb4a8d7e14bcd4491b18a83e37c26c94ecb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/daeaacb4a8d7e14bcd4491b18a83e37c26c94ecb/web_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2704,
16282,
67,
2293,
12,
2890,
16,
1111,
4672,
1111,
18,
12160,
18,
6528,
2668,
56,
16656,
1584,
67,
9344,
6134,
501,
273,
2618,
1319,
273,
365,
18,
3074,
18,
588,
67,
1966... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2704,
16282,
67,
2293,
12,
2890,
16,
1111,
4672,
1111,
18,
12160,
18,
6528,
2668,
56,
16656,
1584,
67,
9344,
6134,
501,
273,
2618,
1319,
273,
365,
18,
3074,
18,
588,
67,
1966... |
data [ node.tag] = node.text.strip() return data def fetch_devices_from_indigo (self, ignore_filter=["",]): """ Depreciated, do not use. Inputs: ignore_filter - the Insteon or X10 addresses to filter out Outputs: None, populates the insteon_devices & x10_devices of the Indigo_Restful_Server object. The insteon_devices & x10_devices are a list of device dictionarys. The dictionary contains the device data from the server. Depending on the device, this data will be different (eg, The Thermostat Adapter will not have the same data that an ApplianceLinc has. Replaced by get_device_by_name, and get_device_list. """ devices = self.fetch_web_page ( self.server_address + r"/devices.txt/") for x in devices: device_data = self.fetch_web_page (self.server_address + x.replace(" ", "%20")) device_data = self.map_device_to_dict ( device_data) if self.return_device_from_insteonaddr ( device_data) <> None: if not(self.return_device_type(device_data) in ignore_filter): self.insteon_devices [device_data["name"]] = device_data if self.return_device_from_x10_addr ( device_data) <> None: if not(self.return_device_type(device_data) in ignore_filter): self.x10_devices [device_data["name"]] = device_data | if node.text <> None: data [ node.tag] = node.text.strip() else: data [ node.tag ] = node.text return data | def __init__ ( self): """ Initialization routines, clears the X10 device list, Insteon Device List, and clears the Server Address. Inputs - None Outputs - None """ self.x10_devices = {} self.insteon_devices = {} self.server_address = "" | 4e3c39c14d9bfff1471bed5c40725d72a8a1cbf8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4701/4e3c39c14d9bfff1471bed5c40725d72a8a1cbf8/indigo_restful_api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
365,
4672,
3536,
26586,
28580,
16,
22655,
326,
1139,
2163,
2346,
666,
16,
13448,
73,
265,
6077,
987,
16,
471,
22655,
326,
3224,
5267,
18,
225,
24472,
300,
599,
2616... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
261,
365,
4672,
3536,
26586,
28580,
16,
22655,
326,
1139,
2163,
2346,
666,
16,
13448,
73,
265,
6077,
987,
16,
471,
22655,
326,
3224,
5267,
18,
225,
24472,
300,
599,
2616... |
hbox.pack_end(self.recurse_dirs,False, False) | hbox2.pack_start(self.recurse_dirs,False, False, 5) | def __init__(self, in_path = None): rox.Window.__init__(self) self.set_title(APP_NAME) self.set_default_size(550, 500) self.cancel = False self.running = False self.selected = False self.path = '' self.what = '' self.where = '' toolbar = gtk.Toolbar() toolbar.set_style(gtk.TOOLBAR_ICONS) toolbar.insert_stock(gtk.STOCK_CLOSE, _('Close'), None, self.close, None, -1) self.show_btn = toolbar.insert_stock(gtk.STOCK_GO_UP, _('Show file'), None, self.show_dir, None, -1) self.find_btn = toolbar.insert_stock(gtk.STOCK_EXECUTE, _('Find'), None, self.start_find, None, -1) self.clear_btn = toolbar.insert_stock(gtk.STOCK_CLEAR, _('Clear'), None, self.clear, None, -1) self.cancel_btn = toolbar.insert_stock(gtk.STOCK_STOP, _('Cancel'), None, self.cancel_find, None, -1) toolbar.insert_stock(gtk.STOCK_PREFERENCES, _('Settings'), None, self.edit_options, None, -1) | 438364b32a747fe39be6e8f2ea68669bc697db81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5002/438364b32a747fe39be6e8f2ea68669bc697db81/filefind.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
316,
67,
803,
273,
599,
4672,
721,
92,
18,
3829,
16186,
2738,
972,
12,
2890,
13,
365,
18,
542,
67,
2649,
12,
7215,
67,
1985,
13,
365,
18,
542,
67,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
316,
67,
803,
273,
599,
4672,
721,
92,
18,
3829,
16186,
2738,
972,
12,
2890,
13,
365,
18,
542,
67,
2649,
12,
7215,
67,
1985,
13,
365,
18,
542,
67,
18... |
with support.temp_cwd('\xe7w\xf0'): | with support.temp_cwd(b'\xe7w\xf0'): | def test_abspath_issue3426(self): # Check that abspath returns unicode when the arg is unicode # with both ASCII and non-ASCII cwds. abspath = self.pathmodule.abspath for path in ('', 'fuu', 'f\xf9\xf9', '/fuu', 'U:\\'): self.assertIsInstance(abspath(path), str) | f7f676fc1038d8fcd1516bf94af6ca18970898c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/f7f676fc1038d8fcd1516bf94af6ca18970898c2/test_genericpath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5113,
803,
67,
13882,
5026,
5558,
12,
2890,
4672,
468,
2073,
716,
9488,
1135,
5252,
1347,
326,
1501,
353,
5252,
468,
598,
3937,
11768,
471,
1661,
17,
13756,
14098,
2377,
18,
94... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5113,
803,
67,
13882,
5026,
5558,
12,
2890,
4672,
468,
2073,
716,
9488,
1135,
5252,
1347,
326,
1501,
353,
5252,
468,
598,
3937,
11768,
471,
1661,
17,
13756,
14098,
2377,
18,
94... |
if lvl > maxdepth or id is None: | if lvl < mindepth or lvl > maxdepth or id is None: | def macro_TableOfContents(macro, maxdepth=int): """ | 29b9e534b78fa120f43f459f67c75e7f990e29f4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/888/29b9e534b78fa120f43f459f67c75e7f990e29f4/TableOfContents.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
67,
1388,
951,
6323,
12,
26448,
16,
943,
5979,
33,
474,
4672,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
11522,
67,
1388,
951,
6323,
12,
26448,
16,
943,
5979,
33,
474,
4672,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if 'latex' in node.get('format', '').split(): self.out.append(node.astext()) raise nodes.SkipNode | if not 'latex' in node.get('format', '').split(): raise nodes.SkipNode if node['classes']: self.visit_inline(node) self.verbatim = True def depart_raw(self, node): self.verbatim = False if node['classes']: self.depart_inline(node) | def visit_raw(self, node): if 'latex' in node.get('format', '').split(): self.out.append(node.astext()) raise nodes.SkipNode | d1a332cc00a1b10df4c2b8fa6efdd3ca79dbf763 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1278/d1a332cc00a1b10df4c2b8fa6efdd3ca79dbf763/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
1899,
12,
2890,
16,
756,
4672,
309,
296,
26264,
11,
316,
756,
18,
588,
2668,
2139,
2187,
875,
2934,
4939,
13332,
365,
18,
659,
18,
6923,
12,
2159,
18,
689,
408,
10756,
1002,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
1899,
12,
2890,
16,
756,
4672,
309,
296,
26264,
11,
316,
756,
18,
588,
2668,
2139,
2187,
875,
2934,
4939,
13332,
365,
18,
659,
18,
6923,
12,
2159,
18,
689,
408,
10756,
1002,
... |
ponyFactory = OneTrickPonyServerFactory() self.testListening() | def actualTest(ign): ponyFactory = OneTrickPonyServerFactory() _1 = self.addClientService( self.toAddress, 'aaaa', self.serverService) def _1c(_1result): self.clientServerService2 = _1result _2 = self.clientServerService2.listenQ2Q(self.toAddress, {'pony': ponyFactory}, 'ponies are weird') def _2c(ign): _3 = self.clientServerService.listenQ2Q(self.toAddress, {'pony': ponyFactory}, 'ponies rule') def _3c(ign): expectedList = ['ponies rule', 'ponies are weird', 'test-description'] def chooser(servers): self.failUnlessEqual(len(servers), 3) for server in servers: expectedList.remove(server['description']) if server['description'] == 'ponies rule': self.assertEquals( self.clientServerService.certificateStorage.getPrivateCertificate(str(self.toAddress)), server['certificate']) yield server ponged = defer.Deferred() _4 = self.clientClientService.connectQ2Q( self.fromAddress, self.toAddress, 'pony', OneTrickPonyClientFactory(ponged), chooser=chooser) def _4c(ign): self.failUnlessEqual(expectedList, []) return _4.addCallback(_4c) return _3.addCallback(_3c) return _2.addCallback(_2c) return _1.addCallback(_1c) return self.testListening().addCallback(actualTest) | def testChooserGetsThreeChoices(self): ponyFactory = OneTrickPonyServerFactory() self.testListening() | 37f03e58474c9d3756dd1192a546f215552de242 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8962/37f03e58474c9d3756dd1192a546f215552de242/test_q2q.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
17324,
3002,
28019,
17442,
12,
2890,
4672,
293,
6598,
1733,
273,
6942,
1070,
1200,
52,
6598,
2081,
1733,
1435,
365,
18,
3813,
31594,
1435,
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,
0,
0,
0,
0,
0,
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,
17324,
3002,
28019,
17442,
12,
2890,
4672,
293,
6598,
1733,
273,
6942,
1070,
1200,
52,
6598,
2081,
1733,
1435,
365,
18,
3813,
31594,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if field.field == 'partner_id': attrs.append('on_change="onchange_partner_id(move_id,partner_id,account_id,debit,credit,date,((\'journal_id\' in context) and context[\'journal_id\']) or {})"') | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False): result = super(osv.osv, self).fields_view_get(cr, uid, view_id,view_type,context,toolbar=toolbar) if view_type=='tree' and 'journal_id' in context: title = self.view_header_get(cr, uid, view_id, view_type, context) journal = self.pool.get('account.journal').browse(cr, uid, context['journal_id']) | d96f05d8de12cfa447d79576c3d8b17cbcdda975 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/d96f05d8de12cfa447d79576c3d8b17cbcdda975/account_move_line.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1466,
67,
1945,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1476,
67,
350,
33,
7036,
16,
1476,
67,
723,
2218,
687,
2187,
819,
28793,
12748,
33,
8381,
4672,
563,
273,
2240,
12,
538,
90... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1466,
67,
1945,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1476,
67,
350,
33,
7036,
16,
1476,
67,
723,
2218,
687,
2187,
819,
28793,
12748,
33,
8381,
4672,
563,
273,
2240,
12,
538,
90... | |
copy_to_target("keydaemon/tests/*", target_dir) | def main(): repytest = False RANDOMPORTS = False target_dir = None for arg in sys.argv[1:]: # -t means we will copy repy tests if arg == '-t': repytest = True # The user wants us to fill in the port numbers randomly. elif arg == '-randomports': RANDOMPORTS = True # Not a flag? Assume it's the target directory else: target_dir = arg # We need a target dir. If one isn't found in argv, quit. if target_dir is None: help_exit("Please pass the target directory as a parameter.") #store root directory current_dir = os.getcwd() # Make sure they gave us a valid directory if not( os.path.isdir(target_dir) ): help_exit("given foldername is not a directory") #set working directory to the test folder os.chdir(target_dir) files_to_remove = glob.glob("*") #clean the test folder for f in files_to_remove: if os.path.isdir(f): shutil.rmtree(f) else: os.remove(f) #go back to root project directory os.chdir(current_dir) #now we copy the necessary files to the test folder copy_to_target("repy/*", target_dir) copy_to_target("nodemanager/*", target_dir) copy_to_target("portability/*", target_dir) copy_to_target("seattlelib/*", target_dir) copy_to_target("seash/*", target_dir) copy_to_target("softwareupdater/*", target_dir) copy_to_target("autograder/nm_remote_api.mix", target_dir) copy_to_target("keydaemon/*", target_dir) # The license must be included in anything we distribute. copy_to_target("LICENSE.TXT", target_dir) if repytest: # Only copy the tests if they were requested. copy_to_target("repy/tests/*", target_dir) copy_to_target("nodemanager/tests/*", target_dir) copy_to_target("portability/tests/*", target_dir) copy_to_target("seash/tests/*", target_dir) copy_to_target("seattlelib/tests/*", target_dir) copy_to_target("keydaemon/tests/*", target_dir) copy_to_target("dist/update_crontab_entry.py", target_dir) # The web server is used in the software updater tests copy_to_target("assignments/webserver/*", target_dir) copy_to_target("softwareupdater/test/*", target_dir) #set working directory to the test folder os.chdir(target_dir) #call the process_mix function to process all mix files in the target directory process_mix("repypp.py") # set up dynamic port information if RANDOMPORTS: portstouseasints = random.sample(range(52000, 53000), 3) portstouseasstr = [] for portint in portstouseasints: portstouseasstr.append(str(portint)) print "Randomly chosen ports: ",portstouseasstr testportfiller.replace_ports(portstouseasstr, portstouseasstr) else: # if this isn't specified, just use the default ports... testportfiller.replace_ports(['12345','12346','12347'], ['12345','12346','12347']) #go back to root project directory os.chdir(current_dir) | 17e14ab0ccc2678b6e57893a0b91f9640e9557a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7263/17e14ab0ccc2678b6e57893a0b91f9640e9557a7/preparetest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2071,
93,
3813,
273,
1083,
534,
28159,
6354,
55,
273,
1083,
225,
1018,
67,
1214,
273,
599,
364,
1501,
316,
2589,
18,
19485,
63,
21,
30,
14542,
468,
300,
88,
4696,
732,
903... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2071,
93,
3813,
273,
1083,
534,
28159,
6354,
55,
273,
1083,
225,
1018,
67,
1214,
273,
599,
364,
1501,
316,
2589,
18,
19485,
63,
21,
30,
14542,
468,
300,
88,
4696,
732,
903... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.