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 |
|---|---|---|---|---|---|---|
def is_integral_domain(self): | def is_integral_domain(self, proof = True): | def is_integral_domain(self): """ Returns True if self is an integral domain. EXAMPLES:: | b2b195cdb614cec1d76a98bd875ed03386d7ef1a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/b2b195cdb614cec1d76a98bd875ed03386d7ef1a/laurent_polynomial_ring.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
14970,
23811,
67,
4308,
12,
2890,
16,
14601,
273,
1053,
4672,
3536,
2860,
1053,
309,
365,
353,
392,
21423,
2461,
18,
225,
5675,
8900,
11386,
2866,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
14970,
23811,
67,
4308,
12,
2890,
16,
14601,
273,
1053,
4672,
3536,
2860,
1053,
309,
365,
353,
392,
21423,
2461,
18,
225,
5675,
8900,
11386,
2866,
2,
-100,
-100,
-100,
-100,
-10... |
elif type(attrname) is type([]): | elif type(attrname) is ListType: | def subconvert(self, endchar=None, depth=0): stack = [] line = self.line if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _comment_rx.match(line) if m: text = m.group(1) if text: self.write("(COMMENT\n- %s \n)COMMENT\n-\\n\n" % encode(text)) line = line[m.end():] continue m = _begin_env_rx.match(line) if m: # re-write to use the macro handler line = r"\%s %s" % (m.group(1), line[m.end():]) continue m = _end_env_rx.match(line) if m: # end of environment envname = m.group(1) if envname == "document": # special magic for n in stack[1:]: if n not in self.autoclosing: raise LaTeXFormatError( "open element on stack: " + `n`) # should be more careful, but this is easier to code: stack = [] self.write(")document\n") elif stack and envname == stack[-1]: self.write(")%s\n" % envname) del stack[-1] popping(envname, "a", len(stack) + depth) else: self.err_write("stack: %s\n" % `stack`) raise LaTeXFormatError( "environment close for %s doesn't match" % envname) line = line[m.end():] continue m = _begin_macro_rx.match(line) if m: # start of macro macroname = m.group(1) if macroname == "verbatim": # really magic case! pos = string.find(line, "\\end{verbatim}") text = line[m.end(1):pos] self.write("(verbatim\n") self.write("-%s\n" % encode(text)) self.write(")verbatim\n") line = line[pos + len("\\end{verbatim}"):] continue numbered = 1 opened = 0 if macroname[-1] == "*": macroname = macroname[:-1] numbered = 0 if macroname in self.autoclosing and macroname in stack: while stack[-1] != macroname: top = stack.pop() if top and top not in self.discards: self.write(")%s\n-\\n\n" % top) popping(top, "b", len(stack) + depth) if macroname not in self.discards: self.write("-\\n\n)%s\n-\\n\n" % macroname) popping(macroname, "c", len(stack) + depth - 1) del stack[-1] # if macroname in self.discards: self.push_output(StringIO.StringIO()) else: self.push_output(self.ofp) # params, optional, empty, environ = self.start_macro(macroname) if not numbered: self.write("Anumbered TOKEN no\n") # rip off the macroname if params: if optional and len(params) == 1: line = line[m.end():] else: line = line[m.end(1):] elif empty: line = line[m.end(1):] else: line = line[m.end():] # # Very ugly special case to deal with \item[]. The catch # is that this needs to occur outside the for loop that # handles attribute parsing so we can 'continue' the outer # loop. # if optional and type(params[0]) is type(()): # the attribute name isn't used in this special case pushing(macroname, "a", depth + len(stack)) stack.append(macroname) self.write("(%s\n" % macroname) m = _start_optional_rx.match(line) if m: self.line = line[m.end():] line = self.subconvert("]", depth + len(stack)) line = "}" + line continue # handle attribute mappings here: for attrname in params: if optional: optional = 0 if type(attrname) is type(""): m = _optional_rx.match(line) if m: line = line[m.end():] self.write("A%s TOKEN %s\n" % (attrname, encode(m.group(1)))) elif type(attrname) is type(()): # This is a sub-element; but don't place the # element we found on the stack (\section-like) pushing(macroname, "b", len(stack) + depth) stack.append(macroname) self.write("(%s\n" % macroname) macroname = attrname[0] m = _start_group_rx.match(line) if m: line = line[m.end():] elif type(attrname) is type([]): # A normal subelement: <macroname><attrname>...</>... attrname = attrname[0] if not opened: opened = 1 self.write("(%s\n" % macroname) pushing(macroname, "c", len(stack) + depth) self.write("(%s\n" % attrname) pushing(attrname, "sub-elem", len(stack) + depth + 1) self.line = skip_white(line)[1:] line = self.subconvert("}", len(stack) + depth + 1)[1:] dbgmsg("subconvert() ==> " + `line[:20]`) popping(attrname, "sub-elem", len(stack) + depth + 1) self.write(")%s\n" % attrname) else: m = _parameter_rx.match(line) if not m: raise LaTeXFormatError( "could not extract parameter %s for %s: %s" % (attrname, macroname, `line[:100]`)) value = m.group(1) if _token_rx.match(value): dtype = "TOKEN" else: dtype = "CDATA" self.write("A%s %s %s\n" % (attrname, dtype, encode(value))) line = line[m.end():] if params and type(params[-1]) is type('') \ and (not empty) and not environ: # attempt to strip off next '{' m = _start_group_rx.match(line) if not m: raise LaTeXFormatError( "non-empty element '%s' has no content: %s" % (macroname, line[:12])) line = line[m.end():] if not opened: self.write("(%s\n" % macroname) pushing(macroname, "d", len(stack) + depth) if empty: line = "}" + line stack.append(macroname) self.pop_output() continue if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line[1:] return self.line if line[0] == "}": # end of macro or group macroname = stack[-1] conversion = self.table.get(macroname) if macroname \ and macroname not in self.discards \ and type(conversion) is not type(""): # otherwise, it was just a bare group self.write(")%s\n" % stack[-1]) popping(macroname, "d", len(stack) + depth - 1) del stack[-1] line = line[1:] continue if line[0] == "{": pushing("", "e", len(stack) + depth) stack.append("") line = line[1:] continue if line[0] == "\\" and line[1] in ESCAPED_CHARS: self.write("-%s\n" % encode(line[1])) line = line[2:] continue if line[:2] == r"\\": self.write("(BREAK\n)BREAK\n") line = line[2:] continue m = _text_rx.match(line) if m: text = encode(m.group()) self.write("-%s\n" % text) line = line[m.end():] continue # special case because of \item[] if line[0] == "]": self.write("-]\n") line = line[1:] continue # avoid infinite loops extra = "" if len(line) > 100: extra = "..." raise LaTeXFormatError("could not identify markup: %s%s" % (`line[:100]`, extra)) while stack and stack[-1] in self.autoclosing: self.write("-\\n\n") self.write(")%s\n" % stack[-1]) popping(stack.pop(), "e", len(stack) + depth - 1) if stack: raise LaTeXFormatError("elements remain on stack: " + string.join(stack, ", ")) # otherwise we just ran out of input here... | 54fb7fb9d0ff1c96849572ff809cc9323e87bfa4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/54fb7fb9d0ff1c96849572ff809cc9323e87bfa4/latex2esis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
6283,
12,
2890,
16,
679,
3001,
33,
7036,
16,
3598,
33,
20,
4672,
2110,
273,
5378,
980,
273,
365,
18,
1369,
309,
6369,
471,
679,
3001,
30,
365,
18,
370,
67,
2626,
12,
315,
1717,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
6283,
12,
2890,
16,
679,
3001,
33,
7036,
16,
3598,
33,
20,
4672,
2110,
273,
5378,
980,
273,
365,
18,
1369,
309,
6369,
471,
679,
3001,
30,
365,
18,
370,
67,
2626,
12,
315,
1717,
... |
file.warn ("can't have multiple words unless first word " + "('%s') is a directory name" % words[0]) | manifest.warn ("can't have multiple words unless first word " + "('%s') is a directory name" % words[0]) | def read_manifest (self): | b10371c295a021a94e580e02d59b2b0ffbc3ad4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b10371c295a021a94e580e02d59b2b0ffbc3ad4b/dist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
14357,
261,
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,
855,
67,
14357,
261,
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,
-1... |
if self.assy.shelf.members: pastables = self.assy.shelf.getPastables() if not pastables: msg = orangemsg("Nothing to paste.") env.history.message(msg) return recentPastable = pastables[-1] self.assy.paste(recentPastable) else: msg = orangemsg("Nothing to paste.") env.history.message(msg) return | if self.assy.shelf.members: pastables = self.assy.shelf.getPastables() if not pastables: msg = orangemsg("Nothing to paste.") env.history.message(msg) return recentPastable = pastables[-1] self.assy.paste(recentPastable) else: msg = orangemsg("Nothing to paste.") env.history.message(msg) return | def editPaste(self): | c25263540add024396d4bcf7631292f1fd2d50bb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/c25263540add024396d4bcf7631292f1fd2d50bb/MWsemantics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
52,
14725,
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,
3874,
52,
14725,
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,
-1... |
reg.registerUtility(renderer, ITemplateRenderer, name=spec) | try: lock.acquire() reg.registerUtility(renderer, ITemplateRenderer, name=spec) finally: lock.release() | def template_renderer_factory(spec, impl): reg = get_current_registry() if os.path.isabs(spec): # 'spec' is an absolute filename if not os.path.exists(spec): raise ValueError('Missing template file: %s' % spec) renderer = reg.queryUtility(ITemplateRenderer, name=spec) if renderer is None: renderer = impl(spec) reg.registerUtility(renderer, ITemplateRenderer, name=spec) else: # spec is a package:relpath resource spec renderer = reg.queryUtility(ITemplateRenderer, name=spec) if renderer is None: try: package_name, filename = spec.split(':', 1) except ValueError: # pragma: no cover # somehow we were passed a relative pathname; this # should die package_name = caller_package(4).__name__ filename = spec abspath = pkg_resources.resource_filename(package_name, filename) if not pkg_resources.resource_exists(package_name, filename): raise ValueError( 'Missing template resource: %s (%s)' % (spec, abspath)) renderer = impl(abspath) if not _reload_resources(): # cache the template reg.registerUtility(renderer, ITemplateRenderer, name=spec) return renderer | 75aa412d1dadda6c955e094e91380c7ae70695fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/75aa412d1dadda6c955e094e91380c7ae70695fb/renderers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1542,
67,
14374,
67,
6848,
12,
2793,
16,
9380,
4672,
960,
273,
336,
67,
2972,
67,
9893,
1435,
309,
1140,
18,
803,
18,
291,
5113,
12,
2793,
4672,
468,
296,
2793,
11,
353,
392,
4967,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1542,
67,
14374,
67,
6848,
12,
2793,
16,
9380,
4672,
960,
273,
336,
67,
2972,
67,
9893,
1435,
309,
1140,
18,
803,
18,
291,
5113,
12,
2793,
4672,
468,
296,
2793,
11,
353,
392,
4967,
1... |
try: event, value, line_number = stream.next() except StopIteration: return None | event, value, line_number = stream_next(stream) if event == None: break | def paragraph_stream(stream, _tag_uri, _tag_name, _attributes, _ns_decls, pdf_stylesheet): content = [] stack = [] stack.append((_tag_name, _attributes, None)) while True: try: event, value, line_number = stream.next() except StopIteration: return None #### START ELEMENT #### if event == START_ELEMENT: tag_uri, tag_name, attributes, ns_decls = value content.append(build_start_tag(tag_name, attributes)) stack.append((tag_name, attributes, None)) #### END ELEMENT #### elif event == END_ELEMENT: tag_uri, tag_name = value if tag_name == _tag_name: content = ''.join(content) element = stack.pop() widget = create_paragraph(pdf_stylesheet, element, content) return widget else: element = stack.pop() content.append(build_end_tag(element[0])) #### TEXT ELEMENT #### elif event == TEXT: if stack: value = strip(Unicode.decode(value, encoding), True) if len(value) > 0: # alow to write : # <para><u><i>Choix de l'appareillage</i> </u></para> value = XML.encode(value) # entities content.append(value) | 51b02e012792ad1fcdef1300580c1d6a58548c1f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/51b02e012792ad1fcdef1300580c1d6a58548c1f/rml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10190,
67,
3256,
12,
3256,
16,
389,
2692,
67,
1650,
16,
389,
2692,
67,
529,
16,
389,
4350,
16,
389,
2387,
67,
323,
6429,
16,
8169,
67,
19403,
4672,
913,
273,
5378,
2110,
273,
5378,
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,
10190,
67,
3256,
12,
3256,
16,
389,
2692,
67,
1650,
16,
389,
2692,
67,
529,
16,
389,
4350,
16,
389,
2387,
67,
323,
6429,
16,
8169,
67,
19403,
4672,
913,
273,
5378,
2110,
273,
5378,
2... |
gc = agg.GraphicsContextArray((100,100)) ctrl1 = 1.0,1.0 ctrl2 = 2.0,2.0 to = 3.0,3.0 gc.curve_to(ctrl1[0],ctrl1[1],ctrl2[0],ctrl2[1],to[0],to[1]) | gc = agg.GraphicsContextArray((100, 100)) ctrl1 = 1.0, 1.0 ctrl2 = 2.0, 2.0 to = 3.0, 3.0 gc.curve_to(ctrl1[0], ctrl1[1], ctrl2[0], ctrl2[1], to[0], to[1]) | def test_curve_to(self): gc = agg.GraphicsContextArray((100,100)) ctrl1 = 1.0,1.0 ctrl2 = 2.0,2.0 to = 3.0,3.0 gc.curve_to(ctrl1[0],ctrl1[1],ctrl2[0],ctrl2[1],to[0],to[1]) | e47282ce7056af747cbd7b863b37854c3c1dd9d6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13166/e47282ce7056af747cbd7b863b37854c3c1dd9d6/graphics_context_test_case.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
16683,
67,
869,
12,
2890,
4672,
8859,
273,
10421,
18,
17558,
1042,
1076,
12443,
6625,
16,
6625,
3719,
6414,
21,
273,
404,
18,
20,
16,
21,
18,
20,
6414,
22,
273,
576,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
16683,
67,
869,
12,
2890,
4672,
8859,
273,
10421,
18,
17558,
1042,
1076,
12443,
6625,
16,
6625,
3719,
6414,
21,
273,
404,
18,
20,
16,
21,
18,
20,
6414,
22,
273,
576,
18,
20... |
f = codecs.open(path.join(srcdir, 'conf.py'), 'w', encoding='utf-8') | f = open(path.join(srcdir, 'conf.py'), 'w', encoding='utf-8') | def inner_main(args): d = {} texescape.init() if not color_terminal(): nocolor() print bold('Welcome to the Sphinx %s quickstart utility.') % __version__ print ''' | 84cba9c39c0b36c6837d8cc7ce19bbad05be7ff1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5532/84cba9c39c0b36c6837d8cc7ce19bbad05be7ff1/quickstart.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3443,
67,
5254,
12,
1968,
4672,
302,
273,
2618,
16573,
6939,
18,
2738,
1435,
225,
309,
486,
2036,
67,
15979,
13332,
30601,
355,
280,
1435,
225,
1172,
13068,
2668,
59,
16312,
358,
326,
34... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3443,
67,
5254,
12,
1968,
4672,
302,
273,
2618,
16573,
6939,
18,
2738,
1435,
225,
309,
486,
2036,
67,
15979,
13332,
30601,
355,
280,
1435,
225,
1172,
13068,
2668,
59,
16312,
358,
326,
34... |
""" | r""" | def eulers_method(f,x0,y0,h,x1,method="table"): """ This implements Euler's method for finding numerically the solution of the 1st order ODE ``y' = f(x,y)``, ``y(a)=c``. The "x" column of the table increments from ``x0`` to ``x1`` by ``h`` (so ``(x1-x0)/h`` must be an integer). In the "y" column, the new y-value equals the old y-value plus the corresponding entry in the last column. *For pedagogical purposes only.* EXAMPLES:: sage: from sage.calculus.desolvers import eulers_method sage: x,y = PolynomialRing(QQ,2,"xy").gens() sage: eulers_method(5*x+y-5,0,1,1/2,1) x y h*f(x,y) 0 1 -2 1/2 -1 -7/4 1 -11/4 -11/8 :: sage: x,y = PolynomialRing(QQ,2,"xy").gens() sage: eulers_method(5*x+y-5,0,1,1/2,1,method="none") [[0, 1], [1/2, -1], [1, -11/4], [3/2, -33/8]] :: sage: RR = RealField(sci_not=0, prec=4, rnd='RNDU') sage: x,y = PolynomialRing(RR,2,"xy").gens() sage: eulers_method(5*x+y-5,0,1,1/2,1,method="None") [[0, 1], [1/2, -1.0], [1, -2.7], [3/2, -4.0]] :: sage: RR = RealField(sci_not=0, prec=4, rnd='RNDU') sage: x,y=PolynomialRing(RR,2,"xy").gens() sage: eulers_method(5*x+y-5,0,1,1/2,1) x y h*f(x,y) 0 1 -2.0 1/2 -1.0 -1.7 1 -2.7 -1.3 :: sage: x,y=PolynomialRing(QQ,2,"xy").gens() sage: eulers_method(5*x+y-5,1,1,1/3,2) x y h*f(x,y) 1 1 1/3 4/3 4/3 1 5/3 7/3 17/9 2 38/9 83/27 :: sage: eulers_method(5*x+y-5,0,1,1/2,1,method="none") [[0, 1], [1/2, -1], [1, -11/4], [3/2, -33/8]] :: sage: pts = eulers_method(5*x+y-5,0,1,1/2,1,method="none") sage: P1 = list_plot(pts) sage: P2 = line(pts) sage: (P1+P2).show() AUTHORS: - David Joyner """ if method=="table": print "%10s %20s %25s"%("x","y","h*f(x,y)") n=int((1.0)*(x1-x0)/h) x00=x0; y00=y0 soln = [[x00,y00]] for i in range(n+1): if method=="table": print "%10r %20r %20r"%(x00,y00,h*f(x00,y00)) y00 = y00+h*f(x00,y00) x00=x00+h soln.append([x00,y00]) if method!="table": return soln | 7f133a6744923b72b06980a1787657382d80133b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7f133a6744923b72b06980a1787657382d80133b/desolvers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
425,
332,
414,
67,
2039,
12,
74,
16,
92,
20,
16,
93,
20,
16,
76,
16,
92,
21,
16,
2039,
1546,
2121,
6,
4672,
436,
8395,
1220,
4792,
512,
17040,
1807,
707,
364,
13727,
6389,
1230,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
425,
332,
414,
67,
2039,
12,
74,
16,
92,
20,
16,
93,
20,
16,
76,
16,
92,
21,
16,
2039,
1546,
2121,
6,
4672,
436,
8395,
1220,
4792,
512,
17040,
1807,
707,
364,
13727,
6389,
1230,
32... |
os.path.exists(os.path.join(dir, 'exe'))): | os.path.exists(os.path.join(dir, 'cvs.exe'))): | def __init__(self, repository, path): self.tempdir = "" self.currentdir = os.getcwd() self.repository = repository self.path = path | 7b8f46769e1fa35bf1361783eea875c8be467347 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1600/7b8f46769e1fa35bf1361783eea875c8be467347/cvs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3352,
16,
589,
4672,
365,
18,
5814,
1214,
273,
1408,
365,
18,
2972,
1214,
273,
1140,
18,
588,
11089,
1435,
365,
18,
9071,
273,
3352,
365,
18,
803,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3352,
16,
589,
4672,
365,
18,
5814,
1214,
273,
1408,
365,
18,
2972,
1214,
273,
1140,
18,
588,
11089,
1435,
365,
18,
9071,
273,
3352,
365,
18,
803,
273,
... |
reply = ector.getActivatedSentence() | replyNode = ector.getActivatedSentenceNode() reply = replyNode.getSymbol() reply = reply.replace("@bot@", username) reply = reply.replace("@user@", botname) previousSentenceNode = replyNode | def main(): from optparse import OptionParser usage="usage: %prog [-p username][-n botname=Ector][-v|-q][-l logfilepath=ector.log][-s|-g][-h]" parser = OptionParser(usage=usage,version="%prog 0.2") parser.add_option("-p", "--person", dest="username", default="User", help="set the name of the utterer") parser.add_option("-n", "--name", dest="botname", default="Ector", help="set the name of the bot") parser.add_option("-v", action="store_true", dest="verbose", default=False, help="say all that you can say") parser.add_option("-q", action="store_false", dest="verbose", help="shut up!") parser.add_option("-l", "--log", dest="logname", default="ector.log", help="log the dialogue in log file") parser.add_option("-s", "--sentence", dest="sentence", default=True, help="set sentence reply mode") parser.add_option("-q", "--quiet", dest="quiet", default=False, help="make the bot shut up") (options, args) = parser.parse_args() license = None stdin = sys.stdin stdout = sys.stdout username = options.username botname = options.botname.capitalize() logfilename = options.logname version = "0.2" sentence_mode = options.sentence generate_mode = False quiet_mode = options.quiet if quiet_mode: sentence_mode = False generate_mode = False ector = Ector(botname, username) previousSentenceNode = None print """pyECTOR version %s, Copyright (C) 2008 Francois PARMENTIER | 73d42973a645c06545e0ca1228c5f677b5dd5802 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13131/73d42973a645c06545e0ca1228c5f677b5dd5802/Ector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
628,
2153,
2670,
1930,
18862,
225,
4084,
1546,
9167,
30,
738,
14654,
23059,
84,
2718,
6362,
17,
82,
2512,
529,
33,
41,
30206,
6362,
17,
90,
24718,
85,
6362,
17,
80,
613,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
628,
2153,
2670,
1930,
18862,
225,
4084,
1546,
9167,
30,
738,
14654,
23059,
84,
2718,
6362,
17,
82,
2512,
529,
33,
41,
30206,
6362,
17,
90,
24718,
85,
6362,
17,
80,
613,
1... |
w(obj.replace('\\', '\\\\').replace('"', '\\"').encode('unicode-escape')) | w(unicodeEscape(obj)) | def _serialize(obj, w, seen): if isinstance(obj, types.BooleanType): if obj: w('true') else: w('false') elif isinstance(obj, (int, long, float)): w(str(obj)) elif isinstance(obj, unicode): w('"') w(obj.replace('\\', '\\\\').replace('"', '\\"').encode('unicode-escape')) w('"') elif isinstance(obj, types.NoneType): w('null') elif id(obj) in seen: raise CycleError(type(obj)) elif isinstance(obj, (tuple, list)): w('[') for n, e in enumerate(obj): _serialize(e, w, seen) if n != len(obj) - 1: w(',') w(']') elif isinstance(obj, dict): w('{') for n, (k, v) in enumerate(obj.iteritems()): _serialize(k, w, seen) w(':') _serialize(v, w, seen) if n != len(obj) - 1: w(',') w('}') else: raise TypeError("Unsupported type %r: %r" % (type(obj), obj)) | acbc7d1eae3419dd2ebbc7b77745ff85bc923cdc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7162/acbc7d1eae3419dd2ebbc7b77745ff85bc923cdc/json.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6288,
12,
2603,
16,
341,
16,
5881,
4672,
309,
1549,
12,
2603,
16,
1953,
18,
5507,
559,
4672,
309,
1081,
30,
341,
2668,
3767,
6134,
469,
30,
341,
2668,
5743,
6134,
1327,
1549,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6288,
12,
2603,
16,
341,
16,
5881,
4672,
309,
1549,
12,
2603,
16,
1953,
18,
5507,
559,
4672,
309,
1081,
30,
341,
2668,
3767,
6134,
469,
30,
341,
2668,
5743,
6134,
1327,
1549,
12,
... |
except ExitNow: | except asyncore.ExitNow: | def poll(self): results = asyncore.poller.poll(0) for fd, flags in results: obj = asyncore.socket_map.get(fd) if obj is None: self.logger.warning('Invalid FD for poll() - %d', fd) try: if flags & (select.POLLIN | select.POLLPRI): obj.handle_read_event() if flags & select.POLLOUT: obj.handle_write_event() if flags & (select.POLLERR | select.POLLHUP | select.POLLNVAL): obj.handle_expt_event() except ExitNow: raise except: obj.handle_error() | 84ded9dab02971c471bc3f845982e1b183d5ed5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14147/84ded9dab02971c471bc3f845982e1b183d5ed5a/BaseMangler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
12,
2890,
4672,
1686,
273,
4326,
479,
18,
3915,
749,
18,
13835,
12,
20,
13,
364,
5194,
16,
2943,
316,
1686,
30,
1081,
273,
4326,
479,
18,
7814,
67,
1458,
18,
588,
12,
8313,
13,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
12,
2890,
4672,
1686,
273,
4326,
479,
18,
3915,
749,
18,
13835,
12,
20,
13,
364,
5194,
16,
2943,
316,
1686,
30,
1081,
273,
4326,
479,
18,
7814,
67,
1458,
18,
588,
12,
8313,
13,... |
"""Verify suggest results in omnibox.""" | """Verify suggested results in omnibox.""" | def testSuggest(self): """Verify suggest results in omnibox.""" matches = self._GetOmniboxMatchesFor('apple') self.assertTrue(matches) self.assertTrue([x for x in matches if x['type'] == 'search-suggest']) | 7f17d9e6533559f2265179bd0d746f9daaa37a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7f17d9e6533559f2265179bd0d746f9daaa37a14/omnibox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
55,
8679,
12,
2890,
4672,
3536,
8097,
22168,
1686,
316,
8068,
82,
495,
2409,
12123,
1885,
273,
365,
6315,
967,
51,
13607,
495,
2409,
6869,
1290,
2668,
438,
1802,
6134,
365,
18,
112... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
55,
8679,
12,
2890,
4672,
3536,
8097,
22168,
1686,
316,
8068,
82,
495,
2409,
12123,
1885,
273,
365,
6315,
967,
51,
13607,
495,
2409,
6869,
1290,
2668,
438,
1802,
6134,
365,
18,
112... |
def debug(level, domain, msg, fn = None): if not domain: domain = 'default' if debug_level[domain] >= level: | def debug(level, msgdomain, msg, fn = None): if not msgdomain: msgdomain = domain.Default if debug_level[msgdomain] >= level: | def debug(level, domain, msg, fn = None): if not domain: domain = 'default' if debug_level[domain] >= level: bb.event.fire(MsgDebug(msg), None) if not bb.event._ui_handlers: print 'DEBUG: ' + msg | 350c3126e130b1f6d22c6b5061a3feacc05025fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8123/350c3126e130b1f6d22c6b5061a3feacc05025fc/msg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
12,
2815,
16,
1234,
4308,
16,
1234,
16,
2295,
273,
599,
4672,
309,
486,
1234,
4308,
30,
1234,
4308,
273,
2461,
18,
1868,
225,
309,
1198,
67,
2815,
63,
3576,
4308,
65,
1545,
1801,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
12,
2815,
16,
1234,
4308,
16,
1234,
16,
2295,
273,
599,
4672,
309,
486,
1234,
4308,
30,
1234,
4308,
273,
2461,
18,
1868,
225,
309,
1198,
67,
2815,
63,
3576,
4308,
65,
1545,
1801,... |
try: 2+2 finally: return 4 | try: 2+2 finally: return 4 | def foo(): try: 2+2 finally: return 4 | 255f4210c1e3b967db40828e7c0a557465f32371 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6753/255f4210c1e3b967db40828e7c0a557465f32371/bugs101.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8431,
13332,
775,
30,
576,
15,
22,
3095,
30,
327,
1059,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8431,
13332,
775,
30,
576,
15,
22,
3095,
30,
327,
1059,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
ShortField("seqnum", 0), | LEShortField("seqnum", 0), | def mysummary(self): if self.ID == 0: return "SSID=%s"%repr(self.info),[Dot11] else: return "" | 69e2217253b26915631841c3e37ad820c0d63235 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/69e2217253b26915631841c3e37ad820c0d63235/scapy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3399,
7687,
12,
2890,
4672,
309,
365,
18,
734,
422,
374,
30,
327,
315,
1260,
734,
5095,
87,
28385,
12715,
12,
2890,
18,
1376,
3631,
63,
10412,
2499,
65,
469,
30,
327,
1408,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3399,
7687,
12,
2890,
4672,
309,
365,
18,
734,
422,
374,
30,
327,
315,
1260,
734,
5095,
87,
28385,
12715,
12,
2890,
18,
1376,
3631,
63,
10412,
2499,
65,
469,
30,
327,
1408,
2,
-100,
... |
self.assertEquals(b.getvalue(), b"abc?def\n") | self.assertEquals(b.getvalue(), b"abc?def" + os.linesep.encode()) | def testEncodingErrorsWriting(self): # (1) default b = io.BytesIO() t = io.TextIOWrapper(b, encoding="ascii") self.assertRaises(UnicodeError, t.write, "\xff") # (2) explicit strict b = io.BytesIO() t = io.TextIOWrapper(b, encoding="ascii", errors="strict") self.assertRaises(UnicodeError, t.write, "\xff") # (3) ignore b = io.BytesIO() t = io.TextIOWrapper(b, encoding="ascii", errors="ignore") t.write("abc\xffdef\n") t.flush() self.assertEquals(b.getvalue(), b"abcdef\n") # (4) replace b = io.BytesIO() t = io.TextIOWrapper(b, encoding="ascii", errors="replace") t.write("abc\xffdef\n") t.flush() self.assertEquals(b.getvalue(), b"abc?def\n") | e4f966eda98d92ac1a751649a86b4cff0a28f995 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/e4f966eda98d92ac1a751649a86b4cff0a28f995/test_io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
4705,
4229,
18835,
12,
2890,
4672,
468,
261,
21,
13,
805,
324,
273,
2527,
18,
2160,
4294,
1435,
268,
273,
2527,
18,
1528,
4294,
3611,
12,
70,
16,
2688,
1546,
9184,
7923,
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,
1842,
4705,
4229,
18835,
12,
2890,
4672,
468,
261,
21,
13,
805,
324,
273,
2527,
18,
2160,
4294,
1435,
268,
273,
2527,
18,
1528,
4294,
3611,
12,
70,
16,
2688,
1546,
9184,
7923,
365,
18,... |
try: entry.set_property('editable', False) except: pass | entry.set_property('editable', False) | def tags_win_save_all(self, _button, window, tags, entries, entries_names): for entry in entries: try: # Skip GtkLabels entry.set_property('editable', False) except: pass while window.get_property('visible'): self.tags_win_response(window, gtk.RESPONSE_ACCEPT, tags, entries, entries_names) | d1018ca8fe80bff7e2511fdfc60a7c92d2db7523 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2312/d1018ca8fe80bff7e2511fdfc60a7c92d2db7523/tagedit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2342,
67,
8082,
67,
5688,
67,
454,
12,
2890,
16,
389,
5391,
16,
2742,
16,
2342,
16,
3222,
16,
3222,
67,
1973,
4672,
364,
1241,
316,
3222,
30,
775,
30,
468,
6611,
22132,
5888,
1241,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2342,
67,
8082,
67,
5688,
67,
454,
12,
2890,
16,
389,
5391,
16,
2742,
16,
2342,
16,
3222,
16,
3222,
67,
1973,
4672,
364,
1241,
316,
3222,
30,
775,
30,
468,
6611,
22132,
5888,
1241,
1... |
title = task.get_title()[0:self.MAX_TITLE_LEN] if len(title)== self.MAX_TITLE_LEN: title = title + "..." | def add_menu_task(self, tid): """Adds a task in the menu, trimming the title if necessary""" task = self.plugin_api.get_task(tid) if self.tasks_in_menu.has_key(tid): #task is already in the menu, updating the title menu_item = self.tasks_in_menu[tid] menu_item.get_children()[0].set_label(task.get_title()) return #trimming of the title title = task.get_title()[0:self.MAX_TITLE_LEN] if len(title)== self.MAX_TITLE_LEN: title = title + "..." #putting a separator between the tasks and the static menu if self.task_separator == None: self.task_separator = gtk.SeparatorMenuItem() self.task_separator.show() self.menu.append(self.task_separator) #creating the menu item menu_item = gtk.ImageMenuItem(title) menu_item.connect('activate', self.open_task, tid) menu_item.show() self.menu.append(menu_item) self.tasks_in_menu[tid] = menu_item | 5ff5914b85a49c1326c31c9073f84ad78d4ae722 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/5ff5914b85a49c1326c31c9073f84ad78d4ae722/notification_area.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
5414,
67,
4146,
12,
2890,
16,
11594,
4672,
3536,
3655,
279,
1562,
316,
326,
3824,
16,
2209,
11987,
326,
2077,
309,
4573,
8395,
1562,
273,
365,
18,
4094,
67,
2425,
18,
588,
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,
527,
67,
5414,
67,
4146,
12,
2890,
16,
11594,
4672,
3536,
3655,
279,
1562,
316,
326,
3824,
16,
2209,
11987,
326,
2077,
309,
4573,
8395,
1562,
273,
365,
18,
4094,
67,
2425,
18,
588,
67,... | |
if oldbinding[1] is binding[1]: duplicate = 1 else: | if oldbinding[1] is binding[1]: duplicate = 1 else: | def trySearch(self): """Search the store""" nbs = [] if self.short == INFINITY: if thing.verbosity() > 36: progress( " Non-recursive, can't search for %s" % `self`) else: if thing.verbosity() > 36: progress( " Searching %i for %s" %(self.short, `self`)) for s in self.myIndex : # search the index nb = [] reject = 0 for p in ALL4: if self.neededFor[p] == [self.quad[p]]: # A regular variable binding = ( self.quad[p], s.quad[p]) duplicate = 0 for oldbinding in nb: if oldbinding[0] is self.quad[p]: if oldbinding[1] is binding[1]: # A binding we have already - no sweat duplicate = 1 #from double occurrence on variable in query line else: # A clash - reject binding the same to var to 2 different things! reject = 1 if not duplicate: nb.append(( self.quad[p], s.quad[p])) if not reject: nbs.append(nb) # Add the new bindings into the set | 9014f1b29ec001a58490a448dc6782aa1860acf4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/9014f1b29ec001a58490a448dc6782aa1860acf4/llyn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
775,
2979,
12,
2890,
4672,
3536,
2979,
326,
1707,
8395,
290,
2038,
273,
5378,
309,
365,
18,
6620,
422,
2120,
16685,
30,
309,
7757,
18,
16629,
8807,
1435,
405,
6580,
30,
4007,
12,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
775,
2979,
12,
2890,
4672,
3536,
2979,
326,
1707,
8395,
290,
2038,
273,
5378,
309,
365,
18,
6620,
422,
2120,
16685,
30,
309,
7757,
18,
16629,
8807,
1435,
405,
6580,
30,
4007,
12,
315,
... |
"WindowsForms10.RichEdit20W.app.0.378734a":"RichEdit20", | def _get_name(self): return _("Desktop") | 613f1cdba51e4d231c55f8caabbb0b47606a10ed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9340/613f1cdba51e4d231c55f8caabbb0b47606a10ed/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
529,
12,
2890,
4672,
327,
389,
2932,
27583,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
529,
12,
2890,
4672,
327,
389,
2932,
27583,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
'WHERE partner_id IN (' + self.partner_ids + ') ' \ 'AND account_id IN (' + self.account_ids + ') ' \ | 'WHERE ' \ 'account_id IN (' + self.account_ids + ') ' \ "AND partner_id is not null " \ | def _sum_litige(self): if not self.ids: return 0.0 account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='account_move_line', context={'fiscalyear': self.datas['form']['fiscalyear']}) self.cr.execute( 'SELECT sum(debit-credit) ' \ 'FROM account_move_line ' \ 'WHERE partner_id IN (' + self.partner_ids + ') ' \ 'AND account_id IN (' + self.account_ids + ') ' \ 'AND date >= %s ' \ 'AND date <= %s ' \ 'AND blocked=TRUE ' \ 'AND ' + line_query, (self.datas['form']['date1'], self.datas['form']['date2'])) return self.cr.fetchone()[0] or 0.0 | 3037c6957360ef3618c6e04e4548ebf132e4ab75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/3037c6957360ef3618c6e04e4548ebf132e4ab75/partner_balance.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1364,
67,
24235,
360,
73,
12,
2890,
4672,
309,
486,
365,
18,
2232,
30,
327,
374,
18,
20,
2236,
67,
8501,
67,
1369,
67,
2603,
273,
2845,
264,
18,
588,
67,
6011,
12,
2890,
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,
1364,
67,
24235,
360,
73,
12,
2890,
4672,
309,
486,
365,
18,
2232,
30,
327,
374,
18,
20,
2236,
67,
8501,
67,
1369,
67,
2603,
273,
2845,
264,
18,
588,
67,
6011,
12,
2890,
18,
3... |
def Hack1(): | pylib.Target = "NT386GNU" | def Hack1(): # appropriate pylib.GCC_BACKEND = True pylib.OMIT_GCC = False # hack os.environ["GCC_BACKEND"] = "yes" os.environ.pop("OMIT_GCC", None) reload(pylib) | f79eddf7420d7ecca90b9ab0d9d7d03ff433e039 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9328/f79eddf7420d7ecca90b9ab0d9d7d03ff433e039/bootntgnu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
2395,
2941,
18,
2326,
273,
315,
1784,
23,
5292,
8318,
57,
6,
225,
468,
5505,
2395,
2941,
18,
43,
6743,
67,
8720,
4415,
273,
1053,
2395,
2941,
18,
1872,
1285,
67,
43,
6743,
273,
1083,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
2395,
2941,
18,
2326,
273,
315,
1784,
23,
5292,
8318,
57,
6,
225,
468,
5505,
2395,
2941,
18,
43,
6743,
67,
8720,
4415,
273,
1053,
2395,
2941,
18,
1872,
1285,
67,
43,
6743,
273,
1083,
... |
angleIncr = 2.0 * vtk.vtkMath.Pi() / 8.056 | angleIncr = 2.0 * vtk.vtkMath.Pi() / 8.0 | def executeModule(self): if self._giaDistal and self._giaProximal and self._inputPolyData: # construct eight planes with the insertion axis as mid-line # the planes should go somewhat further proximally than the # proximal insertion axis point | 3bc1d9e28538cb88d6b9d5fd1678ff10ad1bb7db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4494/3bc1d9e28538cb88d6b9d5fd1678ff10ad1bb7db/glenoidMouldDesignFLT.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
3120,
12,
2890,
4672,
309,
365,
6315,
75,
1155,
5133,
287,
471,
365,
6315,
75,
1155,
16155,
2840,
471,
365,
6315,
2630,
12487,
751,
30,
468,
4872,
425,
750,
31634,
598,
326,
12626,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
3120,
12,
2890,
4672,
309,
365,
6315,
75,
1155,
5133,
287,
471,
365,
6315,
75,
1155,
16155,
2840,
471,
365,
6315,
2630,
12487,
751,
30,
468,
4872,
425,
750,
31634,
598,
326,
12626,... |
elif '"' in v and "'" not in v: quote_char = '"' | def serialize(self, treewalker, encoding=None): in_cdata = False self.errors = [] if encoding and self.inject_meta_charset: treewalker = self.filter_inject_meta_charset(treewalker, encoding) if self.strip_whitespace: treewalker = self.filter_whitespace(treewalker) if self.omit_optional_tags: treewalker = self.filter_optional_tags(treewalker) for token in treewalker: type = token["type"] if type == "Doctype": doctype = u"<!DOCTYPE %s>" % token["name"] if encoding: yield doctype.encode(encoding) else: yield doctype | fb6d8c5aee6224dbd200c3d5f89c0e61c9b0a141 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9368/fb6d8c5aee6224dbd200c3d5f89c0e61c9b0a141/serializer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4472,
12,
2890,
16,
9787,
359,
2960,
264,
16,
2688,
33,
7036,
4672,
316,
67,
71,
892,
273,
1083,
365,
18,
4324,
273,
5378,
309,
2688,
471,
365,
18,
22170,
67,
3901,
67,
9999,
30,
978... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4472,
12,
2890,
16,
9787,
359,
2960,
264,
16,
2688,
33,
7036,
4672,
316,
67,
71,
892,
273,
1083,
365,
18,
4324,
273,
5378,
309,
2688,
471,
365,
18,
22170,
67,
3901,
67,
9999,
30,
978... | |
def run_one_test(self, test, compileflags, out): if self._reset_random_seed: randstate.set_random_seed(long(0)) OrigDocTestRunner.run_one_test(self, test, compileflags, out) def run_one_example(self, test, example, filename, compileflags): if self._collect_timeit_stats: with self._random_seed: from sage.misc.sage_timeit import sage_timeit key = (example.source, example) try: self._timeit_stats[key] = sage_timeit(example.source, test.globs) except Exception, e: self._timeit_stats[key] = e OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags) def save_timeit_stats_to_file_named(self, output_filename): if self._collect_timeit_stats: from sage.structure.sage_object import save save(self._timeit_stats, filename=output_filename) ncadoctest.DocTestRunner = SageDocTestRunner | def report_unexpected_exception(self, out, test, example, exc_info): raise UnexpectedException(test, example, exc_info) def report_failure(self, out, test, example, got): raise DocTestFailure(test, example, got) master = None | def run_one_test(self, test, compileflags, out): if self._reset_random_seed: randstate.set_random_seed(long(0)) OrigDocTestRunner.run_one_test(self, test, compileflags, out) | 3208799c86e1446f7ee49fcbcecfd3d7e50f1181 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/3208799c86e1446f7ee49fcbcecfd3d7e50f1181/ncadoctest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
476,
67,
3813,
12,
2890,
16,
1842,
16,
4074,
7133,
16,
596,
4672,
309,
365,
6315,
6208,
67,
9188,
67,
12407,
30,
5605,
2019,
18,
542,
67,
9188,
67,
12407,
12,
5748,
12,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
476,
67,
3813,
12,
2890,
16,
1842,
16,
4074,
7133,
16,
596,
4672,
309,
365,
6315,
6208,
67,
9188,
67,
12407,
30,
5605,
2019,
18,
542,
67,
9188,
67,
12407,
12,
5748,
12,
20,... |
try: | if self.msgs.get(key, "") is "": return default else: | def get(self, key, default=None): try: return self[key] except KeyError: return default | 7b3e1c36328c0c92d5aa00e110e895fd2f59069e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/7b3e1c36328c0c92d5aa00e110e895fd2f59069e/Corpus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
498,
16,
805,
33,
7036,
4672,
1377,
309,
365,
18,
27439,
18,
588,
12,
856,
16,
1408,
13,
353,
1408,
30,
327,
805,
469,
30,
327,
365,
63,
856,
65,
1335,
4999,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
498,
16,
805,
33,
7036,
4672,
1377,
309,
365,
18,
27439,
18,
588,
12,
856,
16,
1408,
13,
353,
1408,
30,
327,
805,
469,
30,
327,
365,
63,
856,
65,
1335,
4999,
30,... |
SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.syntax[0]>, line 2) | SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.syntax[0]>, line 3) | >>> def f(): | bf39f862ae932b4c89c2b39409add25af9507824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf39f862ae932b4c89c2b39409add25af9507824/test_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
284,
13332,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
284,
13332,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"VALUES ('%s',%d,'%s','%s','%s',NOW(),NOW(),'Submitted')" % \ | "VALUES ('%s',%d,'%s','%s','%s','%s',UTC_TIMESTAMP(),UTC_TIMESTAMP(),'Submitted')" % \ | def addPilotReference(self,pilotRef,jobID,ownerDN,ownerGroup,broker='Unknown',gridType='DIRAC'): """ Add a new pilot job reference """ | 86d649fea5b5e7c61efe199fcff64b28158d8b5b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/86d649fea5b5e7c61efe199fcff64b28158d8b5b/PilotAgentsDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
52,
22797,
2404,
12,
2890,
16,
84,
22797,
1957,
16,
4688,
734,
16,
8443,
8609,
16,
8443,
1114,
16,
21722,
2218,
4874,
2187,
5222,
559,
2218,
4537,
2226,
11,
4672,
3536,
1436,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
52,
22797,
2404,
12,
2890,
16,
84,
22797,
1957,
16,
4688,
734,
16,
8443,
8609,
16,
8443,
1114,
16,
21722,
2218,
4874,
2187,
5222,
559,
2218,
4537,
2226,
11,
4672,
3536,
1436,
279,
... |
codemuxslices[sliver['name']] = {'host': host, 'port': port} | def GetSlivers(data): """For each sliver with the codemux attribute, parse out "host,port" and make entry in conf. Restart service after.""" logger.log("codemux: Starting.", 2) # slices already in conf slicesinconf = parseConf() # slices that need to be written to the conf codemuxslices = {} _writeconf = False # Parse attributes and update dict of scripts for sliver in data['slivers']: for attribute in sliver['attributes']: if attribute['name'] == 'codemux': # add to conf. Attribute is [host, port] [host, port] = attribute['value'].split(",") try: # Check to see if sliver is running. If not, continue if vserver.VServer(sliver['name']).is_running(): # Check for new if sliver['name'] not in slicesinconf.keys(): logger.log("codemux: New slice %s using %s" % \ (sliver['name'], host)) codemuxslices[sliver['name']] = {'host': host, 'port': port} _writeconf = True # Check old slivers for changes else: sliverinconf = slicesinconf[sliver['name']] if (sliverinconf['host'] != host) or \ (sliverinconf['port'] != port): logger.log("codemux: Updating slice %s" % sliver['name']) _writeconf = True codemuxslices[sliver['name']] = {'host': host, 'port': port} except: logger.log("codemux: sliver %s not running yet. Deferring."\ % sliver['name']) logger.log_exc(name = "codemux") pass # Remove slices from conf that no longer have the attribute for deadslice in Set(slicesinconf.keys()) - Set(codemuxslices.keys()): logger.log("codemux: Removing %s" % deadslice) _writeconf = True if _writeconf: writeConf(codemuxslices) | f9e49617e63944a306307d5753bdfaee1576c1cc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6995/f9e49617e63944a306307d5753bdfaee1576c1cc/codemux.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
3738,
6760,
12,
892,
4672,
3536,
1290,
1517,
2020,
1667,
598,
326,
981,
81,
2616,
1566,
16,
1109,
596,
315,
2564,
16,
655,
6,
471,
1221,
1241,
316,
2195,
18,
225,
20709,
1156,
183... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
3738,
6760,
12,
892,
4672,
3536,
1290,
1517,
2020,
1667,
598,
326,
981,
81,
2616,
1566,
16,
1109,
596,
315,
2564,
16,
655,
6,
471,
1221,
1241,
316,
2195,
18,
225,
20709,
1156,
183... | |
if self.lastBuilding: filename = self.neighborhood + '_building_styles.txt' fname = Filename(self.styleManager.stylePathPrefix + '/alpha/DIRECT/LevelEditor/StyleFiles/' + filename) f = open(fname.toOsSpecific(), 'a') f.write('\n') style = DNAFlatBuildingStyle(building = self.lastBuilding) style.output(f) f.close() | dnaObject = self.selectedDNARoot if dnaObject: if DNAClassEqual(dnaObject, DNA_FLAT_BUILDING): filename = self.neighborhood + '_building_styles.txt' fname = Filename(self.styleManager.stylePathPrefix + '/alpha/DIRECT/LevelEditor/StyleFiles/' + filename) f = open(fname.toOsSpecific(), 'a') f.write('\n') style = DNAFlatBuildingStyle(building = dnaObject) style.output(f) f.close() return print 'Must select building before saving building style' | def saveBuildingStyle(self): if self.lastBuilding: # Valid wall, add style to file filename = self.neighborhood + '_building_styles.txt' fname = Filename(self.styleManager.stylePathPrefix + '/alpha/DIRECT/LevelEditor/StyleFiles/' + filename) f = open(fname.toOsSpecific(), 'a') # Add a blank line f.write('\n') # Now output style details to file style = DNAFlatBuildingStyle(building = self.lastBuilding) style.output(f) # Close the file f.close() | e1db26af8c57af032aa677f97743e9dc1eeb9d6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/e1db26af8c57af032aa677f97743e9dc1eeb9d6d/LevelEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
16713,
2885,
12,
2890,
4672,
309,
365,
18,
2722,
16713,
30,
468,
2364,
17662,
16,
527,
2154,
358,
585,
1544,
273,
365,
18,
18168,
19619,
397,
2070,
3510,
310,
67,
10218,
18,
5830,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
16713,
2885,
12,
2890,
4672,
309,
365,
18,
2722,
16713,
30,
468,
2364,
17662,
16,
527,
2154,
358,
585,
1544,
273,
365,
18,
18168,
19619,
397,
2070,
3510,
310,
67,
10218,
18,
5830,
... |
print "RFC2822 thought %s is boring despite the magic" % line return True | result.decoration = 'naked' result.heading("Select columns to hide:") result.start_form(query, refresh="parent") result.start_table() for name in names: result.checkbox(name,"hide_column",name) result.end_table() result.end_form() | def boring(self,metadata, data=''): """ The magic determination of RFC2822 messages is too loose, this does further tests to make sure it really is a message. | 1ee7c443ac12b92467db780065b519ce62dc68e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5568/1ee7c443ac12b92467db780065b519ce62dc68e0/HTMLUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
6053,
12,
2890,
16,
4165,
16,
501,
2218,
11,
4672,
3536,
1021,
8146,
6328,
367,
434,
8372,
6030,
3787,
2743,
353,
4885,
28393,
16,
333,
1552,
9271,
7434,
358,
1221,
3071,
518,
8654,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
6053,
12,
2890,
16,
4165,
16,
501,
2218,
11,
4672,
3536,
1021,
8146,
6328,
367,
434,
8372,
6030,
3787,
2743,
353,
4885,
28393,
16,
333,
1552,
9271,
7434,
358,
1221,
3071,
518,
8654,... |
from pypy.rlib import objectmodel | from pypy.rlib import jit | def test_is_early_constant(): from pypy.rlib import objectmodel def f(x): if objectmodel._is_early_constant(x): return 42 return 0 fn = compile_function(f, [int]) res = fn(5) assert res == 0 | 72c60f4f0a04d13582670964468480ba06fc5876 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/72c60f4f0a04d13582670964468480ba06fc5876/test_symbolic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
291,
67,
2091,
715,
67,
14384,
13332,
628,
18951,
93,
18,
1321,
495,
1930,
525,
305,
1652,
284,
12,
92,
4672,
309,
733,
2284,
6315,
291,
67,
2091,
715,
67,
14384,
12,
92,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
291,
67,
2091,
715,
67,
14384,
13332,
628,
18951,
93,
18,
1321,
495,
1930,
525,
305,
1652,
284,
12,
92,
4672,
309,
733,
2284,
6315,
291,
67,
2091,
715,
67,
14384,
12,
92,
4... |
"""Generate one ServerSection for each BotAllocator we have, sorted by hostname""" allocators = self.botNet.servers.values() allocators.sort(lambda a,b: cmp(a.host, b.host)) return [ServerSection(a) for a in allocators] | servers = self.botNet.servers.keys() servers.sort(lambda a,b: cmp(str(a), str(b))) return [ServerSection(self.botNet, s) for s in servers] | def render_mainColumn(self, context): """Generate one ServerSection for each BotAllocator we have, sorted by hostname""" allocators = self.botNet.servers.values() allocators.sort(lambda a,b: cmp(a.host, b.host)) return [ServerSection(a) for a in allocators] | 31fe557d90b0ea11ca0ccc84fa62cfc15351a729 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/31fe557d90b0ea11ca0ccc84fa62cfc15351a729/BotStatus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
5254,
1494,
12,
2890,
16,
819,
4672,
3536,
4625,
1245,
3224,
5285,
364,
1517,
15039,
21156,
732,
1240,
16,
3115,
635,
5199,
8395,
4767,
3062,
273,
365,
18,
4819,
7308,
18,
1424... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
5254,
1494,
12,
2890,
16,
819,
4672,
3536,
4625,
1245,
3224,
5285,
364,
1517,
15039,
21156,
732,
1240,
16,
3115,
635,
5199,
8395,
4767,
3062,
273,
365,
18,
4819,
7308,
18,
1424... |
class BundleStreamManagerAllowedForAnyoneTestCase(TestCase): | class BundleStreamManagerAllowedForUserTestCase(TestCase): | def test_allowed_for_anyone(self): with fixtures.created_bundle_streams(self.bundle_streams): pathnames = [bundle_stream.pathname for bundle_stream in BundleStream.objects.allowed_for_anyone().order_by('pathname')] self.assertEqual(pathnames, self.expected_pathnames) | 6dd7d6e77198fb0d6af86d4cabeac6b4bb4698bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12617/6dd7d6e77198fb0d6af86d4cabeac6b4bb4698bd/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
8151,
67,
1884,
67,
2273,
476,
12,
2890,
4672,
598,
23302,
18,
4824,
67,
9991,
67,
16320,
12,
2890,
18,
9991,
67,
16320,
4672,
589,
1973,
273,
306,
9991,
67,
3256,
18,
28336,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8151,
67,
1884,
67,
2273,
476,
12,
2890,
4672,
598,
23302,
18,
4824,
67,
9991,
67,
16320,
12,
2890,
18,
9991,
67,
16320,
4672,
589,
1973,
273,
306,
9991,
67,
3256,
18,
28336,... |
if req.path == 'favicon.ico': | if req.path == '/favicon.ico': | def __call__(self, environ, start_response): """ Dispatch requests. """ set_connection(self.db_con) req = Request(environ) url = req.path.strip('/') or 'index' | 7e2a3c7b6afe3e6879e84e620bf8614414139d8f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5532/7e2a3c7b6afe3e6879e84e620bf8614414139d8f/application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
5473,
16,
787,
67,
2740,
4672,
3536,
11552,
3285,
18,
3536,
444,
67,
4071,
12,
2890,
18,
1966,
67,
591,
13,
1111,
273,
1567,
12,
28684,
13,
880,
273,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
5473,
16,
787,
67,
2740,
4672,
3536,
11552,
3285,
18,
3536,
444,
67,
4071,
12,
2890,
18,
1966,
67,
591,
13,
1111,
273,
1567,
12,
28684,
13,
880,
273,
1... |
if old_stream.media_type == media_type and ((media_ip == "0.0.0.0" and old_remote[1] == media_port) or old_remote == (media_ip, media_port)): | if old_stream.is_alive and old_stream.media_type==media_type and ((media_ip, media_port) in (old_remote, ('0.0.0.0', old_remote[1]), (old_remote[0], 0))): | def update_media(self, cseq, to_tag, user_agent, media_list, is_downstream, is_caller_cseq): if self.cseq is None: old_cseq = (0,0) else: old_cseq = self.cseq if is_caller_cseq: cseq = (cseq, old_cseq[1]) if self.to_tag is None and to_tag is not None: self.to_tag = to_tag else: cseq = (old_cseq[0], cseq) if is_downstream: party = "caller" if self.caller_ua is None: self.caller_ua = user_agent else: party = "callee" if self.callee_ua is None: self.callee_ua = user_agent if self.cseq is None or cseq > self.cseq: log.debug("Received new SDP offer") self.streams[cseq] = new_streams = [] if self.cseq is None: old_streams = [] else: old_streams = self.streams[self.cseq] for media_type, media_ip, media_port, media_direction in media_list: if media_port == 0: continue stream = None for old_stream in old_streams: old_remote = getattr(old_stream, party).remote_sdp if old_stream.media_type == media_type and ((media_ip == "0.0.0.0" and old_remote[1] == media_port) or old_remote == (media_ip, media_port)): stream = old_stream stream.check_hold(party, media_direction, media_ip) log.debug("Found matching existing stream: %s" % stream) break if stream is None: stream = MediaStream(self, media_type, media_ip, media_port, party, media_direction) log.debug("Added new stream: %s" % stream) new_streams.append(stream) if self.previous_cseq is not None: for stream in self.streams[self.previous_cseq]: if stream not in self.streams[self.cseq] + new_streams: stream.cleanup() self.previous_cseq = self.cseq self.cseq = cseq elif self.cseq == cseq: log.debug("Received updated SDP answer") now = time() if self.start_time is None: self.start_time = now current_streams = self.streams[cseq] if len(media_list) < len(current_streams): for stream in current_streams[len(media_list):]: log.debug("Stream rejected by not being included in the SDP answer: %s" % stream) stream.cleanup("rejected") if stream.start_time is None: stream.start_time = now for stream, (media_type, media_ip, media_port, media_direction) in zip(current_streams, media_list): if stream.start_time is None: stream.start_time = now if stream.media_type != media_type: raise ValueError('Media types do not match: "%s" and "%s"' % (stream.media_type, media_type)) if media_port == 0: log.debug("Stream explicitly rejected: %s" % stream) stream.cleanup("rejected") continue stream.check_hold(party, media_direction, media_ip) party_info = getattr(stream, party) if party_info.remote_sdp is None or party_info.remote_sdp[0] == "0.0.0.0": party_info.remote_sdp = (media_ip, media_port) log.debug("Got initial answer from %s for stream: %s" % (party, stream)) else: if party_info.remote_sdp[1] != media_port or (party_info.remote_sdp[0] != media_ip != '0.0.0.0'): stream.reset(party, media_ip, media_port) log.debug("Updated %s for stream: %s" % (party, stream)) else: log.debug("Unchanged stream: %s" % stream) if self.previous_cseq is not None: for stream in [stream for stream in self.streams[self.previous_cseq] if stream not in current_streams]: log.debug("Removing old stream: %s" % stream) stream.cleanup() else: log.debug("Received old CSeq %d:%d, ignoring" % cseq) | d152d84ff0e81372d62ba1d69a67f5907739c67d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3445/d152d84ff0e81372d62ba1d69a67f5907739c67d/mediacontrol.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
5829,
12,
2890,
16,
276,
5436,
16,
358,
67,
2692,
16,
729,
67,
5629,
16,
3539,
67,
1098,
16,
353,
67,
2378,
3256,
16,
353,
67,
16140,
67,
71,
5436,
4672,
309,
365,
18,
71... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
5829,
12,
2890,
16,
276,
5436,
16,
358,
67,
2692,
16,
729,
67,
5629,
16,
3539,
67,
1098,
16,
353,
67,
2378,
3256,
16,
353,
67,
16140,
67,
71,
5436,
4672,
309,
365,
18,
71... |
self.anytingElse() | self.anythingElse() | def startTagOther(self, name, attributes): self.anytingElse() self.parser.processStartTag(name, attributes) | 2fb2cbabda22a54e217122e4450a295370d06019 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4487/2fb2cbabda22a54e217122e4450a295370d06019/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1805,
8290,
12,
2890,
16,
508,
16,
1677,
4672,
365,
18,
2273,
4274,
12427,
1435,
365,
18,
4288,
18,
2567,
30512,
12,
529,
16,
1677,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1805,
8290,
12,
2890,
16,
508,
16,
1677,
4672,
365,
18,
2273,
4274,
12427,
1435,
365,
18,
4288,
18,
2567,
30512,
12,
529,
16,
1677,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
"""See zope.app.container.interfaces.IAdding""" | """See zope.publisher.interfaces.IPublishTraverse""" | def publishTraverse(self, request, name): """See zope.app.container.interfaces.IAdding""" if '=' in name: view_name, content_name = name.split("=", 1) self.contentName = content_name | 3722aab15fca369e63130fab2dcafcac9d794efd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9826/3722aab15fca369e63130fab2dcafcac9d794efd/adding.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3808,
29654,
12,
2890,
16,
590,
16,
508,
4672,
3536,
9704,
998,
1306,
18,
26018,
18,
15898,
18,
2579,
2394,
29654,
8395,
309,
5214,
316,
508,
30,
1476,
67,
529,
16,
913,
67,
529,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3808,
29654,
12,
2890,
16,
590,
16,
508,
4672,
3536,
9704,
998,
1306,
18,
26018,
18,
15898,
18,
2579,
2394,
29654,
8395,
309,
5214,
316,
508,
30,
1476,
67,
529,
16,
913,
67,
529,
273,
... |
Replace a with a cluster constructed from a and b. The cluster's time-frequency tile is the smallest tile that contains the original two tiles, and the "most signficiant" contributor for the cluster is the most confident of the two input tiles most significant contributors. The event a is returned. """ | Modify a in place to be a cluster constructed from a and b. The cluster's time-frequency tile is the smallest tile that contains the original two tiles, and the "most signficiant" contributor for the cluster is the tile whose boundaries are the SNR^{2} weighted average boundaries of the two contributing tiles. The "most signficiant" contributor's h_{rss}, SNR, and confidence, are copied verbatim from whichever of the two contributing tiles has the highest confidence. The modified event a is returned. """ | def ExcessPowerClusterFunc(a, b): """ Replace a with a cluster constructed from a and b. The cluster's time-frequency tile is the smallest tile that contains the original two tiles, and the "most signficiant" contributor for the cluster is the most confident of the two input tiles most significant contributors. The event a is returned. """ # # Save the properties of the most significant contributor # if b.ms_confidence > a.ms_confidence: a.set_ms_period(weighted_average_seg(a.get_ms_period(), a.snr**2.0, b.get_ms_period(), b.snr**2.0)) a.set_ms_band(weighted_average_seg(a.get_ms_band(), a.snr**2.0, b.get_ms_band(), b.snr**2.0)) a.ms_hrss = b.ms_hrss a.ms_snr = b.ms_snr a.ms_confidence = b.ms_confidence # # Compute the SNR squared weighted peak time and frequency (recall # that the peak times have been converted to floats relative to # epoch, and stored in the peak_time column). # a.peak_time = (a.snr**2.0 * a.peak_time + b.snr**2.0 * b.peak_time) / (a.snr**2.0 + b.snr**2.0) a.peak_frequency = (a.snr**2.0 * a.peak_frequency + b.snr**2.0 * b.peak_frequency) / (a.snr**2.0 + b.snr**2.0) # # Compute the combined h_rss and SNR by summing the original ones. # Note that no accounting of the overlap of the events is made, so # these parameters are being horribly overcounted, but the SNR in # particular must be summed like this in order to carry the # information needed to continue computing the SNR squared weighted # peak time and frequencies. # a.amplitude += b.amplitude a.snr = math.sqrt(a.snr**2.0 + b.snr**2.0) # # The confidence is the confidence of the most significant tile. # a.confidence = a.ms_confidence # # The cluster's frequency band is the smallest band containing the # bands of the two original events # a.set_band(smallest_enclosing_seg(a.get_band(), b.get_band())) # # The cluster's time interval is the smallest interval containing # the intervals of the two original events # a.set_period(smallest_enclosing_seg(a.get_period(), b.get_period())) # # Success # return a | 70b8d6d8f0cce1d2750fe944e24231a96791af25 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5758/70b8d6d8f0cce1d2750fe944e24231a96791af25/ligolw_bucluster.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1312,
614,
13788,
3629,
2622,
12,
69,
16,
324,
4672,
3536,
6910,
279,
598,
279,
2855,
15688,
628,
279,
471,
324,
18,
225,
1021,
2855,
1807,
813,
17,
14092,
4769,
353,
326,
13541,
4769,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1312,
614,
13788,
3629,
2622,
12,
69,
16,
324,
4672,
3536,
6910,
279,
598,
279,
2855,
15688,
628,
279,
471,
324,
18,
225,
1021,
2855,
1807,
813,
17,
14092,
4769,
353,
326,
13541,
4769,
... |
os.system("make distclean") | os.system("python ./generate.py distclean") | def main(): parser = optparse.OptionParser( "usage: %prog [options]", option_class=ExtendAction ) migrator_options = optparse.OptionGroup(parser, "Migrator Options") migrator_options.add_option( "-m", "--from-makefile", dest="makefile", metavar="MAKEFILE", help="Makefile of the skeleton project to migrate (optional)" ) migrator_options.add_option( "--from-version", dest="from_version", metavar="VERSION", default="", help="qooxdoo version used for the project e.g. '0.6.3'" ) migrator_options.add_option( "--migrate-html", action="store_true", dest="migrateHtml", default=False, help="Migrates recursively all HTML files. Starting from the current directory." ) migrator_options.add_option( "-i", "--input", dest="file", metavar="FILE.js", help="Migrate just one JavaScript file. Writes the generated file to STDOUT." ) migrator_options.add_option( "--class-path", action="extend", dest="classPath", metavar="DIRECTORY", type="string", default=[], help="Define a class path." ) parser.add_option_group(migrator_options) # options from generator.py parser.add_option( "-v", "--verbose", action="store_true", dest="verbose", default=False, help="Verbose output mode." ) parser.add_option( "--class-encoding", action="extend", dest="classEncoding", metavar="ENCODING", type="string", default=[], help="Encoding of the files to migrate." ) # Options for pretty printing pp_options = optparse.OptionGroup(parser,"Pretty printer options") compiler.addCommandLineOptions(pp_options) parser.add_option_group(pp_options) (options, args) = parser.parse_args() if options.from_version == "": if options.makefile: print """ | f4c455feb0f960f896e9eb758de3c18f37158d4e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5718/f4c455feb0f960f896e9eb758de3c18f37158d4e/migrator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
225,
2082,
273,
2153,
2670,
18,
1895,
2678,
12,
315,
9167,
30,
738,
14654,
306,
2116,
65,
3113,
1456,
67,
1106,
33,
16675,
1803,
262,
225,
30188,
67,
2116,
273,
2153,
2670,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
225,
2082,
273,
2153,
2670,
18,
1895,
2678,
12,
315,
9167,
30,
738,
14654,
306,
2116,
65,
3113,
1456,
67,
1106,
33,
16675,
1803,
262,
225,
30188,
67,
2116,
273,
2153,
2670,
... |
for a in v: unit_to_type[a] = k | for a in v: unit_to_type[a] = k | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | d9145e61c2e167a847618a21778e0e532a04af5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/d9145e61c2e167a847618a21778e0e532a04af5d/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5302,
4873,
1576,
13332,
3536,
6910,
777,
326,
533,
924,
434,
326,
2836,
1576,
2190,
635,
3675,
12697,
10138,
16,
471,
10736,
2690,
1308,
4606,
364,
28769,
434,
999,
18,
1220,
445,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5302,
4873,
1576,
13332,
3536,
6910,
777,
326,
533,
924,
434,
326,
2836,
1576,
2190,
635,
3675,
12697,
10138,
16,
471,
10736,
2690,
1308,
4606,
364,
28769,
434,
999,
18,
1220,
445,
353,
... |
def submit_puids(self, puids, handler): from picard.const import PUID_SUBMIT_HOST, PUID_SUBMIT_PORT | def _submit_puids(self, puids, handler): | def submit_puids(self, puids, handler): from picard.const import PUID_SUBMIT_HOST, PUID_SUBMIT_PORT data = ('client=MusicBrainz Picard-%s&' % version_string) + '&'.join(['puid=%s%%20%s' % i for i in puids.items()]) header = self._prepare("POST", PUID_SUBMIT_HOST, PUID_SUBMIT_PORT, '/ws/1/track/') requestid = self.request(header, None) self._puid_data[requestid] = data.encode('ascii', 'ignore'), handler | 99cef230e14a13ea1086c6a2e70bd861ac21f5cd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12415/99cef230e14a13ea1086c6a2e70bd861ac21f5cd/webservice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9297,
67,
84,
21428,
12,
2890,
16,
293,
21428,
16,
1838,
4672,
501,
273,
7707,
2625,
33,
49,
14894,
38,
7596,
94,
453,
335,
1060,
6456,
87,
26045,
738,
1177,
67,
1080,
13,
397,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9297,
67,
84,
21428,
12,
2890,
16,
293,
21428,
16,
1838,
4672,
501,
273,
7707,
2625,
33,
49,
14894,
38,
7596,
94,
453,
335,
1060,
6456,
87,
26045,
738,
1177,
67,
1080,
13,
397,
... |
self.context.add_pin(lat, lon, '', '', type, rating, REQUEST) | self.submit_pin(lat, lon, '', '', type, rating, REQUEST) | def add_random_pins(self, num, REQUEST): num = int(num) for i in range(num): lat = randint(-89*100, 89*100)/100. lon = randint(-179*100, 179*100)/100. type = choice(TYPE_VALUES) rating = choice(RATING_VALUES) self.context.add_pin(lat, lon, '', '', type, rating, REQUEST) | a1b8278ac0dbfd3fe94988abbc86a152e59832a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/a1b8278ac0dbfd3fe94988abbc86a152e59832a1/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
9188,
67,
84,
2679,
12,
2890,
16,
818,
16,
12492,
4672,
818,
273,
509,
12,
2107,
13,
364,
277,
316,
1048,
12,
2107,
4672,
2516,
273,
16783,
19236,
6675,
14,
6625,
16,
28308,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
9188,
67,
84,
2679,
12,
2890,
16,
818,
16,
12492,
4672,
818,
273,
509,
12,
2107,
13,
364,
277,
316,
1048,
12,
2107,
4672,
2516,
273,
16783,
19236,
6675,
14,
6625,
16,
28308,
... |
subtitle = """<a name="6">6. Modify search fields for collection '%s'</a>   <small>[<a href="%s/admin/websearch/guide.html | subtitle = """<a name="6">6. Modify search fields for collection '%s'</a>   <small>[<a title="See guide" href="%s/admin/websearch/guide.html | def perform_showsearchfields(colID, ln=cdslang, callback='yes', content='', confirm=-1): """show the search fields of this collection..""" colID = int(colID) col_dict = dict(get_current_name('', ln, get_col_nametypes()[0][0], "collection")) fld_dict = dict(get_current_name('', ln, get_fld_nametypes()[0][0], "field")) fld_type = get_sort_nametypes() subtitle = """<a name="6">6. Modify search fields for collection '%s'</a>   <small>[<a href="%s/admin/websearch/guide.html#3.6">?</a>]</small>""" % (col_dict[colID], weburl) output = """<dl> <dt>Field actions (not related to this collection)</dt> <dd>Go to the BibIndex interface to modify</dd> <dt>Collection specific actions <dd><a href="addexistingfield?colID=%s&ln=%s&fmeth=sew#6.2">Add field to collection</a></dd> </dl> """ % (colID, ln) header = ['', 'Fieldname', 'Actions'] actions = [] cdslang = get_languages() lang = dict(cdslang) fld_type_list = fld_type.items() if len(get_col_fld(colID, 'sew')) > 0: res = get_col_fld(colID, 'sew') i = 0 for (fldID, fldvID, stype, score, score_fieldvalue) in res: if i != 0: move = """<a href="%s/admin/websearch/websearchadmin.py/switchfldscore?colID=%s&ln=%s&id_1=%s&id_2=%s&fmeth=sew#6"><img border="0" src="%s/img/arrow_up.gif" title="Move up"></a>""" % (weburl, colID, ln, fldID, res[i - 1][0],weburl) else: move = " " i += 1 if i != len(res): move += '<a href="%s/admin/websearch/websearchadmin.py/switchfldscore?colID=%s&ln=%s&id_1=%s&id_2=%s&fmeth=sew#6"><img border="0" src="%s/img/%s" title="Move down"></a>' % (weburl, colID, ln, fldID, res[i][0], weburl, ('arrow_down.gif')) actions.append([move, fld_dict[int(fldID)]]) for col in [(('Remove', 'removefield'),)]: actions[-1].append('<a href="%s/admin/websearch/websearchadmin.py/%s?colID=%s&ln=%s&fldID=%s&fmeth=sew#6.4">%s</a>' % (weburl, col[0][1], colID, ln, fldID, col[0][0])) for (str, function) in col[1:]: actions[-1][-1] += ' / <a href="%s/admin/websearch/websearchadmin.py/%s?colID=%s&ln=%s&fldID=%s#6.5">%s</a>' % (weburl, function, colID, ln, fldID, str) output += tupletotable(header=header, tuple=actions) else: output += """No search fields exists for this collection""" output += content try: body = [output, extra] except NameError: body = [output] if callback: return perform_editcollection(colID, ln, "perform_showsearchfields", addadminbox(subtitle, body)) else: return addadminbox(subtitle, body) | beda71fdc80661821084d0fd30dadb0e7e956b74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/beda71fdc80661821084d0fd30dadb0e7e956b74/websearchadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
4500,
3072,
2821,
12,
1293,
734,
16,
7211,
33,
4315,
2069,
539,
16,
1348,
2218,
9707,
2187,
913,
2218,
2187,
6932,
29711,
21,
4672,
3536,
4500,
326,
1623,
1466,
434,
333,
1849,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
4500,
3072,
2821,
12,
1293,
734,
16,
7211,
33,
4315,
2069,
539,
16,
1348,
2218,
9707,
2187,
913,
2218,
2187,
6932,
29711,
21,
4672,
3536,
4500,
326,
1623,
1466,
434,
333,
1849,... |
upgrade_graph(graph, module_list, force) | upgrade_graph(graph, cr, module_list, force) | def create_graph(module_list, force=None): graph = Graph() upgrade_graph(graph, module_list, force) return graph | f38712b1abe6dd684f135d257f439b4712b38435 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/f38712b1abe6dd684f135d257f439b4712b38435/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
4660,
12,
2978,
67,
1098,
16,
2944,
33,
7036,
4672,
2667,
273,
5601,
1435,
8400,
67,
4660,
12,
4660,
16,
4422,
16,
1605,
67,
1098,
16,
2944,
13,
327,
2667,
225,
2,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
4660,
12,
2978,
67,
1098,
16,
2944,
33,
7036,
4672,
2667,
273,
5601,
1435,
8400,
67,
4660,
12,
4660,
16,
4422,
16,
1605,
67,
1098,
16,
2944,
13,
327,
2667,
225,
2,
-100,
-10... |
if look=='itanium': | if look == 'itanium': | def get_platform (): """Return a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by 'os.uname()'), although the exact information included depends on the OS; eg. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-x86_64 (64bit Windows on x86_64 (AMD64)) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. """ if os.name == 'nt': # sniff sys.version for architecture. prefix = " bit (" i = string.find(sys.version, prefix) if i == -1: return sys.platform j = string.find(sys.version, ")", i) look = sys.version[i+len(prefix):j].lower() if look=='amd64': return 'win-x86_64' if look=='itanium': return 'win-ia64' return sys.platform if os.name != "posix" or not hasattr(os, 'uname'): # XXX what about the architecture? NT is Intel or Alpha, # Mac OS is M68k or PPC, etc. return sys.platform # Try to distinguish various flavours of Unix (osname, host, release, version, machine) = os.uname() # Convert the OS name to lowercase, remove '/' characters # (to accommodate BSD/OS), and translate spaces (for "Power Macintosh") osname = osname.lower().replace('/', '') machine = machine.replace(' ', '_') machine = machine.replace('/', '-') if osname[:5] == "linux": # At least on Linux/Intel, 'machine' is the processor -- # i386, etc. # XXX what about Alpha, SPARC, etc? return "%s-%s" % (osname, machine) elif osname[:5] == "sunos": if release[0] >= "5": # SunOS 5 == Solaris 2 osname = "solaris" release = "%d.%s" % (int(release[0]) - 3, release[2:]) # fall through to standard osname-release-machine representation elif osname[:4] == "irix": # could be "irix64"! return "%s-%s" % (osname, release) elif osname[:3] == "aix": return "%s-%s.%s" % (osname, version, release) elif osname[:6] == "cygwin": osname = "cygwin" rel_re = re.compile (r'[\d.]+') m = rel_re.match(release) if m: release = m.group() elif osname[:6] == "darwin": # # For our purposes, we'll assume that the system version from # distutils' perspective is what MACOSX_DEPLOYMENT_TARGET is set # to. This makes the compatibility story a bit more sane because the # machine is going to compile and link as if it were # MACOSX_DEPLOYMENT_TARGET. from distutils.sysconfig import get_config_vars cfgvars = get_config_vars() macver = os.environ.get('MACOSX_DEPLOYMENT_TARGET') if not macver: macver = cfgvars.get('MACOSX_DEPLOYMENT_TARGET') if not macver: # Get the system version. Reading this plist is a documented # way to get the system version (see the documentation for # the Gestalt Manager) try: f = open('/System/Library/CoreServices/SystemVersion.plist') except IOError: # We're on a plain darwin box, fall back to the default # behaviour. pass else: m = re.search( r'<key>ProductUserVisibleVersion</key>\s*' + r'<string>(.*?)</string>', f.read()) f.close() if m is not None: macver = '.'.join(m.group(1).split('.')[:2]) # else: fall back to the default behaviour if macver: from distutils.sysconfig import get_config_vars release = macver osname = "macosx" if (release + '.') < '10.4.' and \ get_config_vars().get('UNIVERSALSDK', '').strip(): # The universal build will build fat binaries, but not on # systems before 10.4 machine = 'fat' elif machine in ('PowerPC', 'Power_Macintosh'): # Pick a sane name for the PPC architecture. machine = 'ppc' return "%s-%s-%s" % (osname, release, machine) | c49a8d0dc091a213d4117981931f3d1357ba1d02 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/c49a8d0dc091a213d4117981931f3d1357ba1d02/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9898,
1832,
30,
3536,
990,
279,
533,
716,
25283,
326,
783,
4072,
18,
225,
1220,
353,
1399,
31457,
358,
23926,
4072,
17,
12524,
1361,
6402,
471,
4072,
17,
12524,
6650,
23296,
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,
9898,
1832,
30,
3536,
990,
279,
533,
716,
25283,
326,
783,
4072,
18,
225,
1220,
353,
1399,
31457,
358,
23926,
4072,
17,
12524,
1361,
6402,
471,
4072,
17,
12524,
6650,
23296,
18,... |
''' Embed the current index args in a URL ''' | """ Embed the current index args in a URL """ | def indexargs_url(self, url, args): ''' Embed the current index args in a URL ''' q = urllib.quote sc = self.special_char l = ['%s=%s'%(k,v) for k,v in args.items()] | 16a3ebf380b95607b344181655488d818a27791f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1906/16a3ebf380b95607b344181655488d818a27791f/templating.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
1968,
67,
718,
12,
2890,
16,
880,
16,
833,
4672,
3536,
14564,
326,
783,
770,
833,
316,
279,
1976,
3536,
1043,
273,
11527,
18,
6889,
888,
273,
365,
18,
9371,
67,
3001,
328,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
1968,
67,
718,
12,
2890,
16,
880,
16,
833,
4672,
3536,
14564,
326,
783,
770,
833,
316,
279,
1976,
3536,
1043,
273,
11527,
18,
6889,
888,
273,
365,
18,
9371,
67,
3001,
328,
273,
... |
def WriteGLES2ImplementationImpl(self, func, file): """Overrriden from TypeHandler.""" pass | def WriteGLES2ImplementationImpl(self, func, file): """Overrriden from TypeHandler.""" pass | b4a937e280d5e05e48c8a7abf6caf1fdf5448b1b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4a937e280d5e05e48c8a7abf6caf1fdf5448b1b/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
43,
11386,
22,
13621,
2828,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
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,
2598,
43,
11386,
22,
13621,
2828,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
self.assertAlmostEqual(-0.5, self.event.x, 2) | self.assertAlmostEqual(-0.5 * 4.0/3.0, self.event.x, 2) | def testRedLightDetector(self): # Create a vision system with two mock cameras and an EventHub cfg = { 'name' : 'Test', 'type' : 'TestSubsystem' } cfg = core.ConfigNode.fromString(str(cfg)) forwardCamera = vision.Camera(640,480) backwardCamera = vision.Camera(640,480) | 0ecefb998dc72110f3fdf1303502deae88148fae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10608/0ecefb998dc72110f3fdf1303502deae88148fae/TestVisionSystem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3715,
12128,
12594,
12,
2890,
4672,
468,
1788,
279,
331,
1951,
2619,
598,
2795,
5416,
5861,
12067,
471,
392,
2587,
8182,
2776,
273,
288,
296,
529,
11,
294,
296,
4709,
2187,
296,
72... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3715,
12128,
12594,
12,
2890,
4672,
468,
1788,
279,
331,
1951,
2619,
598,
2795,
5416,
5861,
12067,
471,
392,
2587,
8182,
2776,
273,
288,
296,
529,
11,
294,
296,
4709,
2187,
296,
72... |
self.js("window.resizeTo(screen.width,screen.height)") | time.sleep(1) self.js("window.resizeTo(screen.availWidth,screen.availHeight)") | def start_browser(self, browser, url): """Start browser and load website.""" self.safari = appscript.app('Safari') self.js("window.moveTo(0,0)") self.js("window.resizeTo(screen.width,screen.height)") time.sleep(1) self.js("document.location='%s'" % url) for dummy in range(10): time.sleep(3) if self.ready_state(): break | 65ae93cacb98c57c860c8f1a735b0c97bb1a962b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3111/65ae93cacb98c57c860c8f1a735b0c97bb1a962b/darwin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
11213,
12,
2890,
16,
4748,
16,
880,
4672,
3536,
1685,
4748,
471,
1262,
12504,
12123,
365,
18,
87,
19328,
273,
595,
4263,
18,
2910,
2668,
55,
19328,
6134,
365,
18,
2924,
2932,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
11213,
12,
2890,
16,
4748,
16,
880,
4672,
3536,
1685,
4748,
471,
1262,
12504,
12123,
365,
18,
87,
19328,
273,
595,
4263,
18,
2910,
2668,
55,
19328,
6134,
365,
18,
2924,
2932,
... |
fp.write(subpart.get_payload()) | fp.write(subpart.get_payload(decode=1)) | def to_plaintext(msg): changedp = 0 for subpart in typed_subpart_iterator(msg, 'text', 'html'): filename = tempfile.mktemp('.html') fp = open(filename, 'w') try: fp.write(subpart.get_payload()) fp.close() cmd = os.popen(mm_cfg.HTML_TO_PLAIN_TEXT_COMMAND % {'filename': filename}) plaintext = cmd.read() rtn = cmd.close() if rtn: syslog('error', 'HTML->text/plain error: %s', rtn) finally: try: os.unlink(filename) except OSError, e: if e.errno <> errno.ENOENT: raise # Now replace the payload of the subpart and twiddle the Content-Type: subpart.set_payload(plaintext) subpart.set_type('text/plain') changedp = 1 return changedp | 98ca03ed785ca20d48bedfa001e92d117bfc0335 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/98ca03ed785ca20d48bedfa001e92d117bfc0335/MimeDel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
412,
10133,
12,
3576,
4672,
3550,
84,
273,
374,
364,
720,
2680,
316,
9092,
67,
1717,
2680,
67,
9838,
12,
3576,
16,
296,
955,
2187,
296,
2620,
11,
4672,
1544,
273,
13275,
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,
358,
67,
412,
10133,
12,
3576,
4672,
3550,
84,
273,
374,
364,
720,
2680,
316,
9092,
67,
1717,
2680,
67,
9838,
12,
3576,
16,
296,
955,
2187,
296,
2620,
11,
4672,
1544,
273,
13275,
18,
... |
testformat("--> %10.2f", 1000.0, grouping=1, output='--> 1,000.00', | testformat("--> %10.2f", 1000.0, grouping=1, output='--> 1%s000.00' % sep, | def testformat(formatstr, value, grouping = 0, output=None, func=locale.format): if verbose: if output: print "%s %% %s =? %s ..." %\ (repr(formatstr), repr(value), repr(output)), else: print "%s %% %s works? ..." % (repr(formatstr), repr(value)), result = func(formatstr, value, grouping = grouping) if output and result != output: if verbose: print 'no' print "%s %% %s == %s != %s" %\ (repr(formatstr), repr(value), repr(result), repr(output)) else: if verbose: print "yes" | 3173101aa34aee8b9fe17db6efcad0224c46775b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3173101aa34aee8b9fe17db6efcad0224c46775b/test_locale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2139,
12,
2139,
701,
16,
460,
16,
12116,
273,
374,
16,
876,
33,
7036,
16,
1326,
33,
6339,
18,
2139,
4672,
309,
3988,
30,
309,
876,
30,
1172,
2213,
87,
26510,
738,
87,
273,
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,
1842,
2139,
12,
2139,
701,
16,
460,
16,
12116,
273,
374,
16,
876,
33,
7036,
16,
1326,
33,
6339,
18,
2139,
4672,
309,
3988,
30,
309,
876,
30,
1172,
2213,
87,
26510,
738,
87,
273,
35,
... |
return true | return True | def OnMouseEvent (self, event): x, y = event.GetPositionTuple() if event.ButtonDown(1) and self.SelectedHitTest (x, y) : self.canvas.DeSelectAll() self.SetSelected() self.canvas.Update() if self.DragHitTest (x, y): self.dragStartPos = (x, y) elif event.ButtonUp(1): self.dragStartPos = None elif event.Dragging() and event.LeftIsDown(): tolerance = 2 if abs(x - self.dragStartPos[0]) > tolerance or abs(y - self.dragStartPos[1]) > tolerance: self.DoDrag(x, y) return true event.Skip() return false | c0cecfcb7704c0cc4c05de4b417e49f03bc3a0f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/c0cecfcb7704c0cc4c05de4b417e49f03bc3a0f8/SimpleCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
9186,
1133,
261,
2890,
16,
871,
4672,
619,
16,
677,
273,
871,
18,
967,
2555,
9038,
1435,
309,
871,
18,
3616,
4164,
12,
21,
13,
471,
365,
18,
7416,
13616,
4709,
261,
92,
16,
677... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9186,
1133,
261,
2890,
16,
871,
4672,
619,
16,
677,
273,
871,
18,
967,
2555,
9038,
1435,
309,
871,
18,
3616,
4164,
12,
21,
13,
471,
365,
18,
7416,
13616,
4709,
261,
92,
16,
677... |
el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ | el = SubElement(self.automatic_styles, 'style:style', attrib={ | def visit_option_list(self, node): #self.document.reporter.debug_flag = 1 #self.document.reporter.attach_observer(self.show_message) table_name = 'rststyle-tableoption' # # Generate automatic styles if not self.optiontablestyles_generated: self.optiontablestyles_generated = True el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ 'style:name': table_name, 'style:family': 'table'}) el1 = etree.SubElement(el, 'style:table-properties', attrib={ 'style:width': '17.59cm', 'table:align': 'left', 'style:shadow': 'none'}) el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ 'style:name': '%s.A' % table_name, 'style:family': 'table-column'}) el1 = etree.SubElement(el, 'style:table-column-properties', attrib={ 'style:column-width': '4.999cm'}) el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ 'style:name': '%s.B' % table_name, 'style:family': 'table-column'}) el1 = etree.SubElement(el, 'style:table-column-properties', attrib={ 'style:column-width': '12.587cm'}) el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ 'style:name': '%s.A1' % table_name, 'style:family': 'table-cell'}) el1 = etree.SubElement(el, 'style:table-cell-properties', attrib={ 'fo:background-color': 'transparent', 'fo:padding': '0.097cm', 'fo:border-left': '0.035cm solid #000000', 'fo:border-right': 'none', 'fo:border-top': '0.035cm solid #000000', 'fo:border-bottom': '0.035cm solid #000000'}) el2 = etree.SubElement(el1, 'style:background-image') el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ 'style:name': '%s.B1' % table_name, 'style:family': 'table-cell'}) el1 = etree.SubElement(el, 'style:table-cell-properties', attrib={ 'fo:padding': '0.097cm', 'fo:border': '0.035cm solid #000000'}) el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ 'style:name': '%s.A2' % table_name, 'style:family': 'table-cell'}) el1 = etree.SubElement(el, 'style:table-cell-properties', attrib={ 'fo:padding': '0.097cm', 'fo:border-left': '0.035cm solid #000000', 'fo:border-right': 'none', 'fo:border-top': 'none', 'fo:border-bottom': '0.035cm solid #000000'}) el = etree.SubElement(self.automatic_styles, 'style:style', attrib={ 'style:name': '%s.B2' % table_name, 'style:family': 'table-cell'}) el1 = etree.SubElement(el, 'style:table-cell-properties', attrib={ 'fo:padding': '0.097cm', 'fo:border-left': '0.035cm solid #000000', 'fo:border-right': '0.035cm solid #000000', 'fo:border-top': 'none', 'fo:border-bottom': '0.035cm solid #000000'}) # # Generate table data el = self.append_child('table:table', attrib={ 'table:name': table_name, 'table:style-name': table_name, }) el1 = etree.SubElement(el, 'table:table-column', attrib={ 'table:style-name': '%s.A' % table_name}) el1 = etree.SubElement(el, 'table:table-column', attrib={ 'table:style-name': '%s.B' % table_name}) el1 = etree.SubElement(el, 'table:table-header-rows') el2 = etree.SubElement(el1, 'table:table-row') el3 = etree.SubElement(el2, 'table:table-cell', attrib={ 'table:style-name': '%s.A1' % table_name, 'office:value-type': 'string'}) el4 = etree.SubElement(el3, 'text:p', attrib={ 'text:style-name': 'Table_20_Heading'}) el4.text= 'Option' el3 = etree.SubElement(el2, 'table:table-cell', attrib={ 'table:style-name': '%s.B1' % table_name, 'office:value-type': 'string'}) el4 = etree.SubElement(el3, 'text:p', attrib={ 'text:style-name': 'Table_20_Heading'}) el4.text= 'Description' self.set_current_element(el) | 57ceb741b8ea9b94d9b9e314a03912d12bd3c5c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/57ceb741b8ea9b94d9b9e314a03912d12bd3c5c5/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
3482,
67,
1098,
12,
2890,
16,
756,
4672,
468,
2890,
18,
5457,
18,
266,
7988,
18,
4148,
67,
6420,
273,
404,
468,
2890,
18,
5457,
18,
266,
7988,
18,
7331,
67,
30971,
12,
2890... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
3482,
67,
1098,
12,
2890,
16,
756,
4672,
468,
2890,
18,
5457,
18,
266,
7988,
18,
4148,
67,
6420,
273,
404,
468,
2890,
18,
5457,
18,
266,
7988,
18,
7331,
67,
30971,
12,
2890... |
bound = ZZ(floor(bound)) | bound = ZZ(floor(max(bound, 0))) | def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all vectors of length i. Reference: This is a slightly modified version of Cohn's Algorithm 2.7.5 in "A Course in Computational Number Theory", with the increment step moved around and slightly re-indexed to allow clean looping. Note: We could speed this up for very skew matrices by using LLL first, and then changing coordinates back, but for our purposes the simpler method is efficient enough. =) EXAMPLES: sage: Q = DiagonalQuadraticForm(ZZ, [1,1]) sage: Q.vectors_by_length(5) [[[0, 0]], [[0, -1], [-1, 0]], [[-1, -1], [1, -1]], [], [[0, -2], [-2, 0]], [[-1, -2], [1, -2], [-2, -1], [2, -1]]] sage: Q1 = DiagonalQuadraticForm(ZZ, [1,3,5,7]) sage: Q1.vectors_by_length(5) [[[0, 0, 0, 0]], [[-1, 0, 0, 0]], [], [[0, -1, 0, 0]], [[-1, -1, 0, 0], [1, -1, 0, 0], [-2, 0, 0, 0]], [[0, 0, -1, 0]]] sage: Q = QuadraticForm(ZZ, 4, [1,1,1,1, 1,0,0, 1,0, 1]) sage: map(len, Q.vectors_by_length(2)) [1, 12, 12] """ # pari uses eps = 1e-6 ; nothing bad should happen if eps is too big # but if eps is too small, roundoff errors may knock off some # vectors of norm = bound (see #7100) eps = RDF(1e-6) bound = ZZ(floor(bound)) Theta_Precision = bound + eps n = self.dim() ## Make the vector of vectors which have a given value ## (So theta_vec[i] will have all vectors v with Q(v) = i.) theta_vec = [[] for i in range(bound + 1)] ## Initialize Q with zeros and Copy the Cholesky array into Q Q = self.cholesky_decomposition() ## 1. Initialize T = n * [RDF(0)] ## Note: We index the entries as 0 --> n-1 U = n * [RDF(0)] i = n-1 T[i] = RDF(Theta_Precision) U[i] = RDF(0) L = n * [0] x = n * [0] Z = RDF(0) ## 2. Compute bounds Z = (T[i] / Q[i][i]).sqrt(extend=False) L[i] = ( Z - U[i]).floor() x[i] = (-Z - U[i]).ceil() done_flag = False Q_val_double = RDF(0) Q_val = 0 ## WARNING: Still need a good way of checking overflow for this value... ## Big loop which runs through all vectors while not done_flag: ## 3b. Main loop -- try to generate a complete vector x (when i=0) while (i > 0): #print " i = ", i #print " T[i] = ", T[i] #print " Q[i][i] = ", Q[i][i] #print " x[i] = ", x[i] #print " U[i] = ", U[i] #print " x[i] + U[i] = ", (x[i] + U[i]) #print " T[i-1] = ", T[i-1] T[i-1] = T[i] - Q[i][i] * (x[i] + U[i]) * (x[i] + U[i]) #print " T[i-1] = ", T[i-1] #print " x = ", x #print i = i - 1 U[i] = 0 for j in range(i+1, n): U[i] = U[i] + Q[i][j] * x[j] ## Now go back and compute the bounds... ## 2. Compute bounds Z = (T[i] / Q[i][i]).sqrt(extend=False) L[i] = ( Z - U[i]).floor() x[i] = (-Z - U[i]).ceil() ## 4. Solution found (This happens when i = 0) #print "-- Solution found! --" #print " x = ", x #print " Q_val = Q(x) = ", Q_val Q_val_double = Theta_Precision - T[0] + Q[0][0] * (x[0] + U[0]) * (x[0] + U[0]) Q_val = Q_val_double.round() ## SANITY CHECK: Roundoff Error is < 0.001 if abs(Q_val_double - Q_val) > 0.001: print " x = ", x print " Float = ", Q_val_double, " Long = ", Q_val raise RuntimeError, "The roundoff error is bigger than 0.001, so we should use more precision somewhere..." #print " Float = ", Q_val_double, " Long = ", Q_val, " XX " #print " The float value is ", Q_val_double #print " The associated long value is ", Q_val if (Q_val <= bound): #print " Have vector ", x, " with value ", Q_val theta_vec[Q_val].append(deepcopy(x)) ## 5. Check if x = 0, for exit condition. =) j = 0 done_flag = True while (j < n): if (x[j] != 0): done_flag = False j += 1 ## 3a. Increment (and carry if we go out of bounds) x[i] += 1 while (x[i] > L[i]) and (i < n-1): i += 1 x[i] += 1 #print " Leaving ThetaVectors()" return theta_vec | 940d646c5a5bb4c0ca67886e37ff3ca582c9d5d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/940d646c5a5bb4c0ca67886e37ff3ca582c9d5d8/quadratic_form__split_local_covering.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10046,
67,
1637,
67,
2469,
12,
2890,
16,
2489,
4672,
3536,
2860,
279,
666,
434,
3025,
10046,
9475,
598,
3675,
924,
18,
225,
1220,
353,
279,
28224,
4886,
1492,
4692,
326,
1680,
9112,
1846... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10046,
67,
1637,
67,
2469,
12,
2890,
16,
2489,
4672,
3536,
2860,
279,
666,
434,
3025,
10046,
9475,
598,
3675,
924,
18,
225,
1220,
353,
279,
28224,
4886,
1492,
4692,
326,
1680,
9112,
1846... |
support.verbose = True | def test_main(verbose=False): if skip_expected: raise unittest.SkipTest("No SSL support") if support.verbose: plats = { 'Linux': platform.linux_distribution, 'Mac': platform.mac_ver, 'Windows': platform.win32_ver, } for name, func in plats.items(): plat = func() if plat and plat[0]: plat = '%s %r' % (name, plat) break else: plat = repr(platform.platform()) print("test_ssl: testing with %r %r" % (ssl.OPENSSL_VERSION, ssl.OPENSSL_VERSION_INFO)) print(" under %s" % plat) for filename in [ CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, BYTES_CERTFILE, ONLYCERT, ONLYKEY, BYTES_ONLYCERT, BYTES_ONLYKEY, BADCERT, BADKEY, EMPTYCERT]: if not os.path.exists(filename): raise support.TestFailed("Can't read certificate file %r" % filename) tests = [ContextTests, BasicSocketTests] if support.is_resource_enabled('network'): tests.append(NetworkedTests) if _have_threads: thread_info = support.threading_setup() if thread_info and support.is_resource_enabled('network'): tests.append(ThreadedTests) old_verbose = support.verbose try: support.verbose = True support.run_unittest(*tests) finally: support.verbose = old_verbose if _have_threads: support.threading_cleanup(*thread_info) | c48ada47c892b16a90ed478ce9293fad08bbe836 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/c48ada47c892b16a90ed478ce9293fad08bbe836/test_ssl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
12,
11369,
33,
8381,
4672,
309,
2488,
67,
3825,
30,
1002,
2836,
3813,
18,
6368,
4709,
2932,
2279,
7419,
2865,
7923,
225,
309,
2865,
18,
11369,
30,
886,
2323,
273,
288,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5254,
12,
11369,
33,
8381,
4672,
309,
2488,
67,
3825,
30,
1002,
2836,
3813,
18,
6368,
4709,
2932,
2279,
7419,
2865,
7923,
225,
309,
2865,
18,
11369,
30,
886,
2323,
273,
288,
... | |
elements = [Paragraph(self.font_switcher.fontifyText(title), text_style(mode='booktitle'))] | elements = [Paragraph(self.font_switcher.fontifyText(xmlescape(title)), text_style(mode='booktitle'))] | def writeTitlePage(self, coverimage=None): # FIXME: clean this up. there seems to be quite a bit of deprecated here title = self.book.get('title') subtitle = self.book.get('subtitle') | b02db8ef792490a1884e1fc23d64675069ebfb10 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12390/b02db8ef792490a1884e1fc23d64675069ebfb10/rlwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
4247,
1964,
12,
2890,
16,
5590,
2730,
33,
7036,
4672,
468,
9852,
30,
2721,
333,
731,
18,
1915,
12001,
358,
506,
25102,
279,
2831,
434,
6849,
2674,
2077,
273,
365,
18,
3618,
18,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
4247,
1964,
12,
2890,
16,
5590,
2730,
33,
7036,
4672,
468,
9852,
30,
2721,
333,
731,
18,
1915,
12001,
358,
506,
25102,
279,
2831,
434,
6849,
2674,
2077,
273,
365,
18,
3618,
18,
5... |
WARNING -- this isn't ready for general use yet. | def extension(self, modulus, prec = None, names = None, print_mode = None, halt = None): """ Create an extension of this p-adic ring. | 30a764f77f807a9f30b4503dfb3c45d3268a9450 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/30a764f77f807a9f30b4503dfb3c45d3268a9450/padic_generic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2710,
12,
2890,
16,
24770,
16,
13382,
273,
599,
16,
1257,
273,
599,
16,
1172,
67,
3188,
273,
599,
16,
18389,
273,
599,
4672,
3536,
1788,
392,
2710,
434,
333,
293,
17,
20333,
9221,
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,
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,
2710,
12,
2890,
16,
24770,
16,
13382,
273,
599,
16,
1257,
273,
599,
16,
1172,
67,
3188,
273,
599,
16,
18389,
273,
599,
4672,
3536,
1788,
392,
2710,
434,
333,
293,
17,
20333,
9221,
18,
... | |
as = atom.service.AtomService('code.google.com') self.assertEquals(as.server, 'code.google.com') (host, port, ssl, path) = atom.service.ProcessUrl(as, | atom_service = atom.service.AtomService('code.google.com') self.assertEquals(atom_service.server, 'code.google.com') (host, port, ssl, path) = atom.service.ProcessUrl(atom_service, | def testParseHttpUrlWithPort(self): as = atom.service.AtomService('code.google.com') self.assertEquals(as.server, 'code.google.com') (host, port, ssl, path) = atom.service.ProcessUrl(as, 'http://www.google.com:12/service/subservice?name=value&newname=newvalue') | c04c73a782840c833cb2436bbf4e5d652abedbfc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5609/c04c73a782840c833cb2436bbf4e5d652abedbfc/service_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3201,
2940,
1489,
1190,
2617,
12,
2890,
4672,
3179,
67,
3278,
273,
3179,
18,
3278,
18,
3641,
1179,
2668,
710,
18,
9536,
18,
832,
6134,
365,
18,
11231,
8867,
12,
7466,
67,
3278,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3201,
2940,
1489,
1190,
2617,
12,
2890,
4672,
3179,
67,
3278,
273,
3179,
18,
3278,
18,
3641,
1179,
2668,
710,
18,
9536,
18,
832,
6134,
365,
18,
11231,
8867,
12,
7466,
67,
3278,
1... |
manifest = os.path.join(contribCachePath, contrib, manifile) | manifest = os.path.normpath(os.path.join(contribCachePath, contrib, manifile)) | def resolveLibs(self, jobs): config = self.get("jobs") console = self._console | ea5954aebd407753bd7a5070f37e36849ad0de46 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/ea5954aebd407753bd7a5070f37e36849ad0de46/Config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2245,
5664,
87,
12,
2890,
16,
6550,
4672,
642,
225,
273,
365,
18,
588,
2932,
10088,
7923,
2983,
273,
365,
6315,
8698,
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,
2245,
5664,
87,
12,
2890,
16,
6550,
4672,
642,
225,
273,
365,
18,
588,
2932,
10088,
7923,
2983,
273,
365,
6315,
8698,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self._getOb(id).manage_upload(file) | if file: self._getOb(id).manage_upload(file) | def manage_addFile(self,id,file='',title='',precondition='', content_type='', REQUEST=None): """Add a new File object. Creates a new File object 'id' with the contents of 'file'""" id=str(id) title=str(title) content_type=str(content_type) precondition=str(precondition) id, title = cookId(id, title, file) self=self.this() # First, we create the file without data: self._setObject(id, File(id,title,'',content_type, precondition)) # Now we "upload" the data. By doing this in two steps, we # can use a database trick to make the upload more efficient. self._getOb(id).manage_upload(file) if content_type: self._getOb(id).content_type=content_type if REQUEST is not None: REQUEST['RESPONSE'].redirect(self.absolute_url()+'/manage_main') | 5cccb2a2b43b994691261e44e9d663e082e10070 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5cccb2a2b43b994691261e44e9d663e082e10070/Image.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
1289,
812,
12,
2890,
16,
350,
16,
768,
2218,
2187,
2649,
2218,
2187,
1484,
4175,
2218,
2187,
913,
67,
723,
2218,
2187,
12492,
33,
7036,
4672,
3536,
986,
279,
394,
1387,
733,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
1289,
812,
12,
2890,
16,
350,
16,
768,
2218,
2187,
2649,
2218,
2187,
1484,
4175,
2218,
2187,
913,
67,
723,
2218,
2187,
12492,
33,
7036,
4672,
3536,
986,
279,
394,
1387,
733,
... |
ui.show_error_msg(window, _('Unable to launch a suitable browser.'), _('Launch Browser'), 'browserLoadError') | ui.show_msg(window, _('Unable to launch a suitable browser.'), _('Launch Browser'), 'browserLoadError', gtk.BUTTONS_CLOSE) | def browser_load(docslink, browser, window): if browser and browser.strip(): browsers = [browser.strip()] else: browsers = ["gnome-open", # default, we are a "gnome" app "x-www-browser", # default on Debian-based systems "exo-open", "kfmclient openURL", "firefox", "mozilla", "opera"] for browser in browsers: try: subprocess.Popen(browser.split()+[docslink]) break # done except OSError: pass # try next else: # none worked # FIXME no function ui.show_error_msg defined ui.show_error_msg(window, _('Unable to launch a suitable browser.'), _('Launch Browser'), 'browserLoadError') | 6999e41694cbf9e7c56fe99d195b855c2ad1ef59 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2312/6999e41694cbf9e7c56fe99d195b855c2ad1ef59/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4748,
67,
945,
12,
8532,
1232,
16,
4748,
16,
2742,
4672,
309,
4748,
471,
4748,
18,
6406,
13332,
14993,
273,
306,
11213,
18,
6406,
1435,
65,
469,
30,
14993,
273,
8247,
1600,
1742,
17,
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,
4748,
67,
945,
12,
8532,
1232,
16,
4748,
16,
2742,
4672,
309,
4748,
471,
4748,
18,
6406,
13332,
14993,
273,
306,
11213,
18,
6406,
1435,
65,
469,
30,
14993,
273,
8247,
1600,
1742,
17,
3... |
test(r"""sre.match('(x)*', 50000*'x').span()""", (0, 50000), RuntimeError) test(r"""sre.match('(x)*y', 50000*'x'+'y').span()""", (0, 50001), RuntimeError) test(r"""sre.match('(x)*?y', 50000*'x'+'y').span()""", (0, 50001), RuntimeError) | test(r"""sre.match(r'(x)*', 50000*'x').span()""", (0, 50000), RuntimeError) test(r"""sre.match(r'(x)*y', 50000*'x'+'y').span()""", (0, 50001), RuntimeError) test(r"""sre.match(r'(x)*?y', 50000*'x'+'y').span()""", (0, 50001), RuntimeError) | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 03dd010b4fa7524e90cf1d5469f41618428589c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/03dd010b4fa7524e90cf1d5469f41618428589c9/test_sre.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23559,
67,
2107,
12,
1916,
2603,
4672,
509,
67,
1132,
273,
509,
12,
1916,
2603,
18,
1655,
12,
20,
3719,
327,
609,
12,
474,
67,
1132,
397,
404,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23559,
67,
2107,
12,
1916,
2603,
4672,
509,
67,
1132,
273,
509,
12,
1916,
2603,
18,
1655,
12,
20,
3719,
327,
609,
12,
474,
67,
1132,
397,
404,
13,
225,
2,
-100,
-100,
-100,
-100,
-10... |
if data['pi_bl'] != '': | if os.path.dirname(data['pi_bl']) != '': | def blosxom_process_path_info(args): """ Process HTTP PATH_INFO for URI according to path specifications, fill in data dict accordingly The paths specification looks like this: - C{/cat} - category - C{/2002} - year - C{/2002/Feb} (or 02) - Year and Month - C{/cat/2002/Feb/31} - year and month day in category. - C{/foo.html} and C{/cat/foo.html} - file foo.* in / and /cat To simplify checking, four digits directory name is not allowed. @param args: dict containing the incoming Request object @type args: L{Pyblosxom.pyblosxom.Request} """ request = args['request'] config = request.getConfiguration() data = request.getData() pyhttp = request.getHttp() form = pyhttp["form"] data['flavour'] = (form.has_key('flav') and form['flav'].value or config.get('defaultFlavour', 'html')) path_info = [] data['pi_yr'] = '' data['pi_mo'] = '' data['pi_da'] = '' if pyhttp.get('PATH_INFO', ''): path_info = pyhttp['PATH_INFO'].split('/') path_info = [x for x in path_info if x != ''] data['path_info'] = list(path_info) data['root_datadir'] = config['datadir'] got_date = 0 for path_data in path_info: if not path_data: continue elif len(path_data) == 4 and path_data.isdigit(): # We got a hot date here guys :) got_date = 1 break else: data['pi_bl'] = os.path.join(data['pi_bl'], path_data) if got_date: # Get messy with dates while not (len(path_info[0]) == 4 and path_info[0].isdigit()): path_info.pop(0) # Year data['pi_yr'] = path_info.pop(0) # Month if path_info and path_info[0] in tools.MONTHS: data['pi_mo'] = path_info.pop(0) # Day if path_info and re.match("^([0-2][0-9]|3[0-1])", path_info[0]): # Potential day here data['pi_da'] = path_info.pop(0) if path_info and path_info[0]: # Potential flavour after date filename, ext = os.path.splitext(path_info[0]) if filename == 'index': data['flavour'] = ext[1:] blog_result = os.path.join(config['datadir'], data['pi_bl']) data['bl_type'] = '' # If all we've got is a directory, things are simple if os.path.isdir(blog_result): if data['pi_bl'] != '': config['blog_title'] += ' : %s' % data['pi_bl'] data['root_datadir'] = blog_result data['bl_type'] = 'dir' # Else we may have a file if not data['bl_type']: # Try for file ext = tools.what_ext(data["extensions"].keys(), blog_result) if ext: config['blog_title'] += ' : %s' % data['pi_bl'] data['bl_type'] = 'file' data['root_datadir'] = blog_result + '.' + ext else: # We may have flavour embedded here filename, ext = os.path.splitext(blog_result) fileext = tools.what_ext(data["extensions"].keys(), filename) dirname = os.path.dirname(filename) if fileext: data['flavour'] = ext[1:] data['root_datadir'] = filename + '.' + fileext config['blog_title'] += ' : %s' % data['pi_bl'] data['bl_type'] = 'file' elif (os.path.basename(filename) == 'index' and os.path.isdir(dirname)): # blanket flavours? data['flavour'] = ext[1:] if data['pi_bl'] != '': config['blog_title'] += ' : %s' % os.path.dirname(data['pi_bl']) data['root_datadir'] = dirname data['bl_type'] = 'dir' # Construct our final URL data['url'] = '%s/%s' % (config['base_url'], data['pi_bl']) | 684476b7e472e7fe307d73c0ccb635cf045913df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11836/684476b7e472e7fe307d73c0ccb635cf045913df/pyblosxom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
383,
30319,
362,
67,
2567,
67,
803,
67,
1376,
12,
1968,
4672,
3536,
4389,
2239,
7767,
67,
5923,
364,
3699,
4888,
358,
589,
21950,
16,
3636,
316,
501,
2065,
15905,
225,
1021,
2953,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
383,
30319,
362,
67,
2567,
67,
803,
67,
1376,
12,
1968,
4672,
3536,
4389,
2239,
7767,
67,
5923,
364,
3699,
4888,
358,
589,
21950,
16,
3636,
316,
501,
2065,
15905,
225,
1021,
2953,
... |
gateGump.addText( 35, 135, "Tokuno Islands" ) | gateGump.addText( 35, 135, "Tokuno Islands", 61 ) | def sendGump( char, item ): char.soundeffect( 0x58 ) # noclose, nomove gump gateGump = cGump( 1, 1, 0, 100, 120 ) # trammel gateGump.startPage( 1 ) gateGump.addBackground( 9200, 380, 280 ) gateGump.addText( 5, 10, "Pick your destination:" ) gateGump.addButton( 10, 210, 0xFA5, 0xFA7, 1 ) gateGump.addText( 45, 210, "OKAY", 0 ) gateGump.addButton( 10, 235, 0xFA5, 0xFA7, 0 ) gateGump.addText( 45, 235, "CANCEL" ) # facets gateGump.addText( 35, 35, "Trammel", 61 ) gateGump.addPageButton( 10, 35, 0x4B9, 0x4BA, 1 ) gateGump.addText( 35, 60, "Felucca" ) gateGump.addPageButton( 10, 60, 0x4B9, 0x4BA, 2 ) gateGump.addText( 35, 85, "Ilshenar" ) gateGump.addPageButton( 10, 85, 0x4B9, 0x4BA, 3 ) gateGump.addText( 35, 110, "Malas" ) gateGump.addPageButton( 10, 110, 0x4B9, 0x4BA, 4 ) gateGump.addText( 35, 135, "Tokuno Islands") gateGump.addPageButton( 10, 135, 0x4B9, 0x4BA, 5 ) # gates gateGump.addText( 225, 40, "Britain" ) gateGump.addRadioButton(200, 40, 210, 211, 10 ) gateGump.addText( 225, 65, "Magincia" ) gateGump.addRadioButton(200, 65, 210, 211, 11 ) gateGump.addText( 225, 90, "Moonglow" ) gateGump.addRadioButton(200, 90, 210, 211, 12 ) gateGump.addText( 225, 115, "Skara Brae" ) gateGump.addRadioButton(200, 115, 210, 211, 13 ) gateGump.addText( 225, 140, "Trinsic" ) gateGump.addRadioButton(200, 140, 210, 211, 14 ) gateGump.addText( 225, 165, "Vesper" ) gateGump.addRadioButton(200, 165, 210, 211, 15 ) gateGump.addText( 225, 190, "Yew" ) gateGump.addRadioButton(200, 190, 210, 211, 16 ) gateGump.addText( 225, 215, "Jhelom" ) gateGump.addRadioButton(200, 215, 210, 211, 17 ) # felucca gateGump.startPage( 2 ) gateGump.addBackground( 9200, 380, 280 ) gateGump.addText( 5, 10, "Pick your destination:" ) gateGump.addButton( 10, 210, 0xFA5, 0xFA7, 1 ) gateGump.addText( 45, 210, "OKAY", 0 ) gateGump.addButton( 10, 235, 0xFA5, 0xFA7, 0 ) gateGump.addText( 45, 235, "CANCEL" ) # facets gateGump.addText( 35, 35, "Trammel" ) gateGump.addPageButton( 10, 35, 0x4B9, 0x4BA, 1 ) gateGump.addText( 35, 60, "Felucca", 61 ) gateGump.addPageButton( 10, 60, 0x4B9, 0x4BA, 2 ) gateGump.addText( 35, 85, "Ilshenar" ) gateGump.addPageButton( 10, 85, 0x4B9, 0x4BA, 3 ) gateGump.addText( 35, 110, "Malas" ) gateGump.addPageButton( 10, 110, 0x4B9, 0x4BA, 4 ) gateGump.addText( 35, 135, "Tokuno Islands" ) gateGump.addPageButton( 10, 135, 0x4B9, 0x4BA, 5 ) # gates gateGump.addText( 225, 40, "Britain" ) gateGump.addRadioButton(200, 40, 210, 211, 18 ) gateGump.addText( 225, 65, "Magincia" ) gateGump.addRadioButton(200, 65, 210, 211, 19 ) gateGump.addText( 225, 90, "Moonglow" ) gateGump.addRadioButton(200, 90, 210, 211, 20 ) gateGump.addText( 225, 115, "Skara Brae" ) gateGump.addRadioButton(200, 115, 210, 211, 21 ) gateGump.addText( 225, 140, "Trinsic" ) gateGump.addRadioButton(200, 140, 210, 211, 22 ) gateGump.addText( 225, 165, "Vesper" ) gateGump.addRadioButton(200, 165, 210, 211, 23 ) gateGump.addText( 225, 190, "Yew" ) gateGump.addRadioButton(200, 190, 210, 211, 24 ) gateGump.addText( 225, 215, "Jhelom" ) gateGump.addRadioButton(200, 215, 210, 211, 25 ) # ilshenar gateGump.startPage( 3 ) gateGump.addBackground( 9200, 380, 280 ) gateGump.addText( 5, 10, "Pick your destination:" ) gateGump.addButton( 10, 210, 0xFA5, 0xFA7, 1 ) gateGump.addText( 45, 210, "OKAY", 0 ) gateGump.addButton( 10, 235, 0xFA5, 0xFA7, 0 ) gateGump.addText( 45, 235, "CANCEL" ) # facets gateGump.addText( 35, 35, "Trammel" ) gateGump.addPageButton( 10, 35, 0x4B9, 0x4BA, 1 ) gateGump.addText( 35, 60, "Felucca" ) gateGump.addPageButton( 10, 60, 0x4B9, 0x4BA, 2 ) gateGump.addText( 35, 85, "Ilshenar", 61 ) gateGump.addPageButton( 10, 85, 0x4B9, 0x4BA, 3 ) gateGump.addText( 35, 110, "Malas" ) gateGump.addPageButton( 10, 110, 0x4B9, 0x4BA, 4 ) gateGump.addText( 35, 135, "Tokuno Islands" ) gateGump.addPageButton( 10, 135, 0x4B9, 0x4BA, 5 ) #gates gateGump.addText( 225, 40, "Compassion" ) gateGump.addRadioButton( 200, 40, 210, 211, 26 ) gateGump.addText( 225, 65, "Honesty" ) gateGump.addRadioButton( 200, 65, 210, 211, 27 ) gateGump.addText( 225, 90, "Honor" ) gateGump.addRadioButton( 200, 90, 210, 211, 28 ) gateGump.addText( 225, 115, "Humility" ) gateGump.addRadioButton( 200, 115, 210, 211, 29 ) gateGump.addText( 225, 140, "Justice" ) gateGump.addRadioButton( 200, 140, 210, 211, 30 ) gateGump.addText( 225, 165, "Sacrifice" ) gateGump.addRadioButton( 200, 165, 210, 211, 31 ) gateGump.addText( 225, 190, "Spirituality" ) gateGump.addRadioButton( 200, 190, 210, 211, 32 ) gateGump.addText( 225, 215, "Valor" ) gateGump.addRadioButton( 200, 215, 210, 211, 33 ) gateGump.addText( 225, 240, "Chaos" ) gateGump.addRadioButton( 200, 240, 210, 211, 34 ) # Malas gateGump.startPage( 4 ) gateGump.addBackground( 9200, 380, 280 ) gateGump.addText( 5, 10, "Pick your destination:" ) gateGump.addButton( 10, 210, 0xFA5, 0xFA7, 1 ) gateGump.addText( 45, 210, "OKAY", 0 ) gateGump.addButton( 10, 235, 0xFA5, 0xFA7, 0 ) gateGump.addText( 45, 235, "CANCEL" ) # facets gateGump.addText( 35, 35, "Trammel" ) gateGump.addPageButton( 10, 35, 0x4B9, 0x4BA, 1 ) gateGump.addText( 35, 60, "Felucca" ) gateGump.addPageButton( 10, 60, 0x4B9, 0x4BA, 2 ) gateGump.addText( 35, 85, "Ilshenar" ) gateGump.addPageButton( 10, 85, 0x4B9, 0x4BA, 3 ) gateGump.addText( 35, 110, "Malas", 61 ) gateGump.addPageButton( 10, 110, 0x4B9, 0x4BA, 4 ) gateGump.addText( 35, 110, "Tokuno Islands" ) gateGump.addPageButton( 10, 110, 0x4B9, 0x4BA, 5 ) # #gates gateGump.addText( 225, 40, "Luna Moongate" ) gateGump.addRadioButton( 200, 40, 210, 211, 35 ) gateGump.addText( 225, 65, "Bank of Luna" ) gateGump.addRadioButton( 200, 65, 210, 211, 36 ) gateGump.addText( 225, 90, "Stables of Luna" ) gateGump.addRadioButton( 200, 90, 210, 211, 37 ) gateGump.addText( 225, 115, "North Entrance" ) gateGump.addRadioButton( 200, 115, 210, 211, 38 ) gateGump.addText( 225, 140, "Luna Arena" ) gateGump.addRadioButton( 200, 140, 210, 211, 39 ) gateGump.addText( 225, 165, "Umbra Moongate" ) gateGump.addRadioButton( 200, 165, 210, 211, 40 ) gateGump.addText( 225, 190, "Umbra Bridge" ) gateGump.addRadioButton( 200, 190, 210, 211, 41 ) gateGump.addText( 225, 215, "Stables of Umbra" ) gateGump.addRadioButton( 200, 215, 210, 211, 42 ) # tokuno islands gateGump.startPage( 5 ) gateGump.addBackground( 9200, 380, 280 ) gateGump.addText( 5, 10, "Pick your destination:" ) gateGump.addButton( 10, 210, 0xFA5, 0xFA7, 1 ) gateGump.addText( 45, 210, "OKAY", 0 ) gateGump.addButton( 10, 235, 0xFA5, 0xFA7, 0 ) gateGump.addText( 45, 235, "CANCEL" ) # facets gateGump.addText( 35, 35, "Trammel" ) gateGump.addPageButton( 10, 35, 0x4B9, 0x4BA, 1 ) gateGump.addText( 35, 60, "Felucca" ) gateGump.addPageButton( 10, 60, 0x4B9, 0x4BA, 2 ) gateGump.addText( 35, 85, "Ilshenar", 61 ) gateGump.addPageButton( 10, 85, 0x4B9, 0x4BA, 3 ) gateGump.addText( 35, 110, "Malas" ) gateGump.addPageButton( 10, 110, 0x4B9, 0x4BA, 4 ) gateGump.addText( 35, 135, "Tokuno Islands" ) gateGump.addPageButton( 10, 135, 0x4B9, 0x4BA, 5 ) #gates gateGump.addText( 225, 40, "Makoto-Jima" ) gateGump.addRadioButton( 200, 40, 210, 211, 43 ) gateGump.addText( 225, 65, "Isamu-Jima" ) gateGump.addRadioButton( 200, 65, 210, 211, 44 ) gateGump.addText( 225, 90, "Homare-Jima" ) gateGump.addRadioButton( 200, 90, 210, 211, 45 ) # set callback function and its arguments gateGump.setCallback( gateCallback ) # send it gateGump.setArgs( [ item ] ) gateGump.setType( 0x87654321 ) gateGump.send( char ) | 46ac451c56a951fe645ddb6977e67287f7363f64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/46ac451c56a951fe645ddb6977e67287f7363f64/moongate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
43,
2801,
12,
1149,
16,
761,
262,
30,
1149,
18,
87,
465,
536,
74,
386,
12,
374,
92,
8204,
262,
468,
30601,
2061,
16,
12457,
841,
314,
2801,
12611,
43,
2801,
273,
276,
43,
2801,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
43,
2801,
12,
1149,
16,
761,
262,
30,
1149,
18,
87,
465,
536,
74,
386,
12,
374,
92,
8204,
262,
468,
30601,
2061,
16,
12457,
841,
314,
2801,
12611,
43,
2801,
273,
276,
43,
2801,... |
def __check_installed_binaries(self): | def _check_installed_binaries(self): | def __check_installed_binaries(self): """ Make sure the relevant binaries installed actually come from the build that was installed. """ source_rpm = "%s.src.rpm" % self.build for bin in self.qemu_bin_paths: origin_source_rpm = utils.system_output( "rpm -qf --queryformat '%{sourcerpm}' " + bin) if origin_source_rpm != source_rpm: raise error.TestError("File %s comes from source package %s. " "It doesn't come from build %s, " "aborting." % (bin, origin_source_rpm, self.build)) | 7f086351a5671c6cab0b425e56b647c8c4418ab1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/7f086351a5671c6cab0b425e56b647c8c4418ab1/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
13435,
67,
4757,
5646,
12,
2890,
4672,
3536,
4344,
3071,
326,
9368,
4158,
5646,
5876,
6013,
12404,
628,
326,
1361,
716,
1703,
5876,
18,
3536,
1084,
67,
86,
7755,
273,
2213... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1893,
67,
13435,
67,
4757,
5646,
12,
2890,
4672,
3536,
4344,
3071,
326,
9368,
4158,
5646,
5876,
6013,
12404,
628,
326,
1361,
716,
1703,
5876,
18,
3536,
1084,
67,
86,
7755,
273,
2213... |
for entry in entries[:]: if 0x1600 <= entry < 0x1800 or 0x1A00 <= entry < 0x1C00: subentry_value = Node.GetEntry(entry, 1) if subentry_value is None or subentry_value == 0: entries.remove(entry) entries.remove(entry - 0x200) | def GenerateFileContent(Node, filepath): # Dictionary of each index contents indexContents = {} # Extract local time current_time = localtime() # Extract node informations nodename = Node.GetNodeName() nodeid = Node.GetNodeID() nodetype = Node.GetNodeType() description = Node.GetNodeDescription() # Retreiving lists of indexes defined entries = Node.GetIndexes() # Generate FileInfo section fileContent = "[FileInfo]\n" fileContent += "FileName=%s\n"%os.path.split(filepath)[-1] fileContent += "FileVersion=1\n" fileContent += "FileRevision=1\n" fileContent += "EDSVersion=4.0\n" fileContent += "Description=%s\n"%description fileContent += "CreationTime=%s"%strftime("%I:%M", current_time) # %p option of strftime seems not working, then generate AM/PM by hands if strftime("%I", current_time) == strftime("%H", current_time): fileContent += "AM\n" else: fileContent += "PM\n" fileContent += "CreationDate=%s\n"%strftime("%m-%d-%Y", current_time) fileContent += "CreatedBy=CANFestival\n" fileContent += "ModificationTime=%s"%strftime("%I:%M", current_time) # %p option of strftime seems not working, then generate AM/PM by hands if strftime("%I", current_time) == strftime("%H", current_time): fileContent += "AM\n" else: fileContent += "PM\n" fileContent += "ModificationDate=%s\n"%strftime("%m-%d-%Y", current_time) fileContent += "ModifiedBy=CANFestival\n" # Generate DeviceInfo section fileContent += "\n[DeviceInfo]\n" fileContent += "VendorName=CANFestival\n" # Use information typed by user in Identity entry fileContent += "VendorNumber=0x%8.8X\n"%Node.GetEntry(0x1018, 1) fileContent += "ProductName=%s\n"%nodename fileContent += "ProductNumber=0x%8.8X\n"%Node.GetEntry(0x1018, 2) fileContent += "RevisionNumber=0x%8.8X\n"%Node.GetEntry(0x1018, 3) # CANFestival support all baudrates as soon as driver choosen support them fileContent += "BaudRate_10=1\n" fileContent += "BaudRate_20=1\n" fileContent += "BaudRate_50=1\n" fileContent += "BaudRate_125=1\n" fileContent += "BaudRate_250=1\n" fileContent += "BaudRate_500=1\n" fileContent += "BaudRate_800=1\n" fileContent += "BaudRate_1000=1\n" # Select BootUp type from the informations given by user fileContent += "SimpleBootUpMaster=%s\n"%BOOL_TRANSLATE[nodetype == "master"] fileContent += "SimpleBootUpSlave=%s\n"%BOOL_TRANSLATE[nodetype == "slave"] # CANFestival characteristics fileContent += "Granularity=8\n" fileContent += "DynamicChannelsSupported=0\n" fileContent += "CompactPDO=0\n" fileContent += "GroupMessaging=0\n" # Calculate receive and tranmit PDO numbers with the entry available fileContent += "NrOfRXPDO=%d\n"%len([idx for idx in entries if 0x1400 <= idx <= 0x15FF]) fileContent += "NrOfTXPDO=%d\n"%len([idx for idx in entries if 0x1800 <= idx <= 0x19FF]) # LSS not supported as soon as DS-302 was not fully implemented fileContent += "LSS_Supported=0\n" # Generate Dummy Usage section fileContent += "\n[DummyUsage]\n" fileContent += "Dummy0001=0\n" fileContent += "Dummy0002=1\n" fileContent += "Dummy0003=1\n" fileContent += "Dummy0004=1\n" fileContent += "Dummy0005=1\n" fileContent += "Dummy0006=1\n" fileContent += "Dummy0007=1\n" # Generate Comments section fileContent += "\n[Comments]\n" fileContent += "Lines=0\n" # List of entry by type (Mandatory, Optional or Manufacturer mandatories = [] optionals = [] manufacturers = [] # Remove all unused PDO for entry in entries[:]: if 0x1600 <= entry < 0x1800 or 0x1A00 <= entry < 0x1C00: subentry_value = Node.GetEntry(entry, 1) if subentry_value is None or subentry_value == 0: entries.remove(entry) entries.remove(entry - 0x200) # For each entry, we generate the entry section or sections if there is subindexes for entry in entries: # Extract infos and values for the entry entry_infos = Node.GetEntryInfos(entry) values = Node.GetEntry(entry, compute = False) # Define section name text = "\n[%X]\n"%entry # If there is only one value, it's a VAR entry if type(values) != ListType: # Extract the informations of the first subindex subentry_infos = Node.GetSubentryInfos(entry, 0) # Generate EDS informations for the entry text += "ParameterName=%s\n"%subentry_infos["name"] text += "ObjectType=0x7\n" text += "DataType=0x%4.4X\n"%subentry_infos["type"] text += "AccessType=%s\n"%subentry_infos["access"] if subentry_infos["type"] == 1: text += "DefaultValue=%s\n"%BOOL_TRANSLATE[values] else: text += "DefaultValue=%s\n"%values text += "PDOMapping=%s\n"%BOOL_TRANSLATE[subentry_infos["pdo"]] else: # Generate EDS informations for the entry text += "ParameterName=%s\n"%entry_infos["name"] if entry_infos["struct"] & node.OD_IdenticalSubindexes: text += "ObjectType=0x9\n" else: text += "ObjectType=0x8\n" # Generate EDS informations for subindexes of the entry in a separate text subtext = "" # Reset number of subindex defined nb_subentry = 0 for subentry, value in enumerate(values): # Extract the informations of each subindex subentry_infos = Node.GetSubentryInfos(entry, subentry) # If entry is not for the compatibility, generate informations for subindex if subentry_infos["name"] != "Compatibility Entry": subtext += "\n[%Xsub%X]\n"%(entry, subentry) subtext += "ParameterName=%s\n"%subentry_infos["name"] subtext += "ObjectType=0x7\n" subtext += "DataType=0x%4.4X\n"%subentry_infos["type"] subtext += "AccessType=%s\n"%subentry_infos["access"] if subentry_infos["type"] == 1: subtext += "DefaultValue=%s\n"%BOOL_TRANSLATE[value] else: subtext += "DefaultValue=%s\n"%value subtext += "PDOMapping=%s\n"%BOOL_TRANSLATE[subentry_infos["pdo"]] # Increment number of subindex defined nb_subentry += 1 # Write number of subindex defined for the entry text += "SubNumber=%d\n"%nb_subentry # Write subindex definitions text += subtext # Then we add the entry in the right list # First case, entry is between 0x2000 and 0x5FFF, then it's a manufacturer entry if 0x2000 <= entry <= 0x5FFF: manufacturers.append(entry) # Second case, entry is required, then it's a mandatory entry elif entry_infos["need"]: mandatories.append(entry) # In any other case, it's an optional entry else: optionals.append(entry) # Save text of the entry in the dictiionary of contents indexContents[entry] = text # Before generate File Content we sort the entry list manufacturers.sort() mandatories.sort() optionals.sort() # Generate Definition of mandatory objects fileContent += "\n[MandatoryObjects]\n" fileContent += "SupportedObjects=%d\n"%len(mandatories) for idx, entry in enumerate(mandatories): fileContent += "%d=0x%4.4X\n"%(idx + 1, entry) # Write mandatory entries for entry in mandatories: fileContent += indexContents[entry] # Generate Definition of optional objects fileContent += "\n[OptionalObjects]\n" fileContent += "SupportedObjects=%d\n"%len(optionals) for idx, entry in enumerate(optionals): fileContent += "%d=0x%4.4X\n"%(idx + 1, entry) # Write optional entries for entry in optionals: fileContent += indexContents[entry] # Generate Definition of manufacturer objects fileContent += "\n[ManufacturerObjects]\n" fileContent += "SupportedObjects=%d\n"%len(manufacturers) for idx, entry in enumerate(manufacturers): fileContent += "%d=0x%4.4X\n"%(idx + 1, entry) # Write manufacturer entries for entry in manufacturers: fileContent += indexContents[entry] # Return File Content return fileContent | a405cc27955acfd6edf4b05b5a3c72d39b39c9b0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/116/a405cc27955acfd6edf4b05b5a3c72d39b39c9b0/eds_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6654,
25391,
12,
907,
16,
3608,
4672,
468,
16447,
434,
1517,
770,
2939,
770,
6323,
273,
2618,
225,
468,
8152,
1191,
813,
783,
67,
957,
273,
1191,
957,
1435,
468,
8152,
756,
26978,
14003,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6654,
25391,
12,
907,
16,
3608,
4672,
468,
16447,
434,
1517,
770,
2939,
770,
6323,
273,
2618,
225,
468,
8152,
1191,
813,
783,
67,
957,
273,
1191,
957,
1435,
468,
8152,
756,
26978,
14003,... | |
settings.append(r'<graph><type/><title>'+str(year)+'</title></graph>') | settings.append(r'<graph><type/><title>'+str(year)+'</title><balloon_text>{series}: Video Production = {value}</balloon_text></graph>') | def video_monthwise_bar_settings(request,geog,id): id = int(id) if 'from_date' in request.GET and request.GET['from_date'] \ and 'to_date' in request.GET and request.GET['to_date']: from_year = int(from_date.split('-')[0]) to_year = int(to_date.split('-')[0]); else: rs = run_query(database.video_month_bar(dict(geog = geog, id = id))); year_list = [] for i in range(len(rs)): if rs [i]['YEAR'] not in year_list: year_list.append(rs[i]['YEAR']) if year_list: from_year = int(min(year_list)) to_year = int(max(year_list)) year_list = range(from_year,to_year+1) #Making Settings file settings = [] settings.append(r'<settings><graphs>') for year in year_list: settings.append(r'<graph><type/><title>'+str(year)+'</title></graph>') settings.append(r'</graphs></settings>') settings = ''.join(settings) else: settings = [] settings.append(r'<settings><graphs></settings></graphs>') return HttpResponse(settings) | 74b63d83f202c84846ad1893b6d07691ea8b3ee2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11995/74b63d83f202c84846ad1893b6d07691ea8b3ee2/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6191,
67,
7496,
2460,
67,
3215,
67,
4272,
12,
2293,
16,
908,
717,
16,
350,
4672,
612,
273,
509,
12,
350,
13,
225,
309,
296,
2080,
67,
712,
11,
316,
590,
18,
3264,
471,
590,
18,
326... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6191,
67,
7496,
2460,
67,
3215,
67,
4272,
12,
2293,
16,
908,
717,
16,
350,
4672,
612,
273,
509,
12,
350,
13,
225,
309,
296,
2080,
67,
712,
11,
316,
590,
18,
3264,
471,
590,
18,
326... |
cp.set("condor","lalapps_coherent_inspiral", self.which("lalapps_coherent_inspiral")) | cp.set("condor","chia", self.which("lalapps_coherent_inspiral")) | def __init__(self, config=None): cp = ConfigParser.ConfigParser() self.cp = cp self.time_now = "_".join([str(i) for i in time.gmtime()[0:6]]) home_base = self.__home_dirs() # CONDOR SECTION NEEDED BY THINGS IN INSPIRAL.PY cp.add_section("condor") cp.set("condor","datafind",self.which("ligo_data_find")) cp.set("condor","inspiral",self.which("lalapps_inspiral")) cp.set("condor","lalapps_coherent_inspiral", self.which("lalapps_coherent_inspiral")) cp.set("condor","universe","standard") # DATAFIND SECTION cp.add_section("datafind") | 765c75ca2eafc58eaa52c3bab4b6459fe63d26ba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/765c75ca2eafc58eaa52c3bab4b6459fe63d26ba/stfu_pipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
642,
33,
7036,
4672,
3283,
273,
25076,
18,
809,
2678,
1435,
365,
18,
4057,
273,
3283,
365,
18,
957,
67,
3338,
273,
8802,
18,
5701,
3816,
701,
12,
77,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
642,
33,
7036,
4672,
3283,
273,
25076,
18,
809,
2678,
1435,
365,
18,
4057,
273,
3283,
365,
18,
957,
67,
3338,
273,
8802,
18,
5701,
3816,
701,
12,
77,
1... |
name = DottedName('%s-%s' % (name, _unreachable_names[name])) | def _unreachable_name_for(val_doc, docindex): assert isinstance(val_doc, ValueDoc) # [xx] (when) does this help? if (isinstance(val_doc, ModuleDoc) and len(val_doc.canonical_name)==1 and val_doc.package is None): for root_val in docindex.root: if root_val.canonical_name == val_doc.canonical_name: if root_val != val_doc: log.error("Name conflict: %r vs %r" % (val_doc, root_val)) break else: return val_doc.canonical_name, -1000 # Assign it an 'unreachable' name: if (val_doc.pyval is not UNKNOWN and hasattr(val_doc.pyval, '__name__')): try: name = DottedName(DottedName.UNREACHABLE, val_doc.pyval.__name__) except DottedName.InvalidDottedName: name = DottedName(DottedName.UNREACHABLE) else: name = DottedName(DottedName.UNREACHABLE) # Uniquify the name. if name in _unreachable_names: name = DottedName('%s-%s' % (name, _unreachable_names[name])) _unreachable_names[name] += 1 else: _unreachable_names[name] = 2 return name, -10000 | d6f70ed40e8e374ae1518023f9807be279e3536a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/d6f70ed40e8e374ae1518023f9807be279e3536a/docbuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
318,
17246,
67,
529,
67,
1884,
12,
1125,
67,
2434,
16,
997,
1615,
4672,
1815,
1549,
12,
1125,
67,
2434,
16,
1445,
1759,
13,
225,
468,
306,
5279,
65,
261,
13723,
13,
1552,
333,
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,
389,
318,
17246,
67,
529,
67,
1884,
12,
1125,
67,
2434,
16,
997,
1615,
4672,
1815,
1549,
12,
1125,
67,
2434,
16,
1445,
1759,
13,
225,
468,
306,
5279,
65,
261,
13723,
13,
1552,
333,
2... | |
This function uses the algorithm of [Edmonds74] to calculate the | This function uses the algorithm of [Edmonds74]_ to calculate the | def racah(aa, bb, cc, dd, ee, ff, prec=None): r""" Calculate the Racah symbol `W(a,b,c,d;e,f)`. INPUT: - ``a``, ..., ``f`` - integer or half integer - ``prec`` - precision, default: None. Providing a precision can drastically speed up the calculation. OUTPUT: rational number times the square root of a rational number (if prec=None), or real number if a precision is given EXAMPLES:: sage: racah(3,3,3,3,3,3) -1/14 NOTES: The Racah symbol is related to the Wigner 6j symbol: .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =(-1)^{j_1+j_2+j_4+j_5} W(j_1,j_2,j_5,j_4,j_3,j_6) Please see the 6j symbol for its much richer symmetries and for additional properties. ALGORITHM: This function uses the algorithm of [Edmonds74] to calculate the value of the 6j symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [Rasch03]. REFERENCES: - [Edmonds74] 'Angular Momentum in Quantum Mechanics', A. R. Edmonds, Princeton University Press (1974) - [Rasch03] 'Efficient Storage Scheme for Pre-calculated Wigner 3j, 6j and Gaunt Coefficients', J. Rasch and A. C. H. Yu, SIAM J. Sci. Comput. Volume 25, Issue 4, pp. 1416-1428 (2003) AUTHORS: - Jens Rasch (2009-03-24): initial version """ prefac = _big_delta_coeff(aa, bb, ee, prec) * \ _big_delta_coeff(cc, dd, ee, prec) * \ _big_delta_coeff(aa, cc, ff, prec) * \ _big_delta_coeff(bb, dd, ff, prec) if prefac == 0: return 0 imin = max(aa + bb + ee, cc + dd + ee, aa + cc + ff, bb + dd + ff) imax = min(aa + bb + cc + dd, aa + dd + ee + ff, bb + cc + ee + ff) maxfact = max(imax + 1, aa + bb + cc + dd, aa + dd + ee + ff, \ bb + cc + ee + ff) _calc_factlist(maxfact) sumres = 0 for kk in range(imin, imax + 1): den = _Factlist[int(kk - aa - bb - ee)] * \ _Factlist[int(kk - cc - dd - ee)] * \ _Factlist[int(kk - aa - cc - ff)] * \ _Factlist[int(kk - bb - dd - ff)] * \ _Factlist[int(aa + bb + cc + dd - kk)] * \ _Factlist[int(aa + dd + ee + ff - kk)] * \ _Factlist[int(bb + cc + ee + ff - kk)] sumres = sumres + Integer((-1) ** kk * _Factlist[kk + 1]) / den res = prefac * sumres * (-1) ** (int(aa + bb + cc + dd)) return res | c6a90d820f57455b2ff6063db98cb5e6f7a11f83 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/c6a90d820f57455b2ff6063db98cb5e6f7a11f83/wigner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
767,
5353,
76,
12,
7598,
16,
7129,
16,
4946,
16,
6957,
16,
14657,
16,
6875,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,
534,
1077,
9795,
3273,
1375,
59,
12,
69,
16,
70,
16,
71,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
767,
5353,
76,
12,
7598,
16,
7129,
16,
4946,
16,
6957,
16,
14657,
16,
6875,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,
534,
1077,
9795,
3273,
1375,
59,
12,
69,
16,
70,
16,
71,
... |
item = self.Append(wx.ID_ANY,name) | item = wx.MenuItem(self, wx.ID_ANY, name) | def __init__(self, mapper=None, canvas=None, callback=None): """ Define a context menu for selecting colormaps. | b1e395342d4674c0ba11318ab2138ac77c258f4c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13135/b1e395342d4674c0ba11318ab2138ac77c258f4c/cmapmenu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5815,
33,
7036,
16,
5953,
33,
7036,
16,
1348,
33,
7036,
4672,
3536,
13184,
279,
819,
3824,
364,
24674,
645,
535,
6679,
18,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5815,
33,
7036,
16,
5953,
33,
7036,
16,
1348,
33,
7036,
4672,
3536,
13184,
279,
819,
3824,
364,
24674,
645,
535,
6679,
18,
2,
-100,
-100,
-100,
-100,
-10... |
cur.execute('SELECT * FROM filelist WHERE pkgKey="%s"' % pkgKey) | cur.execute('SELECT * FROM filelist WHERE pkgKey=?', (pkgKey,)) | def getFiles(self, pkg): pkgKey = pkg.pkgKey if self._filelistsdb: cur = self._filelistsdb.cursor() cur.execute('SELECT * FROM filelist WHERE pkgKey="%s"' % pkgKey) basenames = [] dirnames = [] dirindexes = [] for ob in cur.fetchall(): idx = len(dirnames) base = ob["filenames"].split('/') dirnames.append(ob["dirname"] + '/') basenames.extend(base) dirindexes.extend([idx] * len(base)) if pkg.has_key('oldfilenames'): del pkg['oldfilenames'] if basenames: pkg['basenames'] = basenames pkg['dirnames'] = dirnames pkg['dirindexes'] = dirindexes else: cur = self._primarydb.cursor() cur.execute( 'SELECT * FROM files WHERE pkgKey="%s"' % pkgKey) files = [ob['name'] for ob in cur.fetchall()] if files: pkg['oldfilenames'] = files pkg.generateFileNames() | 1bd6adee371af6defb14a869c8d6fece65e51000 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1143/1bd6adee371af6defb14a869c8d6fece65e51000/sqliterepodb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18262,
12,
2890,
16,
3475,
4672,
3475,
653,
273,
3475,
18,
10657,
653,
309,
365,
6315,
7540,
292,
1486,
1966,
30,
662,
273,
365,
6315,
7540,
292,
1486,
1966,
18,
9216,
1435,
662,
18,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18262,
12,
2890,
16,
3475,
4672,
3475,
653,
273,
3475,
18,
10657,
653,
309,
365,
6315,
7540,
292,
1486,
1966,
30,
662,
273,
365,
6315,
7540,
292,
1486,
1966,
18,
9216,
1435,
662,
18,
8... |
self.write(cr, uid, ids, {'state':'cancel', 'move_dest_id': False}) for pick in self.pool.get('stock.picking').browse(cr,uid,pickings.keys()): | self.write(cr, uid, ids, {'state': 'cancel', 'move_dest_id': False}) for pick in self.pool.get('stock.picking').browse(cr, uid, pickings.keys()): | def action_cancel(self, cr, uid, ids, context={}): if not len(ids): return True pickings = {} for move in self.browse(cr, uid, ids): if move.state in ('confirmed','waiting','assigned','draft'): if move.picking_id: pickings[move.picking_id.id] = True if move.move_dest_id and move.move_dest_id.state=='waiting': self.write(cr, uid, [move.move_dest_id.id], {'state':'assigned'}) if move.move_dest_id.picking_id: wf_service = netsvc.LocalService("workflow") wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr) self.write(cr, uid, ids, {'state':'cancel', 'move_dest_id': False}) | 369221b47101072e094ad2d02fe2edd2b47690aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/369221b47101072e094ad2d02fe2edd2b47690aa/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
10996,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
309,
486,
562,
12,
2232,
4672,
327,
1053,
6002,
899,
273,
2618,
364,
3635,
316,
365,
18,
25731,
12,
3353,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
10996,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
309,
486,
562,
12,
2232,
4672,
327,
1053,
6002,
899,
273,
2618,
364,
3635,
316,
365,
18,
25731,
12,
3353,... |
path = self.changes_table.get_row(self.selected_rows[0])[0] | url1 = self.changes_table.get_row(self.selected_rows[0])[0] url2 = url1 if url1 == ".": url1 = "" url2 = "" url1 = rabbitvcs.lib.helper.url_join(self.first_urls.get_active_text(), url1) url2 = rabbitvcs.lib.helper.url_join(self.second_urls.get_active_text(), url2) | def on_context_show_changes(self, widget, data=None): path = self.changes_table.get_row(self.selected_rows[0])[0] | c13318831ef6554cf062f7d57fb3fe0bee53d3b0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5119/c13318831ef6554cf062f7d57fb3fe0bee53d3b0/compare.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
2472,
67,
4500,
67,
6329,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
589,
273,
365,
18,
6329,
67,
2121,
18,
588,
67,
492,
12,
2890,
18,
8109,
67,
3870,
63,
20,
5717,
63,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2472,
67,
4500,
67,
6329,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
589,
273,
365,
18,
6329,
67,
2121,
18,
588,
67,
492,
12,
2890,
18,
8109,
67,
3870,
63,
20,
5717,
63,... |
domain = [('res_id', '=', False), ('value', 'in', ['%s,%s' % (self._name, i) for i in ids]), | domain = [('res_id', '=', False), ('value', 'in', ['%s,%s' % (self._name, i) for i in ids]), | def unlink(self, cr, uid, ids, context=None): if not ids: return True if isinstance(ids, (int, long)): ids = [ids] | 9f8394a3119b661e0f978387e8467c7103893025 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/9f8394a3119b661e0f978387e8467c7103893025/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8255,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
309,
486,
3258,
30,
327,
1053,
309,
1549,
12,
2232,
16,
261,
474,
16,
1525,
3719,
30,
3258,
273,
306,
2232,
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,
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,
8255,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
309,
486,
3258,
30,
327,
1053,
309,
1549,
12,
2232,
16,
261,
474,
16,
1525,
3719,
30,
3258,
273,
306,
2232,
65,... |
slice_R = [slice(None)]*nd | slice_R = all | def romb(y, dx=1.0, axis=-1, show=0): """Uses Romberg integration to integrate y(x) using N samples along the given axis which are assumed equally spaced with distance dx. The number of samples must be 1 + a non-negative power of two: N=2**k + 1 """ y = asarray(y) nd = len(y.shape) Nsamps = y.shape[axis] Ninterv = Nsamps-1 n = 1 k = 0 while n < Ninterv: n <<= 1 k += 1 if n != Ninterv: raise ValueError, \ "Number of samples must be one plus a non-negative power of 2." R = {} slice0 = [slice(None)]*nd slice0[axis] = 0 slicem1 = [slice(None)]*nd slicem1[axis] = -1 h = Ninterv*asarray(dx)*1.0 R[(1,1)] = (y[slice0] + y[slicem1])/2.0*h slice_R = [slice(None)]*nd start = stop = step = Ninterv for i in range(2,k+1): start >>= 1 slice_R[axis] = slice(start,stop,step) step >>= 1 R[(i,1)] = 0.5*(R[(i-1,1)] + h*add.reduce(y[slice_R],axis)) for j in range(2,i+1): R[(i,j)] = R[(i,j-1)] + \ (R[(i,j-1)]-R[(i-1,j-1)]) / ((1 << (2*(j-1)))-1) h = h / 2.0 if show: if not isscalar(R[(1,1)]): print "*** Printing table only supported for integrals" + \ " of a single data set." else: try: precis = show[0] except (TypeError, IndexError): precis = 5 try: width = show[1] except (TypeError, IndexError): width = 8 formstr = "%" + str(width) + '.' + str(precis)+'f' print "\n Richardson Extrapolation Table for Romberg Integration " print "====================================================================" for i in range(1,k+1): for j in range(1,i+1): print formstr % R[(i,j)], print print "====================================================================\n" return R[(k,k)] | 704696cd1cef533b4e608563919a4d4ce035a41b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/704696cd1cef533b4e608563919a4d4ce035a41b/quadrature.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24137,
70,
12,
93,
16,
6633,
33,
21,
18,
20,
16,
2654,
29711,
21,
16,
2405,
33,
20,
4672,
3536,
15128,
534,
362,
31317,
12040,
358,
23367,
677,
12,
92,
13,
1450,
423,
5216,
7563,
326... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24137,
70,
12,
93,
16,
6633,
33,
21,
18,
20,
16,
2654,
29711,
21,
16,
2405,
33,
20,
4672,
3536,
15128,
534,
362,
31317,
12040,
358,
23367,
677,
12,
92,
13,
1450,
423,
5216,
7563,
326... |
def test_camera_light(): col = Color3(200,200,200) oldambient = Viewer.light.ambient Viewer.light.ambient = col assert Viewer.light.ambient == col, "Viewer.light.ambient do not set the good value" Viewer.light.ambient = oldambient olddiffuse = Viewer.light.diffuse Viewer.light.diffuse = col assert Viewer.light.diffuse == col, "Viewer.light.diffuse do not set the good value" Viewer.light.diffuse = olddiffuse oldspecular = Viewer.light.specular Viewer.light.specular = col assert Viewer.light.specular == col, "Viewer.light.specular do not set the good value" Viewer.light.specular = oldspecular Viewer.light.enabled = False assert Viewer.light.enabled == False, "Viewer.light.enabled do not set the good value" Viewer.light.enabled = True assert Viewer.light.enabled == True, "Viewer.light.enabled do not set the good value" pos = (10,10,10) Viewer.position = pos assert Viewer.position == pos, "Viewer.light.position do not set the good value" def test_image(): w = 300 Viewer.frameGL.maximize() Viewer.frameGL.setSize(w,w) fname = 'test_framegl.png' Viewer.frameGL.saveImage(fname,'PNG') Viewer.frameGL.maximize(False) assert os.path.exists(fname), "Viewer.frameGL.saveImage failed" try: from PIL import Image q = Image.open(fname) rw, rh = q.size[0], q.size[1] imgsizetest = (rw == w and rh == w) del q except: imgsizetest = True assert imgsizetest and "Viewer.frameGL.setSize failed %s", str((rw,rh)) os.remove(fname) | def test_image(self): w = 300 h = 408 Viewer.frameGL.maximize() Viewer.frameGL.setSize(w,w) fname = 'test_framegl.png' Viewer.frameGL.saveImage(fname,'PNG') Viewer.frameGL.maximize(False) assert os.path.exists(fname), "Viewer.frameGL.saveImage failed" try: from PIL import Image q = Image.open(fname) rw, rh = q.size[0], q.size[1] imgsizetest = (rw == w and rh == h) del q except: imgsizetest = True assert imgsizetest and "Viewer.frameGL.setSize failed %s", str((rw,rh)) os.remove(fname) time.sleep(1) | def test_camera_light(): col = Color3(200,200,200) oldambient = Viewer.light.ambient Viewer.light.ambient = col assert Viewer.light.ambient == col, "Viewer.light.ambient do not set the good value" Viewer.light.ambient = oldambient olddiffuse = Viewer.light.diffuse Viewer.light.diffuse = col assert Viewer.light.diffuse == col, "Viewer.light.diffuse do not set the good value" Viewer.light.diffuse = olddiffuse oldspecular = Viewer.light.specular Viewer.light.specular = col assert Viewer.light.specular == col, "Viewer.light.specular do not set the good value" Viewer.light.specular = oldspecular Viewer.light.enabled = False assert Viewer.light.enabled == False, "Viewer.light.enabled do not set the good value" Viewer.light.enabled = True assert Viewer.light.enabled == True, "Viewer.light.enabled do not set the good value" pos = (10,10,10) Viewer.position = pos assert Viewer.position == pos, "Viewer.light.position do not set the good value" | 72ba525c78f088994523e96afa368548c76eeba8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/799/72ba525c78f088994523e96afa368548c76eeba8/test_viewer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
26426,
67,
5099,
13332,
645,
273,
5563,
23,
12,
6976,
16,
6976,
16,
6976,
13,
1592,
2536,
1979,
273,
4441,
264,
18,
5099,
18,
2536,
1979,
4441,
264,
18,
5099,
18,
2536,
1979,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26426,
67,
5099,
13332,
645,
273,
5563,
23,
12,
6976,
16,
6976,
16,
6976,
13,
1592,
2536,
1979,
273,
4441,
264,
18,
5099,
18,
2536,
1979,
4441,
264,
18,
5099,
18,
2536,
1979,... |
p.rule(f_uliAlias, 'ulialias', "uli-[-_a-zA-Z]+ [a-zA-Z]+ http://.+$" ) | p.msg(origin.sender, "added alias %r for %s to %s" % (name, uli.form_names[form_func], target)) p.rule(f_uliAlias, 'alias', "^%s?alias ([^\s]+) ([^\s]+) (http://[^\s]+)$" % address_pattern) | def f_uliAlias(m, origin, (cmd, channel), text, p=p): if debug: p.msg(origin.sender, 'alias accepted') command_word, name, target = text.split(None) junk, form_name = command_word.split("-", 1) aliaslist[name] = (uli.forms_by_name[form_name], target) save() | 631d28bc7881a33d0654ab03e73977ce4a049c74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2338/631d28bc7881a33d0654ab03e73977ce4a049c74/ulibot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
67,
14826,
2936,
12,
81,
16,
4026,
16,
261,
4172,
16,
1904,
3631,
977,
16,
293,
33,
84,
4672,
309,
1198,
30,
293,
18,
3576,
12,
10012,
18,
15330,
16,
296,
4930,
8494,
6134,
1296... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
67,
14826,
2936,
12,
81,
16,
4026,
16,
261,
4172,
16,
1904,
3631,
977,
16,
293,
33,
84,
4672,
309,
1198,
30,
293,
18,
3576,
12,
10012,
18,
15330,
16,
296,
4930,
8494,
6134,
1296... |
for i in xrange(self.state.frameCount): | for i in xrange(self.state.frameCount): | def __iter__(self): for i in xrange(self.state.frameCount): yield self.state.frame(i) | 550f86f8e1997ee990877076421feaf1936da8eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5451/550f86f8e1997ee990877076421feaf1936da8eb/PyV8.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
364,
277,
316,
12314,
12,
2890,
18,
2019,
18,
3789,
1380,
4672,
2824,
365,
18,
2019,
18,
3789,
12,
77,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
364,
277,
316,
12314,
12,
2890,
18,
2019,
18,
3789,
1380,
4672,
2824,
365,
18,
2019,
18,
3789,
12,
77,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
cr.execute('select "'+field._fields_id+'" from "'+field_obj._table+'" where id in ('+','.join(map(str,ids2))+')') ids3 = [x[0] for x in cr.fetchall()] | ids3 = [] for i in range((len(ids2) / ID_MAX) + (len(ids2) % ID_MAX)): sub_ids2 = ids2[ID_MAX * i:ID_MAX * (i + 1)] cr.execute('select "'+field._fields_id+'" ' \ 'from "'+field_obj._table+'" ' \ 'where id in ('+','.join(map(str,sub_ids2))+')') ids3.extend([x[0] for x in cr.fetchall()]) | def _where_calc(self, cr, user, args, active_test=True, context=None): if not context: context={} args = args[:] # if the object has a field named 'active', filter out all inactive # records unless they were explicitely asked for if 'active' in self._columns and (active_test and context.get('active_test', True)): i = 0 active_found = False while i<len(args): if args[i][0]=='active': active_found = True i += 1 if not active_found: args.append(('active', '=', 1)) | 525cd78a0f7b727670a1fe51b4f78f60206be1e1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12853/525cd78a0f7b727670a1fe51b4f78f60206be1e1/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6051,
67,
12448,
12,
2890,
16,
4422,
16,
729,
16,
833,
16,
2695,
67,
3813,
33,
5510,
16,
819,
33,
7036,
4672,
309,
486,
819,
30,
819,
12938,
833,
273,
833,
10531,
65,
468,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6051,
67,
12448,
12,
2890,
16,
4422,
16,
729,
16,
833,
16,
2695,
67,
3813,
33,
5510,
16,
819,
33,
7036,
4672,
309,
486,
819,
30,
819,
12938,
833,
273,
833,
10531,
65,
468,
309,
... |
self.assertTrue(len(impage.text) >= 100) for impage in mysite.allimages(maxsize=200, limit=5): | self.assertTrue(impage._imageinfo["size"] >= 100) for impage in mysite.allimages(maxsize=2000, limit=5): | def testAllImages(self): """Test the site.allimages() method""" | b386c763dfa286fcd1988dabcc7a358d4afe10b8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9005/b386c763dfa286fcd1988dabcc7a358d4afe10b8/site_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1595,
8946,
12,
2890,
4672,
3536,
4709,
326,
2834,
18,
454,
7369,
1435,
707,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1595,
8946,
12,
2890,
4672,
3536,
4709,
326,
2834,
18,
454,
7369,
1435,
707,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
data = urllib.urlencode({"summary":self.summary, | data = urllib.urlencode({"field_summary":self.summary, | def report(self): f = urllib2.urlopen(trac_new_ticket) | 1d5058b3c32fd1c0b63b38ad086556fee4e3cb4a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11468/1d5058b3c32fd1c0b63b38ad086556fee4e3cb4a/BugRegister.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2605,
12,
2890,
4672,
284,
273,
11527,
22,
18,
295,
18589,
12,
313,
1077,
67,
2704,
67,
16282,
13,
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,
2605,
12,
2890,
4672,
284,
273,
11527,
22,
18,
295,
18589,
12,
313,
1077,
67,
2704,
67,
16282,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
security.declareProtected(permissions.View, 'getSchemataFields') | security.declareProtected(CMFCorePermissions.View, 'getSchemataFields') | def getSchemataNames(self): """Return list of schemata names in order of appearing""" lst = [] for f in self.fields(): if not f.schemata in lst: lst.append(f.schemata) return lst | b9a35d44b511b5a532334179a24412a4695367d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/b9a35d44b511b5a532334179a24412a4695367d1/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1322,
1036,
396,
1557,
12,
2890,
4672,
3536,
990,
666,
434,
30140,
396,
1257,
316,
1353,
434,
7226,
5968,
8395,
9441,
273,
5378,
364,
284,
316,
365,
18,
2821,
13332,
309,
486,
284,
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,
1322,
1036,
396,
1557,
12,
2890,
4672,
3536,
990,
666,
434,
30140,
396,
1257,
316,
1353,
434,
7226,
5968,
8395,
9441,
273,
5378,
364,
284,
316,
365,
18,
2821,
13332,
309,
486,
284,
18,
... |
self.lang = self.site.lang | def put_talk(self, notification, head, notification2 = None, commx = None): commento2 = wikipedia.translate(self.site, comm2) talk_page = self.talk_page notification = self.notification if notification2 == None: notification2 = notification else: notification2 = notification2 % self.image head = self.head second_text = False # Getting the talk page's history, to check if there is another advise... # The try block is used to prevent error if you use an old wikipedia.py's version. edit_to_load = 10 if talk_page.exists(): try: history = talk_page.getVersionHistory(False, False, False, edit_to_load) except TypeError: history = talk_page.getVersionHistory(False, False, False) latest_edit = history[0] latest_user = latest_edit[2] wikipedia.output(u'The latest user that has written something is: %s' % latest_user) else: wikipedia.output(u'The user page is blank') | eeb10e16b4af158bfe9b9ae9a4de18f568574e2f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/eeb10e16b4af158bfe9b9ae9a4de18f568574e2f/checkimages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
67,
88,
2960,
12,
2890,
16,
3851,
16,
910,
16,
3851,
22,
273,
599,
16,
1543,
92,
273,
599,
4672,
2879,
83,
22,
273,
21137,
18,
13929,
12,
2890,
18,
4256,
16,
1543,
22,
13,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
67,
88,
2960,
12,
2890,
16,
3851,
16,
910,
16,
3851,
22,
273,
599,
16,
1543,
92,
273,
599,
4672,
2879,
83,
22,
273,
21137,
18,
13929,
12,
2890,
18,
4256,
16,
1543,
22,
13,
26... | |
finally: fileobj.close() os.unlink(name) | def compare_dialect_123(self, expected, *writeargs, **kwwriteargs): with TemporaryFile("w+b") as fileobj: writer = csv.writer(fileobj, *writeargs, **kwwriteargs) writer.writerow([1,2,3]) fileobj.seek(0) self.assertEqual(str(fileobj.read()), expected) | def test_space_dialect(self): class space(csv.excel): delimiter = " " quoting = csv.QUOTE_NONE escapechar = "\\" | 3372cde256bb490026e8a5e8c2502a82d2e6c5a0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/3372cde256bb490026e8a5e8c2502a82d2e6c5a0/test_csv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2981,
67,
25909,
386,
12,
2890,
4672,
667,
3476,
12,
6715,
18,
24121,
4672,
5654,
273,
315,
315,
29911,
273,
6101,
18,
18980,
67,
9826,
4114,
3001,
273,
14520,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2981,
67,
25909,
386,
12,
2890,
4672,
667,
3476,
12,
6715,
18,
24121,
4672,
5654,
273,
315,
315,
29911,
273,
6101,
18,
18980,
67,
9826,
4114,
3001,
273,
14520,
2,
-100,
-100,
... |
return sources[1] | return sources[0] | def stack(*sources): """ create a trove source that will search first source1, then source2 """ if len(sources) > 2: return stack(sources[0], stack(*sources[1:])) elif len(sources) == 1: return sources[1] elif not sources: return None else: source1, source2 = sources if source1 is source2: # trove source stacks may have different behavior than # individual trove sources, so always return a # stack even when there's nothing to stack if isinstance(source1, TroveSourceStack): return source1 return TroveSourceStack(source1) if isinstance(source1, TroveSourceStack): if source1.hasSource(source2): return source1 source1 = source1.copy() source1.addSource(source2) return source1 elif isinstance(source2, TroveSourceStack): if source2.hasSource(source1): return source2 source2 = source2.copy() source2.insertSource(source1) return source2 return TroveSourceStack(*sources) | dfce1cf03db0f432a501d0e68249653b60c12aac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/dfce1cf03db0f432a501d0e68249653b60c12aac/trovesource.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2110,
30857,
10141,
4672,
3536,
752,
279,
23432,
537,
1084,
716,
903,
1623,
1122,
1084,
21,
16,
1508,
1084,
22,
3536,
309,
562,
12,
10141,
13,
405,
576,
30,
327,
2110,
12,
10141,
63,
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,
2110,
30857,
10141,
4672,
3536,
752,
279,
23432,
537,
1084,
716,
903,
1623,
1122,
1084,
21,
16,
1508,
1084,
22,
3536,
309,
562,
12,
10141,
13,
405,
576,
30,
327,
2110,
12,
10141,
63,
2... |
Reads file src and saves to dest only the true content | Reads file src_path and saves to dest_path only the true content | def tex_postprocess(src, dest, want_header = False, process_line=noop): """ Postprocessing of the LaTeX file generated from ReST. Reads file src and saves to dest only the true content (without the document header and final) - so it is suitable to be used as part of the longer document. Returns the title of document If want_header is set, returns also the document header (as the list of lines). """ title = '' header = [] add_header_line = header.append global counter_no counter_no = counter_no + 1 counter_text = "listcnt%d" % counter_no search_title = re.compile(r'\\title{([^}]*)}').search skipping = re.compile(r'(\\end{document}|\\tableofcontents)').search src = file(src) dest = file(dest, "w") iter_lines = iter(src.readlines()) for l in iter_lines: l = process_line(l) if not l: continue if want_header: add_header_line(replace_rst_macros('', l)) m = search_title(l) if m: title = m.group(0) if l.startswith("\\maketitle"): break for l in iter_lines: l = process_line(l) if skipping(l): # To-Do minitoc instead of tableofcontents continue elif "\hypertarget{old-versions}" in l: break elif "listcnt0" in l: l = l.replace("listcnt0", counter_text) dest.write(l) if not title: raise Exception("Bueee, no title") return title, header | 6d2a084d7d87c7db6ac34a2a97ebcf661ae34075 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13107/6d2a084d7d87c7db6ac34a2a97ebcf661ae34075/mklatex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16573,
67,
2767,
2567,
12,
4816,
16,
1570,
16,
2545,
67,
3374,
273,
1083,
16,
1207,
67,
1369,
33,
2135,
556,
4672,
3536,
5616,
10632,
434,
326,
21072,
21575,
60,
585,
4374,
628,
868,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16573,
67,
2767,
2567,
12,
4816,
16,
1570,
16,
2545,
67,
3374,
273,
1083,
16,
1207,
67,
1369,
33,
2135,
556,
4672,
3536,
5616,
10632,
434,
326,
21072,
21575,
60,
585,
4374,
628,
868,
8... |
k -- an integer (ddefault: 2) p -- a prime (default: 0); just the p-new subspace if given | k -- an integer (default: 2) p -- a prime (default: 0); just the $p$-new subspace if given | def dimension_new_cusp_forms_group(group, k=2, p=0): """ Return the dimension of the new space of cusp forms for the congruence subgroup group. If p is given, return the p-new subspace. INPUT: group -- a congruence subgroup k -- an integer (ddefault: 2) p -- a prime (default: 0); just the p-new subspace if given OUTPUT: Integer EXAMPLES: sage: sage.modular.dims.dimension_new_cusp_forms_group(Gamma0(33),2) 1 sage: sage.modular.dims.dimension_new_cusp_forms_group(Gamma0(33),2,3) 1 sage: sage.modular.dims.dimension_new_cusp_forms_group(Gamma0(33),2,11) 3 sage: sage.modular.dims.dimension_new_cusp_forms_group(Gamma1(33),2) 19 sage: sage.modular.dims.dimension_new_cusp_forms_group(Gamma1(33),2,11) 21 sage: sage.modular.dims.dimension_new_cusp_forms_group(GammaH(33,[1,2]),2) 3 """ assert isinstance(group, congroup.CongruenceSubgroup), \ "Argument 1 must be a congruence subgroup." if isinstance(group, congroup.Gamma0): return dimension_new_cusp_forms_gamma0(group.level(), k, p) elif isinstance(group, congroup.Gamma1): return dimension_new_cusp_forms_gamma1(group.level(), k, p) elif congroup.is_GammaH(group): return dimension_new_cusp_forms_H(group, k, p) else: raise NotImplementedError, "Computing of dimensions for congruence subgroups besides \ Gamma0 and Gamma1 is not yet implemented." | c82112a889c87779a875085f7c30d0e045ec245d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/c82112a889c87779a875085f7c30d0e045ec245d/dims.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4968,
67,
2704,
67,
71,
407,
84,
67,
9741,
67,
1655,
12,
1655,
16,
417,
33,
22,
16,
293,
33,
20,
4672,
3536,
2000,
326,
4968,
434,
326,
394,
3476,
434,
27964,
84,
10138,
364,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4968,
67,
2704,
67,
71,
407,
84,
67,
9741,
67,
1655,
12,
1655,
16,
417,
33,
22,
16,
293,
33,
20,
4672,
3536,
2000,
326,
4968,
434,
326,
394,
3476,
434,
27964,
84,
10138,
364,
326,
... |
for kind,href,title,date,author,message in events: | for kind, href, title, date, author, message in events: | def process_request(self, req): req.perm.assert_permission('TIMELINE_VIEW') | ba1cf021145a9e1db08a24d3aa8558e5880c91a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/ba1cf021145a9e1db08a24d3aa8558e5880c91a3/Timeline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2293,
12,
2890,
16,
1111,
4672,
1111,
18,
12160,
18,
11231,
67,
9827,
2668,
4684,
5997,
67,
12145,
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,
1207,
67,
2293,
12,
2890,
16,
1111,
4672,
1111,
18,
12160,
18,
11231,
67,
9827,
2668,
4684,
5997,
67,
12145,
6134,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
cmdclass = { 'install_lib': my_install_lib, | cmdclass = { | def get_ext_filename(self, name): fname = build_ext.get_ext_filename(self, name) base, ext = os.path.splitext(fname) newbase = REGNAMES.get(name, fname) if self.debug: return newbase + '_d' + '.dll' return newbase + '.dll' | d4c2532cebb5723b17c2a81ed745d9edd2ff62ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/d4c2532cebb5723b17c2a81ed745d9edd2ff62ec/setup_win32all_core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
408,
67,
3459,
12,
2890,
16,
508,
4672,
5299,
273,
1361,
67,
408,
18,
588,
67,
408,
67,
3459,
12,
2890,
16,
508,
13,
1026,
16,
1110,
273,
1140,
18,
803,
18,
4939,
408,
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,
336,
67,
408,
67,
3459,
12,
2890,
16,
508,
4672,
5299,
273,
1361,
67,
408,
18,
588,
67,
408,
67,
3459,
12,
2890,
16,
508,
13,
1026,
16,
1110,
273,
1140,
18,
803,
18,
4939,
408,
12,... |
ecore.timer_add(1.0,self.main.transition_to,"menu") | ecore.timer_add(1.0,self.check_connection) | def __init__(self, main): edje_group.__init__(self, main, "main") | 836a0ec19c40be3f15006941c5837aeebe8036cd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4058/836a0ec19c40be3f15006941c5837aeebe8036cd/bluemaemo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2774,
4672,
1675,
78,
73,
67,
1655,
16186,
2738,
972,
12,
2890,
16,
2774,
16,
315,
5254,
7923,
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,
1001,
2738,
972,
12,
2890,
16,
2774,
4672,
1675,
78,
73,
67,
1655,
16186,
2738,
972,
12,
2890,
16,
2774,
16,
315,
5254,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
(fd, indirect_fname) = tempfile.mkstemp(dir=self.TMP_DIR, | (fd, indirect_fname) = tempfile.mkstemp(dir=self.temp_dir, | def CreateBrowserWrapper(self, command, logfiles): """The program being run invokes Python or something else that can't stand to be valgrinded, and also invokes the Chrome browser. Set an environment variable to tell the program to prefix the Chrome commandline with a magic wrapper. Build the magic wrapper here. """ (fd, indirect_fname) = tempfile.mkstemp(dir=self.TMP_DIR, prefix="browser_wrapper.", text=True) f = os.fdopen(fd, "w") f.write("#!/bin/sh\n") f.write('echo "Started Valgrind wrapper for this test, PID=$$"\n') # Add the PID of the browser wrapper to the logfile names so we can # separate log files for different UI tests at the analyze stage. f.write(command.replace("%p", "$$.%p")) f.write(' "$@"\n') f.close() os.chmod(indirect_fname, stat.S_IRUSR|stat.S_IXUSR) os.putenv("BROWSER_WRAPPER", indirect_fname) logging.info('export BROWSER_WRAPPER=' + indirect_fname) | 09a4f701e8a53003ff9f43042db088214ef61594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/09a4f701e8a53003ff9f43042db088214ef61594/valgrind_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
9132,
3611,
12,
2890,
16,
1296,
16,
613,
2354,
4672,
3536,
1986,
5402,
3832,
1086,
18058,
6600,
578,
5943,
469,
716,
848,
1404,
12842,
358,
506,
1244,
3197,
267,
785,
16,
471,
2546... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
9132,
3611,
12,
2890,
16,
1296,
16,
613,
2354,
4672,
3536,
1986,
5402,
3832,
1086,
18058,
6600,
578,
5943,
469,
716,
848,
1404,
12842,
358,
506,
1244,
3197,
267,
785,
16,
471,
2546... |
'lightPath|LightPathWrapper', | 'lightPath|LightPathWrapper', | def getRGB (self): """ @return: list. A list of (r,g,b) values """ return (self._color['red'], self._color['green'], self._color['blue']) | f04d6b835888d75be3c246b00ce015feaaf466ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/f04d6b835888d75be3c246b00ce015feaaf466ce/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4170,
5887,
261,
2890,
4672,
3536,
632,
2463,
30,
666,
18,
432,
666,
434,
261,
86,
16,
75,
16,
70,
13,
924,
3536,
225,
327,
261,
2890,
6315,
3266,
3292,
1118,
17337,
365,
6315,
3266,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4170,
5887,
261,
2890,
4672,
3536,
632,
2463,
30,
666,
18,
432,
666,
434,
261,
86,
16,
75,
16,
70,
13,
924,
3536,
225,
327,
261,
2890,
6315,
3266,
3292,
1118,
17337,
365,
6315,
3266,
... |
print u' %s\tan\t%-30s' % (section['destination_time'].strftime('%H:%M'), unicode(section['destination_station'])) | print(' %s\tan\t%-30s' % (section['destination_time'].strftime('%H:%M'), section['destination_station'])) | def get_url(self): return (_REQ_URL + ('&' if _REQ_URL.find('?') > -1 else '?') + urllib.urlencode(self.post) ) | dd568e81c1b8182cd4ce3412e911e6ca45e46cbd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7908/dd568e81c1b8182cd4ce3412e911e6ca45e46cbd/bsag.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
718,
12,
2890,
4672,
327,
261,
67,
20373,
67,
1785,
397,
7707,
26045,
309,
389,
20373,
67,
1785,
18,
4720,
2668,
4899,
13,
405,
300,
21,
469,
6787,
13,
397,
11527,
18,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
718,
12,
2890,
4672,
327,
261,
67,
20373,
67,
1785,
397,
7707,
26045,
309,
389,
20373,
67,
1785,
18,
4720,
2668,
4899,
13,
405,
300,
21,
469,
6787,
13,
397,
11527,
18,
718,
... |
new_content = new_node.get_content().read() | new_content = util.to_utf8(new_node.get_content().read()) | def render_diff(self, req, repos, chgset, diff_options): """Raw Unified Diff version""" req.send_response(200) req.send_header('Content-Type', 'text/plain;charset=utf-8') req.send_header('Content-Disposition', 'filename=Changeset%s.diff' % req.args.get('rev')) req.end_headers() | 294ad5958b84e6670b05ec7b2263cef3638204e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/294ad5958b84e6670b05ec7b2263cef3638204e0/Changeset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
5413,
12,
2890,
16,
1111,
16,
13686,
16,
462,
75,
542,
16,
3122,
67,
2116,
4672,
3536,
4809,
1351,
939,
13008,
1177,
8395,
1111,
18,
4661,
67,
2740,
12,
6976,
13,
1111,
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,
1743,
67,
5413,
12,
2890,
16,
1111,
16,
13686,
16,
462,
75,
542,
16,
3122,
67,
2116,
4672,
3536,
4809,
1351,
939,
13008,
1177,
8395,
1111,
18,
4661,
67,
2740,
12,
6976,
13,
1111,
18,
... |
if ((os.uname()[0] == 'SunOS')): | if (hasattr(os,'uname') and (os.uname()[0] == 'SunOS')): | def get_extra_link_args(self): # SunOS often has dynamically loaded symbols defined in the # static library libg2c.a The linker doesn't like this. To # ignore the problem, use the -mimpure-text flag. It isn't # the safest thing, but seems to work. args = [] if ((os.uname()[0] == 'SunOS')): args = ['-mimpure-text'] return args | 76fc2c06dec2ba223aa26917b8070e5845ef441a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/76fc2c06dec2ba223aa26917b8070e5845ef441a/build_flib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7763,
67,
1232,
67,
1968,
12,
2890,
4672,
468,
31608,
4618,
16337,
711,
18373,
4203,
7963,
2553,
316,
326,
468,
760,
5313,
2561,
75,
22,
71,
18,
69,
225,
1021,
28058,
3302,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7763,
67,
1232,
67,
1968,
12,
2890,
4672,
468,
31608,
4618,
16337,
711,
18373,
4203,
7963,
2553,
316,
326,
468,
760,
5313,
2561,
75,
22,
71,
18,
69,
225,
1021,
28058,
3302,
14... |
ae(app.ini, '[credentials]\nsip.bar.com=Z2F6cGFjaG8AYm93bA==\n\n') | ae(app.ini, '[credentials]\nsip.bar.com=Z2F6cGFjaG8AYm93bA==\n') | def test_credcache_set_save(self): ae = self.assertEquals app = DummyApp() c = CredCache(app) ae(c.getCred('sip.foo.com'), None) c.addCred('sip.foo.com', 'gonzo', 'seekrit') ae(c.getCred('sip.foo.com'), ('gonzo', 'seekrit')) c.addCred('sip.bar.com', 'gazpacho', 'soup', save=True) ae(c.getCred('sip.bar.com'), ('gazpacho', 'soup')) ae(app.ini, '[credentials]\nsip.bar.com=Z2F6cGFjaG8Ac291cA==\n\n') c.addCred('sip.bar.com', 'gazpacho', 'bowl', save=True) ae(c.getCred('sip.bar.com'), ('gazpacho', 'bowl')) ae(app.ini, '[credentials]\nsip.bar.com=Z2F6cGFjaG8AYm93bA==\n\n') c.addCred('sip.foo.com', 'gonzo', 'seekrit', save=True) ae(app.ini, '[credentials]\nsip.foo.com=Z29uem8Ac2Vla3JpdA==\n\nsip.bar.com=Z2F6cGFjaG8AYm93bA==\n\n') | 9091698ade204d8fccbca0cddd698bfa377459e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1265/9091698ade204d8fccbca0cddd698bfa377459e2/test_credcache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
20610,
2493,
67,
542,
67,
5688,
12,
2890,
4672,
14221,
273,
365,
18,
11231,
8867,
595,
273,
28622,
3371,
1435,
276,
273,
385,
1118,
1649,
12,
2910,
13,
14221,
12,
71,
18,
588... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
20610,
2493,
67,
542,
67,
5688,
12,
2890,
4672,
14221,
273,
365,
18,
11231,
8867,
595,
273,
28622,
3371,
1435,
276,
273,
385,
1118,
1649,
12,
2910,
13,
14221,
12,
71,
18,
588... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.