rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
self.assertEqual(check_line('print """<a="=")', REPORTER), None) | self.assertEqual(check_line('print """<a="=")\n"""', REPORTER), None) | def test_known_values_tqstring(self): self.assertEqual(check_line('print """<a="=")', REPORTER), None) | 037076855b9415e022bb196d33edeb4310a31884 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/928/037076855b9415e022bb196d33edeb4310a31884/test_format.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2994,
67,
2372,
67,
88,
85,
1080,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
1893,
67,
1369,
2668,
1188,
3536,
32,
69,
1546,
1546,
5153,
82,
8395,
2187,
2438,
52,
916,
2560,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1842,
67,
2994,
67,
2372,
67,
88,
85,
1080,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
1893,
67,
1369,
2668,
1188,
3536,
32,
69,
1546,
1546,
5153,
82,
8395,
2187,
2438,
52,
916,
2560,
... |
if EOF in charStack: | if EOF in charStack[:2]: | def consumeEntity(self, fromAttribute=False): char = None charStack = [self.stream.char()] if charStack[0] in spaceCharacters or charStack[0] in (EOF, "<", "&"): self.stream.unget(charStack) elif charStack[0] == u"#": # We might have a number entity here. charStack.extend([self.stream.char(), self.stream.char()]) if EOF in charStack: # If we reach the end of the file put everything up to EOF # back in the queue charStack = charStack[:charStack.index(EOF)] self.stream.unget(charStack) self.tokenQueue.append({"type": "ParseError", "data": _("Numeric entity expected. Got end of file instead.")}) else: if charStack[1].lower() == u"x" \ and charStack[2] in hexDigits: # Hexadecimal entity detected. self.stream.unget(charStack[2]) char = self.consumeNumberEntity(True) elif charStack[1] in digits: # Decimal entity detected. self.stream.unget(charStack[1:]) char = self.consumeNumberEntity(False) else: # No number entity detected. self.stream.unget(charStack) self.tokenQueue.append({"type": "ParseError", "data": _("Numeric entity expected but none found.")}) else: # At this point in the process might have named entity. Entities # are stored in the global variable "entities". # # Consume characters and compare to these to a substring of the # entity names in the list until the substring no longer matches. filteredEntityList = [e for e in entities if \ e.startswith(charStack[0])] | 58460553eb28df59eff60544b30b8dcb2ab4bfa0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10463/58460553eb28df59eff60544b30b8dcb2ab4bfa0/tokenizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7865,
1943,
12,
2890,
16,
628,
1499,
33,
8381,
4672,
1149,
273,
599,
1149,
2624,
273,
306,
2890,
18,
3256,
18,
3001,
1435,
65,
309,
1149,
2624,
63,
20,
65,
316,
3476,
11600,
578,
1149,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7865,
1943,
12,
2890,
16,
628,
1499,
33,
8381,
4672,
1149,
273,
599,
1149,
2624,
273,
306,
2890,
18,
3256,
18,
3001,
1435,
65,
309,
1149,
2624,
63,
20,
65,
316,
3476,
11600,
578,
1149,... |
print 'Building project "%s" in "%s" configuration' % (project, config) | logging.info('Building project "%s" in "%s" configuration', project, config) | def BuildConfig(self, config): '''Builds all projects for a given config. | dcdf32015f8971d0bfd9944f6e54a65b0ad142fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/dcdf32015f8971d0bfd9944f6e54a65b0ad142fa/smoke_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3998,
809,
12,
2890,
16,
642,
4672,
9163,
7746,
777,
10137,
364,
279,
864,
642,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
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,
3998,
809,
12,
2890,
16,
642,
4672,
9163,
7746,
777,
10137,
364,
279,
864,
642,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
existing = ProjectPermissionSet.objects.filter(project=instance, user=None, is_default=True) | existing = ProjectPermissionSet.objects.filter(project__id = instance.id, is_default=True) | def create_default_permission_set(sender, instance, signal, *args, **kwargs): """ Executed on creation of a project, this defines the default permissions """ from hgfront.project.models import Project, ProjectPermissionSet existing = ProjectPermissionSet.objects.filter(project=instance, user=None, is_default=True) if not existing: permission_set = ProjectPermissionSet(is_default=True, project=instance, user=None) permission_set.save() | 2644952170e7bb12ba2123660d02a18ae99cc4d6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14843/2644952170e7bb12ba2123660d02a18ae99cc4d6/signals.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
1886,
67,
9827,
67,
542,
12,
15330,
16,
791,
16,
4277,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
3889,
4817,
603,
6710,
434,
279,
1984,
16,
333,
11164,
326,
805,
4371,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
1886,
67,
9827,
67,
542,
12,
15330,
16,
791,
16,
4277,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
3889,
4817,
603,
6710,
434,
279,
1984,
16,
333,
11164,
326,
805,
4371,
3536,
... |
pass | continue try: obj.handle_write_event() except ExitNow: raise ExitNow except: obj.handle_error() | def poll (timeout=0.0, map=None): global DEBUG if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): if obj.readable(): r.append (fd) if obj.writable(): w.append (fd) r,w,e = select.select (r,w,e, timeout) if DEBUG: print r,w,e for fd in r: try: obj = map[fd] try: obj.handle_read_event() except ExitNow: raise ExitNow except: obj.handle_error() except KeyError: pass for fd in w: try: obj = map[fd] try: obj.handle_write_event() except ExitNow: raise ExitNow except: obj.handle_error() except KeyError: pass | e66f5751e5825c28880ab37cf35890958d97e274 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/e66f5751e5825c28880ab37cf35890958d97e274/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
261,
4538,
33,
20,
18,
20,
16,
852,
33,
7036,
4672,
2552,
6369,
309,
852,
353,
599,
30,
852,
273,
2987,
67,
1458,
309,
852,
30,
436,
273,
5378,
31,
341,
273,
5378,
31,
425,
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,
7672,
261,
4538,
33,
20,
18,
20,
16,
852,
33,
7036,
4672,
2552,
6369,
309,
852,
353,
599,
30,
852,
273,
2987,
67,
1458,
309,
852,
30,
436,
273,
5378,
31,
341,
273,
5378,
31,
425,
2... |
def docother(self, object, name=None, mod=None, maxlen=None): | def docother(self, object, name=None, mod=None, maxlen=None, doc=None): | def docother(self, object, name=None, mod=None, maxlen=None): """Produce text documentation for a data object.""" repr = self.repr(object) if maxlen: line = (name and name + ' = ' or '') + repr chop = maxlen - len(line) if chop < 0: repr = repr[:chop] + '...' line = (name and self.bold(name) + ' = ' or '') + repr return line | ac156054356b61fdccd0e3e3ddf29c06aea9b35c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/ac156054356b61fdccd0e3e3ddf29c06aea9b35c/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
3011,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
681,
33,
7036,
16,
21882,
33,
7036,
16,
997,
33,
7036,
4672,
3536,
25884,
977,
7323,
364,
279,
501,
733,
12123,
8480,
273,
365,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
3011,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
681,
33,
7036,
16,
21882,
33,
7036,
16,
997,
33,
7036,
4672,
3536,
25884,
977,
7323,
364,
279,
501,
733,
12123,
8480,
273,
365,
1... |
p = pproc.Popen([cxx, '/help'], env=env, stdout=pproc.PIPE, stderr=pproc.PIPE) | p = pproc.Popen([compiler_name, '/help'], env=env, stdout=pproc.PIPE, stderr=pproc.PIPE) | def get_msvc_version(conf, compiler, version, target, vcvars): debug('msvc: get_msvc_version: ' + compiler + ' ' + version + ' ' + target + ' ...') batfile = os.path.join(conf.blddir, "waf-print-msvc.bat") f = open(batfile, 'w') f.write("""@echo off | 05495af483649bfc6f90e3fef7d4b6f6cdb27e4d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7302/05495af483649bfc6f90e3fef7d4b6f6cdb27e4d/msvc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
959,
4227,
67,
1589,
12,
3923,
16,
5274,
16,
1177,
16,
1018,
16,
12802,
4699,
4672,
1198,
2668,
959,
4227,
30,
336,
67,
959,
4227,
67,
1589,
30,
296,
397,
5274,
397,
296,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
959,
4227,
67,
1589,
12,
3923,
16,
5274,
16,
1177,
16,
1018,
16,
12802,
4699,
4672,
1198,
2668,
959,
4227,
30,
336,
67,
959,
4227,
67,
1589,
30,
296,
397,
5274,
397,
296,
29... |
timeout = int(timeout*1000) | if timeout is not None: timeout = int(timeout*1000) | def poll3 (timeout=0.0, map=None): # Use the poll() support added to the select module in Python 2.0 if map is None: map=socket_map # timeout is in milliseconds timeout = int(timeout*1000) pollster = select.poll() if map: for fd, obj in map.items(): flags = 0 if obj.readable(): flags = select.POLLIN if obj.writable(): flags = flags | select.POLLOUT if flags: pollster.register(fd, flags) r = pollster.poll (timeout) for fd, flags in r: try: obj = map[fd] try: if (flags & select.POLLIN): obj.handle_read_event() if (flags & select.POLLOUT): obj.handle_write_event() except ExitNow: raise ExitNow except: obj.handle_error() except KeyError: pass | 6ead78a4c15f23abe3f579ee49e90bc8ec5288ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6ead78a4c15f23abe3f579ee49e90bc8ec5288ed/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
23,
261,
4538,
33,
20,
18,
20,
16,
852,
33,
7036,
4672,
468,
2672,
326,
7672,
1435,
2865,
3096,
358,
326,
2027,
1605,
316,
6600,
576,
18,
20,
309,
852,
353,
599,
30,
852,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
23,
261,
4538,
33,
20,
18,
20,
16,
852,
33,
7036,
4672,
468,
2672,
326,
7672,
1435,
2865,
3096,
358,
326,
2027,
1605,
316,
6600,
576,
18,
20,
309,
852,
353,
599,
30,
852,
33,
... |
print >> f, 'LIBTBX_DISPATCHER_NAME="%s"' % os.path.basename(target_file) | print >> f, 'LIBTBX_DISPATCHER_NAME="%s"' % op.basename(target_file) | def write_bin_sh_dispatcher(self, source_file, target_file): f = open(target_file, "w") if (source_file is not None): print >> f, '#! /bin/sh' print >> f, '# LIBTBX_DISPATCHER DO NOT EDIT' else: print >> f, '# LIBTBX_DISPATCHER_HEAD DO NOT EDIT' print >> f, '#' print >> f, '# This file is intended to be sourced from other scripts.' print >> f, '# It is like the dispatcher scripts in the bin directory,' print >> f, '# but only sets up the environment without calling a' print >> f, '# command at the end.' print >> f, '#' write_do_not_edit_please_re_run_libtbx_configure_py(f=f) print >> f, '# To customize this auto-generated script create' print >> f, '#' print >> f, '# dispatcher_include*.sh' print >> f, '#' print >> f, '# files in %s and run' % show_string(self.build_path) print >> f, '#' print >> f, '# libtbx.refresh' print >> f, '#' print >> f, '# to re-generate the dispatchers (libtbx.refresh is a subset' print >> f, '# of the functionality of the libtbx/configure.py command).' print >> f, '#' print >> f, '# See also:' print >> f, '# %s' \ % show_string(self.under_build("dispatcher_include_template.sh")) print >> f, '#' print >> f, 'unset PYTHONHOME' print >> f, 'LC_ALL=C' print >> f, 'export LC_ALL' print >> f, 'LIBTBX_BUILD="%s"' % self.build_path print >> f, 'export LIBTBX_BUILD' source_is_py = False if (source_file is not None): dispatcher_name = os.path.basename(target_file) if (dispatcher_name.find('"') >= 0): raise RuntimeError( "Dispatcher target file name contains double-quote: %s\n" % dispatcher_name + " source file: %s" % source_file) print >> f, 'LIBTBX_DISPATCHER_NAME="%s"' % os.path.basename(target_file) print >> f, 'export LIBTBX_DISPATCHER_NAME' if (source_file.lower().endswith(".py")): source_is_py = True pyexe_dirname, pyexe_basename = os.path.split(self.python_exe) print >> f, 'LIBTBX_PYEXE_BASENAME=%s' % show_string(pyexe_basename) print >> f, 'export LIBTBX_PYEXE_BASENAME' for line in self.dispatcher_include(where="at_start"): print >> f, line essentials = [("PYTHONPATH", self.pythonpath)] essentials.append((ld_library_path_var_name(), [self.lib_path])) essentials.append(("PATH", [self.bin_path])) for n,v in essentials: if (len(v) == 0): continue v = ":".join(v) if (sys.platform == "irix6" and n == "LD_LIBRARY_PATH"): n32 = "LD_LIBRARYN32_PATH" print >> f, 'if [ -n "$%s" ]; then' % n32 print >> f, ' %s="%s:$%s"' % (n32, v, n32) print >> f, ' export %s' % n32 print >> f, 'elif [ -n "$%s" ]; then' % n else: print >> f, 'if [ -n "$%s" ]; then' % n print >> f, ' %s="%s:$%s"' % (n, v, n) print >> f, ' export %s' % n print >> f, 'else' print >> f, ' %s="%s"' % (n, v) print >> f, ' export %s' % n print >> f, 'fi' precall_commands = self.dispatcher_precall_commands() if (precall_commands is not None): for line in precall_commands: print >> f, line if (source_is_py): scan_for_dispatcher_includes = True elif (source_file is None or not os.path.isfile(source_file)): scan_for_dispatcher_includes = False else: scan_for_dispatcher_includes = not detect_binary_file.from_initial_block( file_name=source_file) if (scan_for_dispatcher_includes): for line in source_specific_dispatcher_include( pattern="LIBTBX_PRE_DISPATCHER_INCLUDE_SH", source_file=source_file): print >> f, line for line in self.dispatcher_include(where="before_command"): print >> f, line if (scan_for_dispatcher_includes): for line in source_specific_dispatcher_include( pattern="LIBTBX_POST_DISPATCHER_INCLUDE_SH", source_file=source_file): print >> f, line if (source_file is not None): start_python = False cmd = "" if (source_is_py): cmd += ' %s"%s%s$LIBTBX_PYEXE_BASENAME"' % ( ['', '/usr/bin/arch -i386 '][self.build_options.force_32bit], escape_sh_double_quoted(pyexe_dirname), os.sep) if (len(source_specific_dispatcher_include( pattern="LIBTBX_START_PYTHON", source_file=source_file)) > 3): start_python = True if (not start_python): cmd += (" %s'"+source_file+"'") % [ '', '/usr/bin/arch -i386 '][self.build_options.force_32bit and not source_is_py] print >> f, 'if [ -n "$LIBTBX__VALGRIND_FLAG__" ]; then' print >> f, " exec $LIBTBX_VALGRIND"+cmd, '"$@"' print >> f, "elif [ $# -eq 0 ]; then" print >> f, " exec"+cmd print >> f, "else" print >> f, " exec"+cmd, '"$@"' print >> f, "fi" f.close() os.chmod(target_file, 0755) | 621ff93ea6f104ac4c6d943d7e9d6c18b1468502 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/621ff93ea6f104ac4c6d943d7e9d6c18b1468502/env_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
4757,
67,
674,
67,
18495,
12,
2890,
16,
1084,
67,
768,
16,
1018,
67,
768,
4672,
284,
273,
1696,
12,
3299,
67,
768,
16,
315,
91,
7923,
309,
261,
3168,
67,
768,
353,
486,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
4757,
67,
674,
67,
18495,
12,
2890,
16,
1084,
67,
768,
16,
1018,
67,
768,
4672,
284,
273,
1696,
12,
3299,
67,
768,
16,
315,
91,
7923,
309,
261,
3168,
67,
768,
353,
486,
5... |
print pkg_resources.require('PyGreSQL>='+PyGreSQL_minimum_version) | pkg_resources.require('PyGreSQL>='+PyGreSQL_minimum_version) | def _check_MySQLdb_installed(): if not MySQLdb_installed: raise Exception("Cannot read/write MySQL tables - MySQL-python "+MySQLdb_minimum_version+" or later required") # SQLite | 1382bed48817dc7a57da77aba31de6c81138b85b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13233/1382bed48817dc7a57da77aba31de6c81138b85b/sqlhelper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
28723,
1966,
67,
13435,
13332,
309,
486,
13485,
1966,
67,
13435,
30,
1002,
1185,
2932,
4515,
855,
19,
2626,
13485,
4606,
300,
13485,
17,
8103,
13773,
28723,
1966,
67,
15903,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
67,
28723,
1966,
67,
13435,
13332,
309,
486,
13485,
1966,
67,
13435,
30,
1002,
1185,
2932,
4515,
855,
19,
2626,
13485,
4606,
300,
13485,
17,
8103,
13773,
28723,
1966,
67,
15903,... |
print "not implemented, header length", length_octets | print "not implemented, header length", octet1 | def decode_header(binary_data): ''' Decodes the header of a PGP formatted string. ''' results = {} packet_header = ord(binary_data[0]) binary_data = binary_data[1:] format = (packet_header & 0x40) >> 6 if format == 1: # new format packet #print "not implemented, new packet format" results["content_tag"] = packet_header & 0x1F results["format"] = "New" #print "new", len(binary_data) #results['header_size'] = 0 octet1 = ord(binary_data[0]) if octet1 < 192: results['size'] = ord(binary_data[0]) binary_data = binary_data[1:] elif 192 <= octet1 <= 223: results['size'] = ((ord(binary_data[0]) - 192) << 8) + ord(binary_data[1]) binary_data = binary_data[2:] elif octet1 == 255: results['size'] = (ord(binary_data[0]) << 24) | (ord(binary_data[1]) << 16) | (ord(binary_data[2])) << 8 | ord(binary_data[3]) binary_data = binary_data[4:] else: print "not implemented, header length", length_octets return results else: # old format results["format"] = "Old" results["content_tag"] = (packet_header >> 2) & 0x0F length_type = packet_header & 0x03 #print length_type if length_type < 3: length_octets = pow(2, length_type) results['header_size'] = length_octets + 1 #print length_octets if length_octets == 1: results['size'] = ord(binary_data[0]) binary_data = binary_data[1:] elif length_octets == 2: results['size'] = (ord(binary_data[0]) << 8) + ord(binary_data[1]) binary_data = binary_data[2:] elif length_octets == 4: results['size'] = (ord(binary_data[0]) << 24) + (ord(binary_data[1]) << 16) + (ord(binary_data[2]) << 8) + ord(binary_data[3]) binary_data = binary_data[4:] else: print "not implemented, header length", length_octets return results elif length_type == 3: print "not implemented, length type", length_type return results return decode_tag(results, binary_data[:results['size']]) | cedf2d3fa50ba7140bc823ffa4ba7db6a4c37228 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6425/cedf2d3fa50ba7140bc823ffa4ba7db6a4c37228/metalinkc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
67,
3374,
12,
8578,
67,
892,
4672,
9163,
3416,
1145,
326,
1446,
434,
279,
21222,
4955,
533,
18,
9163,
1686,
273,
2618,
225,
4414,
67,
3374,
273,
4642,
12,
8578,
67,
892,
63,
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,
2495,
67,
3374,
12,
8578,
67,
892,
4672,
9163,
3416,
1145,
326,
1446,
434,
279,
21222,
4955,
533,
18,
9163,
1686,
273,
2618,
225,
4414,
67,
3374,
273,
4642,
12,
8578,
67,
892,
63,
20,
... |
"""Return the default value to be used for initializing this field""" | """Return the default value to be used for initializing this field""" | def getDefault(self): """Return the default value to be used for initializing this field""" return self.default | 6c49241026527d58ec33dad69b98fdf197a65ae4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/6c49241026527d58ec33dad69b98fdf197a65ae4/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4829,
12,
2890,
4672,
3536,
990,
326,
805,
460,
358,
506,
1399,
364,
22584,
333,
652,
8395,
327,
365,
18,
1886,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4829,
12,
2890,
4672,
3536,
990,
326,
805,
460,
358,
506,
1399,
364,
22584,
333,
652,
8395,
327,
365,
18,
1886,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
if ring_tags is not None: ring_tag = ring_tags[i] | if ring_markers is not None: ring_marker = ring_markers[i] | def add_polygons(new_polys, tag): polygons.extend(new_polys) tags.extend(len(new_polys)*[tag]) | 6b434447f8881a54b73fed072437bc6aaf45ddda /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11985/6b434447f8881a54b73fed072437bc6aaf45ddda/tet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
20917,
87,
12,
2704,
67,
3915,
1900,
16,
1047,
4672,
17294,
18,
14313,
12,
2704,
67,
3915,
1900,
13,
2342,
18,
14313,
12,
1897,
12,
2704,
67,
3915,
1900,
17653,
63,
2692,
5717... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
527,
67,
20917,
87,
12,
2704,
67,
3915,
1900,
16,
1047,
4672,
17294,
18,
14313,
12,
2704,
67,
3915,
1900,
13,
2342,
18,
14313,
12,
1897,
12,
2704,
67,
3915,
1900,
17653,
63,
2692,
5717... |
if user: | if user and (user not in users): | def get_moderatedUserObjects(self): """ Get the user objects corresponding to the moderated list, assuming we can. """ member_groups = self.getProperty('moderated_groups', []) uids = [] for gid in member_groups: group = self.acl_users.getGroupById(gid) uids += group.getUsers() uids += self.getProperty('moderated_members', []) users = [] for uid in uids: user = self.acl_users.getUser(uid) if user: users.append(user) return users | 7f855f2bbf5f90df59cf488649582bd10ebf87bc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6274/7f855f2bbf5f90df59cf488649582bd10ebf87bc/XWFMailingList.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1711,
19007,
1299,
4710,
12,
2890,
4672,
3536,
968,
326,
729,
2184,
4656,
358,
326,
681,
19007,
666,
16,
15144,
732,
848,
18,
225,
3536,
3140,
67,
4650,
273,
365,
18,
588,
139... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1711,
19007,
1299,
4710,
12,
2890,
4672,
3536,
968,
326,
729,
2184,
4656,
358,
326,
681,
19007,
666,
16,
15144,
732,
848,
18,
225,
3536,
3140,
67,
4650,
273,
365,
18,
588,
139... |
instruc = instruc.replace(","," ") instruc = instruc.lower() instruc = instruc.split(" ") | instruc = sanitize(instruc) | def parse_trap(instruc = "", word_buf = ""): if instruc == "" or word_buf == "": print "ERROR: someone accidentally the code in parse_trap" return "-1" instruc = instruc.replace(","," ") instruc = instruc.lower() instruc = instruc.split(" ") #instruc is now a list imm = instruc[1] imm = int(imm) if imm > 2^8 or imm < 0: print "ERROR: Immediate value " + str(imm) +" is out of range." print "IMM in TRAP UIMM must be greater than 0 and less than 2^8" return "-1" word_buf += "0000" word_buf += int2bin(imm, 8) return word_buf | c9041b22a5fae24347e6995b51cec7b258f41bc2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4891/c9041b22a5fae24347e6995b51cec7b258f41bc2/assembler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
27170,
12,
267,
701,
5286,
273,
23453,
2076,
67,
4385,
273,
1408,
4672,
309,
16170,
5286,
422,
1408,
578,
2076,
67,
4385,
422,
1408,
30,
1172,
315,
3589,
30,
18626,
25961,
1230... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
27170,
12,
267,
701,
5286,
273,
23453,
2076,
67,
4385,
273,
1408,
4672,
309,
16170,
5286,
422,
1408,
578,
2076,
67,
4385,
422,
1408,
30,
1172,
315,
3589,
30,
18626,
25961,
1230... |
gLogger.warn("Failed to get MySQL connection",res['Message']) | gLogger.warn( "Failed to get MySQL connection", res['Message'] ) | def __getConnection(self,connection): if connection: return connection res = self._getConnection() if res['OK']: return res['Value'] gLogger.warn("Failed to get MySQL connection",res['Message']) return connection | 9ad007ea503b29694fc081c1646b7c5ecd07b1f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9ad007ea503b29694fc081c1646b7c5ecd07b1f2/TransformationDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
1952,
12,
2890,
16,
4071,
4672,
309,
1459,
30,
327,
1459,
400,
273,
365,
6315,
588,
1952,
1435,
309,
400,
3292,
3141,
3546,
30,
327,
400,
3292,
620,
3546,
314,
3328,
18,
893... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
588,
1952,
12,
2890,
16,
4071,
4672,
309,
1459,
30,
327,
1459,
400,
273,
365,
6315,
588,
1952,
1435,
309,
400,
3292,
3141,
3546,
30,
327,
400,
3292,
620,
3546,
314,
3328,
18,
893... |
sage: region_plot([y>0, x>0, x^2+y^2<1], (-1.1, 1.1), (-1.1, 1.1), plot_points = 400).show(aspect_ratio=1) | sage: region_plot([y>0, x>0, x^2+y^2<1], (x,-1.1, 1.1), (y,-1.1, 1.1), plot_points = 400).show(aspect_ratio=1) | def region_plot(f, xrange, yrange, plot_points, incol, outcol, bordercol, borderstyle, borderwidth): r""" ``region_plot`` takes a boolean function of two variables, `f(x,y)` and plots the region where f is True over the specified ``xrange`` and ``yrange`` as demonstrated below. ``region_plot(f, (xmin, xmax), (ymin, ymax), ...)`` INPUT: - ``f`` -- a boolean function of two variables - ``(xmin, xmax)`` -- 2-tuple, the range of ``x`` values OR 3-tuple ``(x,xmin,xmax)`` - ``(ymin, ymax)`` -- 2-tuple, the range of ``y`` values OR 3-tuple ``(y,ymin,ymax)`` - ``plot_points`` -- integer (default: 100); number of points to plot in each direction of the grid - ``incol`` -- a color (default: ``'blue'``), the color inside the region - ``outcol`` -- a color (default: ``'white'``), the color of the outside of the region If any of these options are specified, the border will be shown as indicated, otherwise it is only implicit (with color ``incol``) as the border of the inside of the region. - ``bordercol`` -- a color (default: ``None``), the color of the border (``'black'`` if ``borderwidth`` or ``borderstyle`` is specified but not ``bordercol``) - ``borderstyle`` -- string (default: 'solid'), one of 'solid', 'dashed', 'dotted', 'dashdot' - ``borderwidth`` -- integer (default: None), the width of the border in pixels EXAMPLES: Here we plot a simple function of two variables:: sage: x,y = var('x,y') sage: region_plot(cos(x^2+y^2) <= 0, (x, -3, 3), (y, -3, 3)) Here we play with the colors:: sage: region_plot(x^2+y^3 < 2, (x, -2, 2), (y, -2, 2), incol='lightblue', bordercol='gray') An even more complicated plot, with dashed borders:: sage: region_plot(sin(x)*sin(y) >= 1/4, (x,-10,10), (y,-10,10), incol='yellow', bordercol='black', borderstyle='dashed', plot_points=250) A disk centered at the origin:: sage: region_plot(x^2+y^2<1, (x,-1,1), (y,-1,1)).show(aspect_ratio=1) A plot with more than one condition:: sage: region_plot([x^2+y^2<1, x<y], (x,-2,2), (y,-2,2)) Since it doesn't look very good, let's increase plot_points:: sage: region_plot([x^2+y^2<1, x<y], (x,-2,2), (y,-2,2), plot_points=400).show(aspect_ratio=1) #long time The first quadrant of the unit circle:: sage: region_plot([y>0, x>0, x^2+y^2<1], (-1.1, 1.1), (-1.1, 1.1), plot_points = 400).show(aspect_ratio=1) Here is another plot, with a huge border:: sage: region_plot(x*(x-1)*(x+1)+y^2<0, (x, -3, 2), (y, -3, 3), incol='lightblue', bordercol='gray', borderwidth=10, plot_points=50) If we want to keep only the region where x is positive:: sage: region_plot([x*(x-1)*(x+1)+y^2<0, x>-1], (x, -3, 2), (y, -3, 3), incol='lightblue', plot_points=50) Here we have a cut circle:: sage: region_plot([x^2+y^2<4, x>-1], (x, -2, 2), (y, -2, 2), incol='lightblue', bordercol='gray', plot_points=200).show(aspect_ratio=1) """ from sage.plot.plot import Graphics from sage.plot.misc import setup_for_eval_on_grid if not isinstance(f, (list, tuple)): f = [f] variables = reduce(lambda g1, g2: g1.union(g2), [set(g.variables()) for g in f], set([])) f = [equify(g, variables) for g in f] g, ranges = setup_for_eval_on_grid(f, [xrange, yrange], plot_points) xrange,yrange=[r[:2] for r in ranges] xy_data_arrays = map(lambda g: [[g(x, y) for x in xsrange(*ranges[0], include_endpoint=True)] for y in xsrange(*ranges[1], include_endpoint=True)], g) xy_data_array = map(lambda *rows: map(lambda *vals: mangle_neg(vals), *rows), *xy_data_arrays) from matplotlib.colors import ListedColormap incol = rgbcolor(incol) outcol = rgbcolor(outcol) cmap = ListedColormap([incol, outcol]) cmap.set_over(outcol) cmap.set_under(incol) g = Graphics() opt = contour_plot.options.copy() opt.pop('plot_points') opt.pop('fill') opt.pop('contours') opt.pop('frame') g.add_primitive(ContourPlot(xy_data_array, xrange,yrange, dict(plot_points=plot_points, contours=[-1e307, 0, 1e307], cmap=cmap, fill=True, **opt))) if bordercol or borderstyle or borderwidth: cmap = [rgbcolor(bordercol)] if bordercol else ['black'] linestyles = [borderstyle] if borderstyle else None linewidths = [borderwidth] if borderwidth else None opt.pop('linestyles') opt.pop('linewidths') g.add_primitive(ContourPlot(xy_data_array, xrange, yrange, dict(plot_points=plot_points, linestyles=linestyles, linewidths=linewidths, contours=[0], cmap=[bordercol], fill=False, **opt))) return g | 2ab3140f4272b6e39d490424279d912b3be528ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/2ab3140f4272b6e39d490424279d912b3be528ce/contour_plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3020,
67,
4032,
12,
74,
16,
12314,
16,
677,
3676,
16,
3207,
67,
4139,
16,
316,
1293,
16,
596,
1293,
16,
5795,
1293,
16,
5795,
4060,
16,
5795,
2819,
4672,
436,
8395,
12176,
6858,
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,
3020,
67,
4032,
12,
74,
16,
12314,
16,
677,
3676,
16,
3207,
67,
4139,
16,
316,
1293,
16,
596,
1293,
16,
5795,
1293,
16,
5795,
4060,
16,
5795,
2819,
4672,
436,
8395,
12176,
6858,
67,
... |
"fixed") | defaultfont) | def get_composefont(): return sqmail.utils.getsetting("composefont", \ "fixed") | e3164923bef42e478fbe8171006582eddf86beed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3083/e3164923bef42e478fbe8171006582eddf86beed/preferences.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
23658,
5776,
13332,
327,
4744,
4408,
18,
5471,
18,
588,
8920,
2932,
23658,
5776,
3113,
521,
805,
5776,
13,
225,
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,
336,
67,
23658,
5776,
13332,
327,
4744,
4408,
18,
5471,
18,
588,
8920,
2932,
23658,
5776,
3113,
521,
805,
5776,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
b.pack(side = LEFT) | b.pack(side=LEFT) | def build_toolbar(self): tbar = self.tbar canvas = self.canvas commands = self.commands label = TLabel(tbar, image = "toolbar_left") label.pack(side = LEFT) | 5bd05aab08ecc99debb8be46af1003105e4183ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3123/5bd05aab08ecc99debb8be46af1003105e4183ab/mainwindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
18849,
12,
2890,
4672,
268,
3215,
273,
365,
18,
88,
3215,
5953,
273,
365,
18,
15424,
4364,
273,
365,
18,
7847,
225,
1433,
273,
399,
2224,
12,
88,
3215,
16,
1316,
273,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
18849,
12,
2890,
4672,
268,
3215,
273,
365,
18,
88,
3215,
5953,
273,
365,
18,
15424,
4364,
273,
365,
18,
7847,
225,
1433,
273,
399,
2224,
12,
88,
3215,
16,
1316,
273,
315,
... |
return instance._getOb(name) | try: return instance._getOb(name) except Exception, msg: raise AttributeError(msg) | def get(self, name, instance, **kwargs): return instance._getOb(name) | 29af56c02507aefb92353cc0dc1c820d9cd68431 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/29af56c02507aefb92353cc0dc1c820d9cd68431/Storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
16,
508,
16,
791,
16,
2826,
4333,
4672,
327,
791,
6315,
588,
10516,
12,
529,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
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,
336,
12,
2890,
16,
508,
16,
791,
16,
2826,
4333,
4672,
327,
791,
6315,
588,
10516,
12,
529,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
@param mecha: the signing mechanism to be used; use MechanismRSAPKCS1 for CKM_RSA_PKCS or an istance of L{Mechanism} if you want specify another mechanism. @type mecha: L{Mechanism} instance or L{MechanismRSAPKCS1} | @param mecha: the signing mechanism to be used @type mecha: L{Mechanism} instance or L{MechanismRSAPKCS1} for L{CKM_RSA_PKCS} | def sign(self, key, data, mecha=MechanismRSAPKCS1): """ C_SignInit/C_Sign @param key: a key handle, obtained calling L{findObjects}. @type key: integer @param data: the data to be signed @type data: (binary) sring or list/tuple of bytes @param mecha: the signing mechanism to be used; use MechanismRSAPKCS1 for CKM_RSA_PKCS or an istance of L{Mechanism} if you want specify another mechanism. @type mecha: L{Mechanism} instance or L{MechanismRSAPKCS1} @return: the computed signature @rtype: list of bytes Remarks: the returned value is an istance of L{LowLevel.ckbytelist}. You can easly convert it to a binary string with:: ''.join(chr(i) for i in ckbytelistSignature) """ m = PyKCS11.LowLevel.CK_MECHANISM() signature = PyKCS11.LowLevel.ckbytelist() ba = None # must be declared here or may be deallocated too early m.mechanism = mecha.mechanism if (mecha.param): ba = PyKCS11.LowLevel.byteArray(len(mecha.param)) if type(mecha.param) is type(''): for c in xrange(len(mecha.param)): ba[c] = ord(mecha.param[c]) else: for c in xrange(len(mecha.param)): ba[c] = mecha.param[c] # with cast() the ba object continue to own internal pointer (avoids a leak). # pParameter is an opaque pointer, never garbage collected. m.pParameter = ba.cast() m.ulParameterLen = len(mecha.param) data1 = PyKCS11.LowLevel.ckbytelist() data1.reserve(len(data)) if type(data) is type(''): for x in data: data1.append(ord(x)) else: for c in xrange(len(data)): data1.append(data[c]) rv = self.lib.C_SignInit(self.session, m, key) if (rv != 0): raise PyKCS11Error(rv) #first call get signature size rv = self.lib.C_Sign(self.session, data1, signature); if (rv != 0): raise PyKCS11Error(rv) #second call get actual signature data rv = self.lib.C_Sign(self.session, data1, signature); if (rv != 0): raise PyKCS11Error(rv) return signature | 2fcad4b0bf8377d18d6bd13bd94a33bf62cc9ba0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6899/2fcad4b0bf8377d18d6bd13bd94a33bf62cc9ba0/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1573,
12,
2890,
16,
498,
16,
501,
16,
1791,
8838,
33,
31546,
13225,
2203,
47,
4596,
21,
4672,
3536,
385,
67,
2766,
2570,
19,
39,
67,
2766,
225,
632,
891,
498,
30,
279,
498,
1640,
16,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1573,
12,
2890,
16,
498,
16,
501,
16,
1791,
8838,
33,
31546,
13225,
2203,
47,
4596,
21,
4672,
3536,
385,
67,
2766,
2570,
19,
39,
67,
2766,
225,
632,
891,
498,
30,
279,
498,
1640,
16,... |
os.path.normpath("web/wsgi_app.py"), | def walk(root='.'): """ A really really scaled down version of what we have in tools.py. """ # initialize result = [] # must have at least root folder try: names = os.listdir(root) except os.error: return result # check each file for name in names: if name == "CVS": continue fullname = os.path.normpath(os.path.join(root, name)) # recursively scan other folders, appending results if os.path.isdir(fullname) and not os.path.islink(fullname): result.append(fullname) result = result + walk(fullname) return result | 9105f4fad55d54e61351af04d91abf731f9e3bfc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11836/9105f4fad55d54e61351af04d91abf731f9e3bfc/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5442,
12,
3085,
2218,
1093,
4672,
3536,
432,
8654,
8654,
12304,
2588,
1177,
434,
4121,
732,
1240,
316,
8513,
18,
2074,
18,
3536,
468,
4046,
563,
273,
5378,
225,
468,
1297,
1240,
622,
452... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5442,
12,
3085,
2218,
1093,
4672,
3536,
432,
8654,
8654,
12304,
2588,
1177,
434,
4121,
732,
1240,
316,
8513,
18,
2074,
18,
3536,
468,
4046,
563,
273,
5378,
225,
468,
1297,
1240,
622,
452... | |
56: Protocol56() | 56: Protocol56(), 23056: Protocol23056() | def version(self): return 56 | 958b97a93873ed9d3eefac5bd6b991220f19f622 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12279/958b97a93873ed9d3eefac5bd6b991220f19f622/protocol.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1177,
12,
2890,
4672,
327,
13850,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1177,
12,
2890,
4672,
327,
13850,
225,
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,
-1... |
def parent(self, t1, node=nullid, rev=-1, **args): if node != hex(nullid): yield self.t(t1, node = node, rev = rev, **args) | def listfilediffs(self, files, changeset): for f in files[:self.maxfiles]: yield self.t("filedifflink", node = hex(changeset), file = f) if len(files) > self.maxfiles: yield self.t("fileellipses") | 1f0be9da0d615b5f174ebc2d81618398601ea608 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/1f0be9da0d615b5f174ebc2d81618398601ea608/hgweb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
768,
11593,
2556,
12,
2890,
16,
1390,
16,
22463,
4672,
364,
284,
316,
1390,
10531,
2890,
18,
1896,
2354,
14542,
2824,
365,
18,
88,
2932,
768,
5413,
1232,
3113,
756,
273,
3827,
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,
666,
768,
11593,
2556,
12,
2890,
16,
1390,
16,
22463,
4672,
364,
284,
316,
1390,
10531,
2890,
18,
1896,
2354,
14542,
2824,
365,
18,
88,
2932,
768,
5413,
1232,
3113,
756,
273,
3827,
12,
... | |
self.log.write("FutureCall scheduled\n") | self.log.write("CallLater scheduled\n") | def OnTest2Start(self, evt): # Call OnTest2Timer one second in the future, passing some # optional arbitrary args. There is no need to hold a # reference to this one, unless we want to manipulate or query # it later like we do in the two methods below self.t2 = wx.FutureCall(1000, self.OnTest2Timer, 'a', 'b', 'c', one=1, two=2) self.log.write("FutureCall scheduled\n") self.t2b2.Enable() | 04f99266b069fa27d2f380070fa8b3456ed1b485 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/04f99266b069fa27d2f380070fa8b3456ed1b485/Timer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
4709,
22,
1685,
12,
2890,
16,
6324,
4672,
468,
3049,
2755,
4709,
22,
6777,
1245,
2205,
316,
326,
3563,
16,
9588,
2690,
468,
3129,
11078,
833,
18,
225,
6149,
353,
1158,
1608,
358,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
4709,
22,
1685,
12,
2890,
16,
6324,
4672,
468,
3049,
2755,
4709,
22,
6777,
1245,
2205,
316,
326,
3563,
16,
9588,
2690,
468,
3129,
11078,
833,
18,
225,
6149,
353,
1158,
1608,
358,
... |
func.WriteCmdHelper(file) | if True: func.WriteCmdHelper(file) | def WriteCmdHelperHeader(self, filename): """Writes the gles2 command helper.""" file = CHeaderWriter(filename) | 8cd62f61b53e532b829b986326755404bbcaf6ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/8cd62f61b53e532b829b986326755404bbcaf6ad/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
5931,
2276,
1864,
12,
2890,
16,
1544,
4672,
3536,
8368,
326,
314,
1040,
22,
1296,
4222,
12123,
585,
273,
385,
1864,
2289,
12,
3459,
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,
0,
0,
0,
0,
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,
5931,
2276,
1864,
12,
2890,
16,
1544,
4672,
3536,
8368,
326,
314,
1040,
22,
1296,
4222,
12123,
585,
273,
385,
1864,
2289,
12,
3459,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
logging.info('Skipped job %s in status %s' % \ | logging.info('Warning: job %s in status %s' % \ | def killTask(self, taskSpecId): """ | 3eed76489bba9847a72ab7ed11c81e6f0da3ca17 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/3eed76489bba9847a72ab7ed11c81e6f0da3ca17/BossLiteKiller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
2174,
12,
2890,
16,
1562,
1990,
548,
4672,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
2174,
12,
2890,
16,
1562,
1990,
548,
4672,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.create_socket(socket.AF_INET, socket.SOCK_STREAM) | self.create_socket(socket.AF_INET, socket.SOCK_STREAM) if os.name == 'posix': self.set_reuse_addr() | def __init__(self, address, handler): asynchat.async_chat.__init__(self) self.address = address self.handler = handler self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.bind(self.address) self.listen(5) | e5f6a1f671c22778c3b6b1bc7b1f369828ca82cb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3782/e5f6a1f671c22778c3b6b1bc7b1f369828ca82cb/FTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1758,
16,
1838,
4672,
487,
2515,
270,
18,
3810,
67,
10880,
16186,
2738,
972,
12,
2890,
13,
365,
18,
2867,
273,
1758,
365,
18,
4176,
273,
1838,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1758,
16,
1838,
4672,
487,
2515,
270,
18,
3810,
67,
10880,
16186,
2738,
972,
12,
2890,
13,
365,
18,
2867,
273,
1758,
365,
18,
4176,
273,
1838,
365,
18,
... |
if self.no_destroy: return True else: gtk.main_quit() return False def set_no_destroy(self, no_destroy): self.no_destroy = no_destroy | return True | def hide(self, widget, arg): self.window.hide() self.stop_button.set_active(False) if self.no_destroy: return True else: gtk.main_quit() return False | 52c802198824c1426f266f7e4f4294735167c5e9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2811/52c802198824c1426f266f7e4f4294735167c5e9/debugui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6853,
12,
2890,
16,
3604,
16,
1501,
4672,
365,
18,
5668,
18,
11248,
1435,
365,
18,
5681,
67,
5391,
18,
542,
67,
3535,
12,
8381,
13,
309,
365,
18,
2135,
67,
11662,
30,
327,
1053,
469,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6853,
12,
2890,
16,
3604,
16,
1501,
4672,
365,
18,
5668,
18,
11248,
1435,
365,
18,
5681,
67,
5391,
18,
542,
67,
3535,
12,
8381,
13,
309,
365,
18,
2135,
67,
11662,
30,
327,
1053,
469,... |
qparmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)="\([^"]*\)\"' '\([\0- ]*[;,]\)?[\0- ]*\)' ), parmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)=\([^\0- ;,\"]*\)' '\([\0- ]*[;,]\)?[\0- ]*\)' ), | qparmre=re.compile( '([\x00- ]*([^\x00- ;,="]+)="([^"]*)"([\x00- ]*[;,])?[\x00- ]*)'), parmre=re.compile( '([\x00- ]*([^\x00- ;,="]+)=([^\x00- ;,"]*)([\x00- ]*[;,])?[\x00- ]*)'), | def parse_cookie(text, result=None, qparmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)="\([^"]*\)\"' '\([\0- ]*[;,]\)?[\0- ]*\)' ), parmre=regex.compile( '\([\0- ]*' '\([^\0- ;,=\"]+\)=\([^\0- ;,\"]*\)' '\([\0- ]*[;,]\)?[\0- ]*\)' ), acquire=parse_cookie_lock.acquire, release=parse_cookie_lock.release, ): if result is None: result={} already_have=result.has_key acquire() try: if qparmre.match(text) >= 0: # Match quoted correct cookies name=qparmre.group(2) value=qparmre.group(3) l=len(qparmre.group(1)) elif parmre.match(text) >= 0: # Match evil MSIE cookies ;) name=parmre.group(2) value=parmre.group(3) l=len(parmre.group(1)) else: # this may be an invalid cookie. # We'll simply bail without raising an error # if the cookie is invalid. return result finally: release() if not already_have(name): result[name]=value return apply(parse_cookie,(text[l:],result)) | 4720da81224eff2e9d087649a90c6dd0c50e39e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/4720da81224eff2e9d087649a90c6dd0c50e39e4/HTTPRequest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
8417,
12,
955,
16,
563,
33,
7036,
16,
1043,
1065,
81,
266,
33,
266,
18,
11100,
12,
296,
14026,
92,
713,
17,
308,
14,
19042,
92,
713,
17,
274,
16,
1546,
7941,
1546,
8178,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
8417,
12,
955,
16,
563,
33,
7036,
16,
1043,
1065,
81,
266,
33,
266,
18,
11100,
12,
296,
14026,
92,
713,
17,
308,
14,
19042,
92,
713,
17,
274,
16,
1546,
7941,
1546,
8178,
... |
(lambda x: dh_roman( x, u'%ser millénaire' ), lambda x: x == 1), (lambda x: dh_roman( v, u'%se millénaire' ), alwaysTrue)]), | (lambda x: dh_roman( x, u'%ser millénaire' ), lambda p: p == 1), (lambda x: dh_roman( x, u'%se millénaire' ), alwaysTrue)]), | def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalToDigits) # Convert return dh_noConv( tmp, u'%d' ) else: raise ValueError("string contains regular digits") | 32e5f5c1a30bc02fc3075b9c456f10fafab05a66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/32e5f5c1a30bc02fc3075b9c456f10fafab05a66/date.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11007,
67,
21112,
5593,
5072,
12,
460,
262,
30,
309,
618,
12,
1132,
13,
353,
509,
30,
468,
6240,
392,
3571,
460,
1368,
279,
25774,
646,
18,
327,
5252,
12,
1132,
2934,
13929,
24899,
211... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11007,
67,
21112,
5593,
5072,
12,
460,
262,
30,
309,
618,
12,
1132,
13,
353,
509,
30,
468,
6240,
392,
3571,
460,
1368,
279,
25774,
646,
18,
327,
5252,
12,
1132,
2934,
13929,
24899,
211... |
title = title[dot + 2:] | title = title[dcolon + 2:] | def process_link(self, env, refnode, has_explicit_title, title, target): refnode['cpp:parent'] = env.temp_data.get('cpp:parent') if not has_explicit_title: target = target.lstrip('~') # only has a meaning for the title # if the first character is a tilde, don't display the module/class # parts of the contents if title[:1] == '~': title = title[1:] dcolon = title.rfind('::') if dcolon != -1: title = title[dot + 2:] return title, target | e2063b0bae99afc3691de845b3f47eb4af543eae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5532/e2063b0bae99afc3691de845b3f47eb4af543eae/cpp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1232,
12,
2890,
16,
1550,
16,
1278,
2159,
16,
711,
67,
16511,
67,
2649,
16,
2077,
16,
1018,
4672,
1278,
2159,
3292,
4057,
84,
30,
2938,
3546,
273,
1550,
18,
5814,
67,
892,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
1232,
12,
2890,
16,
1550,
16,
1278,
2159,
16,
711,
67,
16511,
67,
2649,
16,
2077,
16,
1018,
4672,
1278,
2159,
3292,
4057,
84,
30,
2938,
3546,
273,
1550,
18,
5814,
67,
892,
... |
stream.render(method, doctype=doctype, out=buffer) | stream.render(method, doctype=doctype, out=buffer, encoding="utf-8") | def render_template(self, req, filename, data, content_type=None, fragment=False): """Render the `filename` using the `data` for the context. | ee4b1fe9f881d2dd57084aa51f26be984c899eeb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/ee4b1fe9f881d2dd57084aa51f26be984c899eeb/chrome.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
3202,
12,
2890,
16,
1111,
16,
1544,
16,
501,
16,
913,
67,
723,
33,
7036,
16,
5481,
33,
8381,
4672,
3536,
3420,
326,
1375,
3459,
68,
1450,
326,
1375,
892,
68,
364,
326,
819,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
3202,
12,
2890,
16,
1111,
16,
1544,
16,
501,
16,
913,
67,
723,
33,
7036,
16,
5481,
33,
8381,
4672,
3536,
3420,
326,
1375,
3459,
68,
1450,
326,
1375,
892,
68,
364,
326,
819,... |
if type(typ) in [type(''),type(u'')] and typ[-6:]=='multi': | if type(typ) in [type(''),type(u'')] and typ[-6:]=='-multi': | def asDict(self): """ Represent dataform as simple dictionary mapping of datafield names to their values.""" ret={} for field in self.getTags('field'): name=field.getAttr('var') typ=field.getType() if type(typ) in [type(''),type(u'')] and typ[-6:]=='multi': val=[] for i in field.getTags('value'): val.append(i.getData()) else: val=field.getTagData('value') ret[name]=val if self.getTag('instructions'): ret['instructions']=self.getInstructions() return ret | 70ba9bfc17a0117d36c0612310d09895105ad113 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7194/70ba9bfc17a0117d36c0612310d09895105ad113/protocol.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
487,
5014,
12,
2890,
4672,
3536,
868,
6706,
501,
687,
487,
4143,
3880,
2874,
434,
501,
1518,
1257,
358,
3675,
924,
12123,
325,
12938,
364,
652,
316,
365,
18,
588,
3453,
2668,
1518,
11,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
487,
5014,
12,
2890,
4672,
3536,
868,
6706,
501,
687,
487,
4143,
3880,
2874,
434,
501,
1518,
1257,
358,
3675,
924,
12123,
325,
12938,
364,
652,
316,
365,
18,
588,
3453,
2668,
1518,
11,
... |
GROUP BY related_tagged_item.object_id | GROUP BY %(model_pk)s | def get_related(self, obj, Model, num=None): """ Retrieve instances of ``Model`` which share tags with the model instance ``obj``, ordered by the number of shared tags in descending order. | 66c95ab90d8516e29acb441e828a9de685439c20 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4290/66c95ab90d8516e29acb441e828a9de685439c20/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9243,
12,
2890,
16,
1081,
16,
3164,
16,
818,
33,
7036,
4672,
3536,
10708,
3884,
434,
12176,
1488,
10335,
1492,
7433,
2342,
598,
326,
938,
791,
12176,
2603,
68,
9191,
5901,
635,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9243,
12,
2890,
16,
1081,
16,
3164,
16,
818,
33,
7036,
4672,
3536,
10708,
3884,
434,
12176,
1488,
10335,
1492,
7433,
2342,
598,
326,
938,
791,
12176,
2603,
68,
9191,
5901,
635,
... |
wrapped = textwrap.wrap(value, self.width) | wrapped = self.textwrap(value, self.width) | def handle_body(self, node): """Transform 'body' tags into wrapped text.""" | 0b5bd3bd954b69bfb417c1196a27bb8e7c5ff1c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2680/0b5bd3bd954b69bfb417c1196a27bb8e7c5ff1c2/fshgv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
3432,
12,
2890,
16,
756,
4672,
3536,
4059,
296,
3432,
11,
2342,
1368,
5805,
977,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
3432,
12,
2890,
16,
756,
4672,
3536,
4059,
296,
3432,
11,
2342,
1368,
5805,
977,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
normalPoint = (float(npnt[0]), float(abs(npnt[1])), float(npnt[2])) | normalPoint = (float(npnt[0]), 0.5, float(npnt[2])) | def write_nh_mpqc_esp_plane_rec(f, esp_window, output_dir): nh_home = get_nh_home() cpnt = esp_window.center * 1e-10 centerPoint = (float(cpnt[0]), float(cpnt[1]), float(cpnt[2])) #print "ESP Window CenterPoint =", centerPoint npnt = esp_window.getaxis() * 1e-10 normalPoint = (float(npnt[0]), float(abs(npnt[1])), float(npnt[2])) #print "ESP Window NormalPoint =", normalPoint resolution = esp_window.resolution # print "ESP Window Resolution =", resolution cutoffHeight = esp_window.window_offset * 1e-10 #print "ESP Window cutoffHeight =", cutoffHeight cutoffWidth = esp_window.edge_offset * 1e-10 #print "ESP Window cutoffWidth =", cutoffWidth outputLength = esp_window.width * 1e-10 #print "ESP Window outputLength =", outputLength f.write('\n') f.write(' <calculator name="espWindow" plugin="MPQC_SClib">\n') f.write(' <parameter name="logDirectory" value="%s/log" />\n' % nh_home) f.write(' <parameter name="dataDirectory" value="%s/data/MPQC_SClib" />\n' % nh_home) f.write(' <parameter name="basis" value="STO-3G" />\n') f.write(' <parameter name="method" value="HF" />\n') f.write(' <parameter name="desiredEnergyAccuracy" value="1.0e-3" />\n') f.write(' <parameter name="multiplicity" value="1" />\n') f.write('\n') f.write(' <parameter name="outputType" value="ESPplane" />\n') f.write(' <parameter name="resolution" value="%d" />\n' % resolution) f.write('\n') if 0: f.write(' <parameter name="centerPoint" value="%.1e %.1e %.1e" />\n' % centerPoint) f.write(' <parameter name="normalPoint" value="%1.1e %1.1e %1.1e" />\n' % normalPoint) f.write(' <parameter name="cutoffHeight" value="%1.1e" />\n' % cutoffHeight) f.write(' <parameter name="cutoffWidth" value="%1.1e" />\n' % cutoffWidth) f.write(' <parameter name="outputLength" value="%1.1e" />\n' % outputLength) else: f.write(' <parameter name="centerPoint" value="0 0 0" />\n') f.write(' <parameter name="normalPoint" value="0 1.0e-10 0" />\n') f.write(' <parameter name="cutoffHeight" value="2e-10" />\n') f.write(' <parameter name="cutoffWidth" value="2e-10" />\n') f.write(' <parameter name="outputLength" value="10.0e-10" />\n') f.write(' </calculator>\n') f.write('\n') f.write(' <result name="simResult" plugin="_ESP_Image">\n') f.write(' <parameter name="outputFilename" value="%s\\result.png" />\n' % output_dir) f.write(' </result>\n') | 179d7f9ff9c03bfb1dcc18bdff5063b647a8084c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/179d7f9ff9c03bfb1dcc18bdff5063b647a8084c/files_nh.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
82,
76,
67,
1291,
30675,
67,
281,
84,
67,
21314,
67,
3927,
12,
74,
16,
5001,
84,
67,
5668,
16,
876,
67,
1214,
4672,
225,
24043,
67,
8712,
273,
336,
67,
82,
76,
67,
8712,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
82,
76,
67,
1291,
30675,
67,
281,
84,
67,
21314,
67,
3927,
12,
74,
16,
5001,
84,
67,
5668,
16,
876,
67,
1214,
4672,
225,
24043,
67,
8712,
273,
336,
67,
82,
76,
67,
8712,
... |
c = app.controller | def makeMultiItemContextMenu(templateName, view, selectedItems, clickedID): c = app.controller # easier/shorter to type watched = unwatched = downloaded = downloading = available = uploadable = 0 for i in selectedItems: if i.getState() == 'downloading': downloading += 1 elif i.isDownloaded(): if i.downloader and i.downloader.getState() == 'finished' and i.downloader.getType() == 'bittorrent': uploadable += 1 downloaded += 1 if i.getSeen(): watched += 1 else: unwatched += 1 else: available += 1 items = [] if downloaded > 0: items.append((None, _('%d Downloaded Items') % downloaded)) items.append((lambda: c.playView(view, clickedID), _('Play'))) items.append((c.addToNewPlaylist, _('Add to new playlist'))) if templateName in ('playlist', 'playlist-folder'): label = _('Remove From Playlist') else: label = _('Remove From the Library') items.append((c.removeCurrentItems, label)) if watched: def markAllUnseen(): for item in selectedItems: item.markItemUnseen() items.append((markAllUnseen, _('Mark as Unwatched'))) if unwatched: def markAllSeen(): for item in selectedItems: item.markItemSeen() items.append((markAllSeen, _('Mark as Watched'))) if available > 0: if len(items) > 0: items.append((None, '')) items.append((None, _('%d Available Items') % available)) items.append((app.controller.downloadCurrentItems, _('Download'))) if downloading: if len(items) > 0: items.append((None, '')) items.append((None, _('%d Downloading Items') % downloading)) items.append((app.controller.stopDownloadingCurrentItems, _('Cancel Download'))) items.append((app.controller.pauseDownloadingCurrentItems, _('Pause Download'))) if uploadable > 0: items.append((c.startUploads, _('Restart Upload'))) return makeMenu(items) | 0fa26e28e1fc140dbf354d0b2b639e31c1572992 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/0fa26e28e1fc140dbf354d0b2b639e31c1572992/contextmenu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
5002,
1180,
27315,
12,
3202,
461,
16,
1476,
16,
3170,
3126,
16,
17688,
734,
4672,
468,
15857,
19,
674,
4975,
358,
618,
23135,
273,
640,
7585,
329,
273,
13549,
273,
23742,
273,
2319... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
5002,
1180,
27315,
12,
3202,
461,
16,
1476,
16,
3170,
3126,
16,
17688,
734,
4672,
468,
15857,
19,
674,
4975,
358,
618,
23135,
273,
640,
7585,
329,
273,
13549,
273,
23742,
273,
2319... | |
new_event = self.add_event(self.calendar_service, event.name, event.name, location, event.date_begin, event.date_end) obj_event.write(cr, uid, [event.id], {'google_event_id': new_event.id.text, 'event_modify_date': new_event.updated.text }) tiny_event_dict[event.google_event_id] = event tiny_event_dict[event.google_event_id] = event for i, an_event in enumerate(feed.entry): google_id = an_event.id.text if google_id in tiny_event_dict.keys(): event = tiny_event_dict[google_id] google_up = an_event.updated.text utime = dateutil.parser.parse(google_up) au_dt = au_tz.normalize(utime.astimezone(au_tz)) timestring_update = datetime.datetime(*au_dt.timetuple()[:6]).strftime('%Y-%m-%d %H:%M:%S') google_up = timestring_update tiny_up = event.event_modify_date if event.write_date > google_up: an_event.title.text = event.name an_event.content.text = event.name an_event.where.insert(0, gdata.calendar.Where(value_string=location)) time_format = "%Y-%m-%d %H:%M:%S" timestring = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(time.mktime(time.strptime(event.date_begin, "%Y-%m-%d %H:%M:%S")))) starttime = time.strptime(timestring, time_format) start_time = time.strftime('%Y-%m-%dT%H:%M:%S.000Z', starttime) timestring_end = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(time.mktime(time.strptime(event.date_end, "%Y-%m-%d %H:%M:%S")))) endtime = time.strptime(timestring_end, time_format) end_time = time.strftime('%Y-%m-%dT%H:%M:%S.000Z', endtime) if an_event and not an_event.when: summary_dict['Error in Event While try to modify in Google'] += 1 else: an_event.when[0].start_time = start_time an_event.when[0].end_time = end_time update_event = self.calendar_service.UpdateEvent(an_event.GetEditLink().href, an_event) summary_dict['Event Modified In Google'] += 1 elif event.write_date < google_up: utime = dateutil.parser.parse(an_event.updated.text) au_dt = au_tz.normalize(utime.astimezone(au_tz)) timestring_update = datetime.datetime(*au_dt.timetuple()[:6]).strftime('%Y-%m-%d %H:%M:%S') name_event = an_event.title.text or '' if an_event and not an_event.when: x = an_event.recurrence.text.split(';') status = x[2].split('=')[-1:] and x[2].split('=')[-1:][0] or '' status_day = x[3].split('=') byday = '' if status_day and status_day[0] == 'BYDAY': byday = status_day[1] repeat_status = _get_repeat_status(self, status, byday) repeat_start, repeat_end = _get_repeat_dates(self, x) timestring = time.strptime(repeat_start, "%Y-%m-%d %H:%M:%S").strftime('%Y-%m-%d %H:%M:%S') timestring_end = time.strptime(repeat_end, "%Y-%m-%d %H:%M:%S").strftime('%Y-%m-%d %H:%M:%S') else: repeat_status = 'norepeat' stime = an_event.when[0].start_time etime = an_event.when[0].end_time stime = dateutil.parser.parse(stime) etime = dateutil.parser.parse(etime) try: au_dt = au_tz.normalize(stime.astimezone(au_tz)) timestring = datetime.datetime(*au_dt.timetuple()[:6]).strftime('%Y-%m-%d %H:%M:%S') au_dt = au_tz.normalize(etime.astimezone(au_tz)) timestring_end = datetime.datetime(*au_dt.timetuple()[:6]).strftime('%Y-%m-%d %H:%M:%S') except : timestring = datetime.datetime(*stime.timetuple()[:6]).strftime('%Y-%m-%d %H:%M:%S') timestring_end = datetime.datetime(*etime.timetuple()[:6]).strftime('%Y-%m-%d %H:%M:%S') val = { 'name': name_event, 'date_begin': timestring, 'date_end': timestring_end, 'event_modify_date': timestring_update, 'repeat_status': repeat_status or 'norepeat' } obj_event.write(cr, uid, [event.id], val) summary_dict['Event Modified In Tiny'] += 1 elif event.write_date == google_up: pass else: google_id = an_event.id.text | an_event.when[0].start_time = start_time an_event.when[0].end_time = end_time update_event = self.calendar_service.UpdateEvent(an_event.GetEditLink().href, an_event) summary_dict['Event Modified In Google'] += 1 elif event.write_date < google_up: | def _synch_events(self, cr, uid, data, context={}): | 33a8a1659c1a6ea88ab2a4e6c956f844bdf16a7d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/33a8a1659c1a6ea88ab2a4e6c956f844bdf16a7d/synchronize_events.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
87,
2515,
67,
5989,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
12938,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
87,
2515,
67,
5989,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
12938,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return print "Converting now git to hg repos." for (repo, dirname, maxchanges) in gitrepos: src = grepodir + "/" + dirname + ".git" dst = hgrepo + "/" + dirname mapfile = src + "-mapfile" if not os.path.isdir(dst): makeDirs(dst) os.system("cd %s && hg init" % dst) writeFile(mapfile, []) os.system("/usr/share/doc/mercurial-0.7/convert-repo " + src + " " + \ dst + " " + mapfile) data = ["[paths]\ndefault = %s\n" % repo, "[web]\ndescription = mirror from %s\n" % repo] if maxchanges: data.append("maxchanges = %d\n" % maxchanges) writeFile(dst + "/.hg/hgrc", data) print "Done." | def updateGitMirrors(verbose): if not os.path.isdir(grepodir): print "No directory", grepodir, "is setup." return #return # The following is all disabled: print "Downloading from git mirrors." for (repo, dirname, maxchanges) in gitrepos: if verbose > 2: print repo d = grepodir + "/" + dirname if repo.startswith("rsync://"): os.system("rsync -rltqvH --delete " + repo + "/ " + d + ".git") else: if not os.path.isdir(d + ".git"): os.system("git clone -q " + repo + " " + d) os.rename(d + "/.git", d + ".git") os.system("rmdir " + d) os.system("cd %s && GIT_DIR=%s git-pull" % (grepodir, d + ".git")) writeFile(d + ".git/description", ["mirror from " + repo + "\n"]) return # The following is all disabled: print "Converting now git to hg repos." for (repo, dirname, maxchanges) in gitrepos: src = grepodir + "/" + dirname + ".git" dst = hgrepo + "/" + dirname mapfile = src + "-mapfile" if not os.path.isdir(dst): makeDirs(dst) os.system("cd %s && hg init" % dst) writeFile(mapfile, []) os.system("/usr/share/doc/mercurial-0.7/convert-repo " + src + " " + \ dst + " " + mapfile) data = ["[paths]\ndefault = %s\n" % repo, "[web]\ndescription = mirror from %s\n" % repo] if maxchanges: data.append("maxchanges = %d\n" % maxchanges) writeFile(dst + "/.hg/hgrc", data) print "Done." | 5af1a9ab2d3fc26ec4980dbba8ae98a457986a26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/5af1a9ab2d3fc26ec4980dbba8ae98a457986a26/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
11540,
49,
27026,
12,
11369,
4672,
309,
486,
1140,
18,
803,
18,
291,
1214,
12,
11556,
7832,
481,
4672,
1172,
315,
2279,
1867,
3113,
5174,
7832,
481,
16,
315,
291,
3875,
1199,
327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
11540,
49,
27026,
12,
11369,
4672,
309,
486,
1140,
18,
803,
18,
291,
1214,
12,
11556,
7832,
481,
4672,
1172,
315,
2279,
1867,
3113,
5174,
7832,
481,
16,
315,
291,
3875,
1199,
327,
... | |
el2 = etree.SubElement(el1, 'style:footer') | el2 = SubElement(el1, 'style:footer') | def add_header_footer(self, content): if len(self.header_content) > 0 or len(self.footer_content) > 0: root_el = etree.fromstring(content) path = '{%s}master-styles' % (NAME_SPACE_1, ) master_el = root_el.find(path) if not master_el: return content el1 = etree.SubElement(master_el, 'style:master-page', attrib={ 'style:name': 'Standard', 'style:page-layout-name': 'pm1', }) if len(self.header_content) > 0: el2 = etree.SubElement(el1, 'style:header') for el in self.header_content: el.attrib['text:style-name'] = 'rststyle-header' el2.append(el) if len(self.footer_content) > 0: el2 = etree.SubElement(el1, 'style:footer') for el in self.footer_content: el.attrib['text:style-name'] = 'rststyle-footer' el2.append(el) new_tree = etree.ElementTree(root_el) new_content = ToString(new_tree) return new_content else: return content | ff5e4f0a960dc872d240ae9d03fa81f22e3cbcce /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5620/ff5e4f0a960dc872d240ae9d03fa81f22e3cbcce/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
3374,
67,
14723,
12,
2890,
16,
913,
4672,
309,
562,
12,
2890,
18,
3374,
67,
1745,
13,
405,
374,
578,
562,
12,
2890,
18,
14723,
67,
1745,
13,
405,
374,
30,
1365,
67,
292,
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,
527,
67,
3374,
67,
14723,
12,
2890,
16,
913,
4672,
309,
562,
12,
2890,
18,
3374,
67,
1745,
13,
405,
374,
578,
562,
12,
2890,
18,
14723,
67,
1745,
13,
405,
374,
30,
1365,
67,
292,
2... |
_helper(pid, signal.SIGKILL, wait) | _helper(pid, signal.SIGKILL, waitpid) | def _helper(pid, signal_, wait): """Simple helper to encapsulate the kill/waitpid sequence""" os.kill(pid, signal_) if wait: try: os.waitpid(pid, os.WNOHANG) except OSError: pass | e1bd00725bf942a2b7cf10acf46ec3bab2456aed /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/e1bd00725bf942a2b7cf10acf46ec3bab2456aed/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4759,
12,
6610,
16,
4277,
67,
16,
2529,
4672,
3536,
5784,
4222,
358,
22106,
6243,
326,
8673,
19,
7048,
6610,
3102,
8395,
1140,
18,
16418,
12,
6610,
16,
4277,
67,
13,
309,
2529,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4759,
12,
6610,
16,
4277,
67,
16,
2529,
4672,
3536,
5784,
4222,
358,
22106,
6243,
326,
8673,
19,
7048,
6610,
3102,
8395,
1140,
18,
16418,
12,
6610,
16,
4277,
67,
13,
309,
2529,
30... |
print 'seq despues operac: ',seq | def procesar_producto(self, cr, uid, ids, prod_id, Dict, loc_ids, inter_loc_ids, prod_loc_ids, pending=False): ''' Concepto de prueba de Humberto Arocha para procesamiento recursivo de de stock card line ''' rpp_obj = self.pool.get('report.profit.picking') sc_line_obj = self.pool.get('stock.card.line') product = Dict[prod_id] sml_x_pd_id = product['sml'] no_cump = product['no_cump'] total = product['total'] avg = product['avg'] qda = product['qda'] cont = product['cont'] seq = product['seq'] def_code = self.pool.get('product.product').browse(cr,uid,prod_id).default_code.strip() if pending: print '@'*10 print 'procesando: ',self.pool.get('product.product').browse(cr,uid,prod_id).name #~ time.sleep(10) while sml_x_pd_id: sml_id = sml_x_pd_id.pop(0) value={} if not cont: cont = True q = 0.0 subtotal = 0.0 qda = 0.0 #se debe buscar el costo inicial cr.execute('SELECT standard_price,product_qty FROM lst_cost ' \ 'WHERE default_code=%s', (def_code,)) res = cr.fetchall() if res and res[0][1]: print 'encontre costo inicccc' avg,q = res[0] else: rpp = rpp_obj.browse(cr,uid,sml_id) if rpp.location_dest_id.id == loc_ids and rpp.invoice_id.type == 'in_invoice': q = rpp.picking_qty print 'cantidad inicialxxxxx: ',q avg = rpp.invoice_price_unit else: no_cump.append(sml_id) continue #avg = 1430.96 #q = 5.0 print 'cantidad inicial: ',q print 'costo inicial: ',avg total = avg*q subtotal = avg*q qda = q seq += 1 value = { 'subtotal':subtotal, 'total':total, 'avg':avg, 'stk_bef_cor':0.0, 'stk_aft_cor':qda, 'sequence':seq } scl_id = sc_line_obj.search(cr, uid, [('stk_mov_id','=',sml_id)]) sc_line_obj.write(cr, uid, scl_id, value) print 'q inicial: ',q print 'avg: ',avg print 'qda inicial: ',qda print 'seq inicial: ',seq else: rpp = rpp_obj.browse(cr,uid,sml_id) q = rpp.picking_qty scl_id = sc_line_obj.search(cr, uid, [('stk_mov_id','=',sml_id)]) scl = sc_line_obj.browse(cr,uid,scl_id)[0] print 'viene operac: ',sml_id print 'packing: ',rpp.picking_id.name print 'seq antes operac: ',seq #VENTA if rpp.location_id.id == loc_ids and rpp.invoice_id.type == 'out_invoice': print 'validando VENTA:' qda,total,avg,no_cump,seq= \ self.validate_venta(cr, uid, ids,scl,q,total,avg,qda,no_cump,sml_x_pd_id,sml_id,seq) print 'seq despues operac: ',seq #NC COMPRA if rpp.location_id.id == loc_ids and (rpp.invoice_id.type == 'in_refund' or rpp.invoice_id.type == 'in_invoice'): print 'validando NC compra:' qda,total,avg,no_cump,seq= \ self.validate_nc_compra(cr,uid,ids,scl,q,total,avg,qda,no_cump,sml_x_pd_id,sml_id,seq) print 'seq despues operac: ',seq #COMPRA if rpp.location_dest_id.id == loc_ids and rpp.invoice_id.type == 'in_invoice': print 'procesooo compra:' q_bef = qda qda,subtotal,total,avg = self.compute_compra(cr, uid, ids,scl,q,total,avg,qda) #REALIZAR EL WRITE DE LA LINEA value = { 'subtotal':subtotal, 'total':total, 'avg':avg, 'stk_bef_cor':q_bef, 'stk_aft_cor':qda } seq=self.write_data(cr, uid, ids, scl.id, value, seq) print 'seq despues operac: ',seq if no_cump: print 'agregando nuevamente las vta:' #no_cump.append(sml_id) no_cump.extend(sml_x_pd_id) print 'no cumplioooo: ',no_cump sml_x_pd_id = no_cump print 'nueva listaaa: ',sml_x_pd_id no_cump = [] #NC VENTA if rpp.location_dest_id.id == loc_ids and rpp.invoice_id.type == 'out_refund': print 'validando NC VENTA:' qda,total,avg,no_cump,seq= \ self.validate_nc_vta(cr, uid, ids,scl,q,total,avg,qda,no_cump,sml_x_pd_id,sml_id,seq) print 'seq despues operac: ',seq if no_cump and not scl.parent_id: print 'agregando nuevamente los movimientos:' #no_cump.append(sml_id) no_cump.extend(sml_x_pd_id) print 'no cumplioooo: ',no_cump sml_x_pd_id = no_cump print 'nueva listaaa: ',sml_x_pd_id no_cump = [] #DESTINO USO INTERNO if rpp.location_id.id == loc_ids and rpp.location_dest_id.id == inter_loc_ids: print 'validando USO INTERNO:' #fixme blanquear la variables de cuenta #acc_src = None #acc_dest = None qda,total,avg,no_cump,seq= \ self.validate_venta(cr, uid, ids,scl,q,total,avg,qda,no_cump,sml_x_pd_id,sml_id,seq) print 'seq despues operac: ',seq valores = {} if not (rpp.aml_cost_id or rpp.aml_inv_id): move = scl.stk_mov_id acc_src = move.product_id.product_tmpl_id.\ property_stock_account_output.id if move.location_dest_id.account_id: acc_dest = move.location_dest_id.account_id.id acc_mov_id = self.write_aml(cr, uid, ids, scl, q, avg, acc_src, acc_dest) acc_mov_obj = self.pool.get('account.move').browse(cr,uid,acc_mov_id) for aml in acc_mov_obj.line_id: valores.update({ 'aml_cost_qty':aml.quantity or 0.0, 'aml_cost_price_unit':avg, 'aml_inv_qty':aml.quantity or 0.0, 'aml_inv_price_unit':avg}) if aml.debit: valores.update({'aml_cost_id':aml.id}) if aml.credit: valores.update({'aml_inv_id':aml.id}) sc_line_obj.write(cr, uid, scl.id, valores) #~ else: #~ id1=scl.aml_cost_id.id #~ id2=scl.aml_inv_id.id #~ if not scl.aml_cost_id.credit: #~ valores.update({'aml_cost_id':id2, 'aml_inv_id':id1}) #~ sc_line_obj.write(cr, uid, scl.id, valores) #~ #DESTINO PROCESAMIENTO if rpp.location_id.id == loc_ids and rpp.location_dest_id.id == prod_loc_ids: print 'validando PROCESAMIENTO:' #fixme blanquear la variables de cuenta #acc_src = None #acc_dest = None qda,total,avg,no_cump,seq= \ self.validate_venta(cr, uid, ids,scl,q,total,avg,qda,no_cump,sml_x_pd_id,sml_id,seq) print 'seq despues operac: ',seq valores = {} if not (rpp.aml_cost_id or rpp.aml_inv_id): move = scl.stk_mov_id acc_src = move.product_id.product_tmpl_id.\ property_stock_account_output.id if move.location_dest_id.account_id: acc_dest = move.location_dest_id.account_id.id | 62ca858ba796453e95db5d16001d237fb203c2e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7359/62ca858ba796453e95db5d16001d237fb203c2e9/stock_card.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
450,
764,
297,
67,
5896,
83,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
10791,
67,
350,
16,
9696,
16,
1515,
67,
2232,
16,
1554,
67,
1829,
67,
2232,
16,
10791,
67,
1829,
67,
2232,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
450,
764,
297,
67,
5896,
83,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
10791,
67,
350,
16,
9696,
16,
1515,
67,
2232,
16,
1554,
67,
1829,
67,
2232,
16,
10791,
67,
1829,
67,
2232,
... | |
name=socket.gethostbyaddr(socket.gethostname())[0] | name=socket.gethostbyaddr(socket.gethostname())[0] | def helo(self, name=''): """ SMTP 'helo' command. Hostname to send for this command defaults to the FQDN of the local host """ name=string.strip(name) if len(name)==0: name=socket.gethostbyaddr(socket.gethostname())[0] self.putcmd("helo",name) (code,msg)=self.getreply() self.helo_resp=msg return code | a7d9bdfab61551ed16efc55c1b6c37268c2d9832 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a7d9bdfab61551ed16efc55c1b6c37268c2d9832/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13150,
83,
12,
2890,
16,
508,
2218,
11,
4672,
3536,
18102,
296,
76,
24214,
11,
1296,
18,
17423,
358,
1366,
364,
333,
1296,
3467,
358,
326,
23127,
8609,
434,
326,
1191,
1479,
3536,
508,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13150,
83,
12,
2890,
16,
508,
2218,
11,
4672,
3536,
18102,
296,
76,
24214,
11,
1296,
18,
17423,
358,
1366,
364,
333,
1296,
3467,
358,
326,
23127,
8609,
434,
326,
1191,
1479,
3536,
508,
... |
LocalSimulator.resetNetwork(self,randomize) | LocalSimulator.resetNetwork(self,randomize,saveWeights) | def resetNetwork(self,randomize=False): java.lang.System.out.println('resetting') self.model=self._model_class() self.model.run(limit=0) LocalSimulator.resetNetwork(self,randomize) | a3a31c96cff3935aab05a88b34a28cb54e30f1ae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9336/a3a31c96cff3935aab05a88b34a28cb54e30f1ae/nengo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
3906,
12,
2890,
16,
9188,
554,
33,
8381,
4672,
2252,
18,
4936,
18,
3163,
18,
659,
18,
8222,
2668,
6208,
1787,
6134,
365,
18,
2284,
33,
2890,
6315,
2284,
67,
1106,
1435,
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,
2715,
3906,
12,
2890,
16,
9188,
554,
33,
8381,
4672,
2252,
18,
4936,
18,
3163,
18,
659,
18,
8222,
2668,
6208,
1787,
6134,
365,
18,
2284,
33,
2890,
6315,
2284,
67,
1106,
1435,
365,
18,
... |
c = sys.stdin.read(1) if echo: sys.stdout.write(c) | c = os.read(fd, 1) if echo: sys.stdout.write(c); sys.stdout.flush() | def getkey(): #~ c = os.read(fd, 1) c = sys.stdin.read(1) if echo: sys.stdout.write(c) return c | 43ed8d124fc817e2324f834bb35827b23900a6b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10955/43ed8d124fc817e2324f834bb35827b23900a6b4/miniterm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
856,
13332,
468,
98,
276,
273,
1140,
18,
896,
12,
8313,
16,
404,
13,
71,
273,
1140,
18,
896,
12,
8313,
16,
404,
13,
225,
309,
3376,
30,
2589,
18,
10283,
18,
2626,
12,
71,
1769... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
856,
13332,
468,
98,
276,
273,
1140,
18,
896,
12,
8313,
16,
404,
13,
71,
273,
1140,
18,
896,
12,
8313,
16,
404,
13,
225,
309,
3376,
30,
2589,
18,
10283,
18,
2626,
12,
71,
1769... |
'assertion': lambda result:result.startswith('v1: bass')} | 'assertion': lambda result:result.find('bass') > -1} | def __call__(self, value, instance, field, *args, **kwargs): return self.fun(value) | dae1201ee61f0c7e53e551856b384042cd2ab3a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/dae1201ee61f0c7e53e551856b384042cd2ab3a4/test_fieldvalidation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
460,
16,
791,
16,
652,
16,
380,
1968,
16,
2826,
4333,
4672,
327,
365,
18,
12125,
12,
1132,
13,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
460,
16,
791,
16,
652,
16,
380,
1968,
16,
2826,
4333,
4672,
327,
365,
18,
12125,
12,
1132,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if not line or line.strip().startswith(' | if not line.strip() or line.strip().startswith(' | def run(self, options, args): if args: filename = args[0] else: filename = '-' requirement = options.requirement find_links = options.find_links or [] ## FIXME: Obviously this should be settable: find_tags = False | 21538bc2c8e80ce600cd608d55e1df6812a2b94a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12982/21538bc2c8e80ce600cd608d55e1df6812a2b94a/pip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
702,
16,
833,
4672,
309,
833,
30,
1544,
273,
833,
63,
20,
65,
469,
30,
1544,
273,
4014,
12405,
273,
702,
18,
30848,
1104,
67,
7135,
273,
702,
18,
4720,
67,
7135,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
702,
16,
833,
4672,
309,
833,
30,
1544,
273,
833,
63,
20,
65,
469,
30,
1544,
273,
4014,
12405,
273,
702,
18,
30848,
1104,
67,
7135,
273,
702,
18,
4720,
67,
7135,
... |
else: | else: | def bio_edit_user_program(request, founduser, foundprogram, external=False): """ Edits a teacher bio, given user and program """ if founduser is None: if external: raise ESPError(), 'No user given.' else: raise Http404 if not founduser.isTeacher(): raise ESPError(False), '%s is not a teacher of ESP.' % \ (founduser.name()) if request.user.id != founduser.id and request.user.is_staff != True: raise ESPError(False), 'You are not authorized to edit this biography.' lastbio = TeacherBio.getLastBio(founduser) # if we submitted a newly edited bio... from esp.web.forms.bioedit_form import BioEditForm if request.method == 'POST' and request.POST.has_key('bio_submitted'): form = BioEditForm(request.POST, request.FILES) if form.is_valid(): if foundprogram is not None: # get the last bio for this program. progbio = TeacherBio.getLastForProgram(founduser, foundprogram) else: progbio = lastbio # the slug bio and bio progbio.slugbio = form.cleaned_data['slugbio'] progbio.bio = form.cleaned_data['bio'] progbio.save() # save the image if form.cleaned_data['picture'] is not None: progbio.picture = form.cleaned_data['picture'] else: progbio.picture = lastbio.picture progbio.save() if external: return True return HttpResponseRedirect(progbio.url()) else: formdata = {'slugbio': lastbio.slugbio, 'bio': lastbio.bio, 'picture': lastbio.picture} form = BioEditForm(formdata) return render_to_response('users/teacherbioedit.html', request, GetNode('Q/Web/myesp'), {'form': form, 'user': founduser, 'picture_file': lastbio.picture}) | e5a41a4b01e30beaacfcc8be02aa0bf20f75d513 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12041/e5a41a4b01e30beaacfcc8be02aa0bf20f75d513/bio.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25091,
67,
4619,
67,
1355,
67,
12890,
12,
2293,
16,
1392,
1355,
16,
1392,
12890,
16,
3903,
33,
8381,
4672,
3536,
6651,
1282,
279,
6489,
27779,
25091,
16,
864,
729,
471,
5402,
3536,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25091,
67,
4619,
67,
1355,
67,
12890,
12,
2293,
16,
1392,
1355,
16,
1392,
12890,
16,
3903,
33,
8381,
4672,
3536,
6651,
1282,
279,
6489,
27779,
25091,
16,
864,
729,
471,
5402,
3536,
225,
... |
msng_cl_lst, bases, heads = cl.nodesbetween(basenodes, headnodes) | msng_cl_lst, bases, heads = cl.nodesbetween(bases, heads) | def changegroupsubset(self, bases, heads): cl = self.changelog # msng = missing msng_cl_lst, bases, heads = cl.nodesbetween(basenodes, headnodes) junk = None knownheads = {} for n in basenodes: for p in cl.parents(n): if p != nullid: knownheads[p] = 1 knownheads = knownheads.keys() has_cl_set, junk, junk = cl.nodesbetween(None, knownheads) has_cl_set = dict.fromkeys(hasnodeset) | 327718049ff93cf9846602faa93d2f1091a61712 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/327718049ff93cf9846602faa93d2f1091a61712/localrepo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
1655,
15657,
12,
2890,
16,
8337,
16,
22742,
4672,
927,
273,
365,
18,
24083,
12970,
468,
4086,
3368,
273,
3315,
4086,
3368,
67,
830,
67,
16923,
16,
8337,
16,
22742,
273,
927,
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,
2549,
1655,
15657,
12,
2890,
16,
8337,
16,
22742,
4672,
927,
273,
365,
18,
24083,
12970,
468,
4086,
3368,
273,
3315,
4086,
3368,
67,
830,
67,
16923,
16,
8337,
16,
22742,
273,
927,
18,
... |
"""Check if an element eists between the end of the active | """Check if an element exists between the end of the active | def elementInActiveFormattingElements(self, name): """Check if an element eists between the end of the active formatting elements and the last marker. If it does, return it, else return false""" | 8bba3576f693fe36a77f0bcdc248cfe7c5a6dbde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9368/8bba3576f693fe36a77f0bcdc248cfe7c5a6dbde/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
930,
382,
3896,
23974,
3471,
12,
2890,
16,
508,
4672,
3536,
1564,
309,
392,
930,
1704,
3086,
326,
679,
434,
326,
2695,
10407,
2186,
471,
326,
1142,
5373,
18,
971,
518,
1552,
16,
327,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
930,
382,
3896,
23974,
3471,
12,
2890,
16,
508,
4672,
3536,
1564,
309,
392,
930,
1704,
3086,
326,
679,
434,
326,
2695,
10407,
2186,
471,
326,
1142,
5373,
18,
971,
518,
1552,
16,
327,
5... |
def intialize(self): | def initialize(self): | def intialize(self): self.results = [] | 7eadbfbc4d53ff8aba5a8816309281fb6724f54d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/7eadbfbc4d53ff8aba5a8816309281fb6724f54d/dbench.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
4672,
365,
18,
4717,
273,
5378,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
4672,
365,
18,
4717,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
".//pre/a[@href='grammar-token-try1_stmt']/tt/span": 'try1_stmt', | ".//pre/a[@href=' | def teardown_module(): (test_root / '_build').rmtree(True) | 631ccfa3b574374445d4404fd13de5c9ac3c7edc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5532/631ccfa3b574374445d4404fd13de5c9ac3c7edc/test_build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28196,
67,
2978,
13332,
261,
3813,
67,
3085,
342,
2070,
3510,
16063,
86,
17371,
12,
5510,
13,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28196,
67,
2978,
13332,
261,
3813,
67,
3085,
342,
2070,
3510,
16063,
86,
17371,
12,
5510,
13,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
item = items[randint(0,6)] | item = items[randint(0,5)] | def create_skeletonpart(self, op): retops = Message() newloc=self.location.copy() newloc.velocity=Vector3D(0,0,0) items = ['skull', 'ribcage', 'arm', 'pelvis', 'thigh', 'shin'] item = items[randint(0,6)] newloc.coordinates = newloc.coordinates + Vector3D(uniform(-1,1), uniform(-1,1), uniform(-1,1)) retops = retops + Operation("create", Entity(name=item,parents=[item],location=newloc.copy()), to=self) return retops | 97c2218c15ff02f53cbe83f9e410684bd82008fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12932/97c2218c15ff02f53cbe83f9e410684bd82008fb/Gravestone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
7771,
12143,
2680,
12,
2890,
16,
1061,
4672,
325,
4473,
273,
2350,
1435,
394,
1829,
33,
2890,
18,
3562,
18,
3530,
1435,
394,
1829,
18,
29418,
560,
33,
5018,
23,
40,
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,
752,
67,
7771,
12143,
2680,
12,
2890,
16,
1061,
4672,
325,
4473,
273,
2350,
1435,
394,
1829,
33,
2890,
18,
3562,
18,
3530,
1435,
394,
1829,
18,
29418,
560,
33,
5018,
23,
40,
12,
20,
... |
if line.find('openmpi'): where = 0 | def parse_builds(bp, fname): global numwarn ostr = '' try: for line in open(fname): error = warning = 0 where = line.find('error:') if where > 0: error = 1 #elif config.config(bp.name,'Build'): else: where = line.find('warning:') # things to ignore if line.find('openmpi'): where = 0 if where > 0: warning = 1 if error or warning: if error: ostr += "<Error>\n" else: ostr += "<Warning>\n" ostr += "\t<Text>%s</Text>\n" % cgi.escape(line) file, lnum = parse_line(line[0:where]) # fixme. could fix up path here if file is not absolute ostr += "\t<SourceFile>%s</SourceFile>\n" % file ostr += "\t<SourceLineNumber>%s</SourceLineNumber>\n" % lnum ostr += "<PreContext></PreContext><PostContext></PostContext><RepeatCount>0</RepeatCount><BuildLogLine>0</BuildLogLine>\n" if error: ostr += "</Error>\n" else: ostr += "</Warning>\n" except: pass return ostr | 67122884091229c101258b597a93be717cfa6a07 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5963/67122884091229c101258b597a93be717cfa6a07/cdash.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
27324,
12,
17152,
16,
5299,
4672,
2552,
818,
8935,
320,
701,
273,
875,
775,
30,
364,
980,
316,
1696,
12,
12749,
4672,
555,
273,
3436,
273,
374,
1625,
273,
980,
18,
4720,
2668... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
27324,
12,
17152,
16,
5299,
4672,
2552,
818,
8935,
320,
701,
273,
875,
775,
30,
364,
980,
316,
1696,
12,
12749,
4672,
555,
273,
3436,
273,
374,
1625,
273,
980,
18,
4720,
2668... | |
"bisect": (bisect_run, [], "hg bisect [help|init|reset|next|good|bad]"), | "bisect": (bisect_run, [], "hg bisect [help|init|reset|next|good|bad]"), | def help_(cmd=None, *args): """show help for a given bisect subcommand or all subcommands""" cmdtable = bisectcmdtable if cmd: doc = cmdtable[cmd][0].__doc__ synopsis = cmdtable[cmd][2] ui.write(synopsis + "\n") ui.write("\n" + doc + "\n") return ui.write("list of subcommands for the bisect extension\n\n") cmds = cmdtable.keys() cmds.sort() m = max([len(c) for c in cmds]) for cmd in cmds: doc = cmdtable[cmd][0].__doc__.splitlines(0)[0].rstrip() ui.write(" %-*s %s\n" % (m, cmd, doc)) | b4ab31727f97a0a4cd80eb884d0060e3e4da3485 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/b4ab31727f97a0a4cd80eb884d0060e3e4da3485/hbisect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2809,
67,
12,
4172,
33,
7036,
16,
380,
1968,
4672,
3536,
4500,
2809,
364,
279,
864,
27031,
18856,
578,
777,
23648,
8395,
1797,
2121,
273,
27031,
4172,
2121,
309,
1797,
30,
997,
273,
1797... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2809,
67,
12,
4172,
33,
7036,
16,
380,
1968,
4672,
3536,
4500,
2809,
364,
279,
864,
27031,
18856,
578,
777,
23648,
8395,
1797,
2121,
273,
27031,
4172,
2121,
309,
1797,
30,
997,
273,
1797... |
if not self.ec2_url: self.ec2_url = self.environ['EC2_URL'] if not self.ec2_url: self.ec2_url = \ | if not self.url: self.url = self.environ['EC2_URL'] if not self.url: self.url = \ | def make_connection(self): if not self.ec2_user_access_key: self.ec2_user_access_key = self.environ['EC2_ACCESS_KEY'] if not self.ec2_user_access_key: print 'EC2_ACCESS_KEY environment variable must be set.' raise ConnectionFailed | a12a64b1a029d43a86b59fd430318d27918f5918 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12707/a12a64b1a029d43a86b59fd430318d27918f5918/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
4071,
12,
2890,
4672,
309,
486,
365,
18,
557,
22,
67,
1355,
67,
3860,
67,
856,
30,
365,
18,
557,
22,
67,
1355,
67,
3860,
67,
856,
273,
365,
18,
28684,
3292,
7228,
22,
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,
1221,
67,
4071,
12,
2890,
4672,
309,
486,
365,
18,
557,
22,
67,
1355,
67,
3860,
67,
856,
30,
365,
18,
557,
22,
67,
1355,
67,
3860,
67,
856,
273,
365,
18,
28684,
3292,
7228,
22,
67,... |
self.tasks_number=0 | def __init__(self): BackgroundTask.__init__(self) self.tasks = [] self.running = False self.tasks_number=0 self.tasks_current=0 | a41e757a9e615ab7e5e7abbfd7863edced34e942 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2369/a41e757a9e615ab7e5e7abbfd7863edced34e942/soundconverter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
8977,
2174,
16186,
2738,
972,
12,
2890,
13,
365,
18,
9416,
273,
5378,
365,
18,
8704,
273,
1083,
365,
18,
9416,
67,
2972,
33,
20,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
8977,
2174,
16186,
2738,
972,
12,
2890,
13,
365,
18,
9416,
273,
5378,
365,
18,
8704,
273,
1083,
365,
18,
9416,
67,
2972,
33,
20,
2,
-100,
-100,
-100,
... | |
raise "\nERROR: Invalid Tree Item. " | raise Exception("\nERROR: Invalid Tree Item. ") | def IsItemChecked(self, item): """Returns whether an item is checked or not.""" | e1463b9df091ad0e9d76292564d4389882b28de1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/e1463b9df091ad0e9d76292564d4389882b28de1/customtreectrl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2585,
1180,
11454,
12,
2890,
16,
761,
4672,
3536,
1356,
2856,
392,
761,
353,
5950,
578,
486,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2585,
1180,
11454,
12,
2890,
16,
761,
4672,
3536,
1356,
2856,
392,
761,
353,
5950,
578,
486,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
@property def isBlog(self): context = self.context return bool(IBlogView.providedBy(self) or IBlogEntryView.providedBy(self)) | def __call__(self): blogutils = getUtility(IBlogUtils,name='izug.blog.utils') context = aq_inner(self.context).aq_explicit req = context.REQUEST #hide the green contentmenu-bar req.set('disable_border',1) querystring = context.REQUEST.get('QUERY_STRING','') querystring = querystring and '?' + querystring or querystring | be00a706bd319107e1be712a86f112b30bf8de90 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11901/be00a706bd319107e1be712a86f112b30bf8de90/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
4672,
10700,
5471,
273,
336,
6497,
12,
13450,
1330,
1989,
16,
529,
2218,
452,
637,
18,
11439,
18,
5471,
6134,
819,
273,
279,
85,
67,
7872,
12,
2890,
18,
2472... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1991,
972,
12,
2890,
4672,
10700,
5471,
273,
336,
6497,
12,
13450,
1330,
1989,
16,
529,
2218,
452,
637,
18,
11439,
18,
5471,
6134,
819,
273,
279,
85,
67,
7872,
12,
2890,
18,
2472... | |
pval = (1-distributions.norm.cdf(abs(z)))*2.0 | pval = distributions.norm.sf(abs(z)) * 2.0 | def ansari(x,y): """Determine if the scale parameter for two distributions with equal medians is the same using the Ansari-Bradley statistic. Specifically, compute the AB statistic and the probability of error that the null hypothesis is true but rejected with the computed statistic as the critical value. One can reject the null hypothesis that the ratio of variances is 1 if returned probability of error is small (say < 0.05) """ x,y = asarray(x),asarray(y) n = len(x) m = len(y) if (m < 1): raise ValueError, "Not enough other observations." if (n < 1): raise ValueError, "Not enough test observations." N = m+n xy = r_[x,y] # combine rank = stats.rankdata(xy) symrank = amin(array((rank,N-rank+1)),0) AB = sum(symrank[:n],axis=0) uxy = unique(xy) repeats = (len(uxy) != len(xy)) exact = ((m<55) and (n<55) and not repeats) if repeats and ((m < 55) or (n < 55)): warnings.warn("Ties preclude use of exact statistic.") if exact: astart, a1, ifault = statlib.gscale(n,m) ind = AB-astart total = sum(a1,axis=0) if ind < len(a1)/2.0: cind = int(ceil(ind)) if (ind == cind): pval = 2.0*sum(a1[:cind+1],axis=0)/total else: pval = 2.0*sum(a1[:cind],axis=0)/total else: find = int(floor(ind)) if (ind == floor(ind)): pval = 2.0*sum(a1[find:],axis=0)/total else: pval = 2.0*sum(a1[find+1:],axis=0)/total return AB, min(1.0,pval) # otherwise compute normal approximation if N % 2: # N odd mnAB = n*(N+1.0)**2 / 4.0 / N varAB = n*m*(N+1.0)*(3+N**2)/(48.0*N**2) else: mnAB = n*(N+2.0)/4.0 varAB = m*n*(N+2)*(N-2.0)/48/(N-1.0) if repeats: # adjust variance estimates # compute sum(tj * rj**2,axis=0) fac = sum(symrank**2,axis=0) if N % 2: # N odd varAB = m*n*(16*N*fac-(N+1)**4)/(16.0 * N**2 * (N-1)) else: # N even varAB = m*n*(16*fac-N*(N+2)**2)/(16.0 * N * (N-1)) z = (AB - mnAB)/sqrt(varAB) pval = (1-distributions.norm.cdf(abs(z)))*2.0 return AB, pval | 4d58b41516a50d5156e29a63e4ef92d12ab9e9f5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12971/4d58b41516a50d5156e29a63e4ef92d12ab9e9f5/morestats.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4152,
12954,
12,
92,
16,
93,
4672,
3536,
8519,
309,
326,
3159,
1569,
364,
2795,
23296,
598,
3959,
6735,
19657,
353,
326,
1967,
1450,
326,
1922,
87,
12954,
17,
38,
6012,
30678,
21605,
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,
4152,
12954,
12,
92,
16,
93,
4672,
3536,
8519,
309,
326,
3159,
1569,
364,
2795,
23296,
598,
3959,
6735,
19657,
353,
326,
1967,
1450,
326,
1922,
87,
12954,
17,
38,
6012,
30678,
21605,
18,... |
for filename in filenames: yield os.path.join(dirpath, filename) | for filename in filenames: yield os.path.join(dirpath, filename) | def children_in_directory(top, list_directories = False): """Iterate files and, optionally, subdirectories in directory""" for (dirpath, dirnames, filenames) in os.walk(top, topdown=False): if list_directories: for dirname in dirnames: yield os.path.join(dirpath, dirname) for filename in filenames: yield os.path.join(dirpath, filename) | b5ea0a19ce3fa94b5f70786a6fe401d33cf34e2c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7853/b5ea0a19ce3fa94b5f70786a6fe401d33cf34e2c/FileUtilities.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2325,
67,
267,
67,
5149,
12,
3669,
16,
666,
67,
15121,
273,
1083,
4672,
3536,
14916,
1390,
471,
16,
8771,
16,
31220,
316,
1867,
8395,
364,
261,
1214,
803,
16,
1577,
1973,
16,
9066,
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,
2325,
67,
267,
67,
5149,
12,
3669,
16,
666,
67,
15121,
273,
1083,
4672,
3536,
14916,
1390,
471,
16,
8771,
16,
31220,
316,
1867,
8395,
364,
261,
1214,
803,
16,
1577,
1973,
16,
9066,
13,... |
planned_out = False | planned_out = False | def create_planning(self,cr, uid, ids, context={}): product_obj = self.pool.get('product.product') planning_obj=self.pool.get('stock.planning') mod_obj =self.pool.get('ir.model.data') for f in self.browse(cr, uid, ids, context=context): if f.forecasted_products: cr.execute("SELECT product_id \ FROM stock_sale_forecast \ WHERE (period_id = %s) AND (warehouse_id = %s)", (f.period_id2.id, f.warehouse_id2.id)) products_id1 = [x for x, in cr.fetchall()] else: prod_categ_obj=self.pool.get('product.category') template_obj=self.pool.get('product.template') categ_ids = f.product_categ_id2.id and [f.product_categ_id2.id] or [] prod_categ_ids=prod_categ_obj.search(cr,uid,[('parent_id','child_of',categ_ids)]) templates_ids = template_obj.search(cr,uid,[('categ_id','in',prod_categ_ids)]) products_id1 = product_obj.search(cr,uid,[('product_tmpl_id','in',templates_ids)]) if len(products_id1)==0: raise osv.except_osv(_('Error !'), _('No forecasts for selected period or no products in selected category !')) | 6a21b5d661b74602c870fac41f3c8c42e8bc6c33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6a21b5d661b74602c870fac41f3c8c42e8bc6c33/stock_planning.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
412,
10903,
12,
2890,
16,
3353,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
3017,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
5896,
18,
5896,
6134,
886,
10903,
67,
2603,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
412,
10903,
12,
2890,
16,
3353,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
3017,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
5896,
18,
5896,
6134,
886,
10903,
67,
2603,
33,
... |
image1 : {dictionary} | image1 : {nd_array} | def multires_registration(image1, image2, imdata, lite, smhist, method, opt_method): """ x = multires_registration(image1, image2, imdata, lite, smhist, method, opt_method) to be called by python_coreg() which optionally does 3D image filtering and provies timing for registration. Parameters ---------- image1 : {dictionary} image1 is the source image to be remapped during the registration. it is a dictionary with the data as an ndarray in the ['data'] component. image2 : {dictionary} image2 is the reference image that image1 gets mapped to. imdata : {dictionary} image sampling and optimization information. lite : {integer} lite of 1 is to jitter both images during resampling. 0 is to not jitter. jittering is for non-aliased volumes. smhist: {integer} flag for joint histogram low pass filtering. 0 for no filter, 1 for do filter. method: {'nmi', 'mi', 'ncc', 'ecc'} flag for type of registration metric. nmi is normalized mutual information; mi is mutual information; ecc is entropy cross correlation; ncc is normalized cross correlation. opt_method: {'powell', 'hybrid'} registration is two pass. Pass 1 is low res to get close to alignment and pass 2 starts at the pass 1 optimal alignment. In powell pass 1 and 2 are powell, in hybrid pass 2 is conjugate gradient. Returns ------- x : {nd_array} this is the optimal alignment (6-dim) array with 3 angles and 3 translations. Examples -------- (calling this from python_coreg which optionally filters image2) >>> import numpy as NP >>> import _registration as reg >>> image1, image2, imdata = reg.demo_MRI_volume_align() >>> parm_vector = python_coreg(image1, image2, imdata) """ ret_histo=0 # zero out the start parameter; but this may be set to large values # if the head is out of range and well off the optimal alignment skirt imdata['parms'][0:5] = 0.0 # make the step a scalar to can put in a multi-res loop loop = range(imdata['sample'].size) x = imdata['parms'] for i in loop: step = imdata['sample'][i] imdata['step'][:] = step optfunc_args = (image1, image2, imdata['step'], imdata['fwhm'], lite, smhist, method, ret_histo) p_args = (optfunc_args,) if opt_method=='powell': print 'POWELL multi-res registration step size ', step print 'vector ', x x = fmin_powell(optimize_function, x, args=p_args, callback=callback_powell) elif opt_method=='cg': print 'CG multi-res registration step size ', step print 'vector ', x x = fmin_cg(optimize_function, x, args=p_args, callback=callback_cg) elif opt_method=='hybrid': if i==0: print 'Hybrid POWELL multi-res registration step size ', step print 'vector ', x lite = 0 optfunc_args = (image1, image2, imdata['step'], imdata['fwhm'], lite, smhist, method, ret_histo) p_args = (optfunc_args,) x = fmin_powell(optimize_function, x, args=p_args, callback=callback_powell) elif i==1: print 'Hybrid CG multi-res registration step size ', step print 'vector ', x lite = 1 optfunc_args = (image1, image2, imdata['step'], imdata['fwhm'], lite, smhist, method, ret_histo) p_args = (optfunc_args,) x = fmin_cg(optimize_function, x, args=p_args, callback=callback_cg) return x | a0a06507bdbd3322039b726463a7cc1c63e59774 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12971/a0a06507bdbd3322039b726463a7cc1c63e59774/_registration.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1778,
2814,
67,
14170,
12,
2730,
21,
16,
1316,
22,
16,
709,
892,
16,
328,
1137,
16,
3029,
11488,
16,
707,
16,
2153,
67,
2039,
4672,
3536,
619,
273,
1778,
2814,
67,
14170,
12,
2730,
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,
1778,
2814,
67,
14170,
12,
2730,
21,
16,
1316,
22,
16,
709,
892,
16,
328,
1137,
16,
3029,
11488,
16,
707,
16,
2153,
67,
2039,
4672,
3536,
619,
273,
1778,
2814,
67,
14170,
12,
2730,
2... |
except: groups=None try: roles=object.__roles__ except: pass except: try: | else: groups=None if hasattr(object,'__roles__'): roles=object.__roles__ else: if hasattr(module,'web_objects'): | def get_module_info(self, server_name, module_name, module): | 6e60c63abb35f639b7efc369be01caf096484aa1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/6e60c63abb35f639b7efc369be01caf096484aa1/Publish.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2978,
67,
1376,
12,
2890,
16,
1438,
67,
529,
16,
1605,
67,
529,
16,
1605,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2978,
67,
1376,
12,
2890,
16,
1438,
67,
529,
16,
1605,
67,
529,
16,
1605,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
return super(StringIO, self).tell()//2 | return super(StringIO, self).tell()//self.charsize | def tell(self): return super(StringIO, self).tell()//2 | 4540b95add4ed46c4b3627954a5524baa0151301 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/4540b95add4ed46c4b3627954a5524baa0151301/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9276,
12,
2890,
4672,
327,
2240,
12,
780,
4294,
16,
365,
2934,
88,
1165,
1435,
759,
22,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9276,
12,
2890,
4672,
327,
2240,
12,
780,
4294,
16,
365,
2934,
88,
1165,
1435,
759,
22,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
try: | if names is not None: | def acquire(self, names, timeout=None, shared=0, test_notify=None): """Acquire a set of resource locks. | 76e2f08a6221b83a9203987c254140916aa9c838 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/76e2f08a6221b83a9203987c254140916aa9c838/locking.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10533,
12,
2890,
16,
1257,
16,
2021,
33,
7036,
16,
5116,
33,
20,
16,
1842,
67,
12336,
33,
7036,
4672,
3536,
27761,
279,
444,
434,
1058,
13046,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10533,
12,
2890,
16,
1257,
16,
2021,
33,
7036,
16,
5116,
33,
20,
16,
1842,
67,
12336,
33,
7036,
4672,
3536,
27761,
279,
444,
434,
1058,
13046,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100... |
(addr_port ^ value ^ quoted ^ meta_value) + | pyp.Optional(addr_port ^ value ^ quoted ^ meta_value) + | def _GetShowParser(cls): """Return a parser for `drbd show` output. | 63012024b067a5de9391854f1bcd0f5d64c38b42 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/63012024b067a5de9391854f1bcd0f5d64c38b42/bdev.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
967,
5706,
2678,
12,
6429,
4672,
3536,
990,
279,
2082,
364,
1375,
3069,
16410,
2405,
68,
876,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
967,
5706,
2678,
12,
6429,
4672,
3536,
990,
279,
2082,
364,
1375,
3069,
16410,
2405,
68,
876,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
''' get all variables that are available form workflow and not handled yet. ''' | """Get all variables that are available from the workflow and not handled yet. """ | def getWorkflowVariables(self): ''' get all variables that are available form workflow and not handled yet. ''' wf_vars = self.getAvailableVarIds() if self.var_values is None: return wf_vars ret = [] for vid in wf_vars: if not self.var_values.has_key(vid): ret.append(vid) return ret | 5e0af64cf3211c0187684bc75a3a6a665ab16b8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/5e0af64cf3211c0187684bc75a3a6a665ab16b8f/States.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30995,
6158,
12,
2890,
4672,
3536,
967,
777,
3152,
716,
854,
2319,
628,
326,
6095,
471,
486,
7681,
4671,
18,
3536,
11578,
67,
4699,
273,
365,
18,
588,
5268,
1537,
2673,
1435,
309,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30995,
6158,
12,
2890,
4672,
3536,
967,
777,
3152,
716,
854,
2319,
628,
326,
6095,
471,
486,
7681,
4671,
18,
3536,
11578,
67,
4699,
273,
365,
18,
588,
5268,
1537,
2673,
1435,
309,
365,
... |
if file_dir == this_script_dir: | if file_dir.startswith(this_script_dir): | def handle_error(self, wrapper, exception, traceback_): try: stack = wrapper.stack_where_defined except AttributeError: print >> sys.stderr, "??:??: %s / %r" % (wrapper, exception) else: stack = list(stack) stack.reverse() for (filename, line_number, function_name, text) in stack: file_dir = os.path.dirname(os.path.abspath(filename)) if file_dir == this_script_dir: print >> sys.stderr, "%s:%i: %r" % (os.path.join("..", "bindings", "python", os.path.basename(filename)), line_number, exception) break return True | 3fd4ca4e114576eeb23d2904d523a64ff75784d1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12851/3fd4ca4e114576eeb23d2904d523a64ff75784d1/ns3modulegen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1636,
12,
2890,
16,
4053,
16,
1520,
16,
10820,
67,
4672,
775,
30,
2110,
273,
4053,
18,
3772,
67,
6051,
67,
2178,
1335,
6394,
30,
1172,
1671,
2589,
18,
11241,
16,
315,
14646,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1636,
12,
2890,
16,
4053,
16,
1520,
16,
10820,
67,
4672,
775,
30,
2110,
273,
4053,
18,
3772,
67,
6051,
67,
2178,
1335,
6394,
30,
1172,
1671,
2589,
18,
11241,
16,
315,
14646,
... |
pass | if (self.zoneId): return self.zoneId else: return 0 | def getComponentL(self): pass | bdd673f0627d3a622d2df716aa1039d71a19a39f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8543/bdd673f0627d3a622d2df716aa1039d71a19a39f/DistributedSmoothNodeAI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10322,
48,
12,
2890,
4672,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
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,
10322,
48,
12,
2890,
4672,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
createDir(basedir) | try: createDir(basedir) except: if not os.path.exists(basedir): raise | def DetectLatestCMakeBuilds(basedir, baseurl, vdir): url = ''.join([baseurl, "/", vdir, "/?C=M;O=D"]) filename = ''.join([basedir, "/CMake_", vdir, ".html"]) createDir(basedir) print "Querying " + url + "..." proxies = None # if None, use proxy from env var http_proxy if not options.httpProxy == "": proxies = {'http': options.httpProxy} opener = urllib.FancyURLopener(proxies=proxies) opener.retrieve(url, filename) print "Detecting ..." lines = [] regex = re.compile( "href.*cmake-[0-9.]+(-rc[0-9]+)*-(Darwin-universal.tar.gz|Linux-i386.tar.gz|win32-x86.zip)" ) f = open(filename) alllines = f.readlines() for line in alllines: if regex.search(line): lines.append(line) count = 0 found = 0 version_iterator = "" versionRegEx = re.compile(r'.*-([0-9.]+-rc[0-9]+|[0-9.]+)-.*') dateRegEx = re.compile(r'^[0-9].[0-9].([0-9.]+-rc[0-9]+|[0-9.]+)$') hrefRegEx = re.compile(r'^.*href="([^"]+)".*$') for line in lines: version = versionRegEx.match(line).group(1) if version == "" or version == line: print "error: line does not match version extraction regex" print " line: [" + line + "]" exit(1) date = dateRegEx.match(version).group(1) # l, m, w == found an installer for Linux, Mac, Windows respectively # When encountering a new version, reset back to zeroes... # if(version_iterator != version): version_iterator = version l = 0 m = 0 w = 0 lhref = "" mhref = "" whref = "" href = hrefRegEx.match(line).group(1) if re.search('Linux', line) != None: lhref = href l = 1 elif re.search('Darwin', line) != None: mhref = href m = 1 elif re.search('win32', line) != None: whref = href w = 1 else: print "error: unexpected non-matching line" exit(1) count = count + 1 if l == 1 and m == 1 and w == 1: found = 1 print "Detected latest available CMake " + vdir + " build: " + version break if not found: print "error: could not find a " + vdir + " version with all 3 platforms available" return () return (('linux2', lhref, version), ('darwin', mhref, version), ('win32', whref, version)) | 2ad906783b8f473844958f09bc393447e024ccf2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1130/2ad906783b8f473844958f09bc393447e024ccf2/download-cmake.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13796,
18650,
39,
6464,
7746,
12,
31722,
16,
25427,
16,
331,
1214,
4672,
880,
273,
875,
18,
5701,
3816,
1969,
718,
16,
2206,
3113,
331,
1214,
16,
2206,
35,
39,
33,
49,
31,
51,
33,
40... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13796,
18650,
39,
6464,
7746,
12,
31722,
16,
25427,
16,
331,
1214,
4672,
880,
273,
875,
18,
5701,
3816,
1969,
718,
16,
2206,
3113,
331,
1214,
16,
2206,
35,
39,
33,
49,
31,
51,
33,
40... |
def search(node, found=None, register=False, level=0): | def search(node, found=None, register=False, level=0, other_bound=None): | def search(node, found=None, register=False, level=0): if found == None: found = [] if node.type == "function": if register: name = node.get("name", False) if respect(name, found): found.append(name) openedAt = len(found) register = True # e.g. func(name1, name2); elif register and node.type == "variable" and node.hasChildren() and len(node.children) == 1: if node.parent.type == "params" and node.parent.parent.type != "call": first = node.getFirstChild() if first.type == "identifier": name = first.get("name") if respect(name, found): found.append(name) # e.g. var name1, name2 = "foo"; elif register and node.type == "definition": name = node.get("identifier", False) if respect(name, found): found.append(name) # Iterate over children if node.hasChildren(): if node.type == "function": for child in node.children: search(child, found, register, level+1) else: for child in node.children: search(child, found, register, level) # Function closed if node.type == "function": if level==0: # Generate translation list translations = mapper(found) # Start replacement when get back to first level update(node, translations) # Afterwards the function is closed and we can clean- # up the found variables del found[openedAt:] | c966e9351d91734883c66b2ccf1e37035052eb13 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/c966e9351d91734883c66b2ccf1e37035052eb13/variableoptimizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2159,
16,
1392,
33,
7036,
16,
1744,
33,
8381,
16,
1801,
33,
20,
16,
1308,
67,
3653,
33,
7036,
4672,
309,
1392,
422,
599,
30,
1392,
273,
5378,
225,
309,
756,
18,
723,
422,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2159,
16,
1392,
33,
7036,
16,
1744,
33,
8381,
16,
1801,
33,
20,
16,
1308,
67,
3653,
33,
7036,
4672,
309,
1392,
422,
599,
30,
1392,
273,
5378,
225,
309,
756,
18,
723,
422,
... |
newopt += "-o %s " % value | newopt += "-o %s " % value.replace('"','') | def printvars(self, sections): if sections[0] == 'all': sections = self.config.sections() | 8438476238c21705cfa6068f6a9fd3fadb8c5b03 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/189/8438476238c21705cfa6068f6a9fd3fadb8c5b03/configsdiparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
4699,
12,
2890,
16,
7178,
4672,
309,
7178,
63,
20,
65,
422,
296,
454,
4278,
7178,
273,
365,
18,
1425,
18,
11657,
1435,
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,
1172,
4699,
12,
2890,
16,
7178,
4672,
309,
7178,
63,
20,
65,
422,
296,
454,
4278,
7178,
273,
365,
18,
1425,
18,
11657,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
'charset=UTF-8">\n', | 'charset=UTF-8">\n' | def record(self): self.recordfile(self.output, self.destination) | 83f10f89b61d5351be68869072ef3f7700752cfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/83f10f89b61d5351be68869072ef3f7700752cfb/html4css1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1409,
12,
2890,
4672,
365,
18,
3366,
768,
12,
2890,
18,
2844,
16,
365,
18,
10590,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1409,
12,
2890,
4672,
365,
18,
3366,
768,
12,
2890,
18,
2844,
16,
365,
18,
10590,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
pattern = join(self.packageResourceFolder, pat) | pattern = join(self.resourceFolder, pat) | def _addResources(self): "Add Welcome/ReadMe/License files, .lproj folders and scripts." | 9428c10ace2561d7e95b339d8627931d772c6212 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/9428c10ace2561d7e95b339d8627931d772c6212/buildpkg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
3805,
12,
2890,
4672,
315,
986,
678,
16312,
19,
1994,
4667,
19,
13211,
1390,
16,
263,
80,
17995,
9907,
471,
8873,
1199,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
3805,
12,
2890,
4672,
315,
986,
678,
16312,
19,
1994,
4667,
19,
13211,
1390,
16,
263,
80,
17995,
9907,
471,
8873,
1199,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if extract and len(devinode.keys()): | if extract and devinode.keys(): | def readPayload(self, func, filenames=None, extract=None): self.__openFd(96 + self.sigdatasize + self.hdrdatasize) devinode = {} # this will contain possibly hardlinked files filenamehash = {} # full filename of all files if filenames == None: filenames = self.getFilenames() if filenames: fileinfo = zip(filenames, self["fileflags"], self["filemodes"], self["filemtimes"], self["filedevices"], self["fileinodes"], self["fileusername"], self["filegroupname"], self["filerdevs"], self["filelinktos"], self["filemd5s"], xrange(len(self["fileinodes"]))) for (fn, flag, mode, mtime, dev, inode, user, group, rdev, linkto, md5sum, i) in fileinfo: if flag & (RPMFILE_GHOST | RPMFILE_EXCLUDE): continue filenamehash[fn] = fileinfo[i] if S_ISREG(mode): devinode.setdefault((dev, inode, md5sum), []).append(i) for di in devinode.keys(): if len(devinode[di]) <= 1: del devinode[di] # sanity check hardlinks if self.verify: for hardlinks in devinode.values(): j = hardlinks[0] mode = self["filemodes"][j] mtime = self["filemtimes"][j] size = self["filesizes"][j] for j in hardlinks[1:]: # dev/inode/md5sum are already guaranteed to be the same if self["filemodes"][j] != mode: self.printErr("modes differ for hardlink") if self["filemtimes"][j] != mtime: self.printErr("mtimes differ for hardlink") if self["filesizes"][j] != size: self.printErr("sizes differ for hardlink") cpiosize = self.sig.getOne("payloadsize") archivesize = self.hdr.getOne("archivesize") if archivesize != None: if cpiosize == None: cpiosize = archivesize elif cpiosize != archivesize: self.printErr("wrong archive size") size_in_sig = self.sig.getOne("size_in_sig") if size_in_sig != None: size_in_sig -= self.hdrdatasize if self["payloadcompressor"] in [None, "gzip"]: if size_in_sig != None and size_in_sig >= 8: size_in_sig -= 8 fd = PyGZIP(self.filename, self.fd, cpiosize, size_in_sig) #fd = gzip.GzipFile(fileobj=self.fd) elif self["payloadcompressor"] == "bzip2": import bz2, cStringIO if size_in_sig != None: payload = self.fd.read(size_in_sig) else: payload = self.fd.read() fd = cStringIO.StringIO(bz2.decompress(payload)) else: self.printErr("unknown payload compression") return if self["payloadformat"] not in [None, "cpio"]: self.printErr("unknown payload format") return c = CPIO(self.filename, fd, self.issrc, cpiosize) if c.readCpio(func, filenamehash, devinode, filenames, extract) == None: pass # error output is already done else: for filename in filenamehash.iterkeys(): self.printErr("file not in cpio: %s" % filename) if extract and len(devinode.keys()): self.printErr("hardlinked files remain from cpio") del c, fd self.closeFd() | f728062394d146a49b4554ad764c9bfacddf1565 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/f728062394d146a49b4554ad764c9bfacddf1565/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
6110,
12,
2890,
16,
1326,
16,
9066,
33,
7036,
16,
2608,
33,
7036,
4672,
365,
16186,
3190,
27263,
12,
10525,
397,
365,
18,
7340,
13178,
554,
397,
365,
18,
16587,
13178,
554,
13,
44... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
6110,
12,
2890,
16,
1326,
16,
9066,
33,
7036,
16,
2608,
33,
7036,
4672,
365,
16186,
3190,
27263,
12,
10525,
397,
365,
18,
7340,
13178,
554,
397,
365,
18,
16587,
13178,
554,
13,
44... |
updated = False | def updateRateAndETA(self,length): now = clock() updated = False self.currentSize = self.currentSize + length if self.lastUpdated < now - self.UPDATE_CLIENT_INTERVAL: self.blockTimes.append((now, self.currentSize)) #Only keep the last 100 packets if len(self.blockTimes)>100: self.blockTimes.pop(0) updated = True self.lastUpdated = now if updated: self.updateClient() | b4a40ffd0c80903294d330ba38f0ce0c351918bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12354/b4a40ffd0c80903294d330ba38f0ce0c351918bf/download.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
4727,
1876,
31370,
12,
2890,
16,
2469,
4672,
2037,
273,
7268,
1435,
365,
18,
2972,
1225,
273,
365,
18,
2972,
1225,
397,
769,
309,
365,
18,
2722,
7381,
411,
2037,
300,
365,
18,
82... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4727,
1876,
31370,
12,
2890,
16,
2469,
4672,
2037,
273,
7268,
1435,
365,
18,
2972,
1225,
273,
365,
18,
2972,
1225,
397,
769,
309,
365,
18,
2722,
7381,
411,
2037,
300,
365,
18,
82... | |
if self.settings.match_case != self.stc.locals.case_sensitive_search: | if hasattr(self.stc, 'locals') and self.settings.match_case != self.stc.locals.case_sensitive_search: | def getFlags(self, user_flags=0): if self.settings.match_case != self.stc.locals.case_sensitive_search: self.settings.match_case = self.stc.locals.case_sensitive_search self.setFlags() flags = self.flags | user_flags try: self.regex = re.compile(self.settings.find, flags) except re.error: self.regex = None return flags | c563b173d1e3b8606098eab79f078e692b7b0531 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11522/c563b173d1e3b8606098eab79f078e692b7b0531/find_replace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
5094,
12,
2890,
16,
729,
67,
7133,
33,
20,
4672,
309,
3859,
12,
2890,
18,
334,
71,
16,
296,
17977,
6134,
471,
365,
18,
4272,
18,
1916,
67,
3593,
480,
365,
18,
334,
71,
18,
179... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5094,
12,
2890,
16,
729,
67,
7133,
33,
20,
4672,
309,
3859,
12,
2890,
18,
334,
71,
16,
296,
17977,
6134,
471,
365,
18,
4272,
18,
1916,
67,
3593,
480,
365,
18,
334,
71,
18,
179... |
img = self._make_color_image(colors, self.bounds[perpendicular_dim], self.orientation, self.direction) | img = self._make_color_image(colors, self.bounds[perpendicular_dim], self.orientation, self.direction) | def _draw_plot(self, gc, view_bounds=None, mode='normal'): """ Draws the 'plot' layer. """ self._update_mappers() gc.save_state() if self.orientation == 'h': perpendicular_dim = 1 axis_dim = 0 else: perpendicular_dim = 0 axis_dim = 1 mapper = self.index_mapper low = mapper.range.low high = mapper.range.high if high == low: data_points = array([high]) else: data_points = arange(low, high, (high-low)/self.bounds[axis_dim]) if self.direction == 'flipped': data_points = data_points[::-1] colors = self.color_mapper.map_screen(data_points) img = self._make_color_image(colors, self.bounds[perpendicular_dim], self.orientation, self.direction) try: gc.draw_image(img, (self.x, self.y, self.width, self.height)) finally: gc.restore_state() | 50202d54ec99758f7624d15b52094be86c326484 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13167/50202d54ec99758f7624d15b52094be86c326484/color_bar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9446,
67,
4032,
12,
2890,
16,
8859,
16,
1476,
67,
10576,
33,
7036,
16,
1965,
2218,
6130,
11,
4672,
3536,
10184,
87,
326,
296,
4032,
11,
3018,
18,
3536,
365,
6315,
2725,
67,
1458,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9446,
67,
4032,
12,
2890,
16,
8859,
16,
1476,
67,
10576,
33,
7036,
16,
1965,
2218,
6130,
11,
4672,
3536,
10184,
87,
326,
296,
4032,
11,
3018,
18,
3536,
365,
6315,
2725,
67,
1458,
... |
for i in range(self.width_divisions + 1): step_y = self.height / self.height_divisions * i | for i in range(self.height_divisions + 1): step_y = y_step_size * i | def _subcommands(self): ul_x = self.xabsolute - self.reference_point[0] * self.width bl_x = ul_x ur_x = ul_x + self.width | 57112323562412e7b59dc2fabbda72bc93ea4d0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3716/57112323562412e7b59dc2fabbda72bc93ea4d0c/grid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1717,
7847,
12,
2890,
4672,
7493,
67,
92,
273,
365,
18,
92,
12547,
300,
365,
18,
6180,
67,
1153,
63,
20,
65,
380,
365,
18,
2819,
2811,
67,
92,
273,
7493,
67,
92,
8896,
67,
92,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1717,
7847,
12,
2890,
4672,
7493,
67,
92,
273,
365,
18,
92,
12547,
300,
365,
18,
6180,
67,
1153,
63,
20,
65,
380,
365,
18,
2819,
2811,
67,
92,
273,
7493,
67,
92,
8896,
67,
92,... |
def removeVisualStudioPlatformFiles(self): toRemove = [] for file in self._includedFiles: if file.lower().startswith('c:\\program files\\microsoft platform sdk\\include\\'): toRemove.append(file) for file in toRemove: self._includedFiles.remove(file) | def removeVisualStudioPlatformFiles(self): toRemove = [] for file in self._includedFiles: if file.lower().startswith('c:\\program files\\microsoft platform sdk\\include\\'): toRemove.append(file) for file in toRemove: self._includedFiles.remove(file) | def removeVisualStudioPlatformFiles(self): toRemove = [] for file in self._includedFiles: if file.lower().startswith('c:\\program files\\microsoft platform sdk\\include\\'): toRemove.append(file) for file in toRemove: self._includedFiles.remove(file) | cad7e4a6c0d7a6482cfae7cc459e0ba42b3d27f1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5344/cad7e4a6c0d7a6482cfae7cc459e0ba42b3d27f1/IncludeFileDependencyAnalyzer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
25780,
510,
4484,
8201,
2697,
12,
2890,
4672,
23511,
273,
5378,
364,
585,
316,
365,
6315,
20405,
2697,
30,
309,
585,
18,
8167,
7675,
17514,
1918,
2668,
71,
31027,
12890,
1390,
1695,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
25780,
510,
4484,
8201,
2697,
12,
2890,
4672,
23511,
273,
5378,
364,
585,
316,
365,
6315,
20405,
2697,
30,
309,
585,
18,
8167,
7675,
17514,
1918,
2668,
71,
31027,
12890,
1390,
1695,
... |
if nameInput[j] in connector.obj.inputPorts: del connector.obj.inputPorts[nameInput[j]] | if nameInput[0] in connector.obj.inputPorts: del connector.obj.inputPorts[nameInput[0]] | def create_constant(value): """Creates a Constant module.""" | e7e12a40944658690255521071a05ea5c145269d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6341/e7e12a40944658690255521071a05ea5c145269d/controlflow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
14384,
12,
1132,
4672,
3536,
2729,
279,
10551,
1605,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
14384,
12,
1132,
4672,
3536,
2729,
279,
10551,
1605,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
writeQuickStub(f, attr, setterName, isSetter=True) | writeQuickStub(f, customMethodCalls, attr, setterName, isSetter=True) | def writeAttrStubs(f, attr): getterName = (attr.iface.name + '_' + header.attributeNativeName(attr, True)) writeQuickStub(f, attr, getterName) if attr.readonly: setterName = 'xpc_qsReadOnlySetter' else: setterName = (attr.iface.name + '_' + header.attributeNativeName(attr, False)) writeQuickStub(f, attr, setterName, isSetter=True) ps = ('{"%s", %s, %s}' % (attr.name, getterName, setterName)) return ps | 8896184edbd95bdc709171e1892d30700ae56acd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/8896184edbd95bdc709171e1892d30700ae56acd/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
3843,
11974,
87,
12,
74,
16,
1604,
4672,
7060,
461,
273,
261,
1747,
18,
31479,
18,
529,
397,
4427,
397,
1446,
18,
4589,
9220,
461,
12,
1747,
16,
1053,
3719,
1045,
13663,
11974,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
3843,
11974,
87,
12,
74,
16,
1604,
4672,
7060,
461,
273,
261,
1747,
18,
31479,
18,
529,
397,
4427,
397,
1446,
18,
4589,
9220,
461,
12,
1747,
16,
1053,
3719,
1045,
13663,
11974,
1... |
elif sprite_layers[spr]>layer: | elif sprite_layers[spr] > layer: | def get_sprites_from_layer(self, layer): """returns all sprites from a layer, ordered by how they where added LayeredUpdates.get_sprites_from_layer(layer): return sprites | d9760f3e4782abb02dd98080337626eefdad67ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1298/d9760f3e4782abb02dd98080337626eefdad67ee/sprite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1752,
24047,
67,
2080,
67,
6363,
12,
2890,
16,
3018,
4672,
3536,
6154,
777,
1694,
24047,
628,
279,
3018,
16,
5901,
635,
3661,
2898,
1625,
3096,
12112,
329,
5121,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1752,
24047,
67,
2080,
67,
6363,
12,
2890,
16,
3018,
4672,
3536,
6154,
777,
1694,
24047,
628,
279,
3018,
16,
5901,
635,
3661,
2898,
1625,
3096,
12112,
329,
5121,
18,
588,
67,
... |
from epydoc.html import HTMLFormatter from epydoc.objdoc import DocMap, report_param_mismatches from epydoc.imports import import_module, find_modules from epydoc.objdoc import set_default_docformat | def generateDocs(options, outputDir): if options.verbose: verbosity = 4 else: verbosity = 1 chandlerBin = os.getenv('CHANDLERBIN') targetDir = os.path.join(outputDir, 'api') if not os.path.isdir(targetDir): _mkdirs(targetDir) # This is the options dictionary # It is used by most of the epydoc routines and # the contents were determined by examining epydoc/gui.py # and epydoc/cli.py source_modules = ['samples/skeleton', 'Chandler.py', 'version.py', 'PyICU', 'PyLucene', 'chandlerdb', 'chandlerdb.item', 'chandlerdb.persistence', 'chandlerdb.schema', 'chandlerdb.util'] source_modules += find_packages('application', exclude=['*.tests']) source_modules += find_packages('i18n', exclude=['*.tests']) source_modules += find_packages('repository', exclude=['*.tests']) source_modules += find_packages('tools', exclude=['*.tests']) parcels = find_packages('parcels', exclude=['*.tests']) map(schema.importString, parcels) for name,module in sys.modules.items(): if module is not None and name.rsplit('.', 1)[0] in parcels: source_modules += [name] e_options = { 'target': targetDir, 'verbosity': verbosity, 'prj_name': 'Chandler', 'action': 'html', 'tests': { 'basic': 1 }, 'show_imports': 0, 'frames': 1, 'private': 0, 'debug': 0, 'docformat': None, 'top': None, 'inheritance': "listed", 'alphabetical': 1, 'ignore_param_mismatch': 1, 'list_classes_separately': 0, 'modules': source_modules, } # based on the code in epydoc's gui.py # with subtle changes made to make it work :) from epydoc.html import HTMLFormatter from epydoc.objdoc import DocMap, report_param_mismatches from epydoc.imports import import_module, find_modules from epydoc.objdoc import set_default_docformat set_default_docformat('epytext') try: modules = [] module_names = e_options['modules'] # walk thru list of modules and expand # any packages found for name in module_names[:]: if os.path.isdir(name): index = module_names.index(name) new_modules = find_modules(name) if new_modules: module_names[index:index+1] = new_modules elif options.verbose: print 'Error: %s is not a package' % name # basic regex to exclude directories from consideration exc = re.compile(".*tests.*|.*scripts.*") for name in module_names: if exc.match(name): continue if options.verbose: print 'IMPORT: %s' % name # try importing the module and # add it to the list if successful try: module = import_module(name) if module not in modules: modules.append(module) elif options.verbose: print ' (duplicate)' except ImportError, e: if options.verbose: print e if len(modules) == 0: print 'Error: no modules successfully loaded!' sys.exit(1) document_bases = 1 document_autogen_vars = 1 inheritance_groups = (e_options['inheritance'] == 'grouped') inherit_groups = (e_options['inheritance'] != 'grouped') # let epydoc create an empty document map d = DocMap(verbosity, document_bases, document_autogen_vars, inheritance_groups, inherit_groups) # walk the module list and let epydoc build the documentation for (module, num) in zip(modules, range(len(modules))): if options.verbose: print '\n***Building docs for %s***' % module.__name__ try: d.add(module) except Exception, e: print "Internal Error: %s" % e except: print "Internal Error" if not e_options['ignore_param_mismatch']: if not report_param_mismatches(d): print ' (To supress these warnings, use --ignore-param-mismatch)' htmldoc = HTMLFormatter(d, **e_options) numfiles = htmldoc.num_files() def progress_callback(path): (dir, file) = os.path.split(path) (root, d) = os.path.split(dir) if d in ('public', 'private'): fname = os.path.join(d, file) else: fname = file if options.verbose: print '\n***Writing %s***' % fname # Write the documentation. print "\n***Saving to %s" % targetDir htmldoc.write(targetDir, progress_callback) except Exception, e: print 'Internal error: ', e raise except: raise | a8cce9037ebf48ac9d425d0117fdca66752a072a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/a8cce9037ebf48ac9d425d0117fdca66752a072a/gen_docs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
12656,
12,
2116,
16,
21412,
4672,
309,
702,
18,
11369,
30,
11561,
273,
1059,
469,
30,
11561,
273,
404,
225,
462,
464,
749,
9913,
273,
1140,
18,
588,
3074,
2668,
1792,
4307,
14668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
12656,
12,
2116,
16,
21412,
4672,
309,
702,
18,
11369,
30,
11561,
273,
1059,
469,
30,
11561,
273,
404,
225,
462,
464,
749,
9913,
273,
1140,
18,
588,
3074,
2668,
1792,
4307,
14668,
... | |
def simple_err(func, *args): try: func(*args) except struct.error: pass else: raise TestFailed, "%s%s did not raise struct.error" % ( func.__name__, args) def any_err(func, *args): try: func(*args) except (struct.error, TypeError): pass else: raise TestFailed, "%s%s did not raise error" % ( func.__name__, args) | def simple_err(func, *args): try: func(*args) except struct.error: pass else: raise TestFailed, "%s%s did not raise struct.error" % ( func.__name__, args) | 8688926981c4f0d3e7ba00de92d38ca6b352673a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/8688926981c4f0d3e7ba00de92d38ca6b352673a/test_struct.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4143,
67,
370,
12,
644,
16,
380,
1968,
4672,
775,
30,
1326,
30857,
1968,
13,
1335,
1958,
18,
1636,
30,
1342,
469,
30,
1002,
7766,
2925,
16,
2213,
87,
9,
87,
5061,
486,
1002,
1958,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4143,
67,
370,
12,
644,
16,
380,
1968,
4672,
775,
30,
1326,
30857,
1968,
13,
1335,
1958,
18,
1636,
30,
1342,
469,
30,
1002,
7766,
2925,
16,
2213,
87,
9,
87,
5061,
486,
1002,
1958,
18... | |
attrs.insert(pango.AttrFontDesc(pango.FontDescription("Sans Bold "+str(notify_sz)), end_index = len(self._notification)*3)) layout.set_attributes(attrs) | layout.set_font_description(pango.FontDescription("Sans Bold "+str(notify_sz))) | def _draw(self, widget): 'Render `widget`.' if not widget.window or not widget.window.is_viewable(): return False ccontext = widget.window.cairo_create() screenW, screenH = widget.window.get_size() if widget is self.preview and self.pres.window and self.pres.window.is_viewable(): #Scale if the presentation window size is available win_sz = self.pres.window.get_size() width = int(float(preview_height)*win_sz[0]/win_sz[1]) screenW = screenW*win_sz[0]/width screenH = screenH*win_sz[1]/preview_height ccontext.scale(float(width)/win_sz[0], float(preview_height)/win_sz[1]) elif widget is self.pres: self.preview.queue_draw() slide = exposong.slidelist.slidelist.get_active_item() if widget is self.pres and (self._background or self._black or self._logo) \ or not slide: #When there's no text to render, just draw the background self._set_background(widget, ccontext, (screenW, screenH)) else: if slide.draw(widget) is not NotImplemented: return True self._set_background(widget, ccontext, (screenW, screenH)) txcol = c2dec(exposong.prefs.config['pres.text_color']) screenCenterY = screenH/2 # Header text # TODO # Footer text ftext = str(slide.footer_text()) if isinstance(ftext, (unicode, str)) and len(ftext): layout = ccontext.create_layout() layout.set_text(ftext) layout.set_alignment(pango.ALIGN_CENTER) layout.set_width(int(screenW*pango.SCALE * 0.97)) attrs = pango.AttrList() attrs.insert(pango.AttrFontDesc(pango.FontDescription("Sans Bold "+ str(int(screenH/54.0))), end_index = len(ftext)*3)) layout.set_attributes(attrs) footer_height = layout.get_pixel_size()[1] ccontext.set_source_rgba(txcol[0], txcol[1], txcol[2], 1.0) ccontext.move_to(screenW * 0.015, screenH - footer_height) ccontext.show_layout(layout) screenH -= footer_height screenCenterY -= footer_height/2 # Body Text layout = ccontext.create_layout() size = 16 layout.set_text(str(slide.body_text())) layout.set_alignment(pango.ALIGN_CENTER) layout.set_width(int(screenW*pango.SCALE * 0.97)) attrs = pango.AttrList() attrs.insert(pango.AttrFontDesc(pango.FontDescription("Sans Bold "+str(size)) , end_index = len(str(slide.body_text()))*3)) layout.set_attributes(attrs) min_sz = 0 max_sz = int(exposong.prefs.config['pres.max_font_size']) #Loop through until the text is between 78% of the height and 94%, or #until we get a number that is not a multiple of 4 (2,6,10,14, etc) to #make it simpler... TODO Double check that it doesn't overflow while True: if layout.get_pixel_size()[0] > screenW*0.97 \ or layout.get_pixel_size()[1] > screenH*0.94: max_sz = size size = (min_sz + max_sz) / 2 elif size % 4 != 0 or max_sz - min_sz < 3: break elif layout.get_pixel_size()[1] < screenH*0.78: min_sz = size if(max_sz): size = (min_sz + max_sz) / 2 else: size = size * 2 else: break attrs.insert(pango.AttrFontDesc(pango.FontDescription("Sans Bold "+str(size)), end_index = len(slide.body_text())*3)) layout.set_attributes(attrs) if exposong.prefs.config['pres.text_shadow']: shcol = c2dec(exposong.prefs.config['pres.text_shadow']) ccontext.set_source_rgba(shcol[0], shcol[1], shcol[2], shcol[3]) ccontext.move_to(screenW * 0.015 + size*0.1, screenCenterY - layout.get_pixel_size()[1]/2.0 + size*0.1) ccontext.show_layout(layout) ccontext.set_source_rgba(txcol[0], txcol[1], txcol[2], 1.0) ccontext.move_to(screenW * 0.015,screenCenterY - layout.get_pixel_size()[1]/2.0) ccontext.show_layout(layout) #Draw notification if widget is self.pres and self._notification: layout = ccontext.create_layout() layout.set_text(self._notification) attrs = pango.AttrList() notify_sz = int(screenH/12.0) attrs.insert(pango.AttrFontDesc(pango.FontDescription("Sans Bold "+str(notify_sz)), end_index = len(self._notification)*3)) layout.set_attributes(attrs) while layout.get_pixel_size()[0] > screenW*0.6: notify_sz = int(notify_sz*0.89) attrs.insert(pango.AttrFontDesc(pango.FontDescription("Sans Bold "+str(notify_sz)), end_index = len(slide.body_text())*3)) layout.set_attributes(attrs) sbounds = widget.window.get_size() nbounds = layout.get_pixel_size() pad = notify_sz/14.0 ccontext.rectangle(sbounds[0]-nbounds[0]-pad*2, sbounds[1]-nbounds[1]-pad*2, sbounds[0], sbounds[1]) ccontext.set_source_rgb(exposong.prefs.config['pres.notify_bg'][0], exposong.prefs.config['pres.notify_bg'][1], exposong.prefs.config['pres.notify_bg'][2]) ccontext.fill() ccontext.set_source_rgb(1.0, 1.0, 1.0) ccontext.move_to(sbounds[0]-nbounds[0]-pad, sbounds[1]-nbounds[1]-pad) ccontext.show_layout(layout) return True | 6803342c956584a899e5373903cb551ab32f464a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5029/6803342c956584a899e5373903cb551ab32f464a/screen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9446,
12,
2890,
16,
3604,
4672,
296,
3420,
1375,
6587,
68,
1093,
309,
486,
3604,
18,
5668,
578,
486,
3604,
18,
5668,
18,
291,
67,
1945,
429,
13332,
327,
1083,
225,
276,
2472,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9446,
12,
2890,
16,
3604,
4672,
296,
3420,
1375,
6587,
68,
1093,
309,
486,
3604,
18,
5668,
578,
486,
3604,
18,
5668,
18,
291,
67,
1945,
429,
13332,
327,
1083,
225,
276,
2472,
273,... |
self.theclass(base[:2] + chr(ord_byte) + base[3:]) | self.theclass(str8(base[:2] + chr(ord_byte) + base[3:])) | def test_backdoor_resistance(self): # For fast unpickling, the constructor accepts a pickle string. # This is a low-overhead backdoor. A user can (by intent or # mistake) pass a string directly, which (if it's the right length) # will get treated like a pickle, and bypass the normal sanity # checks in the constructor. This can create insane objects. # The constructor doesn't want to burn the time to validate all # fields, but does check the month field. This stops, e.g., # datetime.datetime('1995-03-25') from yielding an insane object. base = '1995-03-25' if not issubclass(self.theclass, datetime): base = base[:4] for month_byte in '9', chr(0), chr(13), '\xff': self.assertRaises(TypeError, self.theclass, base[:2] + month_byte + base[3:]) for ord_byte in range(1, 13): # This shouldn't blow up because of the month byte alone. If # the implementation changes to do more-careful checking, it may # blow up because other fields are insane. self.theclass(base[:2] + chr(ord_byte) + base[3:]) | 3aaf87b2dec3219103bcd63d4214f50baef52248 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/3aaf87b2dec3219103bcd63d4214f50baef52248/test_datetime.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
823,
2896,
280,
67,
455,
13145,
12,
2890,
4672,
468,
2457,
4797,
640,
11503,
2456,
16,
326,
3885,
8104,
279,
13379,
533,
18,
468,
1220,
353,
279,
4587,
17,
1643,
1978,
1473,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
823,
2896,
280,
67,
455,
13145,
12,
2890,
4672,
468,
2457,
4797,
640,
11503,
2456,
16,
326,
3885,
8104,
279,
13379,
533,
18,
468,
1220,
353,
279,
4587,
17,
1643,
1978,
1473,
... |
if get_verbose() >= 2: print "R[%02d].output %s"%(self.n,self.hex_str_vector(P)) | if get_verbose() >= 2: print "R[%02d].output %s"%(self.n, self.hex_str_vector(P)) | def __call__(self, P, K): r""" Encrypts the plaintext $P$ using the key $K$. | 26b5b14a2a46b23848ccefac3b41425cf353e86a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/26b5b14a2a46b23848ccefac3b41425cf353e86a/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
453,
16,
1475,
4672,
436,
8395,
8594,
20261,
326,
11917,
271,
52,
8,
1450,
326,
498,
271,
47,
8,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
453,
16,
1475,
4672,
436,
8395,
8594,
20261,
326,
11917,
271,
52,
8,
1450,
326,
498,
271,
47,
8,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
suite.addTest(PlayerTestCase("testPanoImage")) | def playerTestSuite(): suite = unittest.TestSuite() suite.addTest(LoggerTestCase("test")) suite.addTest(ParPortTestCase("test")) suite.addTest(ConradRelaisTestCase("test")) suite.addTest(NodeTestCase("testAttributes")) suite.addTest(PlayerTestCase("testImage")) suite.addTest(PlayerTestCase("testError")) suite.addTest(PlayerTestCase("testEvents")) suite.addTest(PlayerTestCase("testEventErr")) suite.addTest(PlayerTestCase("testConfig")) | ca67e78aa516a30e2f17da7869fdecdd8dbcb353 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7300/ca67e78aa516a30e2f17da7869fdecdd8dbcb353/Test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7291,
4709,
13587,
13332,
11371,
273,
2836,
3813,
18,
4709,
13587,
1435,
11371,
18,
1289,
4709,
12,
3328,
4709,
2449,
2932,
3813,
6,
3719,
11371,
18,
1289,
4709,
12,
1553,
2617,
4709,
2449... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7291,
4709,
13587,
13332,
11371,
273,
2836,
3813,
18,
4709,
13587,
1435,
11371,
18,
1289,
4709,
12,
3328,
4709,
2449,
2932,
3813,
6,
3719,
11371,
18,
1289,
4709,
12,
1553,
2617,
4709,
2449... | |
def move_cursor_cb (self, buffer, cursoriter, mark, view): self.update_cursor_position(buffer, view) def update_cursor_position(self, buffer, view): name, buff, text, model = self.get_current() if text is None: return tabwidth = text.get_tabs_width() iter = buffer.get_iter_at_mark(buffer.get_insert()) nchars = iter.get_offset() row = iter.get_line() + 1 start = iter start.set_line_offset(0) col = 0 while not start.equal(iter): if start.get_char == '\t': col += (tabwidth - (col % tabwidth)) else: col += 1 start = start.forward_char() | def move_cursor_cb (self, buffer, cursoriter, mark, view): self.update_cursor_position(buffer, view) | e910eb971454c8115ba2ece51009678060fa4d42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/e910eb971454c8115ba2ece51009678060fa4d42/edit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
67,
9216,
67,
7358,
261,
2890,
16,
1613,
16,
3347,
2165,
16,
2267,
16,
1476,
4672,
365,
18,
2725,
67,
9216,
67,
3276,
12,
4106,
16,
1476,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3635,
67,
9216,
67,
7358,
261,
2890,
16,
1613,
16,
3347,
2165,
16,
2267,
16,
1476,
4672,
365,
18,
2725,
67,
9216,
67,
3276,
12,
4106,
16,
1476,
13,
2,
-100,
-100,
-100,
-100,
-100,
-... | |
template = Template("www/timetable.pt") | def test_title(self): view = self.createView() view.request = RequestStub() self.assertEquals(view.title(), "John Smith's timetable for 2004 fall, default") | def _traverse(self, name, request): if self.period is None: return TimetableTraverseView(self.context, name) else: tt = self.context.getCompositeTimetable(self.period, name) if tt is None: raise KeyError(self.period, name) return TimetableView(tt, (self.period, name)) | 3cd13be2add709d2150b864d90414df5d3e5307f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/3cd13be2add709d2150b864d90414df5d3e5307f/test_timetable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2033,
2476,
12,
2890,
16,
508,
16,
590,
4672,
309,
365,
18,
6908,
353,
599,
30,
327,
12652,
278,
429,
29654,
1767,
12,
2890,
18,
2472,
16,
508,
13,
469,
30,
3574,
273,
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,
389,
2033,
2476,
12,
2890,
16,
508,
16,
590,
4672,
309,
365,
18,
6908,
353,
599,
30,
327,
12652,
278,
429,
29654,
1767,
12,
2890,
18,
2472,
16,
508,
13,
469,
30,
3574,
273,
365,
18,
... |
Expression.Context = _PyV8.AstExpressionContext | def convert(obj): if type(obj) == _PyV8.JSArray: return [convert(v) for v in obj] if type(obj) == _PyV8.JSObject: return dict([[str(k), convert(obj.__getattr__(str(k)))] for k in obj.__members__]) return obj | b01e1ad32a72773fc24456e02dd8435ddf76d5e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5451/b01e1ad32a72773fc24456e02dd8435ddf76d5e7/PyV8.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
12,
2603,
4672,
309,
618,
12,
2603,
13,
422,
389,
9413,
58,
28,
18,
6479,
1076,
30,
327,
306,
6283,
12,
90,
13,
364,
331,
316,
1081,
65,
225,
309,
618,
12,
2603,
13,
422,
389... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
12,
2603,
4672,
309,
618,
12,
2603,
13,
422,
389,
9413,
58,
28,
18,
6479,
1076,
30,
327,
306,
6283,
12,
90,
13,
364,
331,
316,
1081,
65,
225,
309,
618,
12,
2603,
13,
422,
389... | |
self.elements += other.elements self.attributes += other.attributes | self.elements.update( other.elements ) self.attributes.update( other.attributes ) | def inherit(self, other): assert self.parent == other.name self.elements += other.elements self.attributes += other.attributes self.parent = None | 30c33ab654bed9985d4ceb463748779d027542d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9355/30c33ab654bed9985d4ceb463748779d027542d7/wmlgrammar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6811,
12,
2890,
16,
1308,
4672,
1815,
365,
18,
2938,
422,
1308,
18,
529,
365,
18,
6274,
18,
2725,
12,
1308,
18,
6274,
262,
365,
18,
4350,
18,
2725,
12,
1308,
18,
4350,
262,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6811,
12,
2890,
16,
1308,
4672,
1815,
365,
18,
2938,
422,
1308,
18,
529,
365,
18,
6274,
18,
2725,
12,
1308,
18,
6274,
262,
365,
18,
4350,
18,
2725,
12,
1308,
18,
4350,
262,
365,
18,
... |
elif request.form['do'][0] == 'del': | elif do == 'del': | def execute(pagename, request): """ Main dispatcher for the 'AttachFile' action. """ _ = request.getText msg = None if action_name in request.cfg.actions_excluded: msg = _('File attachments are not allowed in this wiki!') elif 'do' not in request.form: upload_form(pagename, request) elif request.form['do'][0] == 'savedrawing': if request.user.may.write(pagename): save_drawing(pagename, request) request.emit_http_headers() request.write("OK") else: msg = _('You are not allowed to save a drawing on this page.') elif request.form['do'][0] == 'upload': if request.user.may.write(pagename): if 'file' in request.form: do_upload(pagename, request) else: # This might happen when trying to upload file names # with non-ascii characters on Safari. msg = _("No file content. Delete non ASCII characters from the file name and try again.") else: msg = _('You are not allowed to attach a file to this page.') elif request.form['do'][0] == 'del': if request.user.may.delete(pagename): del_file(pagename, request) else: msg = _('You are not allowed to delete attachments on this page.') elif request.form['do'][0] == 'move': if request.user.may.delete(pagename): send_moveform(pagename, request) else: msg = _('You are not allowed to move attachments from this page.') elif request.form['do'][0] == 'attachment_move': if 'cancel' in request.form: msg = _('Move aborted!') error_msg(pagename, request, msg) return if not wikiutil.checkTicket(request, request.form['ticket'][0]): msg = _('Please use the interactive user interface to move attachments!') error_msg(pagename, request, msg) return if request.user.may.delete(pagename): attachment_move(pagename, request) else: msg = _('You are not allowed to move attachments from this page.') elif request.form['do'][0] == 'get': if request.user.may.read(pagename): get_file(pagename, request) else: msg = _('You are not allowed to get attachments from this page.') elif request.form['do'][0] == 'unzip': if request.user.may.delete(pagename) and request.user.may.read(pagename) and request.user.may.write(pagename): unzip_file(pagename, request) else: msg = _('You are not allowed to unzip attachments of this page.') elif request.form['do'][0] == 'install': if request.user.isSuperUser(): install_package(pagename, request) else: msg = _('You are not allowed to install files.') elif request.form['do'][0] == 'view': if request.user.may.read(pagename): view_file(pagename, request) else: msg = _('You are not allowed to view attachments of this page.') else: msg = _('Unsupported upload action: %s') % (request.form['do'][0],) if msg: error_msg(pagename, request, msg) | 0b374a0e7f09a6bc8083ad52cb15f4654fa1108a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/888/0b374a0e7f09a6bc8083ad52cb15f4654fa1108a/AttachFile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
9095,
1069,
16,
590,
4672,
3536,
12740,
7393,
364,
326,
296,
4761,
812,
11,
1301,
18,
3536,
389,
273,
590,
18,
588,
1528,
225,
1234,
273,
599,
309,
1301,
67,
529,
316,
590,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
9095,
1069,
16,
590,
4672,
3536,
12740,
7393,
364,
326,
296,
4761,
812,
11,
1301,
18,
3536,
389,
273,
590,
18,
588,
1528,
225,
1234,
273,
599,
309,
1301,
67,
529,
316,
590,
... |
self.rolloverAt = newRolloverAt | result = newRolloverAt return result | def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None, delay=0, utc=False): BaseRotatingHandler.__init__(self, filename, 'a', encoding, delay) self.when = when.upper() self.backupCount = backupCount self.utc = utc # Calculate the real rollover interval, which is just the number of # seconds between rollovers. Also set the filename suffix used when # a rollover occurs. Current 'when' events supported: # S - Seconds # M - Minutes # H - Hours # D - Days # midnight - roll over at midnight # W{0-6} - roll over on a certain day; 0 - Monday # # Case of the 'when' specifier is not important; lower or upper case # will work. currentTime = int(time.time()) if self.when == 'S': self.interval = 1 # one second self.suffix = "%Y-%m-%d_%H-%M-%S" self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}$" elif self.when == 'M': self.interval = 60 # one minute self.suffix = "%Y-%m-%d_%H-%M" self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}$" elif self.when == 'H': self.interval = 60 * 60 # one hour self.suffix = "%Y-%m-%d_%H" self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}$" elif self.when == 'D' or self.when == 'MIDNIGHT': self.interval = 60 * 60 * 24 # one day self.suffix = "%Y-%m-%d" self.extMatch = r"^\d{4}-\d{2}-\d{2}$" elif self.when.startswith('W'): self.interval = 60 * 60 * 24 * 7 # one week if len(self.when) != 2: raise ValueError("You must specify a day for weekly rollover from 0 to 6 (0 is Monday): %s" % self.when) if self.when[1] < '0' or self.when[1] > '6': raise ValueError("Invalid day specified for weekly rollover: %s" % self.when) self.dayOfWeek = int(self.when[1]) self.suffix = "%Y-%m-%d" self.extMatch = r"^\d{4}-\d{2}-\d{2}$" else: raise ValueError("Invalid rollover interval specified: %s" % self.when) | affbd871e3964b5101bd8756a5510ac68e291833 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/affbd871e3964b5101bd8756a5510ac68e291833/handlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1544,
16,
1347,
2218,
76,
2187,
3673,
33,
21,
16,
5114,
1380,
33,
20,
16,
2688,
33,
7036,
16,
4624,
33,
20,
16,
9439,
33,
8381,
4672,
3360,
8570,
1776,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1544,
16,
1347,
2218,
76,
2187,
3673,
33,
21,
16,
5114,
1380,
33,
20,
16,
2688,
33,
7036,
16,
4624,
33,
20,
16,
9439,
33,
8381,
4672,
3360,
8570,
1776,... |
il['analytic_lines']=[] | il['analytic_lines'] = [] | def _get_analytic_lines(self, cr, uid, id): inv = self.browse(cr, uid, [id])[0] cur_obj = self.pool.get('res.currency') | 6bf8e8540e15556d4f6de35150e5b4b6a0e54466 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6bf8e8540e15556d4f6de35150e5b4b6a0e54466/account_analytic_plans.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
304,
7834,
335,
67,
3548,
12,
2890,
16,
4422,
16,
4555,
16,
612,
4672,
2198,
273,
365,
18,
25731,
12,
3353,
16,
4555,
16,
306,
350,
5717,
63,
20,
65,
662,
67,
2603,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
304,
7834,
335,
67,
3548,
12,
2890,
16,
4422,
16,
4555,
16,
612,
4672,
2198,
273,
365,
18,
25731,
12,
3353,
16,
4555,
16,
306,
350,
5717,
63,
20,
65,
662,
67,
2603,
2... |
sys.path.pop(self.path) | sys.path.remove(self.path) | def load(self): for modname in self.found_modules: if self.debug_output >= DEBUG_ALL: print "Attempting to 'find' module: %s" % modname # This assumes that we always have .py extension. Is this correct? stripped_modname = modname[0:modname.rfind(".py")] file_handle, filename, description = imp.find_module(stripped_modname) loaded_module = None if not file_handle: if self.debug_output >= DEBUG_ALL: print "Failed 'finding' module (programming error): %s" % modname else: try: loaded_module = imp.load_module(stripped_modname, file_handle, modname, description) except: # If we are not using fault tolerance, reraise if not self.fault_tolerance: raise else: if self.debug_output >= DEBUG_ALL print "Load failed on module: %s, attempting recovery" print sys.exc_info()[0] finally: file_handle.close() # If loaded module is None, something went wrong if loaded_module: self.dir_modules.append(loaded_module) # Remove from path if it wasn't already there if not self.duplicate_path: sys.path.pop(self.path) | 75dbf626c3b697e568752995866893479a555cae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/635/75dbf626c3b697e568752995866893479a555cae/moduleloader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
12,
2890,
4672,
364,
16037,
316,
365,
18,
7015,
67,
6400,
30,
309,
365,
18,
4148,
67,
2844,
1545,
6369,
67,
4685,
30,
1172,
315,
23089,
358,
296,
4720,
11,
1605,
30,
738,
87,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
12,
2890,
4672,
364,
16037,
316,
365,
18,
7015,
67,
6400,
30,
309,
365,
18,
4148,
67,
2844,
1545,
6369,
67,
4685,
30,
1172,
315,
23089,
358,
296,
4720,
11,
1605,
30,
738,
87,
6... |
wxDialog.__init__(self, id = wxID_WXBOAFILEDIALOG, name = 'wxBoaFileDialog', parent = prnt, pos = wxPoint(369, 279), size = wxSize(408, 283), style = wxRESIZE_BORDER | wxDEFAULT_DIALOG_STYLE, title = 'File Dialog') | wxDialog.__init__(self, id = wxID_WXBOAFILEDIALOG, name = 'wxBoaFileDialog', parent = prnt, pos = wxPoint(369, 279), size = wxSize(408, 283), style = wxRESIZE_BORDER | wxDEFAULT_DIALOG_STYLE | wxCLIP_CHILDREN, title = 'File Dialog') | def _init_ctrls(self, prnt): wxDialog.__init__(self, id = wxID_WXBOAFILEDIALOG, name = 'wxBoaFileDialog', parent = prnt, pos = wxPoint(369, 279), size = wxSize(408, 283), style = wxRESIZE_BORDER | wxDEFAULT_DIALOG_STYLE, title = 'File Dialog') self._init_utils() self.SetAutoLayout(true) self.SetClientSize(wxSize(400, 256)) | 29c63b34f15350d68f2bffb35ff76d0e602e0bee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/29c63b34f15350d68f2bffb35ff76d0e602e0bee/FileDlg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
273,
7075,
734,
67,
59,
60,
5315,
37,
3776,
2565,
18683,
16,
508,
273,
296,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
273,
7075,
734,
67,
59,
60,
5315,
37,
3776,
2565,
18683,
16,
508,
273,
296,
9... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.