rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
desc = self.get_descriptor_by_name(package, module_name, namespace) | def get_port_spec(self, package, module_name, namespace, port_name, port_type): try: desc = self.get_descriptor_by_name(package, module_name, namespace) for d in self.get_module_hierarchy(desc): if d.has_port_spec(port_name, port_type): return d.get_port_spec(port_name, port_type) except ModuleDescriptor.MissingPort: print "missing port: '%s:%s|%s', '%s:%s'" % (package, module_name, namespace, port_name, port_type) raise except self.MissingModulePackage: print "missing desc: '%s:%s|%s'" % (package, module_name, namespace) raise return None | b4dfc2201453244e1316ef69a2da21aff0fa9b93 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6341/b4dfc2201453244e1316ef69a2da21aff0fa9b93/module_registry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
655,
67,
2793,
12,
2890,
16,
2181,
16,
1605,
67,
529,
16,
1981,
16,
1756,
67,
529,
16,
1756,
67,
723,
4672,
775,
30,
364,
302,
316,
365,
18,
588,
67,
2978,
67,
17937,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
655,
67,
2793,
12,
2890,
16,
2181,
16,
1605,
67,
529,
16,
1981,
16,
1756,
67,
529,
16,
1756,
67,
723,
4672,
775,
30,
364,
302,
316,
365,
18,
588,
67,
2978,
67,
17937,
12,
... | |
log.info("Making %s.dmg..." % name) makedmg.make_dmg(pkg_dir, self.dist_dir, name) | log.info("Making %s.dmg..." % fullname) makedmg.make_dmg(pkg_dir, self.dist_dir, fullname) | def run (self): name = self.distribution.metadata.name version = self.distribution.metadata.version description = self.distribution.metadata.description self.run_command('build') install = self.reinitialize_command('install', reinit_subcommands=1) install.root = self.bdist_dir install.warn_dir = 0 log.info("installing to %s" % self.bdist_dir) self.run_command('install') | e24c7be3948de844c8f43e643c213af03f056b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/e24c7be3948de844c8f43e643c213af03f056b13/gamera_mac_setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
4672,
508,
273,
365,
18,
16279,
18,
4165,
18,
529,
1177,
273,
365,
18,
16279,
18,
4165,
18,
1589,
2477,
273,
365,
18,
16279,
18,
4165,
18,
3384,
225,
365,
18,
2681,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
261,
2890,
4672,
508,
273,
365,
18,
16279,
18,
4165,
18,
529,
1177,
273,
365,
18,
16279,
18,
4165,
18,
1589,
2477,
273,
365,
18,
16279,
18,
4165,
18,
3384,
225,
365,
18,
2681,
... |
QMessageBox.information(self, self.tr("Conversion Completed!!!"), self.tr("Finish. All files were converted!"), QMessageBox.Ok ) | QMessageBox.information(self, self.tr("¡¡¡Conversion Completed!!!"), self.tr("Finish. All files were converted!"), QMessageBox.Ok ) | def completed(self): global nomore #print "finished" if not nomore: #print "another file" self.actual=self.actual+1 #print self.actual #print self.total if self.actual<self.total: #print "process another" self.processStepbyStep() else: print "it's the end of the list as we know it ^_^" self.ui.b_back_2.setVisible(1) self.ui.b_sortir_2.setVisible(1) self.ui.b_stop.setVisible(0) self.ui.b_sortir.setEnabled(1) QMessageBox.information(self, self.tr("Conversion Completed!!!"), self.tr("Finish. All files were converted!"), QMessageBox.Ok ) #else: #print "nomore - process stoped" | a6d9db07e1edab74604f4c6e3d9dcd06364399ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2564/a6d9db07e1edab74604f4c6e3d9dcd06364399ba/audioconversor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5951,
12,
2890,
4672,
2552,
12457,
479,
468,
1188,
315,
13527,
6,
309,
486,
12457,
479,
30,
468,
1188,
315,
304,
3011,
585,
6,
365,
18,
18672,
33,
2890,
18,
18672,
15,
21,
468,
1188,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5951,
12,
2890,
4672,
2552,
12457,
479,
468,
1188,
315,
13527,
6,
309,
486,
12457,
479,
30,
468,
1188,
315,
304,
3011,
585,
6,
365,
18,
18672,
33,
2890,
18,
18672,
15,
21,
468,
1188,
... |
if not conf.Check_wx_config([2,6,2], env['ARGS']['with-wx-config']): print 'wxWidgets >= 2.6.2 is required.' | if not conf.Check_wx_config([2,6,1], env['ARGS']['with-wx-config']): print 'wxWidgets >= 2.6.1 is required.' | def Check_wx_config(context, version, wx_config_command = "wx-config"): context.Message('Checking for %s ... ' % wx_config_command) if os.environ.has_key("WX_CONFIG_PATH"): wx_config_command = "WX_CONFIG_PATH=" + os.environ["WX_CONFIG_PATH"] + " " + wx_config_command ret = os.popen(wx_config_command + ' --version').read().split('.') if ((int(ret[0]) >= version[0]) and (int(ret[1]) >= version[1]) and (int(ret[2]) >= version[2])): #env.ParseConfig(wx_config_command + ' --cflags --libs'); #--gl-libs #--libs std,gl env.AppendUnique( WX_CCFLAGS = SCons.Util.CLVar( os.popen(wx_config_command+" --cflags 2>/dev/null").read().strip() )); env.AppendUnique( WX_LDFLAGS = SCons.Util.CLVar( os.popen(wx_config_command+" --libs std,gl 2>/dev/null").read().strip() )); context.Result(True) return True else: context.Result(False) return False | 092a4a201d07f37b2b5c998452e589552579fa16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2410/092a4a201d07f37b2b5c998452e589552579fa16/wx.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2073,
67,
27226,
67,
1425,
12,
2472,
16,
1177,
16,
7075,
67,
1425,
67,
3076,
273,
315,
27226,
17,
1425,
6,
4672,
819,
18,
1079,
2668,
14294,
364,
738,
87,
1372,
296,
738,
7075,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2073,
67,
27226,
67,
1425,
12,
2472,
16,
1177,
16,
7075,
67,
1425,
67,
3076,
273,
315,
27226,
17,
1425,
6,
4672,
819,
18,
1079,
2668,
14294,
364,
738,
87,
1372,
296,
738,
7075,
67,
1... |
context.node, context.position, context.size, context.template = state | (context.node, context.position, context.size, context.template, context.current_node) = saved | def instantiate(self, context): if self._select: context.instruction = self context.namespaces = self.namespaces try: nodes = self._select.evaluate_as_nodeset(context) except TypeError: raise raise XsltError(XsltError.INVALID_FOREACH_NODESET) else: nodes = context.node.xml_children | 0a30890db765ba831bac1ad2e2921b357dfebf77 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14078/0a30890db765ba831bac1ad2e2921b357dfebf77/for_each_element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10275,
12,
2890,
16,
819,
4672,
309,
365,
6315,
4025,
30,
819,
18,
19116,
273,
365,
819,
18,
16078,
273,
365,
18,
16078,
775,
30,
2199,
273,
365,
6315,
4025,
18,
21024,
67,
345,
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,
10275,
12,
2890,
16,
819,
4672,
309,
365,
6315,
4025,
30,
819,
18,
19116,
273,
365,
819,
18,
16078,
273,
365,
18,
16078,
775,
30,
2199,
273,
365,
6315,
4025,
18,
21024,
67,
345,
67,
... |
def _dom_node(self, dom): return dom.Text(self.data) def _rooted_dom_node(self, domroot): | def _dom_node(self, domroot): | def _dom_node(self, dom): return dom.Text(self.data) | 4965da4742f1b663cade3631c67c83fc31d4520c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/4965da4742f1b663cade3631c67c83fc31d4520c/nodes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9859,
67,
2159,
12,
2890,
16,
4092,
4672,
327,
4092,
18,
1528,
12,
2890,
18,
892,
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,
... | [
1,
1,
1,
1,
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,
389,
9859,
67,
2159,
12,
2890,
16,
4092,
4672,
327,
4092,
18,
1528,
12,
2890,
18,
892,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.get(force=True, get_redirect=True, throttle=False) | try: self.get(force=True, get_redirect=True, throttle=False) except NoPage: output(u'Page %s is moved and no longer exist.') delattr(self, '_contents') | def move(self, newtitle, reason=None, movetalkpage=True, movesubpages=False, sysop=False, throttle=True, deleteAndMove=False, safe=True, fixredirects=True, leaveRedirect=True): """Move this page to new title given by newtitle. If safe, don't try to move and delete if not directly requested. | a589302f3796bb6cd5e8e918dfe938d6f28d338d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/a589302f3796bb6cd5e8e918dfe938d6f28d338d/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
12,
2890,
16,
394,
2649,
16,
3971,
33,
7036,
16,
5730,
278,
2960,
2433,
33,
5510,
16,
13934,
373,
7267,
33,
8381,
16,
2589,
556,
33,
8381,
16,
18304,
33,
5510,
16,
1430,
1876,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3635,
12,
2890,
16,
394,
2649,
16,
3971,
33,
7036,
16,
5730,
278,
2960,
2433,
33,
5510,
16,
13934,
373,
7267,
33,
8381,
16,
2589,
556,
33,
8381,
16,
18304,
33,
5510,
16,
1430,
1876,
... |
result = True | result = True | def validate_required(self, instance, value, errors): try: int(value) except (ValueError, TypeError): result = False else: result = True return ObjectField.validate_required(self, instance, result, errors) | ce18ea6851443c561d3f359843304d34e49b66e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/ce18ea6851443c561d3f359843304d34e49b66e9/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
4718,
12,
2890,
16,
791,
16,
460,
16,
1334,
4672,
775,
30,
509,
12,
1132,
13,
1335,
261,
23610,
16,
3580,
4672,
563,
273,
1083,
469,
30,
563,
273,
1053,
327,
1033,
974,
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,
1954,
67,
4718,
12,
2890,
16,
791,
16,
460,
16,
1334,
4672,
775,
30,
509,
12,
1132,
13,
1335,
261,
23610,
16,
3580,
4672,
563,
273,
1083,
469,
30,
563,
273,
1053,
327,
1033,
974,
18,... |
7/2 1/2 3 4/3 2.82842712475 1 | (7/2) (1/2) 3 (4/3) 2.82842712475 1 | def test(): '''\ Test function for rat module. The expected output is (module some differences in floating precission): -1 -1 0 0L 0.1 (0.1+0j) [Rat(1,2), Rat(-3,10), Rat(1,25), Rat(1,4)] [Rat(-3,10), Rat(1,25), Rat(1,4), Rat(1,2)] 0 11/10 11/10 1.1 OK 2 1.5 3/2 (1.5+1.5j) 15707963/5000000 2 2 2.0 (2+0j) 4 0 4 1 4 0 3.5 0.5 3.0 1.33333333333 2.82842712475 1 7/2 1/2 3 4/3 2.82842712475 1 (3.5+1.5j) (0.5-1.5j) (3+3j) (0.666666666667-0.666666666667j) (1.43248815986+2.43884761145j) 1 1.5 1 1.5 (1.5+0j) 3.5 -0.5 3.0 0.75 2.25 -1 3.0 0.0 2.25 1.0 1.83711730709 0 3.0 0.0 2.25 1.0 1.83711730709 1 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 3/2 1 1.5 (1.5+0j) 7/2 -1/2 3 3/4 9/4 -1 3.0 0.0 2.25 1.0 1.83711730709 -1 3 0 9/4 1 1.83711730709 0 (3+1.5j) -1.5j (2.25+2.25j) (0.5-0.5j) (1.50768393746+1.04970907623j) -1 (1.5+1.5j) (1.5+1.5j) (3.5+1.5j) (-0.5+1.5j) (3+3j) (0.75+0.75j) 4.5j -1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+1.5j) 1.5j (2.25+2.25j) (1+1j) (1.18235814075+2.85446505899j) 1 (3+3j) 0j 4.5j (1+0j) (-0.638110484918+0.705394566962j) 0 ''' print rat(-1L, 1) print rat(1, -1) a = rat(1, 10) print int(a), long(a), float(a), complex(a) b = rat(2, 5) l = [a+b, a-b, a*b, a/b] print l l.sort() print l print rat(0, 1) print a+1 print a+1L print a+1.0 try: print rat(1, 0) raise SystemError, 'should have been ZeroDivisionError' except ZeroDivisionError: print 'OK' print rat(2), rat(1.5), rat(3, 2), rat(1.5+1.5j), rat(31415926,10000000) list = [2, 1.5, rat(3,2), 1.5+1.5j] for i in list: print i, if type(i) is not ComplexType: print int(i), float(i), print complex(i) print for j in list: print i + j, i - j, i * j, i / j, i ** j, cmp(i, j) | 71d3aa186579a353a324f0dac9b41910b16f0d16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/71d3aa186579a353a324f0dac9b41910b16f0d16/Rat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
875,
8314,
7766,
445,
364,
15183,
1605,
18,
225,
1021,
2665,
876,
353,
261,
2978,
2690,
16440,
316,
13861,
13382,
19710,
4672,
300,
21,
300,
21,
374,
374,
48,
374,
18,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
13332,
875,
8314,
7766,
445,
364,
15183,
1605,
18,
225,
1021,
2665,
876,
353,
261,
2978,
2690,
16440,
316,
13861,
13382,
19710,
4672,
300,
21,
300,
21,
374,
374,
48,
374,
18,
21,
... |
console.endln() | console.endln() | def LoadStructure(struct_source): """Loads Structure, chooses a unique struct_id string. Also, search the REMARK records for TLS group records. If they are found, then add the TLS group ADP magnitude to the B facors of the ATOM records. """ console.debug_stdoutln(">tlsmd_analysis.py->LoadStructure()") ## determine the argument type if isinstance(struct_source, str): file_path = struct_source console.kvformat("LOADING STRUCTURE", file_path) ## LOGLINE fobj = open(file_path, "r") elif hasattr(struct_source, "__iter__") and hasattr(struct_source, "seek"): console.kvformat("LOADING STRUCTURE", str(struct_source)) ## LOGLINE fobj = struct_source else: raise ValueError ## load struct struct = FileIO.LoadStructure(file = fobj, distance_bonds = True) job_dir = str(os.path.dirname(str(struct_source))) console.kvformat("HEADER", struct.header) ## LOGLINE 9 console.kvformat("TITLE", struct.title) ## LOGLINE 10 console.kvformat("EXPERIMENTAL METHOD", struct.experimental_method) ## LOGLINE 11 console.kvformat("PATH", job_dir) ## LOGLINE ## set the structure ID if conf.globalconf.struct_id is not None: struct_id = conf.globalconf.struct_id else: struct_id = struct.structure_id conf.globalconf.struct_id = struct_id struct.structure_id = struct_id console.endln() ## LOGLINE ## if there are REFMAC5 TLS groups in the REMARK records of ## the PDB file, then add those in tls_file = TLS.TLSFile() tls_file.set_file_format(TLS.TLSFileFormatPDB()) ## return to the beginning of the file and read the REMARK/TLS records fobj.seek(0) tls_file.load(fobj) if len(tls_file.tls_desc_list) > 0: console.stdoutln("ADDING TLS GROUP Bequiv TO ATOM TEMPERATURE FACTORS") console.stdoutln(" NUM TLS GROUPS: %d" % (len(tls_file.tls_desc_list))) ## assume REFMAC5 groups where Utotal = Utls + Biso(temp_factor) for tls_desc in tls_file.tls_desc_list: try: tls_group = tls_desc.construct_tls_group_with_atoms(struct) except: print console.formatExceptionInfo() console.stdoutln(" TLS GROUP: %s" % (tls_group.name)) for atm, Utls in tls_group.iter_atm_Utls(): bresi = atm.temp_factor atm.temp_factor = bresi + (Constants.U2B * numpy.trace(Utls) / 3.0) atm.U = (Constants.B2U * bresi * numpy.identity(3, float)) + Utls console.endln() ## LOGLINE return struct | 0e4b9c2feff511845b8e9a45c2ea172793555305 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10674/0e4b9c2feff511845b8e9a45c2ea172793555305/tlsmd_analysis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4444,
6999,
12,
1697,
67,
3168,
4672,
3536,
7968,
13348,
16,
24784,
281,
279,
3089,
1958,
67,
350,
533,
18,
8080,
16,
1623,
326,
2438,
12693,
3853,
364,
8098,
1041,
3853,
18,
971,
2898,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4444,
6999,
12,
1697,
67,
3168,
4672,
3536,
7968,
13348,
16,
24784,
281,
279,
3089,
1958,
67,
350,
533,
18,
8080,
16,
1623,
326,
2438,
12693,
3853,
364,
8098,
1041,
3853,
18,
971,
2898,
... |
min=1, max=100, callback=self.update, callbackOnReturn=True) | min=1, max=100 if not orngDebugging.orngDebuggingEnabled else 5, callback=self.update, callbackOnReturn=True) | def __init__(self, parent=None, signalManager = None): OWWidget.__init__(self, parent, signalManager, 'k-Means Clustering') | e2754f0b1e569edcc7299059f779a11b5924d920 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6366/e2754f0b1e569edcc7299059f779a11b5924d920/OWKMeans.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
33,
7036,
16,
4277,
1318,
273,
599,
4672,
18233,
4609,
16186,
2738,
972,
12,
2890,
16,
982,
16,
4277,
1318,
16,
296,
79,
17,
4667,
634,
29103,
6134,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
33,
7036,
16,
4277,
1318,
273,
599,
4672,
18233,
4609,
16186,
2738,
972,
12,
2890,
16,
982,
16,
4277,
1318,
16,
296,
79,
17,
4667,
634,
29103,
6134,... |
args = ex.args() | args = ex.operands() | def derivative(self, ex, operator): """ EXAMPLES:: | 7612ee2120a60eefd18f1ae87983f5942390076d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/7612ee2120a60eefd18f1ae87983f5942390076d/expression_conversions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16417,
12,
2890,
16,
431,
16,
3726,
4672,
3536,
5675,
8900,
11386,
2866,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16417,
12,
2890,
16,
431,
16,
3726,
4672,
3536,
5675,
8900,
11386,
2866,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
bodydata += struct.pack("=fff", face.normal[1], -face.normal[2], face.normal[0]) | bodydata += struct.pack("=fff", face.normal[1], -face.normal[2], -face.normal[0]) | def mapvertex(index, u, v): for mv in xrange(0, len(vertexmap)): if vertexmap[mv] == index and uvs[mv] == (u, v): return mv vertexmap.append(index) uvs.append( (u, v) ) return len(vertexmap)-1 | 6bb5b38fe37f3944e19d87f90e8fb45f626fc3e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2372/6bb5b38fe37f3944e19d87f90e8fb45f626fc3e5/windstille_export.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
852,
15281,
12,
1615,
16,
582,
16,
331,
4672,
364,
7701,
316,
12314,
12,
20,
16,
562,
12,
15281,
1458,
3719,
30,
309,
5253,
1458,
63,
17509,
65,
422,
770,
471,
582,
6904,
63,
17509,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
852,
15281,
12,
1615,
16,
582,
16,
331,
4672,
364,
7701,
316,
12314,
12,
20,
16,
562,
12,
15281,
1458,
3719,
30,
309,
5253,
1458,
63,
17509,
65,
422,
770,
471,
582,
6904,
63,
17509,
... |
v['pricelist_id']=shop.pricelist_id.id | v['pricelist_id'] = shop.pricelist_id.id | def onchange_shop_id(self, cr, uid, ids, shop_id): v={} if shop_id: shop=self.pool.get('sale.shop').browse(cr,uid,shop_id) v['project_id']=shop.project_id.id # Que faire si le client a une pricelist a lui ? if shop.pricelist_id.id: v['pricelist_id']=shop.pricelist_id.id #v['payment_default_id']=shop.payment_default_id.id return {'value':v} | fa29dc7d9e6d87f49bc3316e2b56fa977448ad6c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/fa29dc7d9e6d87f49bc3316e2b56fa977448ad6c/sale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
5020,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
12122,
67,
350,
4672,
331,
12938,
309,
12122,
67,
350,
30,
12122,
33,
2890,
18,
6011,
18,
588,
2668,
87,
534... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
5020,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
12122,
67,
350,
4672,
331,
12938,
309,
12122,
67,
350,
30,
12122,
33,
2890,
18,
6011,
18,
588,
2668,
87,
534... |
('L,TimeDateStamp', 'H,OffsetModuleName', 'H,Reserved') ) | ('I,TimeDateStamp', 'H,OffsetModuleName', 'H,Reserved') ) | def __init__(self, **args): for key, value in args.items(): setattr(self, key, value) | d0ca75794f69f1d09fd6d31d40ba2f1e9b3b7fb4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/213/d0ca75794f69f1d09fd6d31d40ba2f1e9b3b7fb4/pefile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2826,
1968,
4672,
364,
498,
16,
460,
316,
833,
18,
3319,
13332,
9241,
12,
2890,
16,
498,
16,
460,
13,
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,
2738,
972,
12,
2890,
16,
2826,
1968,
4672,
364,
498,
16,
460,
316,
833,
18,
3319,
13332,
9241,
12,
2890,
16,
498,
16,
460,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return self.is_unary_predicate(cond) and self.has_same_features(cond) and cond.argument.__class__ is DrtIndividualVariableExpression | return is_unary_predicate(cond) and self.has_same_features(cond) and cond.argument.__class__ is DrtIndividualVariableExpression | def is_possible_binding(self, cond): return self.is_unary_predicate(cond) and self.has_same_features(cond) and cond.argument.__class__ is DrtIndividualVariableExpression | dca74bcb89c3d17fa21605cefb94a3107a4c1fbb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2768/dca74bcb89c3d17fa21605cefb94a3107a4c1fbb/temporaldrt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
12708,
67,
7374,
12,
2890,
16,
6941,
4672,
327,
353,
67,
318,
814,
67,
18344,
12,
10013,
13,
471,
365,
18,
5332,
67,
14307,
67,
7139,
12,
10013,
13,
471,
6941,
18,
3446,
161... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
353,
67,
12708,
67,
7374,
12,
2890,
16,
6941,
4672,
327,
353,
67,
318,
814,
67,
18344,
12,
10013,
13,
471,
365,
18,
5332,
67,
14307,
67,
7139,
12,
10013,
13,
471,
6941,
18,
3446,
161... |
self.c.closeCursor(_self.cursor) | c.closeCursor(_self.cursor) | def __del__(_self): | 739ab39786e9e134ce23dc9615e472678f4ebc01 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/739ab39786e9e134ce23dc9615e472678f4ebc01/DBContainer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
24899,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
1001,
3771,
972,
24899,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
table = omero.tables.TableI(self.ctx, omero.model.OriginalFileI(1,None), storage) | table = omero.tables.TableI(self.ctx, omero.model.OriginalFileI(1,None), None, storage) | def testTableIncrDecr(self): storage = mock_storage() table = omero.tables.TableI(self.ctx, omero.model.OriginalFileI(1,None), storage) self.assertTrue(storage.up) table.cleanup() self.assertTrue(storage.down) | a7bf44d8e2cbb411e37c19eab6872649a38acbeb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/a7bf44d8e2cbb411e37c19eab6872649a38acbeb/servants.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1388,
382,
3353,
1799,
86,
12,
2890,
4672,
2502,
273,
5416,
67,
5697,
1435,
1014,
273,
8068,
2439,
18,
9373,
18,
1388,
45,
12,
2890,
18,
5900,
16,
8068,
2439,
18,
2284,
18,
8176,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1388,
382,
3353,
1799,
86,
12,
2890,
4672,
2502,
273,
5416,
67,
5697,
1435,
1014,
273,
8068,
2439,
18,
9373,
18,
1388,
45,
12,
2890,
18,
5900,
16,
8068,
2439,
18,
2284,
18,
8176,... |
self.influence = None | self.influence = 0 | def __init__(self, activationValue=0, age=0): self.oldActivationValue = None self.activationValue = activationValue self.age = age self.influence = None | 4c5558d41c268af2aed5dd7e820d0a0a2f432dfd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13131/4c5558d41c268af2aed5dd7e820d0a0a2f432dfd/ConceptNetwork.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
10027,
620,
33,
20,
16,
9388,
33,
20,
4672,
365,
18,
1673,
14857,
620,
273,
599,
365,
18,
16908,
620,
565,
273,
10027,
620,
365,
18,
410,
7734,
273,
93... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
10027,
620,
33,
20,
16,
9388,
33,
20,
4672,
365,
18,
1673,
14857,
620,
273,
599,
365,
18,
16908,
620,
565,
273,
10027,
620,
365,
18,
410,
7734,
273,
93... |
self._out.write('<?xml version="1.0" encoding="iso-8859-1"?>\n') | self._out.write('<?xml version="1.0" encoding="%s"?>\n' % self._encoding) | def startDocument(self): self._out.write('<?xml version="1.0" encoding="iso-8859-1"?>\n') | 55629583bcc04a7a80933907be9b667ff659bdcf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/55629583bcc04a7a80933907be9b667ff659bdcf/saxutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
2519,
12,
2890,
4672,
365,
6315,
659,
18,
2626,
2668,
12880,
2902,
1177,
1546,
21,
18,
20,
6,
2688,
1546,
9699,
17,
17258,
17,
21,
6,
35,
5333,
82,
6134,
2,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
787,
2519,
12,
2890,
4672,
365,
6315,
659,
18,
2626,
2668,
12880,
2902,
1177,
1546,
21,
18,
20,
6,
2688,
1546,
9699,
17,
17258,
17,
21,
6,
35,
5333,
82,
6134,
2,
-100,
-100,
-100,
-1... |
w("\t\t\t%s,\n" % self.buildSettingsId[1][0]) | for name, setting in self.buildSettingsId[1]: w("\t\t\t%s,\n" % setting) | def writeXCConfigurationList(self): w = self.file.write w("/* Begin XCConfigurationList section */\n") w("\t%s = {\n" % self.buildSettingsId[0]) w("\t\tisa = XCConfigurationList;\n") w("\t\tbuildConfigurations = (\n") w("\t\t\t%s,\n" % self.buildSettingsId[1][0]) w("\t\t);\n") w("\t\tdefaultConfigurationIsVisible = 0;\n") w("\t\tdefaultConfigurationName = Default;\n") w("\t};\n") w("/* End XCConfigurationList section */\n\n") self.writeXCBuildConfiguration() | d8a499abbdb5c22299bf584761258f470cf7eaec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7302/d8a499abbdb5c22299bf584761258f470cf7eaec/xcode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
60,
39,
1750,
682,
12,
2890,
4672,
341,
273,
365,
18,
768,
18,
2626,
341,
2932,
20308,
14323,
1139,
39,
1750,
682,
2442,
1195,
64,
82,
7923,
341,
31458,
88,
9,
87,
273,
18890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
60,
39,
1750,
682,
12,
2890,
4672,
341,
273,
365,
18,
768,
18,
2626,
341,
2932,
20308,
14323,
1139,
39,
1750,
682,
2442,
1195,
64,
82,
7923,
341,
31458,
88,
9,
87,
273,
18890,
... |
ATFileSchema = ATContentTypeSchema + Schema(( | ATFileSchema = ATContentTypeSchema.copy() + Schema(( | def __init__(self, prefix='', archive=False): pass | f98eabe813032df83369483850534aca1fdfcb3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11956/f98eabe813032df83369483850534aca1fdfcb3b/schemata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1633,
2218,
2187,
5052,
33,
8381,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1633,
2218,
2187,
5052,
33,
8381,
4672,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
prefix = ' ' style = 'same' lines = a[i1:i2] elif tag == 'replace' or tag == 'delete': prefix = '- ' style = 'removed' lines = a[i1:i2] elif tag == 'replace' or tag == 'insert': prefix = '+ ' style = 'added' lines = b[j1:j2] else: assert 0 for line in lines: chunk.append({ 'prefix': prefix, 'text': escape(line).rstrip().replace(" ", " "), 'style': style, }) | self._append_diff_lines(chunk, ' ', 'same', a[i1:i2]) if tag == 'replace' or tag == 'delete': self._append_diff_lines(chunk, '- ', 'removed', a[i1:i2]) if tag == 'replace' or tag == 'insert': self._append_diff_lines(chunk, '+ ', 'added', b[j1:j2]) | def get_diff(self, context=3): """Compute a diff between old and new values, and return a sequence of dictionaries with 'text' and 'style' keys. """ a = (self.old_value or '').rstrip().split("\n") b = (self.new_value or '').rstrip().split("\n") | 1f31b163bf5198aea957e226fa4eb0997faa0e9b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9478/1f31b163bf5198aea957e226fa4eb0997faa0e9b/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5413,
12,
2890,
16,
819,
33,
23,
4672,
3536,
7018,
279,
3122,
3086,
1592,
471,
394,
924,
16,
471,
327,
279,
3102,
434,
16176,
598,
296,
955,
11,
471,
296,
4060,
11,
1311,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5413,
12,
2890,
16,
819,
33,
23,
4672,
3536,
7018,
279,
3122,
3086,
1592,
471,
394,
924,
16,
471,
327,
279,
3102,
434,
16176,
598,
296,
955,
11,
471,
296,
4060,
11,
1311,
18... |
if getattr(self, 'ticket', False): extraHeaders = { 'Ticket' : self.ticket } else: extraHeaders = None | def _putItem(self, item): """ putItem should publish an item and return etag/date, etc. """ | 9407bec8d667ad0d61415abd978106b23f8daadc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/9407bec8d667ad0d61415abd978106b23f8daadc/Sharing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
458,
1180,
12,
2890,
16,
761,
4672,
3536,
1378,
1180,
1410,
3808,
392,
761,
471,
327,
13655,
19,
712,
16,
5527,
18,
3536,
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,
389,
458,
1180,
12,
2890,
16,
761,
4672,
3536,
1378,
1180,
1410,
3808,
392,
761,
471,
327,
13655,
19,
712,
16,
5527,
18,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
if is_current_branch(doomed_name) and doomed_name != 'master': git.switch_branch('master') | print 'Deleting branch "%s"...' % doomed_name, sys.stdout.flush() if __is_current_branch(doomed_name): check_local_changes() check_conflicts() check_head_top_equal() if doomed_name != 'master': git.switch_branch('master') | def delete_branch(doomed_name, force = False): doomed = stack.Series(doomed_name) if doomed.get_protected(): raise CmdException, 'This branch is protected. Delete is not permitted' if is_current_branch(doomed_name) and doomed_name != 'master': git.switch_branch('master') doomed.delete(force) if doomed_name != 'master': git.delete_branch(doomed_name) print 'Branch "%s" has been deleted.' % doomed_name | fe4f6d5812d62c1d6a5e0aa7536bad2e8a3beb6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12366/fe4f6d5812d62c1d6a5e0aa7536bad2e8a3beb6b/branch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
7500,
12,
2896,
362,
329,
67,
529,
16,
2944,
273,
1083,
4672,
741,
362,
329,
273,
2110,
18,
6485,
12,
2896,
362,
329,
67,
529,
13,
225,
309,
741,
362,
329,
18,
588,
67,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
7500,
12,
2896,
362,
329,
67,
529,
16,
2944,
273,
1083,
4672,
741,
362,
329,
273,
2110,
18,
6485,
12,
2896,
362,
329,
67,
529,
13,
225,
309,
741,
362,
329,
18,
588,
67,
1... |
self.satEntry = getConfigListEntry(_('Satellite'), config.tuning.sat) | self.satEntry = getConfigListEntry(_('Satellite'), self.tuning.sat) | def createSetup(self): self.typeOfTuningEntry = None self.satEntry = None | 51b1571e9e31d9f7ab1055f562a397a9bfa427ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/51b1571e9e31d9f7ab1055f562a397a9bfa427ab/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
7365,
12,
2890,
4672,
365,
18,
723,
951,
22313,
1622,
273,
599,
365,
18,
12973,
1622,
273,
599,
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,
752,
7365,
12,
2890,
4672,
365,
18,
723,
951,
22313,
1622,
273,
599,
365,
18,
12973,
1622,
273,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
""" clip the area where to draw. Just pass None (default) to reset the clip | """clip the area where to draw; pass None (default) to reset the clip | def set_clip(self, screen_rect=None): """ clip the area where to draw. Just pass None (default) to reset the clip LayeredDirty.set_clip(screen_rect=None): return None """ if screen_rect is None: self._clip = pygame.display.get_surface().get_rect() else: self._clip = screen_rect self._use_update = False | 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,
444,
67,
14161,
12,
2890,
16,
5518,
67,
2607,
33,
7036,
4672,
3536,
14161,
326,
5091,
1625,
358,
3724,
31,
1342,
599,
261,
1886,
13,
358,
2715,
326,
6807,
225,
12112,
329,
10785,
18,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
14161,
12,
2890,
16,
5518,
67,
2607,
33,
7036,
4672,
3536,
14161,
326,
5091,
1625,
358,
3724,
31,
1342,
599,
261,
1886,
13,
358,
2715,
326,
6807,
225,
12112,
329,
10785,
18,
5... |
raise KeyError, "filename %r not found" % name | raise KeyError("filename %r not found" % name) | def getmember(self, name): """Return a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more than once in the archive, its last occurence is assumed to be the most up-to-date version. """ tarinfo = self._getmember(name) if tarinfo is None: raise KeyError, "filename %r not found" % name return tarinfo | 9d576e732e0c14bd37ecb65d8001d6f596cc8566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/9d576e732e0c14bd37ecb65d8001d6f596cc8566/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
5990,
12,
2890,
16,
508,
4672,
3536,
990,
279,
20334,
966,
733,
364,
3140,
1375,
529,
10332,
971,
1375,
529,
11,
848,
486,
506,
1392,
316,
326,
5052,
16,
4999,
353,
11531,
18,
971... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5990,
12,
2890,
16,
508,
4672,
3536,
990,
279,
20334,
966,
733,
364,
3140,
1375,
529,
10332,
971,
1375,
529,
11,
848,
486,
506,
1392,
316,
326,
5052,
16,
4999,
353,
11531,
18,
971... |
<?php echo date("m.d.y"); ?> | <?php echo date("m.d.y"); ?> | def makePage( _T, _N, _M, MIRRORS_DATA, lang, charset ): navigation = Tree \ ( [ P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['home'], href=makeURL( '.', lang ))] ), Tree \ ( [ P ( contents = [ Img( src = '%(ROOT)simages/englishlogo.png', width = 16, height = 10), A( 'English', href='%(BASE)s.' )]), P ( contents = [ Img( src = '%(ROOT)simages/germanylogo.png', width = 16, height = 10), A( 'Deutsch', href='%(BASE)sde/' )]), P ( contents = [ Img( src = '%(ROOT)simages/greecelogo.png', width = 16, height = 10), A( 'Ελληυικά', href='%(BASE)sel/' )]), P ( contents = [ Img( src = '%(ROOT)simages/francelogo.png', width = 16, height = 10), A( 'Français', href='%(BASE)sfr/' )]), P ( contents = [ Img( src = '%(ROOT)simages/italylogo.png', width = 16, height = 10), A( 'Italiano', href='%(BASE)sit/' )]), P ( contents = [ Img( src = '%(ROOT)simages/netherlandslogo.png', width = 16, height = 10), A( 'Nederlands', href='%(BASE)snl/' )]), P ( contents = [ Img( src = '%(ROOT)simages/polandlogo.png', width = 16, height = 10), A( 'Polski', href='%(BASE)spl/' )]), P ( contents = [ Img( src = '%(ROOT)simages/portugallogo.png', width = 16, height = 10), A( 'Português', href='%(BASE)spt/' )]), P ( contents = [ Img( src = '%(ROOT)simages/russialogo.png', width = 16, height = 10), A( 'Русский', href='%(BASE)sru/' )]), P ( contents = [ Img( src = '%(ROOT)simages/spanishlogo.png', width = 16, height = 10), A( 'Español', href='%(BASE)ses/' )]), P ( contents = [ Img( src = '%(ROOT)simages/finlandlogo.png', width = 16, height = 10), A( 'Suomi', href='%(BASE)sfi/' )]), P ( contents = [ Img( src = '%(ROOT)simages/swedenlogo.png', width = 16, height = 10), A( 'Svenska', href='%(BASE)ssv/' )]), P ( contents = [ Img( src = '%(ROOT)simages/czechlogo.png', width = 16, height = 10), A( 'Česky', href='%(BASE)scs/' )]) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['news'], href=makeURL( 'news/', lang ) )]), Tree ( A( _N['archive'], href=makeURL( 'news/archive/', lang ) ) ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['introduction'], href=makeURL( 'introduction/', lang ) ) ]), Tree \ ( [ #A( _N['status'], href=makeURL('introduction/status/everything.html' ), A( _N['screenshots'], href=makeURL( 'pictures/screenshots/', lang) ), A( _N['ports'], href=makeURL( 'introduction/ports', lang ) ), A( _N['license'], href='%(BASE)slicense.html' ) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['download'], href=makeURL( 'download', lang ) )]), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), _N['documentation'] ]), Tree \ ( [ A( _N['users'], href=makeURL( 'documentation/users/', lang ) ), Tree \ ( [ A( _N['installation'], href=makeURL( 'documentation/users/installation', lang ) ), A( _N['using'], href=makeURL( 'documentation/users/using', lang ) ), A( _N['shell'], href=makeURL( 'documentation/users/shell/index', lang ) ), A( _N['applications'], href=makeURL( 'documentation/users/applications/index', lang ) ), A( _N['faq'], href=makeURL( 'documentation/users/faq', lang ) ), #_N['ports'], #A( _N['links'], href=makeURL( 'documentation/users/links', lang ) ) ] ), A( _N['developers'], href=makeURL( 'documentation/developers/index', lang ) ), Tree \ ( [ A( _N['contribute'], href=makeURL( 'documentation/developers/contribute', lang ) ), A( 'Roadmap', href=makeURL( 'documentation/developers/roadmap', lang ) ), A( _N['bug-tracker'], href='http://sourceforge.net/tracker/?atid=439463&group_id=43586&func=browse' ), A( _N['working-with-subversion'], href=makeURL( 'documentation/developers/svn', lang ) ), A( _N['compiling'], href=makeURL( 'documentation/developers/compiling', lang ) ), A( _N['application-development-manual'], href=makeURL( 'documentation/developers/app-dev/index', lang ) ), A( _N['zune-application-development-manual'], href=makeURL( 'documentation/developers/zune-application-development', lang ) ), A( _N['system-development-manual'], href=makeURL( 'documentation/developers/system-development', lang ) ), A( _N['debugging-manual'], href=makeURL( 'documentation/developers/debugging', lang ) ), A( _N['reference'], href=makeURL( 'documentation/developers/autodocs/index', lang ) ), A( _N['specifications'], href=makeURL( 'documentation/developers/specifications/', lang ) ), A( _N['ui-style-guide'], href=makeURL( 'documentation/developers/ui', lang ) ), A( _N['documenting'], href=makeURL( 'documentation/developers/documenting', lang ) ), A( _N['porting'], href=makeURL( 'documentation/developers/porting', lang ) ), A( _N['translating'], href=makeURL( 'documentation/developers/translating', lang ) ), A( _N['summaries'], href=makeURL( 'documentation/developers/summaries/', lang ) ), A( _N['links'], href=makeURL( 'documentation/developers/links', lang ) ) ] ) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['contact'], href=makeURL( 'contact', lang ) )]), Tree \ ( [ A( _N['mailing-lists'], href=makeURL( 'contact', lang, 'mailing-lists' ) ), #A( _N['forums'], href=makeURL( 'contact', lang, 'forums' ) ), A( _N['irc-channels'], href=makeURL( 'contact', lang, 'irc-channels' ) ) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['credits'], href=makeURL( 'credits', lang ) )]), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( 'Acknowledgements', href=makeURL( 'acknowledgements', lang ) )]), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), _N['pictures']]), Tree \ ( [ A( _N['developers'], href=makeURL( 'pictures/developers/', lang ) ), A( _N['developers-together'], href=makeURL( 'pictures/developers-together/', lang ) ) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['sponsors'], href=makeURL( 'sponsors', lang ) )]), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['linking'], href=makeURL( 'linking', lang ) )]), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['links'], href=makeURL( 'links', lang ) )]) ] ) counter = Img( src = 'http://www.hepe.com/cgi-bin/wwwcount.cgi?df=aros.dat&dd=E&ft=0' ) sponsors = Table\ ( cellspacing = 5, cellpadding = 0, contents = [ TR ( TD ( A ( Img( src = '%(ROOT)simages/trustec-small.png', border = 0 ), href = 'http://www.trustsec.de/' ) ) ), TR ( TD ( A ( Img( src = '%(ROOT)simages/genesi-small.gif', border = 0 ), href = 'http://www.pegasosppc.com/' ) ) ), TR ( TD ( A \ ( Img \ ( src = 'http://sflogo.sourceforge.net/sflogo.php?group_id=43586&type=1', width = 88, height = 31, border = 0, alt = 'SourceForge Logo' ), href = 'http://sourceforge.net/' ) ) ) ] ) bar = Table( border = 0, cellpadding = 2, cellspacing = 2, width = 171, valign = 'top', contents = [ TR( valign = 'top', contents = [ TD( rowspan = 8, width=15 ), TD() ] ), TR( valign = 'top', contents = TD( navigation ) ), TR( TD(), height=15 ), TR( valign = 'top', contents = TD( align = 'center', contents = counter ) ), TR( TD(), height=15 ), TR( valign = 'top', contents = TD( align = 'center', contents = sponsors ) ), TR( TD(), height=30 ), TR \ ( valign = 'top', contents = TD \ ( align = 'center', contents = A \ ( Img \ ( src = '%(ROOT)simages/noeupatents-small.png', border = 0 ), href = 'http://petition.eurolinux.org/' ) ) ) ] ) statsPHP = ''' <?php //define("_BBC_PAGE_NAME", "my page title"); define("_BBCLONE_DIR", "%(ROOT)smybbclone/"); define("COUNTER", _BBCLONE_DIR."index.php"); if (file_exists(COUNTER)) include_once(COUNTER); ?> ''' statsPHP2 = ''' <?php echo date("m.d.y"); ?> ''' statsPHP3 = ''' <?php echo "<map name=\\"map\\">"; echo "<area shape=\\"rect\\" coords=\\"11,80,82,95\\" alt=\\"http://www.aros.org\\" href=\\"http://www.aros.org\\">"; echo "<area shape=\\"rect\\" coords=\\"87,78,165,95\\" alt=\\"AROS-Exec\\" href=\\"http://www.aros-exec.org\\">"; echo "<area shape=\\"rect\\" coords=\\"244,77,323,95166,77,240,95\\" alt=\\"Team AROS\\" href=\\"http://www.teamaros.org\\">"; echo "<area shape=\\"rect\\" coords=\\"166,77,240,95\\" alt=\\"AROS-Exec Archives\\" href=\\"http://archives.aros-exec.org\\">"; echo "</map>"; ?> ''' statsPHP4 = ''' <?php echo "<table width=\\"100%%\\"><tr><td>"; echo "<div style=\\"text-align: right;\\">"; echo "<font color=\\"#aaaaaa\\">"; ?> ''' statsPHP6 = ''' <?php echo "</font></div>"; echo "</p></tr></td></table>"; ?> ''' statsPHP5= ''' <?php include( '/home/groups/a/ar/aros/htdocs/rsfeed/browserdetect.php'); $win_ie56 = (browser_detection('browser') == 'ie' ) && (browser_detection('number') >= 5 ) && (browser_detection('number') < 7 ); if ($win_ie56) { echo \"<img src=\\"/images/kittymascot.gif\\" style=\\"float:right\\" border=\\"0\\"></img><img src=\\"/images/toplogomenu.gif\\" border=\\"0\\" usemap=\\"#map\\"></img>"; } else { echo \"<img src=\\"/images/kittymascot.png\\" style=\\"float:right\\" border=\\"0\\"></img><img src=\\"/images/toplogomenu.png\\" border=\\"0\\" usemap=\\"#map\\"></img>"; } ?> ''' page = HTML( [ Head( [ Charset( charset ), Title( 'AROS Research Operating System' ), Link( href = '%(ROOT)saros.css', type = 'text/css', rel = 'stylesheet' ), Meta( name = 'keywords', content = 'AROS, OS, operating system, research, open source, portage' ) ] ), Body( style = 'margin: 0px;', bgcolor = '#ffffff', contents = [ statsPHP3, Table( border = 0, cellspacing = 0, cellpadding = 0, width = '100%%', contents = [ TR( [ TD( halign = 'top', width = '100%%', height = 109, background='%(ROOT)simages/backgroundtop.png' ,rowspan = 4, contents = statsPHP5) | 6f57d571cb5a191a538d1b271f46a3e100233a4d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4747/6f57d571cb5a191a538d1b271f46a3e100233a4d/page.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
1964,
12,
389,
56,
16,
389,
50,
16,
389,
49,
16,
490,
7937,
2784,
55,
67,
4883,
16,
3303,
16,
4856,
262,
30,
10394,
273,
4902,
521,
261,
306,
453,
261,
2939,
273,
306,
2221,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1964,
12,
389,
56,
16,
389,
50,
16,
389,
49,
16,
490,
7937,
2784,
55,
67,
4883,
16,
3303,
16,
4856,
262,
30,
10394,
273,
4902,
521,
261,
306,
453,
261,
2939,
273,
306,
2221,
... |
pass | pass | def replace(s, old, new, maxsplit=0): """replace (str, old, new[, maxsplit]) -> string Return a copy of string str with all occurrences of substring old replaced by new. If the optional argument maxsplit is given, only the first maxsplit occurrences are replaced. """ return s.replace(old, new, maxsplit) | 857c4c36b962c6e74559e045c7fb43177dd5bcea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/857c4c36b962c6e74559e045c7fb43177dd5bcea/string.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
12,
87,
16,
1592,
16,
394,
16,
943,
4939,
33,
20,
4672,
3536,
2079,
261,
701,
16,
1592,
16,
394,
63,
16,
943,
4939,
5717,
317,
533,
225,
2000,
279,
1610,
434,
533,
609,
598,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
12,
87,
16,
1592,
16,
394,
16,
943,
4939,
33,
20,
4672,
3536,
2079,
261,
701,
16,
1592,
16,
394,
63,
16,
943,
4939,
5717,
317,
533,
225,
2000,
279,
1610,
434,
533,
609,
598,
... |
if None and not os.path.isfile(fname): | if not os.path.isfile(fname): | def extractSrpm(pkg, pkgdir, filecache, repodir, oldpkg): pkgname = pkg["name"] files = pkg.getFilenames() i = pkg.getSpecfile(files) specfile = files[i] changelogtime = None if oldpkg and oldpkg["changelogtime"]: changelogtime = oldpkg["changelogtime"][0] if os.path.exists("%s/%s" % (pkgdir, specfile)): checksum = getChecksum("%s/%s" % (pkgdir, specfile)) # same spec file in repo and in rpm: nothing to do if checksum == pkg["filemd5s"][i]: return # If we don't have the previous package anymore, but there is still # a specfile, read the time of the last changelog entry. if changelogtime == None: l = open("%s/%s" % (pkgdir, specfile), "r").readlines() while l: if l[0] == "%changelog\n": l.pop(0) break l.pop(0) if l: l = l[0].split() if l and l[0] == "*" and len(l) >= 5: try: import calendar changelogtime = time.strptime(" ".join(l[1:5]), "%a %b %d %Y") changelogtime = calendar.timegm(changelogtime) except: pass os.system('rm -rf "%s"' % pkgdir) makeDirs(pkgdir) extractRpm(pkg, pkgdir + "/") for f in os.listdir(pkgdir): if f not in files and f not in ("Makefile", "sources"): fsrc = pkgdir + "/" + f os.unlink(fsrc) os.system("cd %s/.. && GIT_DIR=%s git-update-index --remove %s/%s" % (pkgdir, repodir, pkgname, f)) if "sources" in files or "Makefile" in files: raise ValueError, \ "src.rpm contains sources/Makefile: %s" % pkg.filename EXTRACT_SOURCE_FOR = ["MAKEDEV", "anaconda", "anaconda-help", "anaconda-product", "basesystem", "booty", "chkconfig", "device-mapper", "dmraid", "firstboot", "glibc-kernheaders", "hwdata", "initscripts", "kudzu", "mkinitrd", "pam_krb5", "passwd", "redhat-config-kickstart", "redhat-config-netboot", "redhat-config-network", "redhat-config-securitylevel", "redhat-logos", "redhat-release", "rhn-applet", "rhnlib", "rhpl", "sysklogd", "system-config-printer", "system-config-securitylevel", "tux", "udev"] if repodir.endswith("/RHEL2.1.git"): EXTRACT_SOURCE_FOR.remove("redhat-config-network") sources = [] if filecache: for i in xrange(len(files)): f = files[i] if not S_ISREG(pkg["filemodes"][i]) or not isBinary(f): continue fsrc = pkgdir + "/" + f # should we use sha instead of md5: #md5data = getChecksum(fsrc, "sha") md5data = pkg["filemd5s"][i] fdir = "%s/%s" % (filecache, md5data[0:2]) fname = "%s/%s.bin" % (fdir, md5data) # XXX disable this until my machine has more disk space if None and not os.path.isfile(fname): makeDirs(fdir) doLnOrCopy(fsrc, fname) if pkg["name"] in EXTRACT_SOURCE_FOR: if fsrc.find(".tar") >= 0: tempdir = "%s/e.tar" % pkgdir os.mkdir(tempdir) dirname = explodeFile(fsrc, tempdir, "0") os.rename(dirname, "%s/tar" % pkgdir) os.rmdir(tempdir) os.unlink(fsrc) sources.append("%s %s\n" % (md5data, f)) sources.sort(cmpNoMD5) writeFile(pkgdir + "/sources", sources) writeFile(pkgdir + "/Makefile", [ "include ../pyrpm/Makefile.srpm\n", "NAME:=%s\nSPECFILE:=%s\n" % (pkg["name"], specfile)]) # XXX: also checkin the data into a per-package repo os.environ["GIT_DIR"] = repodir os.system("cd %s/.. && { find %s -type f -print | xargs git-update-index -q --add --refresh; }" % (pkgdir, pkgname)) os.system('cd %s/.. && { for file in $(git-ls-files); do [ ! -f "$file" ] && git-update-index --remove "$file"; done; }' % pkgdir) del os.environ["GIT_DIR"] # Add changelog text: (fd, tmpfile) = mkstemp_file(tmpdir, special=1) fd.write("update to %s" % pkg.getNVR()) if oldpkg: fd.write(" (from %s-%s)" % (oldpkg["version"], oldpkg["release"])) if changelogtime: fd.write("\n" + pkg.getChangeLog(newer=changelogtime)) fd.write("\n") fd.close() del fd changelog = "-F " + tmpfile # Add a user name and email: user = "cvs@devel.redhat.com" email = user if pkg["changelogname"]: user = pkg["changelogname"][0] if user.rfind("> ") != -1: user = user[:user.rfind("> ") + 1] email = user if email.find("<") != -1: email = email[email.find("<") + 1:email.rfind(">") + 1] if user.rfind(" <") != -1: user = user[:user.rfind(" <")] # XXX if we monitor trees, we could change the checkin time to # first day of release of the rpm package instead of rpm buildtime buildtime = str(pkg.hdr.getOne("buildtime")) os.system("cd " + repodir + " && GIT_AUTHOR_NAME=\"" + user + \ "\" GIT_AUTHOR_EMAIL=\"" + email + "\" GIT_AUTHOR_DATE=" + \ buildtime + " GIT_COMMITTER_NAME=\"" + user + \ "\" GIT_COMMITTER_EMAIL=\"" + email + "\" GIT_COMMITTER_DATE=" + \ buildtime + " GIT_DIR=" + repodir + " git commit " + changelog) if tmpfile != None: os.unlink(tmpfile) | 427871e48b993cbe1bec0e26f0693386c8014c95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/427871e48b993cbe1bec0e26f0693386c8014c95/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
55,
86,
7755,
12,
10657,
16,
3475,
1214,
16,
585,
2493,
16,
2071,
369,
481,
16,
1592,
10657,
4672,
29348,
273,
3475,
9614,
529,
11929,
1390,
273,
3475,
18,
588,
25579,
6809,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
55,
86,
7755,
12,
10657,
16,
3475,
1214,
16,
585,
2493,
16,
2071,
369,
481,
16,
1592,
10657,
4672,
29348,
273,
3475,
9614,
529,
11929,
1390,
273,
3475,
18,
588,
25579,
6809,
1435,
... |
width: %d | width: %dpx; | def render_current_time(): import time html.write("<div class=time>%s</div>" % time.strftime("%H:%M")) | 425dd5d0916c74c41cf0813334848e9b07b233ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5589/425dd5d0916c74c41cf0813334848e9b07b233ef/shipped.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
2972,
67,
957,
13332,
1930,
813,
1729,
18,
2626,
2932,
32,
2892,
667,
33,
957,
9822,
87,
1757,
2892,
2984,
738,
813,
18,
701,
9982,
27188,
44,
5319,
49,
6,
3719,
225,
2,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
2972,
67,
957,
13332,
1930,
813,
1729,
18,
2626,
2932,
32,
2892,
667,
33,
957,
9822,
87,
1757,
2892,
2984,
738,
813,
18,
701,
9982,
27188,
44,
5319,
49,
6,
3719,
225,
2,
-1... |
self.body.append(self.starttag(node, 'a', '[', href=href, CLASS='citation-reference')) | self.body.append(self.starttag(node, 'a', '[', CLASS='citation-reference', **(href and {'href': href} or {}))) | def visit_citation_reference(self, node): href = '' if node.has_key('refid'): href = '#' + node['refid'] elif node.has_key('refname'): href = '#' + self.document.nameids[node['refname']] self.body.append(self.starttag(node, 'a', '[', href=href, CLASS='citation-reference')) | d51d92c3a95b64bd15b83735092b5939a8e1814a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/d51d92c3a95b64bd15b83735092b5939a8e1814a/html4css1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
71,
8773,
67,
6180,
12,
2890,
16,
756,
4672,
3897,
273,
875,
309,
756,
18,
5332,
67,
856,
2668,
1734,
350,
11,
4672,
3897,
273,
6501,
397,
756,
3292,
1734,
350,
3546,
1327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
71,
8773,
67,
6180,
12,
2890,
16,
756,
4672,
3897,
273,
875,
309,
756,
18,
5332,
67,
856,
2668,
1734,
350,
11,
4672,
3897,
273,
6501,
397,
756,
3292,
1734,
350,
3546,
1327,
... |
else: mname = self.module()._obj.__name__ | elif self.module() is not None: mname = self.module()._obj.__name__ else: self._pkg = None return None | def package(self): if not hasattr(self, '_pkg'): # Find the module. if type(self._obj) is _ModuleType: mname = self._obj.__name__ else: mname = self.module()._obj.__name__ | 856b154cf7407c5d9a69312fe04a968af9fae0f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/856b154cf7407c5d9a69312fe04a968af9fae0f1/uid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2181,
12,
2890,
4672,
309,
486,
3859,
12,
2890,
16,
2070,
10657,
11,
4672,
468,
4163,
326,
1605,
18,
309,
618,
12,
2890,
6315,
2603,
13,
353,
389,
3120,
559,
30,
312,
529,
273,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2181,
12,
2890,
4672,
309,
486,
3859,
12,
2890,
16,
2070,
10657,
11,
4672,
468,
4163,
326,
1605,
18,
309,
618,
12,
2890,
6315,
2603,
13,
353,
389,
3120,
559,
30,
312,
529,
273,
365,
... |
self.uri,self.sound,self.phonetic=[None]*3 | def __init__(self,name,value,rfc2425parameters=None): """Initialize a `VCardSound` object. | 6560fbcf4900a7ede466b0f07b37831cc5b55f83 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12769/6560fbcf4900a7ede466b0f07b37831cc5b55f83/vcard.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
529,
16,
1132,
16,
16784,
3247,
2947,
3977,
33,
7036,
4672,
3536,
7520,
279,
1375,
58,
6415,
24331,
68,
733,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
529,
16,
1132,
16,
16784,
3247,
2947,
3977,
33,
7036,
4672,
3536,
7520,
279,
1375,
58,
6415,
24331,
68,
733,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
document = desktop.loadComponentFromURL(tempFile, "_blank", 0, | document = desktop.loadComponentFromURL(tempURL, "_blank", 0, | def convertClipboard(self): #copy/paste from above self._readconfig() logging.debug("call to convertClipboard") desktop = self._context.ServiceManager.createInstanceWithContext( "com.sun.star.frame.Desktop", self._context) clipboard = self._context.ServiceManager.createInstanceWithContext( "com.sun.star.datatransfer.clipboard.SystemClipboard", self._context) contents = clipboard.getContents() logging.debug("Contents:\n%s\n%s\n%s", "-" * 78, "* " + "\n* ".join(dir(contents)), "=" * 78) flavors = contents.getTransferDataFlavors() logging.debug("Flavors:\n%s\n%s\n%s", "-" * 78, "* " + "\n* ".join([flavor.MimeType for flavor in flavors]), "=" * 78) mimetype = \ 'application/x-openoffice-embed-source-xml;windows_formatname="Star \ Embed Source (XML)"' found_flavor = None for flavor in contents.getTransferDataFlavors(): if flavor.MimeType == mimetype: found_flavor = flavor break | f1564a66ced8b4798df75c8535547dad93712567 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12151/f1564a66ced8b4798df75c8535547dad93712567/extension_object.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
15339,
3752,
12,
2890,
4672,
468,
3530,
19,
29795,
628,
5721,
365,
6315,
896,
1425,
1435,
2907,
18,
4148,
2932,
1991,
358,
1765,
15339,
3752,
7923,
21304,
273,
365,
6315,
2472,
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,
1765,
15339,
3752,
12,
2890,
4672,
468,
3530,
19,
29795,
628,
5721,
365,
6315,
896,
1425,
1435,
2907,
18,
4148,
2932,
1991,
358,
1765,
15339,
3752,
7923,
21304,
273,
365,
6315,
2472,
18,
... |
self.data.organism = self.data.organism + line[5:] | self.data.organism += line[5:] | def organism_species(self, line): self.data.organism = self.data.organism + line[5:] | 1a15e85e88e4981766443c53977e691256208447 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7167/1a15e85e88e4981766443c53977e691256208447/SProt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15501,
6228,
67,
22657,
12,
2890,
16,
980,
4672,
365,
18,
892,
18,
22543,
6228,
1011,
980,
63,
25,
26894,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
15501,
6228,
67,
22657,
12,
2890,
16,
980,
4672,
365,
18,
892,
18,
22543,
6228,
1011,
980,
63,
25,
26894,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
alpha = range(len(partition)) | alpha = [] for i in xrange(len(partition)): alpha.append(sum([len(cell) for cell in partition[:i]])) | def coarsest_equitable_refinement(self, partition, sparse=False): """ Returns the coarsest partition which is finer than the input partition, and equitable with respect to self. | cf36b966d84c2061675286e884888154987dabbc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/cf36b966d84c2061675286e884888154987dabbc/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1825,
5913,
395,
67,
14298,
9085,
67,
266,
926,
820,
12,
2890,
16,
3590,
16,
9387,
33,
8381,
4672,
3536,
2860,
326,
1825,
5913,
395,
3590,
1492,
353,
574,
264,
2353,
326,
810,
3590,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1825,
5913,
395,
67,
14298,
9085,
67,
266,
926,
820,
12,
2890,
16,
3590,
16,
9387,
33,
8381,
4672,
3536,
2860,
326,
1825,
5913,
395,
3590,
1492,
353,
574,
264,
2353,
326,
810,
3590,
16... |
"""this function suffers from horrible polymorphism sometimes we get a Document, sometimes a plain dict """ if isinstance(document, dict): return document['document_id'] in self.documents_ids return document.document_id in self.documents_ids | return document['document_id'] in self.documents_ids | def isKnown(self, document): """this function suffers from horrible polymorphism sometimes we get a Document, sometimes a plain dict """ if isinstance(document, dict): return document['document_id'] in self.documents_ids return document.document_id in self.documents_ids | 9b42b264624664d39b69c97853926dcdc1d5c3d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2259/9b42b264624664d39b69c97853926dcdc1d5c3d7/p2pquerier.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
11925,
12,
2890,
16,
1668,
4672,
3536,
2211,
445,
272,
3809,
414,
628,
29404,
86,
1523,
2952,
2942,
7657,
6228,
16594,
732,
336,
279,
4319,
16,
16594,
279,
7351,
2065,
3536,
309,
15... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
11925,
12,
2890,
16,
1668,
4672,
3536,
2211,
445,
272,
3809,
414,
628,
29404,
86,
1523,
2952,
2942,
7657,
6228,
16594,
732,
336,
279,
4319,
16,
16594,
279,
7351,
2065,
3536,
309,
15... |
if self.info.export_values or unnamed_enum: code += in_indent + '.export_values()\n' code += indent + ';\n\n' codeunit.Write('module', code) exported_names[self.enum.FullName()] = 1 def ExportUniqueInt(self, codeunit): write = lambda s: codeunit.Write('declaration', s) write('// Unique type for unnamed enums\n') write(' write(' write('template<int num>\n') write('struct UniqueInt {\n') write(' int v;\n') write(' enum { value=num };\n') write(' UniqueInt(int v_):\n') write(' v(v_)\n') write(' {}\n') write(' operator int() const\n') write(' { return v; }\n') write('};\n') write(' | else: code += indent + namespaces.python code += 'scope().attr("%s") = (int)%s;\n' % (rename, value_fullname ) if self.info.export_values and not unnamed_enum: code += in_indent + '.export_values()\n' if not unnamed_enum: code += indent + ';\n' code += '\n' codeunit.Write('module', code) exported_names[self.enum.FullName()] = 1 | def Export(self, codeunit, exported_names): if not self.info.exclude: indent = self.INDENT in_indent = self.INDENT*2 rename = self.info.rename or self.enum.name full_name = self.enum.FullName() unnamed_enum = False if rename.startswith('$_') or rename.startswith('._'): unique_number = hash(self.info.include) unnamed_enum = True self.ExportUniqueInt(codeunit) full_name = namespaces.pyste + 'UniqueInt<%d>' % unique_number rename = "unnamed" code = indent + namespaces.python code += 'enum_< %s >("%s")\n' % (full_name, rename) for name in self.enum.values: rename = self.info[name].rename or name value_fullname = self.enum.ValueFullName(name) code += in_indent + '.value("%s", %s)\n' % (rename, value_fullname) if self.info.export_values or unnamed_enum: code += in_indent + '.export_values()\n' code += indent + ';\n\n' codeunit.Write('module', code) exported_names[self.enum.FullName()] = 1 | b58812e7f15aaf3ac6a4cfd5c906e23adf8ee1cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9978/b58812e7f15aaf3ac6a4cfd5c906e23adf8ee1cd/EnumExporter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11054,
12,
2890,
16,
981,
4873,
16,
11518,
67,
1973,
4672,
309,
486,
365,
18,
1376,
18,
10157,
30,
3504,
273,
365,
18,
2356,
2222,
316,
67,
9355,
273,
365,
18,
2356,
2222,
14,
22,
64... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11054,
12,
2890,
16,
981,
4873,
16,
11518,
67,
1973,
4672,
309,
486,
365,
18,
1376,
18,
10157,
30,
3504,
273,
365,
18,
2356,
2222,
316,
67,
9355,
273,
365,
18,
2356,
2222,
14,
22,
64... |
cfg.set(section_name, "smtp", account.defaultSMTPAccount.itsUUID) | cfg[section_name][u"smtp"] = account.defaultSMTPAccount.itsUUID | def save(rv, filename): """Save selected settings information, including all sharing accounts and shares (whether published or subscribed), to an INI file""" cfg = ConfigParser.ConfigParser() # Sharing accounts currentAccount = schema.ns("osaf.sharing", rv).currentWebDAVAccount.item section_prefix = "sharing_account" counter = 1 for account in sharing.WebDAVAccount.iterItems(rv): if account.username: # skip account if not configured section_name = "%s_%d" % (section_prefix, counter) cfg.add_section(section_name) cfg.set(section_name, "type", "webdav account") cfg.set(section_name, "uuid", account.itsUUID) cfg.set(section_name, "title", account.displayName) cfg.set(section_name, "host", account.host) cfg.set(section_name, "path", account.path) cfg.set(section_name, "username", account.username) cfg.set(section_name, "password", account.password) cfg.set(section_name, "port", account.port) cfg.set(section_name, "usessl", account.useSSL) if account is currentAccount: cfg.set(section_name, "default", "True") counter += 1 # Subscriptions mine = schema.ns("osaf.pim", rv).mine section_prefix = "share" counter = 1 for col in pim.ContentCollection.iterItems(rv): share = sharing.getShare(col) if share: section_name = "%s_%d" % (section_prefix, counter) cfg.add_section(section_name) cfg.set(section_name, "type", "share") cfg.set(section_name, "title", share.contents.displayName) cfg.set(section_name, "mine", col in mine.sources) uc = usercollections.UserCollection(col) if getattr(uc, "color", False): color = uc.color cfg.set(section_name, "red", color.red) cfg.set(section_name, "green", color.green) cfg.set(section_name, "blue", color.blue) cfg.set(section_name, "alpha", color.alpha) urls = sharing.getUrls(share) if sharing.isSharedByMe(share): cfg.set(section_name, "publisher", "True") cfg.set(section_name, "url", share.getLocation()) else: cfg.set(section_name, "publisher", "False") url = share.getLocation() cfg.set(section_name, "url", url) if url != urls[0]: cfg.set(section_name, "ticket", urls[0]) ticketFreeBusy = getattr(share.conduit, "ticketFreeBusy", None) if ticketFreeBusy: cfg.set(section_name, "freebusy", "True") counter += 1 # SMTP accounts section_prefix = "smtp_account" counter = 1 for account in pim.mail.SMTPAccount.iterItems(rv): if account.isActive and account.host: section_name = "%s_%d" % (section_prefix, counter) cfg.add_section(section_name) cfg.set(section_name, "type", "smtp account") cfg.set(section_name, "uuid", account.itsUUID) cfg.set(section_name, "title", account.displayName) cfg.set(section_name, "host", account.host) cfg.set(section_name, "auth", account.useAuth) cfg.set(section_name, "username", account.username) cfg.set(section_name, "password", account.password) cfg.set(section_name, "name", account.fromAddress.fullName) cfg.set(section_name, "address", account.fromAddress.emailAddress) cfg.set(section_name, "port", account.port) cfg.set(section_name, "security", account.connectionSecurity) counter += 1 # IMAP accounts currentAccount = schema.ns("osaf.pim", rv).currentMailAccount.item section_prefix = "imap_account" counter = 1 for account in pim.mail.IMAPAccount.iterItems(rv): if account.isActive and account.host: section_name = "%s_%d" % (section_prefix, counter) cfg.add_section(section_name) cfg.set(section_name, "type", "imap account") cfg.set(section_name, "uuid", account.itsUUID) cfg.set(section_name, "title", account.displayName) cfg.set(section_name, "host", account.host) cfg.set(section_name, "username", account.username) cfg.set(section_name, "password", account.password) cfg.set(section_name, "name", account.replyToAddress.fullName) cfg.set(section_name, "address", account.replyToAddress.emailAddress) cfg.set(section_name, "port", account.port) cfg.set(section_name, "security", account.connectionSecurity) if account.defaultSMTPAccount: cfg.set(section_name, "smtp", account.defaultSMTPAccount.itsUUID) if account is currentAccount: cfg.set(section_name, "default", "True") counter += 1 # POP accounts currentAccount = schema.ns("osaf.pim", rv).currentMailAccount.item section_prefix = "pop_account" counter = 1 for account in pim.mail.POPAccount.iterItems(rv): if account.isActive and account.host: section_name = "%s_%d" % (section_prefix, counter) cfg.add_section(section_name) cfg.set(section_name, "type", "pop account") cfg.set(section_name, "uuid", account.itsUUID) cfg.set(section_name, "title", account.displayName) cfg.set(section_name, "host", account.host) cfg.set(section_name, "username", account.username) cfg.set(section_name, "password", account.password) cfg.set(section_name, "name", account.replyToAddress.fullName) cfg.set(section_name, "address", account.replyToAddress.emailAddress) cfg.set(section_name, "port", account.port) cfg.set(section_name, "security", account.connectionSecurity) cfg.set(section_name, "leave", account.leaveOnServer) if account.defaultSMTPAccount: cfg.set(section_name, "smtp", account.defaultSMTPAccount.itsUUID) if account is currentAccount: cfg.set(section_name, "default", "True") counter += 1 # Show timezones cfg.add_section("timezones") showTZ = schema.ns("osaf.app", rv).TimezonePrefs.showUI cfg.set("timezones", "type", "show timezones") cfg.set("timezones", "show_timezones", showTZ) # Visible hours cfg.add_section("visible_hours") cfg.set("visible_hours", "type", "visible hours") calPrefs = schema.ns("osaf.framework.blocks.calendar", rv).calendarPrefs cfg.set("visible_hours", "height_mode", calPrefs.hourHeightMode) cfg.set("visible_hours", "num_hours", calPrefs.visibleHours) # Event Logger cfg.add_section("event_logger") eventHook = schema.ns("eventLogger", rv).EventLoggingHook cfg.set("event_logger", "type", "event logger") active = eventHook.logging cfg.set("event_logger", "active", active) output = file(filename, "w") cfg.write(output) output.close() | 5fcc26e162e0c42f8a4ee0116787795eb4f10175 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/5fcc26e162e0c42f8a4ee0116787795eb4f10175/settings.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
4962,
16,
1544,
4672,
3536,
4755,
3170,
1947,
1779,
16,
6508,
777,
21001,
9484,
471,
24123,
261,
3350,
2437,
9487,
578,
16445,
3631,
358,
392,
2120,
45,
585,
8395,
225,
2776,
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,
1923,
12,
4962,
16,
1544,
4672,
3536,
4755,
3170,
1947,
1779,
16,
6508,
777,
21001,
9484,
471,
24123,
261,
3350,
2437,
9487,
578,
16445,
3631,
358,
392,
2120,
45,
585,
8395,
225,
2776,
2... |
extract(vm, test_name + ".tar.bz2", "autotest/tests") | extract(vm, tarred_test_path, "/") | def extract(vm, remote_path, dest_dir="."): """ Extract a .tar.bz2 file on the guest. | 9a0ed8a302f92cd95aef5e2febbdd589f45c65ce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10349/9a0ed8a302f92cd95aef5e2febbdd589f45c65ce/autotest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
12,
3489,
16,
2632,
67,
803,
16,
1570,
67,
1214,
1546,
1199,
4672,
3536,
8152,
279,
263,
11718,
18,
25292,
22,
585,
603,
326,
13051,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
12,
3489,
16,
2632,
67,
803,
16,
1570,
67,
1214,
1546,
1199,
4672,
3536,
8152,
279,
263,
11718,
18,
25292,
22,
585,
603,
326,
13051,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
print 'No input data 2' | def checkJob( self, job, classAdJob ): """This method controls the checking of the job. """ self.log.verbose( 'Job %s will be processed' % ( job ) ) | 9dbdd9496601b617ceebb4a55c4b79c8349ae738 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9dbdd9496601b617ceebb4a55c4b79c8349ae738/JobSchedulingAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
2278,
12,
365,
16,
1719,
16,
667,
1871,
2278,
262,
30,
3536,
2503,
707,
11022,
326,
6728,
434,
326,
1719,
18,
3536,
365,
18,
1330,
18,
11369,
12,
296,
2278,
738,
87,
903,
506,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
2278,
12,
365,
16,
1719,
16,
667,
1871,
2278,
262,
30,
3536,
2503,
707,
11022,
326,
6728,
434,
326,
1719,
18,
3536,
365,
18,
1330,
18,
11369,
12,
296,
2278,
738,
87,
903,
506,
5... | |
print e | def recheckPluginsErrors(self, plugins, plugin_api): for plugin in plugins: if plugin['error']: error = False missing = [] missing_dbus = [] | 6ee3bd6ad88495bc7319b4d9345f2c1b25932dec /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/6ee3bd6ad88495bc7319b4d9345f2c1b25932dec/engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
1893,
9461,
4229,
12,
2890,
16,
4799,
16,
1909,
67,
2425,
4672,
364,
1909,
316,
4799,
30,
309,
1909,
3292,
1636,
3546,
30,
555,
273,
1083,
3315,
273,
5378,
3315,
67,
1966,
407,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
283,
1893,
9461,
4229,
12,
2890,
16,
4799,
16,
1909,
67,
2425,
4672,
364,
1909,
316,
4799,
30,
309,
1909,
3292,
1636,
3546,
30,
555,
273,
1083,
3315,
273,
5378,
3315,
67,
1966,
407,
27... | |
self.fail('Expected DeprecationWarning, none given') | self.fail('Unexpected DeprecationWarning, ' 'no warnings expected here') | def testAllowed(self): """hasRole is an alias for allowed, which should be unaffected.""" try: self.userObject.allowed(None) except DeprecationWarning: self.fail('Expected DeprecationWarning, none given') else: pass | 53a551bb08080f5e8e62bf8d5c4350cda63c1ae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/53a551bb08080f5e8e62bf8d5c4350cda63c1ae5/testDeprecatedAPI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
5042,
12,
2890,
4672,
3536,
5332,
2996,
353,
392,
2308,
364,
2935,
16,
1492,
1410,
506,
640,
20119,
12123,
775,
30,
365,
18,
1355,
921,
18,
8151,
12,
7036,
13,
1335,
24041,
30,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
5042,
12,
2890,
4672,
3536,
5332,
2996,
353,
392,
2308,
364,
2935,
16,
1492,
1410,
506,
640,
20119,
12123,
775,
30,
365,
18,
1355,
921,
18,
8151,
12,
7036,
13,
1335,
24041,
30,
3... |
bestlist = self.bestPackagesFromList(satisfiers) | bestlist = self.bestPackagesFromList(satisfiers, arch=self.compatarch) | def _provideToPkg(self, req): #this is stolen from Anaconda bestlist = None (r, f, v) = req | 8a7700a4a1a80df0b403c5ce61bdf34f20148056 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8489/8a7700a4a1a80df0b403c5ce61bdf34f20148056/gather.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
685,
6768,
774,
11264,
12,
2890,
16,
1111,
4672,
468,
2211,
353,
384,
355,
275,
628,
1922,
16329,
2414,
3796,
1098,
273,
599,
261,
86,
16,
284,
16,
331,
13,
273,
1111,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
685,
6768,
774,
11264,
12,
2890,
16,
1111,
4672,
468,
2211,
353,
384,
355,
275,
628,
1922,
16329,
2414,
3796,
1098,
273,
599,
261,
86,
16,
284,
16,
331,
13,
273,
1111,
2,
-100,
... |
SyntaxError: augmented assignment to generator expression not possible (<doctest test.test_genexps.__test__.doctests[39]>, line 1) | SyntaxError: augmented assignment to generator expression not possible (<doctest test.test_genexps.__test__.doctests[41]>, line 1) | >>> def f(n): | 29d4ceb11fbd1f6e11e36be19da019271e95c43f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/29d4ceb11fbd1f6e11e36be19da019271e95c43f/test_genexps.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
284,
12,
82,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
284,
12,
82,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.version = 3.0 | self.version = 3.0 | def initfp(self, fp, filename): self = VideoParams.init(self) self.fp = fp self.filename = filename self.version = 3.0 # In case anyone inquires self.headerwritten = 0 return self | bc8db65fb865f65620ed14ed45643363560060e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/bc8db65fb865f65620ed14ed45643363560060e3/VFile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
7944,
12,
2890,
16,
4253,
16,
1544,
4672,
365,
273,
14030,
1370,
18,
2738,
12,
2890,
13,
365,
18,
7944,
273,
4253,
365,
18,
3459,
273,
1544,
365,
18,
1589,
273,
890,
18,
20,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
7944,
12,
2890,
16,
4253,
16,
1544,
4672,
365,
273,
14030,
1370,
18,
2738,
12,
2890,
13,
365,
18,
7944,
273,
4253,
365,
18,
3459,
273,
1544,
365,
18,
1589,
273,
890,
18,
20,
46... |
file.Write(" EXPECT_EQ(sizeof(cmd), cmd.header.size * 4); // NOLINT\n") | file.Write(" EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); // NOLINT\n") | def WriteCmdSizeTest(self, func, file): """Writes the size test for a command.""" file.Write(" EXPECT_EQ(sizeof(cmd), cmd.header.size * 4); // NOLINT\n") | d294ef3a7f91afdc1e5f9f570da7b8ef4b5bd8b7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/d294ef3a7f91afdc1e5f9f570da7b8ef4b5bd8b7/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
5931,
1225,
4709,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
8368,
326,
963,
1842,
364,
279,
1296,
12123,
585,
18,
3067,
2932,
225,
5675,
1423,
1268,
67,
27247,
12,
1467,
792,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
5931,
1225,
4709,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
8368,
326,
963,
1842,
364,
279,
1296,
12123,
585,
18,
3067,
2932,
225,
5675,
1423,
1268,
67,
27247,
12,
1467,
792,
12,
... |
_logger.exception('Get nextval for %s', self._sequence) | _logger.exception('Get nextval for %s', self._sequence) | def create(self, cr, user, vals, context=None): """ Create new record with specified value | 6ba509fc0bdc7db3fa49a7ada79e9dd2aab5aac7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/6ba509fc0bdc7db3fa49a7ada79e9dd2aab5aac7/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
729,
16,
5773,
16,
819,
33,
7036,
4672,
3536,
1788,
394,
1409,
598,
1269,
460,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
729,
16,
5773,
16,
819,
33,
7036,
4672,
3536,
1788,
394,
1409,
598,
1269,
460,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
outstring = utils.indent(PyParser.PROTECTED_BEGIN, ind) + ' ' + \ section +u' | outstring = utils.indent(PyParser.PROTECTED_BEGIN, ind) + u' ' + \ section + u' | def getProtectedSection(self, parsed, section, ind=0): """Given a parsed python module and a section name, return a string with the protected code-section to be included in the generated module. """ | 4304ec4612c1ab32ad1c85fb555ab12dbdc9ab0a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11941/4304ec4612c1ab32ad1c85fb555ab12dbdc9ab0a/BaseGenerator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3570,
1050,
5285,
12,
2890,
16,
2707,
16,
2442,
16,
1547,
33,
20,
4672,
3536,
6083,
279,
2707,
5790,
1605,
471,
279,
2442,
508,
16,
327,
279,
533,
598,
326,
4750,
981,
17,
3464,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3570,
1050,
5285,
12,
2890,
16,
2707,
16,
2442,
16,
1547,
33,
20,
4672,
3536,
6083,
279,
2707,
5790,
1605,
471,
279,
2442,
508,
16,
327,
279,
533,
598,
326,
4750,
981,
17,
3464,
358,
... |
print "CURSOR: %s" % self.cursor | def lexIdent(self, ch): token = self.token input = self.source | 90473594c42899d7ca44e35a3375030fc586310c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/90473594c42899d7ca44e35a3375030fc586310c/Tokenizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5275,
6106,
12,
2890,
16,
462,
4672,
1147,
273,
365,
18,
2316,
810,
273,
365,
18,
3168,
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,
5275,
6106,
12,
2890,
16,
462,
4672,
1147,
273,
365,
18,
2316,
810,
273,
365,
18,
3168,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
if filename.find("%v") >=0: filename = filename.replace ("%v",self.bootcd_version()) | try: filename = filename.replace ("%f", self.nodefamily) except: pass try: filename = filename.replace ("%a", arch) except: pass try: filename = filename.replace ("%v",self.bootcd_version()) except: pass | def hexa2 (c): return chr((c>>4)+65) + chr ((c&16)+65) | 4c450582aee96a815d62fdfa9ed65e911d37cbf7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7598/4c450582aee96a815d62fdfa9ed65e911d37cbf7/GetBootMedium.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3827,
69,
22,
261,
71,
4672,
327,
4513,
12443,
71,
9778,
24,
27921,
9222,
13,
397,
4513,
14015,
71,
10,
2313,
27921,
9222,
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,
0,
0,
0,
0,
0,
0,
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,
3827,
69,
22,
261,
71,
4672,
327,
4513,
12443,
71,
9778,
24,
27921,
9222,
13,
397,
4513,
14015,
71,
10,
2313,
27921,
9222,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
perms = stat(filename)[ST_MODE] | perms = os.stat(filename)[ST_MODE] | def VerifyConfigFile(self, entry): '''Install ConfigFile Entry''' filename = entry.get('name') try: ondisk = stat(filename) except OSError: self.CondPrint('debug', "File %s doesn't exist" % (filename)) return False try: data = open(filename).read() except IOError: self.CondPrint('debug', "Failed to read %s" % (filename)) return False try: owner = getpwuid(ondisk[ST_UID])[0] group = getgrgid(ondisk[ST_GID])[0] except KeyError: self.CondPrint('debug', "Owner/Group failure for %s: %s, %s" % (filename, ondisk[ST_UID], ondisk[ST_GID])) return False perms = stat(filename)[ST_MODE] if entry.get('encoding', 'ascii') == 'base64': tempdata = a2b_base64(entry.text) else: tempdata = entry.text | 6b7fe3dffd69efeeeabbce0bcd6cab97bde94cef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/6b7fe3dffd69efeeeabbce0bcd6cab97bde94cef/Toolset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8553,
13705,
12,
2890,
16,
1241,
4672,
9163,
6410,
31988,
3841,
26418,
1544,
273,
1241,
18,
588,
2668,
529,
6134,
775,
30,
603,
10863,
273,
610,
12,
3459,
13,
1335,
10002,
30,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8553,
13705,
12,
2890,
16,
1241,
4672,
9163,
6410,
31988,
3841,
26418,
1544,
273,
1241,
18,
588,
2668,
529,
6134,
775,
30,
603,
10863,
273,
610,
12,
3459,
13,
1335,
10002,
30,
365,
18,
... |
static object looking at the last exceptiopn. It is queried through | static object looking at the last exception. It is queried through | def open_remote_stack_viewer(self): """Initiate the remote stack viewer from a separate thread. | 8942d562f96c87ba6a48f673189015e9a36f3a37 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/8942d562f96c87ba6a48f673189015e9a36f3a37/PyShell.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
7222,
67,
3772,
67,
25256,
12,
2890,
4672,
3536,
28464,
326,
2632,
2110,
14157,
628,
279,
9004,
2650,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
7222,
67,
3772,
67,
25256,
12,
2890,
4672,
3536,
28464,
326,
2632,
2110,
14157,
628,
279,
9004,
2650,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
label='Scan &Outgoing Email Messages', | label='&Scan &Outgoing Email Messages', | def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_WXPREFERENCESDLG, name='', parent=prnt, pos=wxPoint(523, 301), size=wxSize(419, 351), style=wxDEFAULT_DIALOG_STYLE, title='ClamWin Preferences') self._init_utils() self.SetClientSize(wxSize(411, 324)) self.SetAutoLayout(False) self.Center(wxBOTH) EVT_CHAR_HOOK(self, self.OnCharHook) | ced0911957faf8b1fa6a8ca1040dbad5f3b217f2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3644/ced0911957faf8b1fa6a8ca1040dbad5f3b217f2/wxDialogPreferences.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
468,
4374,
707,
16,
2727,
1404,
3874,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
33,
27226,
734,
67,
59,
60,
3670,
10830,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
468,
4374,
707,
16,
2727,
1404,
3874,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
33,
27226,
734,
67,
59,
60,
3670,
10830,
... |
r = apply(func, args, kw) | if kw: r = apply(func, args, kw) else: r = apply(func, args) | def s_apply(self, func, *args, **kw): | 19bd1da574b4daf24452a7875d9a48aa1a95e175 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/19bd1da574b4daf24452a7875d9a48aa1a95e175/rexec.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
67,
9010,
12,
2890,
16,
1326,
16,
380,
1968,
16,
2826,
9987,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
67,
9010,
12,
2890,
16,
1326,
16,
380,
1968,
16,
2826,
9987,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
for id in res.keys(): order=self.browse(cr, uid, [id])[0] cur=order.pricelist_id.currency_id res[id]=cur_obj.round(cr, uid, cur, res[id]) | for sale in self.browse(cr, uid, ids): res[sale.id] = 0.0 for line in sale.order_line: res[sale.id] += line.price_subtotal cur = sale.pricelist_id.currency_id res[sale.id] = cur_obj.round(cr, uid, cur, res[sale.id]) | def _amount_untaxed(self, cr, uid, ids, field_name, arg, context): id_set = ",".join(map(str, ids)) cr.execute("SELECT s.id,COALESCE(SUM(l.price_unit*l.product_uos_qty*(100-l.discount))/100.0,0) AS amount FROM sale_order s LEFT OUTER JOIN sale_order_line l ON (s.id=l.order_id) WHERE s.id IN ("+id_set+") GROUP BY s.id ") res = dict(cr.fetchall()) cur_obj=self.pool.get('res.currency') for id in res.keys(): order=self.browse(cr, uid, [id])[0] cur=order.pricelist_id.currency_id res[id]=cur_obj.round(cr, uid, cur, res[id]) return res | 880941c7d88639b50849f33bfc80be025b67b916 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/880941c7d88639b50849f33bfc80be025b67b916/sale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8949,
67,
318,
8066,
329,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
529,
16,
1501,
16,
819,
4672,
612,
67,
542,
273,
5753,
18,
5701,
12,
1458,
12,
701,
16,
3258,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8949,
67,
318,
8066,
329,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
529,
16,
1501,
16,
819,
4672,
612,
67,
542,
273,
5753,
18,
5701,
12,
1458,
12,
701,
16,
3258,
37... |
self.tk.eval('package require Tix') | self.tk.eval('package require Tix') | def __init__(self, screenName=None, baseName=None, className='Tk'): Tkinter.Tk.__init__(self, screenName, baseName, className) | 0049f0036898e656085d5c214ba07642a9c25a6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0049f0036898e656085d5c214ba07642a9c25a6e/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5518,
461,
33,
7036,
16,
16162,
33,
7036,
16,
2658,
2218,
56,
79,
11,
4672,
399,
79,
2761,
18,
56,
79,
16186,
2738,
972,
12,
2890,
16,
5518,
461,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5518,
461,
33,
7036,
16,
16162,
33,
7036,
16,
2658,
2218,
56,
79,
11,
4672,
399,
79,
2761,
18,
56,
79,
16186,
2738,
972,
12,
2890,
16,
5518,
461,
16,
... |
if len(ybounds.shape) == 1 and len(ybounds) == array_data.shape[0]: ys = linspace(ybounds[0], ybounds[-1], array_data.shape[0]) | if len(ybounds.shape) == 1 and len(ybounds) == num_y_ticks: ys = linspace(ybounds[0], ybounds[-1], num_y_ticks) elif len(ybounds.shape) == 1 and len(ybounds) == num_y_ticks-1: raise ValueError("The ybounds array of an image plot needs to have 1 more element that its corresponding data shape, because it represents the locations of pixel boundaries.") | def contour_plot(self, data, type="line", name=None, poly_cmap=None, xbounds=None, ybounds=None, origin=None, hide_grids=True, **styles): """ Adds contour plots to this Plot object. | 1e2431fcd42684676163acf6b275c1ef4d5fd87b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13167/1e2431fcd42684676163acf6b275c1ef4d5fd87b/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15332,
67,
4032,
12,
2890,
16,
501,
16,
618,
1546,
1369,
3113,
508,
33,
7036,
16,
7573,
67,
22738,
33,
7036,
16,
619,
10576,
33,
7036,
16,
677,
10576,
33,
7036,
16,
4026,
33,
7036,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15332,
67,
4032,
12,
2890,
16,
501,
16,
618,
1546,
1369,
3113,
508,
33,
7036,
16,
7573,
67,
22738,
33,
7036,
16,
619,
10576,
33,
7036,
16,
677,
10576,
33,
7036,
16,
4026,
33,
7036,
1... |
lang = config.mylang project = config.family | def checkbot(): # Command line configurable parameters repeat = True # Restart after having check all the images? limit = 80 # How many images check? time_sleep = 30 # How many time sleep after the check? skip_number = 0 # How many images to skip before checking? wait_number = 0 # How many time sleep before the check? commonsActive = False # Check if on commons there's an image with the same name? normal = False # Check the new images or use another generator? urlUsed = False # Use the url-related function instead of the new-pages generator regexGen = False # Use the regex generator untagged = False # Use the untagged generator skip_list = list() # Inizialize the skip list used below # Here below there are the parameters. for arg in wikipedia.handleArgs(): if arg.startswith('-limit'): if len(arg) == 7: limit = int(wikipedia.input(u'How many images do you want to check?')) else: limit = int(arg[7:]) if arg.startswith('-time'): if len(arg) == 5: time_sleep = int(wikipedia.input(u'How many seconds do you want runs to be apart?')) else: time_sleep = int(arg[6:]) elif arg == '-break': repeat = False elif arg == '-commons': commonsActive = True elif arg.startswith('-skip'): if len(arg) == 5: skip = True skip_number = int(wikipedia.input(u'How many images do you want to skip?')) elif len(arg) > 5: skip = True skip_number = int(arg[6:]) elif arg.startswith('-wait'): if len(arg) == 5: wait = True wait_number = int(wikipedia.input(u'How many time do you want to wait before checking the images?')) elif len(arg) > 5: wait = True wait_number = int(arg[6:]) elif arg.startswith('-start'): if len(arg) == 6: firstPageTitle = str(wikipedia.input(u'From witch page do you want to start?')) elif len(arg) > 6: firstPageTitle = str(arg[7:]) generator = wikipedia.getSite().allpages(start='Image:%s' % firstPageTitle) repeat = False elif arg.startswith('-page'): if len(arg) == 5: regexPageName = str(wikipedia.input(u'Which page do you want to use for the regex?')) elif len(arg) > 5: regexPageName = str(arg[6:]) repeat = False regexGen = True elif arg.startswith('-url'): if len(arg) == 4: regexPageUrl = str(wikipedia.input(u'Which url do you want to use for the regex?')) elif len(arg) > 4: regexPageUrl = str(arg[5:]) urlUsed = True repeat = False regexGen = True elif arg.startswith('-regex'): if len(arg) == 6: regexpToUse = str(wikipedia.input(u'Which regex do you want to use?')) elif len(arg) > 6: regexpToUse = str(arg[7:]) generator = 'regex' repeat = False elif arg.startswith('-cat'): if len(arg) == 4: catName = str(wikipedia.input(u'In which category do I work?')) elif len(arg) > 4: catName = str(arg[5:]) catSelected = catlib.Category(wikipedia.getSite(), 'Category:%s' % catName) generator = pagegenerators.CategorizedPageGenerator(catSelected) repeat = False elif arg.startswith('-untagged'): untagged = True if len(arg) == 9: projectUntagged = str(wikipedia.input(u'In which project should I work?')) elif len(arg) > 9: projectUntagged = str(arg[10:]) # Understand if the generator it's the default or not. try: generator except NameError: normal = True # Define the site. site = wikipedia.getSite() # In this way i find what language, project and what bot do you use. lang = config.mylang project = config.family # Block of text to translate the parameters set above. image_n = site.image_namespace() image_namespace = "%s:" % image_n # Example: "User_talk:" unvertext = wikipedia.translate(site, n_txt) di = wikipedia.translate(site, delete_immediately) dih = wikipedia.translate(site, delete_immediately_head) din = wikipedia.translate(site, delete_immediately_notification) nh = wikipedia.translate(site, nothing_head) nn = wikipedia.translate(site, nothing_notification) dels = wikipedia.translate(site, del_comm) smwl = wikipedia.translate(site, second_message_without_license) TextFind = wikipedia.translate(site, txt_find) hiddentemplate = wikipedia.translate(site, HiddenTemplate) # A template as {{en is not a license! Adding also them in the whitelist template... for langK in wikipedia.Family('wikipedia').knownlanguages: hiddentemplate.append('%s' % langK) # If the images to skip are 0, set the skip variable to False (the same for the wait time) if skip_number == 0: skip = False if wait_number == 0: wait = False # nothing = Defining an empty image description nothing = ['', ' ', ' ', ' ', '\n', '\n ', '\n ', '\n\n', '\n \n', ' \n', ' \n ', ' \n \n'] # something = Minimal requirements for an image description. # If this fits, no tagging will take place (if there aren't other issues) # MIT license is ok on italian wikipedia, let also this here something = ['{{', "'''MIT license'''"] # Don't put "}}" here, please. Useless and can give problems. # Unused file extensions. Does not contain PDF. notallowed = ("xcf", "xls", "sxw", "sxi", "sxc", "sxd") # A little block-statement to ensure that the bot will not start with en-parameters if lang not in project_inserted: wikipedia.output(u"Your project is not supported by this script. You have to edit the script and add it!") wikipedia.stopme() # Some formatting for delete immediately template di = '\n%s' % di dels = dels % di # Reading the log of the new images if another generator is not given. if normal == True: if limit == 1: wikipedia.output(u"Retrieving the latest file for checking...") else: wikipedia.output(u"Retrieving the latest %d files for checking..." % limit) # Main Loop while 1: # Defing the Main Class. mainClass = main(site) # Untagged is True? Let's take that generator if untagged == True: generator = mainClass.untaggedGenerator(projectUntagged) normal = False # Ensure that normal is False # Normal True? Take the default generator if normal == True: generator = pagegenerators.NewimagesPageGenerator(number = limit, site = site) # if urlUsed and regexGen, get the source for the generator if urlUsed == True and regexGen == True: textRegex = pagetext(regexPageUrl) # Not an url but a wiki page as "source" for the regex elif regexGen == True: pageRegex = wikipedia.Page(site, regexPageName) try: textRegex = pageRegex.get() except wikipedia.NoPage: wikipedia.output(u"%s doesn't exist!" % page.title()) textRegex = '' # No source, so the bot will quit later. # If generator is the regex' one, use your own Generator using an url or page and a regex. if generator == 'regex' and regexGen == True: generator = mainClass.regexGenerator(regexpToUse, textRegex) # Ok, We (should) have a generator, so let's go on. try: # Take the additional settings for the Project tupla_written = mainClass.takesettings() except wikipedia.Error: # Error? Settings = None wikipedia.output(u'Problems with loading the settigs, run without them.') tupla_written = None some_problem = False # Ensure that if the list given is empty it will be converted to "None" # (but it should be already done in the takesettings() function) if tupla_written == []: tupla_written = None # Real-Time page loaded if tupla_written != None: wikipedia.output(u'\t >> Loaded the real-time page... <<') # No settings found, No problem, continue. else: wikipedia.output(u'\t >> No additional settings found! <<') # Not the main, but the most important loop. for image in generator: # If I don't inizialize the generator, wait part and skip part are useless if wait: printWithTimeZone(u'Waiting %s seconds before checking the images,' % wait_number) # Let's sleep... time.sleep(wait_number) # Never sleep again (we are in a loop) wait = False # If the generator returns something that is not an image, simply skip it. if normal == False and regexGen == False: if image_namespace.lower() not in image.title().lower() and \ 'image:' not in image.title().lower(): wikipedia.output(u'%s seems not an image, skip it...' % image.title()) continue imageName = image.title().split(image_namespace)[1] # Deleting the namespace (useless here) # Skip block if skip == True: # If the images to skip are more the images to check, make them the same number if skip_number > limit: skip_number = limit # Print a starting message only if no images has been skipped if skip_list == []: if skip_number == 1: wikipedia.output(u'Skipping the first image:\n') else: wikipedia.output(u'Skipping the first %s images:\n' % skip_number) # If we still have pages to skip: if len(skip_list) < skip_number: wikipedia.output(u'Skipping %s...' % imageName) skip_list.append(imageName) if skip_number == 1: wikipedia.output('') skip = False continue else: wikipedia.output('') # Print a blank line. skip = False elif skip_list == []: # Skip must be false if we are here but # the user has set 0 as images to skip wikipedia.output(u'\t\t>> No images to skip...<<') skip_list.append('skip = Off') # Only to print it once # Check on commons if there's already an image with the same name if commonsActive == True: response = mainClass.checkImage(imageName) if response == False: continue parentesi = False # parentesi are these in italian: { ( ) } [] delete = False tagged = False extension = imageName.split('.')[-1] # get the extension from the image's name # Page => ImagePage p = wikipedia.ImagePage(site, image.title()) # Get the text in the image (called g) try: g = p.get() except wikipedia.NoPage: wikipedia.output(u"Skipping %s because it has been deleted." % imageName) continue except wikipedia.IsRedirectPage: wikipedia.output(u"The file description for %s is a redirect?!" % imageName ) continue # Is the image already tagged? If yes, no need to double-check, skip for i in TextFind: # If there are {{ use regex, otherwise no (if there's not the {{ may not be a template # and the regex will be wrong) if '{{' in i: regexP = re.compile('\{\{(?:template|)%s ?(?:\||\n|\}) ?' % i.split('{{')[1].replace(' ', '[ _]'), re.I) result = regexP.findall(g) if result != []: tagged = True elif i.lower() in g: tagged = True # Deleting the useless template from the description (before adding something # in the image the original text will be reloaded, don't worry). for l in hiddentemplate: if tagged == False: res = re.findall(r'\{\{(?:[Tt]emplate:|)%s(?: \n|\||\n|\})' % l.lower(), g.lower()) if res != []: wikipedia.output(u'A white template found, skipping the template...') if l != '' and l != ' ': # Check that l is not nothing or a space # Deleting! (replace the template with nothing) g = g.lower().replace('{{%s' % l, '') for a_word in something: # something is the array with {{, MIT License and so on. if a_word in g: # There's a template, probably a license (or I hope so) parentesi = True # Is the extension allowed? (is it an image or f.e. a .xls file?) for parl in notallowed: if parl.lower() in extension.lower(): delete = True some_problem = False # If it has "some_problem" it must check # the additional settings. # if tupla_writte, use addictional settings if tupla_written != None: for tupla in tupla_written: name = tupla[1] find_tipe = tupla[2] find = tupla[3] find_list = mainClass.load(find) imagechanges = tupla[4] if imagechanges.lower() == 'false': imagestatus = False elif imagechanges.lower() == 'true': imagestatus = True else: wikipedia.output(u"Error! Imagechanges set wrongly!") tupla_written = None break summary = tupla[5] head_2 = tupla[6] text = tupla[7] text = text % imageName mexCatched = tupla[8] wikipedia.setAction(summary) for k in find_list: if find_tipe.lower() == 'findonly': if k.lower() == g.lower(): some_problem = True text_used = text head_used = head_2 imagestatus_used = imagestatus name_used = name summary_used = summary mex_used = mexCatched break elif find_tipe.lower() == 'find': if k.lower() in g.lower(): some_problem = True text_used = text head_used = head_2 imagestatus_used = imagestatus name_used = name summary_used = summary mex_used = mexCatched continue # If the image exists (maybe it has been deleting during the oder # checking parts or something, who knows? ;-)) if p.exists(): # Here begins the check block. if tagged == True: # Tagged? Yes, skip. printWithTimeZone(u'%s is already tagged...' % imageName) continue if some_problem == True: if mex_used in g: wikipedia.output(u'Image already fixed. Skip.') continue wikipedia.output(u"The image description for %s contains %s..." % (imageName, name_used)) if mex_used.lower() == 'default': mex_used = unvertext if imagestatus_used == False: reported = mainClass.report_image(imageName) else: reported = True if reported == True: #if imagestatus_used == True: report(mex_used, imageName, text_used, "\n%s\n" % head_used, None, imagestatus_used, summary_used) else: wikipedia.output(u"Skipping the image...") some_problem = False continue elif parentesi == True: printWithTimeZone(u"%s seems ok," % imageName) # It works also without this... but i want only to be sure ^^ parentesi = False continue elif delete == True: wikipedia.output(u"%s is not a file!" % imageName) # Modify summary text wikipedia.setAction(dels) canctext = di % extension notification = din % imageName head = dih report(canctext, imageName, notification, head) delete = False continue elif g in nothing: wikipedia.output(u"The image description for %s does not contain a license template!" % imageName) if lang == 'commons': head = nh % imageName notification = nn else: notification = nn % imageName head = nh report(unvertext, imageName, notification, head, smwl) continue else: wikipedia.output(u"%s has only text and not the specific license..." % imageName) if lang == 'commons': head = nh % imageName notification = nn else: notification = nn % imageName head = nh report(unvertext, imageName, notification, head, smwl) continue # A little block to perform the repeat or to break. if repeat == True: printWithTimeZone(u"Waiting for %s seconds," % time_sleep) time.sleep(time_sleep) elif repeat == False: wikipedia.output(u"\t\t\t>> STOP! <<") return True # Exit | 543017432a3cd7c95be566464146b6eed2ebdadc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/543017432a3cd7c95be566464146b6eed2ebdadc/checkimages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
4819,
13332,
468,
3498,
980,
14593,
1472,
7666,
273,
1053,
468,
20709,
1839,
7999,
866,
777,
326,
4602,
35,
1800,
273,
8958,
468,
9017,
4906,
4602,
866,
35,
813,
67,
19607,
273,
519... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
4819,
13332,
468,
3498,
980,
14593,
1472,
7666,
273,
1053,
468,
20709,
1839,
7999,
866,
777,
326,
4602,
35,
1800,
273,
8958,
468,
9017,
4906,
4602,
866,
35,
813,
67,
19607,
273,
519... | |
return unit_docs[unit_to_type[str(unit)]+"_docs"][str(unit)] | return unit_docs[unit_to_type[str(unit)]+"_docs"][str(unit)] | def unitdocs(unit): """ Returns docstring for the given unit. INPUT: - ``unit`` OUTPUT: - ``string`` EXAMPLES:: sage: sage.symbolic.units.unitdocs('meter') 'SI base unit of length.\nDefined to be the distance light travels in vacuum in 1/299792458 of a second.' sage: sage.symbolic.units.unitdocs('amu') 'Abbreviation for atomic mass unit.\nApproximately equal to 1.660538782*10^-27 kilograms.' Units not in the list unit_docs will raise a ValueError:: sage: sage.symbolic.units.unitdocs('earth') Traceback (most recent call last): ... ValueError: No documentation exists for the unit earth. """ if is_unit(unit): return unit_docs[unit_to_type[str(unit)]+"_docs"][str(unit)] else: raise ValueError, "No documentation exists for the unit %s."%unit | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2836,
8532,
12,
4873,
4672,
3536,
2860,
14525,
364,
326,
864,
2836,
18,
225,
12943,
30,
225,
300,
12176,
4873,
10335,
225,
11550,
30,
225,
300,
12176,
1080,
10335,
225,
5675,
8900,
11386,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2836,
8532,
12,
4873,
4672,
3536,
2860,
14525,
364,
326,
864,
2836,
18,
225,
12943,
30,
225,
300,
12176,
4873,
10335,
225,
11550,
30,
225,
300,
12176,
1080,
10335,
225,
5675,
8900,
11386,
... |
raise NotImplementedError, "object does not support iteration" for entries in sage.misc.mrange.cartesian_product_iterator([base_ring]*(self.__nrows*self.__ncols)): yield self(entries=list(entries), rows=True) | weight = 0 while True: for iv in sage.combinat.integer_vector.IntegerVectors(weight, number_of_entries): yield self(entries=[base_elements[i] for i in iv], rows=True) weight += 1 base_elements.append( base_iter.next() ) else: for entries in sage.misc.mrange.cartesian_product_iterator([base_ring]*number_of_entries): yield self(entries=list(entries), rows=True) | def __iter__(self): """ EXAMPLES: sage: MS = MatrixSpace(GF(2),2) sage: a = list(MS) sage: len(a) 16 sage: a[0] [0 0] [0 0] | aaa5492c353acf5983c942588b4766cde1644355 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/aaa5492c353acf5983c942588b4766cde1644355/matrix_space.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
9238,
273,
7298,
3819,
12,
43,
42,
12,
22,
3631,
22,
13,
272,
410,
30,
279,
273,
666,
12,
3537,
13,
272,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2165,
972,
12,
2890,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
9238,
273,
7298,
3819,
12,
43,
42,
12,
22,
3631,
22,
13,
272,
410,
30,
279,
273,
666,
12,
3537,
13,
272,
... |
<tr> <td valign="top" nowrap> <table> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> </table> </td> </tr>""" % \ (cell_1_left, cell_1_right, cell_1_moreright, cell_1_farright, \ cell_2_left, cell_2_right, cell_2_moreright, cell_2_farright, \ cell_3_left, cell_3_right, cell_3_moreright, cell_3_farright) | <table class="searchbox"> <thead> <tr> <th colspan="3" class="searchboxheader"> Search for: </th> </tr> </thead> <tbody> <tr valign="bottom"> <td class="searchboxbody">%s</td> <td class="searchboxbody">%s</td> <td class="searchboxbody">%s</td> </tr> <tr valign="bottom"> <td class="searchboxbody">%s</td> <td class="searchboxbody">%s</td> <td class="searchboxbody">%s</td> </tr> <tr valign="bottom"> <td class="searchboxbody">%s</td> <td class="searchboxbody">%s</td> <td class="searchboxbody">%s</td> </tr> <tr valign="bottom"> <td colspan="3" align="right" class="searchboxbody">%s</td> </tr> </tbody> </table> """ % \ (cell_1_left, cell_1_right, cell_1_moreright, \ cell_2_left, cell_2_right, cell_2_moreright, \ cell_3_left, cell_3_right, cell_3_moreright, cell_4) | def create_search_box(cc, colls, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d): "Create search box for 'search again in the results page' functionality." out = "" # print search box prolog: out += """ <form action="%s/search.py" method="get"> <strong class="headline"><span class="h1">%s</span></strong> <input type="hidden" name="cc" value="%s"> <input type="hidden" name="as" value="%s"> """ % (weburl, cc, cc, as) if ot: out += """<input type="hidden" name="ot" value="%s">""" % ot if sp: out += """<input type="hidden" name="sp" value="%s">""" % sp # possibly print external search engines links (Google box): if cfg_google_box: out += """<table align="right"><tr><td>%s</td></tr></table>""" % create_google_box(p, f, p1, p2, p3) out += "<table>" # firstly, print Query box: if as==1: # print Advanced Search form: # define search box elements: cell_1_left = "<small><strong>Search for:</strong></small><br>" + create_matchtype_box('m1', m1) + \ """<input type="text" name="p1" size="%d" value="%s">""" % (cfg_advancedsearch_pattern_box_width, cgi.escape(p1,1)) cell_1_right = "<small><strong>within:</strong></small><br>%s" % create_searchwithin_selection_box('f1', f1) cell_1_moreright = create_andornot_box('op1', op1) cell_1_farright = "" cell_2_left = create_matchtype_box('m2', m2) + """<input type="text" name="p2" size="%d" value="%s">""" % (cfg_advancedsearch_pattern_box_width, cgi.escape(p2,1)) cell_2_right = create_searchwithin_selection_box('f2', f2) cell_2_moreright = create_andornot_box('op2', op2) cell_2_farright = "" cell_3_left = create_matchtype_box('m3', m3) + """<input type="text" name="p3" size="%d" value="%s">""" % (cfg_advancedsearch_pattern_box_width, cgi.escape(p3,1)) cell_3_right = create_searchwithin_selection_box('f3', f3) cell_3_moreright = """<input type="submit" name="search" value="SEARCH"><input type="submit" name="search" value="Browse"> """ cell_3_farright = """<small class="light"><a href="%s/search.py?p=%s&f=%s&cc=%s">Simple Search</a></small> <br><small><a href="%s/help/search/tips.html">Search Tips</a></small>""" % \ (weburl, urllib.quote(p1), urllib.quote(f1), urllib.quote(cc), weburl) # print them: out += """ <tr> <td valign="top" nowrap> <table> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> </table> </td> </tr>""" % \ (cell_1_left, cell_1_right, cell_1_moreright, cell_1_farright, \ cell_2_left, cell_2_right, cell_2_moreright, cell_2_farright, \ cell_3_left, cell_3_right, cell_3_moreright, cell_3_farright) else: # print Simple Search form: cell_1_left = """<small><strong>Search for:</strong></small> <br><input type="text" name="p" size="%d" value="%s">""" % \ (cfg_simplesearch_pattern_box_width, cgi.escape(p, 1)) cell_1_middle = "<small><strong>within:</strong></small><br>%s" % create_searchwithin_selection_box('f', f) cell_1_right = """<input type="submit" name="search" value="SEARCH"><input type="submit" name="search" value="Browse"> """ cell_1_farright = """<small class="light"><a href="%s/search.py?p1=%s&f1=%s&as=1&cc=%s">Advanced Search</a></small> <br><small><a href="%s/help/search/tips.html">Search Tips</a></small>""" %\ (weburl, urllib.quote(p), urllib.quote(f), urllib.quote(cc), weburl) out += """ <tr> <td valign="top" nowrap> <table> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> </table> </td> </tr> """ % (cell_1_left, cell_1_middle, cell_1_right, cell_1_farright) # secondly, print Collection(s) box: out += """ <tr> <td valign="top"> <small><strong>Search collections:</strong></small><br>""" colls_nicely_ordered = get_nicely_ordered_collection_list() if colls and colls[0] != cdsname: # some collections are defined, so print these first, and only then print 'add another collection' heading: for c in colls: if c: out += """<select name="c"><option value="">*** remove this collection ***""" for (cx, cx_printable) in colls_nicely_ordered: # print collection: if not cx.startswith("Unnamed collection"): out+= """<option value="%s"%s>%s""" % (cx, is_selected(c, re.sub("^[\s\-]*","",cx)), cx_printable) out += """</select>""" out += """<select name="c"><option value="">*** add another collection ***""" else: # we searched in CDSNAME, so print 'any collection' heading out += """<select name="c"><option value="">*** any collection ***""" for (cx, cx_printable) in colls_nicely_ordered: if not cx.startswith("Unnamed collection"): out += """<option value="%s">%s""" % (cx, cx_printable) out += """ </select> </td> </tr>""" # thirdly, print from/until date boxen, if applicable: if d1y=="" and d1m=="" and d1d=="" and d2y=="" and d2m=="" and d2d=="": pass # do not need it else: cell_6_a = create_inputdate_box("Added since", "d1", d1y, d1m, d1d) cell_6_b = create_inputdate_box("until", "d2", d2y, d2m, d2d) out += """<table cellpadding="3" cellspacing="0"> <tr> <td colspan="3" height="3"> </td> </tr> <tr valign="bottom"> <td>%s</td> <td>%s</td> </tr> </table>""" % \ (cell_6_a, cell_6_b) # fourthly, print Display/Sort box: cell_1_left = """<small><strong>Sort by:</strong></small><br> <select name="sf"> <option value="">- latest first -""" query = """SELECT DISTINCT(f.code),f.name FROM field AS f, collection_field_fieldvalue AS cff WHERE cff.type='soo' AND cff.id_field=f.id ORDER BY cff.score DESC, f.name ASC""" res = run_sql(query) for code, name in res: # propose found sort options: cell_1_left += """<option value="%s"%s>%s""" % (code, is_selected(sf,code), name) cell_1_left += """</select>""" cell_1_left += """<select name="so"> <option value="a"%s>asc. <option value="d"%s>desc. </select>""" % (is_selected(so,"a"),is_selected(so,"d")) cell_1_right = """<small><strong>Output format:</strong></small><br> <select name="of">""" query = """SELECT code,name FROM format ORDER BY name ASC""" res = run_sql(query) if res: # propose found formats: for code, name in res: cell_1_right += """<option value="%s"%s>%s""" % (code, is_selected(of,code), name) else: # no formats are found, so propose the default HTML one: cell_1_right += """<option value="hb"%s>HTML brief""" % (is_selected(of,"hb")) # is format made of numbers only? if yes, then propose it too: if of and str(of[0:3]).isdigit(): cell_1_right += """<option value="%s" selected>%s MARC tag""" % (of, of) cell_1_right += """</select>""" ## okay, formats ended cell_1_middle = """<small><strong>Display results:</strong></small><br> <select name="rg"> <option value="10"%s>10 results <option value="25"%s>25 results <option value="50"%s>50 results <option value="100"%s>100 results <option value="250"%s>250 results <option value="500"%s>500 results </select> <select name="sc"> <option value="0"%s>grouped together <option value="1"%s>split by collection </select> """ % (is_selected(rg,"10"), is_selected(rg,"25"), is_selected(rg,"50"), \ is_selected(rg,"100"), is_selected(rg,"250"), is_selected(rg,"500"),\ is_selected(sc,"0"), is_selected(sc,"1")) out += """ <tr> <td valign="top"> <table><tr valign="top"><td>%s</td><td>%s</td><td>%s</td></tr></table> </td> </tr>""" % (cell_1_left, cell_1_middle, cell_1_right) # print end of search box: out += """</table></form> """ return out | 620cac641ba839b8d458726c5bcd42752af2f02c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/620cac641ba839b8d458726c5bcd42752af2f02c/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3072,
67,
2147,
12,
952,
16,
645,
3251,
16,
293,
16,
284,
16,
14524,
16,
9033,
16,
1427,
16,
1694,
16,
434,
16,
15835,
16,
487,
16,
293,
21,
16,
284,
21,
16,
312,
21,
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,
752,
67,
3072,
67,
2147,
12,
952,
16,
645,
3251,
16,
293,
16,
284,
16,
14524,
16,
9033,
16,
1427,
16,
1694,
16,
434,
16,
15835,
16,
487,
16,
293,
21,
16,
284,
21,
16,
312,
21,
16... |
security.declareProtected(permissions.View, | security.declareProtected(CMFCorePermissions.View, | def validate(self, instance=None, REQUEST=None, errors=None, data=None, metadata=None): """Validate the state of the entire object. | 67576cc5acaaf506c58ee3fea91da40c0a6516a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/67576cc5acaaf506c58ee3fea91da40c0a6516a2/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
12,
2890,
16,
791,
33,
7036,
16,
12492,
33,
7036,
16,
1334,
33,
7036,
16,
501,
33,
7036,
16,
1982,
33,
7036,
4672,
3536,
4270,
326,
919,
434,
326,
7278,
733,
18,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
12,
2890,
16,
791,
33,
7036,
16,
12492,
33,
7036,
16,
1334,
33,
7036,
16,
501,
33,
7036,
16,
1982,
33,
7036,
4672,
3536,
4270,
326,
919,
434,
326,
7278,
733,
18,
2,
-100,
-100,... |
regex = '([^:]+://(.*)/([^/]*)$' | regex = '([^:]+://(.*)/([^/]*))$' | def get_package_name(self, url, pkg_type): ''' Extract the group and test name for the url. This method is currently used only for tests. ''' if pkg_type == 'test': regex = '([^:]+://(.*)/([^/]*)$' return self._get_package_name(url, regex) else: return ('', url) | 79fb92c18027bd15e492d9e3be357c187ebf29fd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/79fb92c18027bd15e492d9e3be357c187ebf29fd/packages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5610,
67,
529,
12,
2890,
16,
880,
16,
3475,
67,
723,
4672,
9163,
8152,
326,
1041,
471,
1842,
508,
364,
326,
880,
18,
1220,
707,
353,
4551,
1399,
1338,
364,
7434,
18,
9163,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5610,
67,
529,
12,
2890,
16,
880,
16,
3475,
67,
723,
4672,
9163,
8152,
326,
1041,
471,
1842,
508,
364,
326,
880,
18,
1220,
707,
353,
4551,
1399,
1338,
364,
7434,
18,
9163,
3... |
dirpath = u"%s%s" % (channels_to_copy[dir_key], u'folder.jpg') dirpath2 = u"%s%s" % (channels_to_copy[dir_key], u'folder.png') | dirpath = u"%s%s" % (copy_dir, u'folder.jpg') dirpath2 = u"%s%s" % (copy_dir, u'folder.png') | def main(): """Support mirobridge from the command line returns True """ global localhostname, simulation, verbose, storagegroups, ffmpeg, channel_id, channel_num global flat, download_sleeptime, channel_watch_only, channel_mythvideo_only, channel_new_watch_copy global vid_graphics_dirs, imagemagick, statistics, requirements_are_met global graphic_suffix, graphic_path_suffix, graphic_name_suffix global mythcommflag_recordings, mythcommflag_videos global local_only parser = OptionParser(usage=u"%prog usage: mirobridge -huevstdociVHSCWM [parameters]\n") parser.add_option( "-e", "--examples", action="store_true", default=False, dest="examples", help=u"Display examples for executing the jamu script") parser.add_option( "-v", "--version", action="store_true", default=False, dest="version", help=u"Display version and author information") parser.add_option( "-s", "--simulation", action="store_true", default=False, dest="simulation", help=u"Simulation (dry run), no files are copied, symlinks created or MythTV data bases altered. If option (-n) is NOT specified Miro auto downloads WILL take place. See option (-n) help for details.") parser.add_option( "-t", "--testenv", action="store_true", default=False, dest="testenv", help=u"Test that the local environment can run all mirobridge functionality") parser.add_option( "-n", "--no_autodownload", action="store_true", default=False, dest="no_autodownload", help=u"Do not perform Miro Channel updates, video expiry and auto-downloadings. Default is to perform all perform all Channel maintenance features.") parser.add_option( "-o", "--nosubdirs", action="store_true", default=False, dest="nosubdirs", help=u"Organise MythVideo's Miro directory WITHOUT Miro channel subdirectories. The default is to have Channel subdirectories.") parser.add_option( "-c", "--channel", metavar="CHANNEL_ID:CHANNEL_NUM", default="", dest="channel", help=u'Specifies the channel id that is used for Miros unplayed recordings. Enter as "xxxx:yyy". Default is 9999:999. Be warned that once you change the default channel_id "9999" you must always use this option!') #parser.add_option( "-i", "--import", metavar="CONFIGFILE", default="", dest="import", # help=u'Import Miro exported configuration file and or channel changes.') parser.add_option( "-V", "--verbose", action="store_true", default=False, dest="verbose", help=u"Display verbose messages when processing") parser.add_option( "-H", "--hostname", metavar="HOSTNAME", default="", dest="hostname", help=u"MythTV Backend hostname mirobridge is to up date") parser.add_option( "-S", "--sleeptime", metavar="SLEEP_DELAY_SECONDS", default="", dest="sleeptime", help=u"The amount of seconds to wait for an auto download to start.\nThe default is 60 seconds, but this may need to be adjusted for slower Internet connections.") parser.add_option( "-C", "--addchannel", metavar="ICONFILE_PATH", default="OFF", dest="addchannel", help=u'Add a Miro Channel record to MythTV. This gets rid of the "#9999 #9999" on the Watch Recordings screen and replaces it with the usual\nthe channel number and channel name.\nThe default if not overridden by the (-c) option is channel number 999.\nIf a filename and path is supplied it will be set as the channels icon. Make sure your override channel number is NOT one of your current MythTV channel numbers.\nThis option is typically only used once as there can only be one Miro channel record at a time.') parser.add_option( "-N", "--new_watch_copy", action="store_true", default=False, dest="new_watch_copy", help=u'For ALL Miro Channels: Use the "Watch Recording" screen to watch new Miro downloads then once watched copy the videos, icons, screen shot and metadata to MythVideo. Once coping is complete delete the video from Miro.\nThis option overrides any "mirobridge.conf" settings.') parser.add_option( "-W", "--watch_only", action="store_true", default=False, dest="watch_only", help=u'For ALL Miro Channels: Only use "Watch Recording" never move any Miro videos to MythVideo.\nThis option overrides any "mirobridge.conf" settings.') parser.add_option( "-M", "--mythvideo_only", action="store_true", default=False, dest="mythvideo_only", help=u'For ALL Miro Channel videos: Copy newly downloaded Miro videos to MythVideo and removed from Miro. These Miro videos never appear in the MythTV "Watch Recording" screen.\nThis option overrides any "mirobridge.conf" settings.') opts, args = parser.parse_args() if opts.examples: # Display example information sys.stdout.write(examples_txt+'\n') sys.exit(True) if opts.version: # Display program information sys.stdout.write(u"\nTitle: (%s); Version: description(%s); Author: (%s)\n%s\n" % ( __title__, __version__, __author__, __purpose__ )) sys.exit(True) if opts.testenv: test_environment = True else: test_environment = False # Verify that Miro is not currently running if isMiroRunning(): sys.exit(False) # Verify that only None or one of the mutually exclusive (-W), (-M) and (-N) options is being used x = 0 if opts.new_watch_copy: x+=1 if opts.watch_only: x+=1 if opts.mythvideo_only: x+=1 if x > 1: logger.critical(u"The (-W), (-M) and (-N) options are mutually exclusive, so only one can be specified at a time.") sys.exit(False) # Set option related global variables simulation = opts.simulation verbose = opts.verbose if opts.hostname: # Override localhostname if the user specified an hostname localhostname = opts.hostname # Validate settings # Make sure mirobridge is to update a real MythTV backend if not mythdb.getSetting(u'BackendServerIP', hostname = localhostname): logger.critical(u"The MythTV backend (%s) is not a MythTV backend." % localhostname) if test_environment: requirements_are_met = False else: sys.exit(False) ## Video base directory and current version and revision numbers base_video_dir = config.get(prefs.MOVIES_DIRECTORY) miro_version_rev = u"%s r%s" % (config.get(prefs.APP_VERSION), config.get(prefs.APP_REVISION_NUM)) displayMessage(u"Miro Version (%s)" % (miro_version_rev)) displayMessage(u"Base Miro Video Directory (%s)" % (base_video_dir,)) logger.info(u'') # Verify Miro version sufficent and Video file configuration correct. if not os.path.isdir(base_video_dir): logger.critical(u"The Miro Videos directory (%s) does not exist." % str(base_video_dir)) if test_environment: requirements_are_met = False else: sys.exit(False) if config.get(prefs.APP_VERSION) < u"2.0.3": logger.critical(u"The installed version of Miro (%s) is too old. It must be at least v2.0.3 or higher." % config.get(prefs.APP_VERSION)) if test_environment: requirements_are_met = False else: sys.exit(False) # Get storage groups if getStorageGroups() == False: logger.critical(u"Retrieving storage groups from the MythTV data base failed") if test_environment: requirements_are_met = False else: sys.exit(False) elif not u'default' in storagegroups.keys(): logger.critical(u"There must be a 'Default' storage group") if test_environment: requirements_are_met = False else: sys.exit(False) if opts.channel: channel = opts.channel.split(u':') if len(channel) != 2: logger.critical(u"The Channel (%s) must be in the format xxx:yyy with x an y all numeric." % str(opts.channel)) if test_environment: requirements_are_met = False else: sys.exit(False) elif not _can_int(channel[0]) or not _can_int(channel[1]): logger.critical(u"The Channel_id (%s) and Channel_num (%s) must be numeric." % (channel[0], channel[1])) if test_environment: requirements_are_met = False else: sys.exit(False) else: channel_id = int(channel[0]) channel_num = int(channel[1]) if opts.sleeptime: if not _can_int(opts.sleeptime): logger.critical(u"Auto-dewnload sleep time (%s) must be numeric." % str(opts.sleeptime)) if test_environment: requirements_are_met = False else: sys.exit(False) else: download_sleeptime = float(opts.sleeptime) getMythtvDirectories() # Initialize all the Video and graphics directory dictionary if opts.nosubdirs: # Did the user want a flat MythVideo "Miro" directory structure? flat = True # Get the values in the mirobridge.conf configuration file setUseroptions() if opts.watch_only: # ALL Miro videos will only be viewed in the MythTV "Watch Recordings" screen channel_watch_only = [u'all'] if opts.mythvideo_only: # ALL Miro videos will be copied to MythVideo and removed from Miro channel_mythvideo_only = {u'all': vid_graphics_dirs[u'mythvideo']+u'Miro/'} # Once watched ALL Miro videos will be copied to MythVideo and removed from Miro if opts.new_watch_copy: channel_new_watch_copy = {u'all': vid_graphics_dirs[u'mythvideo']+u'Miro/'} # Verify that "Mythvideo Only" and "New-Watch-Copy" channels do not clash if len(channel_mythvideo_only) and len(channel_new_watch_copy): for key in channel_mythvideo_only.keys(): if key in channel_new_watch_copy.keys(): logger.critical(u'The Miro Channel (%s) cannot be used as both a "Mythvideo Only" and "New-Watch-Copy" channel.' % key) if test_environment: requirements_are_met = False else: sys.exit(False) # Verify that ImageMagick is installed ret = useImageMagick(u"convert -version") if ret < 0 or ret > 1: logger.critical(u"ImageMagick must be installed, graphics cannot be resized or converted to the required graphics format (e.g. jpg and or png)") if test_environment: requirements_are_met = False else: sys.exit(False) # Verify that mythcommflag is installed mythcommflagpath = getlocationMythcommflag() if mythcommflagpath: mythcommflag_recordings = mythcommflag_recordings % mythcommflagpath mythcommflag_videos = mythcommflag_videos % mythcommflagpath else: logger.critical(u"mythcommflag must be installed so that Miro video seek tables can be built.") if test_environment: requirements_are_met = False else: sys.exit(False) if opts.testenv: # All tests passed getVideoDetails(u"") # Test that ffmpeg is available if ffmpeg and requirements_are_met: logger.info(u"The environment test passed !\n\n") sys.exit(True) else: logger.critical(u"The environment test FAILED. See previously displayed error messages!") sys.exit(False) if opts.addchannel != u'OFF': # Add a Miro Channel record - Should only be done once createChannelRecord(opts.addchannel, channel_id, channel_num) logger.info(u"The Miro Channel record has been successfully created !\n\n") sys.exit(True) ########################################### # Mainlogic for all Miro and MythTV bridge ########################################### # # Start the Miro Front and Backend - This allows mirobridge to execute actions on the Miro backend # displayMessage(u"Starting Miro Frontend and Backend") startup.initialize(config.get(prefs.THEME_NAME)) app.cli_events = EventHandler() app.cli_events.connect_to_signals() startup.startup() app.cli_events.startup_event.wait() if app.cli_events.startup_failure: logger.critical(u"Starting Miro Frontend and Backend failed: (%s)" % app.cli_events.startup_failure[0]) print_text(app.cli_events.startup_failure[1]) app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) app.cli_interpreter = MiroInterpreter() if opts.verbose: app.cli_interpreter.verbose = True else: app.cli_interpreter.verbose = False app.cli_interpreter.simulation = opts.simulation app.cli_interpreter.videofiles = [] app.cli_interpreter.downloading = False app.cli_interpreter.icon_cache_dir = config.get(prefs.ICON_CACHE_DIRECTORY) app.cli_interpreter.imagemagick = imagemagick app.cli_interpreter.statistics = statistics if config.get(prefs.APP_VERSION) < u"2.5.0": app.renderer = app.cli_interpreter else: app.movie_data_program_info = app.cli_interpreter.movie_data_program_info # # Optionally Update Miro feeds and # download any "autodownloadable" videos which are pending # if not opts.no_autodownload: if opts.verbose: app.cli_interpreter.verbose = False app.cli_interpreter.do_mythtv_getunwatched(u'') before_download = len(app.cli_interpreter.videofiles) if opts.verbose: app.cli_interpreter.verbose = True app.cli_interpreter.do_mythtv_update_autodownload(u'') time.sleep(download_sleeptime) firsttime = True while True: app.cli_interpreter.do_mythtv_check_downloading(u'') if app.cli_interpreter.downloading: time.sleep(30) firsttime = False continue elif firsttime: time.sleep(download_sleeptime) firsttime = False continue else: break if opts.verbose: app.cli_interpreter.verbose = False app.cli_interpreter.do_mythtv_getunwatched(u'') after_download = len(app.cli_interpreter.videofiles) statistics[u'Miros_videos_downloaded'] = after_download - before_download if opts.verbose: app.cli_interpreter.verbose = True # Deal with orphaned oldrecorded records. # These records indicate that the MythTV user deleted the video from the Watched Recordings screen # or from MythVideo # These video items must also be deleted from Miro videostodelete = getOldrecordedOrphans() if len(videostodelete): displayMessage(u"Starting Miro delete of videos deleted in the MythTV Watched Recordings screen.") for video in videostodelete: # Completely remove the video and item information from Miro app.cli_interpreter.do_mythtv_item_remove([video[u'title'], video[u'subtitle']]) # # Collect the set of played Miro video files # app.cli_interpreter.videofiles = getPlayedMiroVideos() # # Updated the played status of items # if app.cli_interpreter.videofiles: displayMessage(u"Starting Miro update of watched MythTV videos") app.cli_interpreter.do_mythtv_updatewatched(u'') # # Get the unwatched videos details from Miro # app.cli_interpreter.do_mythtv_getunwatched(u'') unwatched = app.cli_interpreter.videofiles # # Get the watched videos details from Miro # app.cli_interpreter.do_mythtv_getwatched(u'') watched = app.cli_interpreter.videofiles # # Remove any duplicate Miro videoes from the unwatched or watched list of Miro videos # This means that Miro has duplicates due to a Miro/Channel website issue # These videos should not be added to the MythTV Watch Recordings screen # unwatched_copy = [] for item in unwatched: unwatched_copy.append(item) for item in unwatched_copy: # Check for a duplicate against already watched Miro videos for x in watched: if item[u'channelTitle'] == x[u'channelTitle'] and item[u'title'] == x[u'title']: try: unwatched.remove(item) # Completely remove this duplicate video and item information from Miro app.cli_interpreter.do_mythtv_item_remove(item[u'videoFilename']) displayMessage(u"Skipped adding a duplicate Miro video to the MythTV Watch Recordings screen (%s - %s) which is already in MythVideo.\nSometimes a Miro channel has the same video downloaded multiple times.\nThis is a Miro/Channel web site issue and often rectifies itself overtime." % (item[u'channelTitle'], item[u'title'])) except ValueError: pass duplicates = [] for item in unwatched_copy: dup_flag = 0 for x in unwatched: # Check for a duplicate against un-watched Miro videos if item[u'channelTitle'] == x[u'channelTitle'] and item[u'title'] == x[u'title']: dup_flag+=1 if dup_flag > 1: for x in duplicates: if item[u'channelTitle'] == x[u'channelTitle'] and item[u'title'] == x[u'title']: break else: duplicates.append(item) for duplicate in duplicates: try: unwatched.remove(duplicate) # Completely remove this duplicate video and item information from Miro app.cli_interpreter.do_mythtv_item_remove(duplicate[u'videoFilename']) displayMessage(u"Skipped adding a Miro video to the MythTV Watch Recordings screen (%s - %s) as there are duplicate 'new' video items.\nSometimes a Miro channel has the same video downloaded multiple times.\nThis is a Miro/Channel web site issue and often rectifies itself overtime." % (duplicate[u'channelTitle'], duplicate[u'title'])) except ValueError: pass # # Deal with any Channel videos that are to be copied and removed from Miro # copy_items = [] # Copy unwatched and watched Miro videos (all or only selected Channels) if u'all' in channel_mythvideo_only: for array in [watched, unwatched]: for item in array: copy_items.append(item) elif len(channel_mythvideo_only): for array in [watched, unwatched]: for video in array: if filter(is_not_punct_char, video[u'channelTitle'].lower()) in channel_mythvideo_only.keys(): copy_items.append(video) # Copy ONLY watched Miro videos (all or only selected Channels) if u'all' in channel_new_watch_copy: for video in watched: copy_items.append(video) elif len(channel_new_watch_copy): for video in watched: if filter(is_not_punct_char, video[u'channelTitle'].lower()) in channel_new_watch_copy.keys(): copy_items.append(video) channels_to_copy = {} for key in channel_mythvideo_only.keys(): channels_to_copy[key] = channel_mythvideo_only[key] for key in channel_new_watch_copy.keys(): channels_to_copy[key] = channel_new_watch_copy[key] for video in copy_items: dir_key = filter(is_not_punct_char, video[u'channelTitle'].lower()) # Create the subdirectories to copy the video into directory_coverart = False if not os.path.isdir(channels_to_copy[dir_key]): if simulation: logger.info(u"Simulation: Creating the MythVideo directory (%s)." % (channels_to_copy[dir_key])) else: os.makedirs(channels_to_copy[dir_key]) directory_coverart = True # If the directory was just created it needs coverart else: if video[u'channel_icon']: ext = getExtention(video[u'channel_icon']) if not os.path.isfile(u"%s%s.%s" % (channels_to_copy[dir_key], video[u'channelTitle'].lower(), ext)): directory_coverart = True # If the directory was just created it needs coverart elif video[u'item_icon']: ext = getExtention(video[u'item_icon']) if not os.path.isfile(u"%s%s - %s.%s" % (channels_to_copy[dir_key], video[u'channelTitle'].lower(), video[u'title'].lower(), ext)): directory_coverart = True # If the directory was just created it needs coverart # Copy the Channel icon located in the posters/coverart directory if directory_coverart and video[u'channel_icon']: ext = getExtention(video[u'channel_icon']) tmp_path = channels_to_copy[dir_key][:-1] foldername = tmp_path[tmp_path.rindex(u'/')+1:] dirpath = u"%s%s" % (channels_to_copy[dir_key], u'folder.jpg') dirpath2 = u"%s%s" % (channels_to_copy[dir_key], u'folder.png') if os.path.isfile(dirpath) or os.path.isfile(dirpath2): # See if a folder cover already exists pass else: if simulation: logger.info(u"Simulation: Copy a Channel Icon (%s) for directory (%s)." % (video[u'channel_icon'], dirpath)) else: try: # Miro Channel icon copy for the new subdirectory useImageMagick(u'convert "%s" "%s"' % (video[u'channel_icon'], dirpath)) except: logger.critical(u"Copy a Channel Icon (%s) for directory (%s) failed." % (video[u'channel_icon'], dirpath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) # Copy the Miro video file save_video_filename = video[u'videoFilename'] # This filename is needed later for deleting in Miro ext = getExtention(video[u'videoFilename']) if ext.lower() == u'm4v': ext = u'mpg' filepath = u"%s%s - %s.%s" % (channels_to_copy[dir_key], video[u'channelTitle'], video[u'title'], ext) if simulation: logger.info(u"Simulation: Copying the Miro video (%s) to the MythVideo directory (%s)." % (video[u'videoFilename'], filepath)) else: try: # Miro video copied into a MythVideo directory shutil.copy2(video[u'videoFilename'], filepath) statistics[u'Miros_MythVideos_copied']+=1 if u'mythvideo' in storagegroups.keys() and not local_only: video[u'videoFilename'] = filepath.replace(storagegroups[u'mythvideo'], u'') else: video[u'videoFilename'] = filepath except: logger.critical(u"Copying the Miro video (%s) to the MythVideo directory (%s).\n This maybe a permissions error (mirobridge.py does not have permission to write to the directory)." % (video[u'videoFilename'], filepath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) # Copy the Channel or item's icon if video[u'channel_icon'] and not video[u'channelTitle'].lower() in channel_icon_override: pass else: if video[u'item_icon']: video[u'channel_icon'] = video[u'item_icon'] if video[u'channel_icon']: ext = getExtention(video[u'channel_icon']) if video[u'channelTitle'].lower() in channel_icon_override: filepath = u"%s%s - %s%s.%s" % (vid_graphics_dirs[u'posterdir'], video[u'channelTitle'], video[u'title'], graphic_suffix[u'posterdir'], ext) else: filepath = u"%s%s%s.%s" % (vid_graphics_dirs[u'posterdir'], video[u'channelTitle'], graphic_suffix[u'posterdir'], ext) # There may already be a Channel icon available or it is a symlink which needs to be replaced if not os.path.isfile(filepath) or os.path.islink(filepath): if simulation: logger.info(u"Simulation: Copying the Channel Icon (%s) to the poster directory (%s)." % (video[u'channel_icon'], filepath)) else: try: # Miro Channel icon copied into a MythVideo directory try: # Remove any old symlink file os.remove(filepath) except OSError: pass shutil.copy2(video[u'channel_icon'], filepath) if u'posterdir' in storagegroups.keys() and not local_only: video[u'channel_icon'] = filepath.replace(storagegroups[u'posterdir'], u'') else: video[u'channel_icon'] = filepath except: logger.critical(u"Copying the Channel Icon (%s) to the poster directory (%s).\n This maybe a permissions error (mirobridge.py does not have permission to write to the directory)." % (video[u'channel_icon'], filepath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) else: if u'posterdir' in storagegroups.keys() and not local_only: video[u'channel_icon'] = filepath.replace(storagegroups[u'posterdir'], u'') else: video[u'channel_icon'] = filepath # There may already be a Screenshot available or it is a symlink which needs to be replaced if video[u'screenshot']: ext = getExtention(video[u'screenshot']) filepath = u"%s%s - %s%s.%s" % (vid_graphics_dirs[u'episodeimagedir'], video[u'channelTitle'], video[u'title'], graphic_suffix[u'episodeimagedir'], ext) else: filepath = u'' if not os.path.isfile(filepath) or os.path.islink(filepath): if video[u'screenshot']: if simulation: logger.info(u"Simulation: Copying the Screenshot (%s) to the Screenshot directory (%s)." % (video[u'screenshot'], filepath)) else: try: # Miro Channel icon copied into a MythVideo directory try: # Remove any old symlink file os.remove(filepath) except OSError: pass shutil.copy2(video[u'screenshot'], filepath) displayMessage(u"Copied Miro screenshot file (%s) to MythVideo (%s)" % (video[u'screenshot'], filepath)) if u'episodeimagedir' in storagegroups.keys() and not local_only: video[u'screenshot'] = filepath.replace(storagegroups[u'episodeimagedir'], u'') else: video[u'screenshot'] = filepath except: logger.critical(u"Copying the Screenshot (%s) to the Screenshot directory (%s).\n This maybe a permissions error (mirobridge.py does not have permission to write to the directory)." % (video[u'screenshot'], filepath)) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete sys.exit(False) elif video[u'screenshot']: if u'episodeimagedir' in storagegroups.keys() and not local_only: video[u'screenshot'] = filepath.replace(storagegroups[u'episodeimagedir'], u'') else: video[u'screenshot'] = filepath video[u'copied'] = True # Mark this video item as being copied # Completely remove the video and item information from Miro app.cli_interpreter.do_mythtv_item_remove(save_video_filename) # Gracefully close the Miro database and shutdown the Miro Front and Back ends app.controller.shutdown() time.sleep(5) # Let the shutdown processing complete # # Add and delete MythTV (Watch Recordings) Miro recorded records # Add and remove symlinks for Miro video files # # Check if the user does not want any channels Added to the "Watch Recordings" screen if channel_mythvideo_only.has_key(u'all'): for video in unwatched: watched.append(video) unwatched = [] else: if len(channel_mythvideo_only): unwatched_copy = [] for video in unwatched: if not filter(is_not_punct_char, video[u'channelTitle'].lower()) in channel_mythvideo_only.keys(): unwatched_copy.append(video) else: watched.append(video) unwatched = unwatched_copy statistics[u'Total_unwatched'] = len(unwatched) if not len(unwatched): displayMessage(u"There are no Miro unwatched video items to add as MythTV Recorded videos.") if not updateMythRecorded(unwatched): logger.critical(u"Updating MythTV Recording with Miro video files failed." % str(base_video_dir)) sys.exit(False) # # Add and delete MythVideo records for played Miro Videos # Add and delete symbolic links to Miro Videos and subdirectories # Add and delete symbolic links to coverart/Miro icons and Miro screenshots/fanart # if len(channel_watch_only): # If the user does not want any channels moved to MythVideo exit if channel_watch_only[0].lower() == u'all': printStatistics() return True if not len(watched): displayMessage(u"There are no Miro watched items to add to MythVideo") if not updateMythVideo(watched): logger.critical(u"Updating MythVideo with Miro video files failed.") sys.exit(False) printStatistics() return True | 0f178cb606ce1cfb96840e30bd489d420b041e6d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/0f178cb606ce1cfb96840e30bd489d420b041e6d/mirobridge.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
6289,
312,
11373,
18337,
628,
326,
1296,
980,
1135,
1053,
3536,
2552,
1191,
10358,
16,
14754,
16,
3988,
16,
2502,
4650,
16,
6875,
19951,
16,
1904,
67,
350,
16,
1904,
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,
2774,
13332,
3536,
6289,
312,
11373,
18337,
628,
326,
1296,
980,
1135,
1053,
3536,
2552,
1191,
10358,
16,
14754,
16,
3988,
16,
2502,
4650,
16,
6875,
19951,
16,
1904,
67,
350,
16,
1904,
6... |
print >>dagfile, """\ | print >>dagfile, """ | def write_abstract_dag(self): """ Write all the nodes in the workflow to the DAX file. """ if not self.__dax_file_path: # this workflow is not dax-compatible, so don't write a dax return try: dagfile = open( self.__dax_file_path, 'w' ) except: raise CondorDAGError, "Cannot open file " + self.__dag_file_path | 24b81d2ec6995782c831003011aff6c9c31e0e57 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3589/24b81d2ec6995782c831003011aff6c9c31e0e57/pipeline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
17801,
67,
30204,
12,
2890,
4672,
3536,
2598,
777,
326,
2199,
316,
326,
6095,
358,
326,
463,
2501,
585,
18,
3536,
309,
486,
365,
16186,
72,
651,
67,
768,
67,
803,
30,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
17801,
67,
30204,
12,
2890,
4672,
3536,
2598,
777,
326,
2199,
316,
326,
6095,
358,
326,
463,
2501,
585,
18,
3536,
309,
486,
365,
16186,
72,
651,
67,
768,
67,
803,
30,
468,
... |
print "Polar:", polar_angles print "Azi:", azi_angles | if debug: print "Polar:", polar_angles print "Azi:", azi_angles | def __calc_azi(xi, yi): return math.atan2(yi, xi) | 5dda94f6f020457616aeb9c18c84293aeaff5080 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/762/5dda94f6f020457616aeb9c18c84293aeaff5080/calc_dgs_params.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12448,
67,
1561,
77,
12,
27005,
16,
16805,
4672,
327,
4233,
18,
270,
304,
22,
12,
93,
77,
16,
14087,
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,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12448,
67,
1561,
77,
12,
27005,
16,
16805,
4672,
327,
4233,
18,
270,
304,
22,
12,
93,
77,
16,
14087,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
raise IOError("File not found: %s" % fpath) | raise IOError(errno.ENOENT, "File not found: %s" % fpath) | def __get_data_3(self, cr, uid, boo, ira, context): if not boo.online: raise RuntimeError('media offline') if boo.type == 'filestore': if not ira.store_fname: # On a migrated db, some files may have the wrong storage type # try to fix their directory. if ira.file_size: self._doclog.warning( "ir.attachment #%d does not have a filename, but is at filestore, fix it!" % ira.id) return None fpath = os.path.join(boo.path, ira.store_fname) return file(fpath, 'rb').read() elif boo.type == 'db64': # TODO: we need a better api for large files if ira.db_datas: out = base64.decodestring(ira.db_datas) else: out = '' return out elif boo.type == 'db': # We do an explicit query, to avoid type transformations. cr.execute('SELECT db_datas FROM ir_attachment WHERE id = %s', (ira.id,)) res = cr.fetchone() if res: return res[0] else: return '' elif boo.type == 'realstore': if not ira.store_fname: # On a migrated db, some files may have the wrong storage type # try to fix their directory. if ira.file_size: self._doclog.warning("ir.attachment #%d does not have a filename, trying the name." %ira.id) sfname = ira.name fpath = os.path.join(boo.path,ira.store_fname or ira.name) if os.path.exists(fpath): return file(fpath,'rb').read() elif not ira.store_fname: return None else: raise IOError("File not found: %s" % fpath) | 26935b22e6e045097f3c67418c982392e9fa3a9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/26935b22e6e045097f3c67418c982392e9fa3a9e/document_storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
67,
892,
67,
23,
12,
2890,
16,
4422,
16,
4555,
16,
800,
83,
16,
277,
354,
16,
819,
4672,
309,
486,
800,
83,
18,
21026,
30,
1002,
7265,
2668,
5829,
13493,
6134,
309,
800,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
588,
67,
892,
67,
23,
12,
2890,
16,
4422,
16,
4555,
16,
800,
83,
16,
277,
354,
16,
819,
4672,
309,
486,
800,
83,
18,
21026,
30,
1002,
7265,
2668,
5829,
13493,
6134,
309,
800,
... |
if not basepos: return None, None, None, V(1,0,0) | if not len(basepos): return [], [], [], V(1,0,0) | def shakedown_poly_eval_evec_axis(basepos): """Given basepos (an array of atom positions), compute and return (as the elements of a tuple) the bounding polyhedron we should draw around these atoms to designate that their molecule is selected, the eigenvalues and eigenvectors of the inertia tensor (computed as if all atoms had the same mass), and the (heuristically defined) principal axis. """ # bruce 041106 split this out of the old molecule.shakedown() method, # replaced molecule attrs with simple variables (the ones we return), # and renamed self.eval to evals (just in this function) to avoid # confusion with python's built-in function eval. if not basepos: return None, None, None, V(1,0,0) # find extrema in many directions xtab = dot(basepos, polyXmat) mins = minimum.reduce(xtab) - 1.8 maxs = maximum.reduce(xtab) + 1.8 polyhedron = makePolyList(cat(maxs,mins)) # and compute inertia tensor tensor = zeros((3,3),Float) for p in basepos: rsq = dot(p, p) m= - multiply.outer(p, p) m[0,0] += rsq m[1,1] += rsq m[2,2] += rsq tensor += m evals, evec = eigenvectors(tensor) # Pick a principal axis: if square or circular, the axle; # otherwise the long axis (this is a heuristic) ### bruce 041112 suspects it was a bug in original source # to say atpos rather than basepos. Evidence: axis as used # in self.getaxis should be in base coords; axis computed # below from evec (when > 2 atoms) is in base coords. if len(basepos)<=1: axis = V(1,0,0) elif len(basepos) == 2: axis = norm(subtract.reduce(basepos)) else: ug = argsort(evals) if evals[ug[0]]/evals[ug[1]] >0.95: axis = evec[ug[2]] else: axis = evec[ug[0]] return polyhedron, evals, evec, axis # from shakedown_poly_evals_evec_axis | ddbce1fed5b575cd52c58bfa9a8780a5e1190eee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/ddbce1fed5b575cd52c58bfa9a8780a5e1190eee/chunk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
699,
9477,
995,
67,
16353,
67,
8622,
67,
73,
8799,
67,
4890,
12,
1969,
917,
4672,
3536,
6083,
1026,
917,
261,
304,
526,
434,
3179,
6865,
3631,
3671,
471,
327,
261,
345,
326,
2186,
434,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
699,
9477,
995,
67,
16353,
67,
8622,
67,
73,
8799,
67,
4890,
12,
1969,
917,
4672,
3536,
6083,
1026,
917,
261,
304,
526,
434,
3179,
6865,
3631,
3671,
471,
327,
261,
345,
326,
2186,
434,... |
retangle.SetYLength(size) seeds_yi = self.seeds_yi seeds_yi.SetPoint1(0, 0, 0) seeds_yi.SetPoint2(0, self.y_length, 0) seeds_yf = self.seeds_yf seeds_yf.SetPoint1(self.x_length, self.y_length, 0) seeds_yf.SetPoint2(self.x_length, 0, 0) seeds_xi = self.seeds_xi seeds_xi.SetPoint1(0, self.y_length, 0) seeds_xi.SetPoint2(self.x_length, self.y_length, 0) seeds_xf = self.seeds_xf seeds_xf.SetPoint1(0, 0, 0) seeds_xf.SetPoint2(self.x_length, 0, 0) | retangle.SetYLength(size) | def SetSize(self, size): print "SetSize", size self.x_length = size self.y_length = size retangle = self.retangle retangle.SetXLength(size) retangle.SetYLength(size) seeds_yi = self.seeds_yi seeds_yi.SetPoint1(0, 0, 0) seeds_yi.SetPoint2(0, self.y_length, 0) seeds_yf = self.seeds_yf seeds_yf.SetPoint1(self.x_length, self.y_length, 0) seeds_yf.SetPoint2(self.x_length, 0, 0) seeds_xi = self.seeds_xi seeds_xi.SetPoint1(0, self.y_length, 0) seeds_xi.SetPoint2(self.x_length, self.y_length, 0) seeds_xf = self.seeds_xf seeds_xf.SetPoint1(0, 0, 0) seeds_xf.SetPoint2(self.x_length, 0, 0) #join_lines = self.join_lines #join_lines.AddInput(seeds_yi.GetOutput()) #join_lines.AddInput(seeds_yf.GetOutput()) #join_lines.AddInput(seeds_xi.GetOutput()) #join_lines.AddInput(seeds_xf.GetOutput()) self.__calculate_area_pixels() | d8df5d576e393f5c8db03d2308e5e6c2d2e3c49e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10228/d8df5d576e393f5c8db03d2308e5e6c2d2e3c49e/cursor_actors.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
1225,
12,
2890,
16,
963,
4672,
1172,
315,
694,
1225,
3113,
963,
365,
18,
92,
67,
2469,
273,
963,
365,
18,
93,
67,
2469,
273,
963,
325,
4341,
273,
365,
18,
1349,
4341,
325,
4341... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
1225,
12,
2890,
16,
963,
4672,
1172,
315,
694,
1225,
3113,
963,
365,
18,
92,
67,
2469,
273,
963,
365,
18,
93,
67,
2469,
273,
963,
325,
4341,
273,
365,
18,
1349,
4341,
325,
4341... |
[2*5 + 2*5^2 + 4*5^3 + 3*5^4 + 3*5^5 + 4*5^6 + 3*5^7 + 4*5^8 + O(5^9) 2*5 + 3*5^2 + 3*5^3 + 3*5^4 + 2*5^5 + O(5^7)] [ 2*5 + 3*5^2 + 3*5^3 + 3*5^4 + 2*5^5 + O(5^7) 3*5^3 + 5^4 + 5^6 + O(5^7)] | [2*5 + 2*5^2 + 4*5^3 + 3*5^4 + 3*5^5 + 4*5^6 + 3*5^7 + 4*5^8 + O(5^9) 4*5 + 3*5^3 + 2*5^4 + 5^5 + 3*5^7 + 3*5^8 + O(5^9)] [ 4*5 + 3*5^3 + 2*5^4 + 5^5 + 3*5^7 + 3*5^8 + O(5^9) 5 + 4*5^2 + 4*5^3 + 2*5^4 + 4*5^5 + 5^6 + O(5^9)] | def padic_height_pairing_matrix(self, p, prec=20, height=None, check_hypotheses=True): r""" Computes the cyclotomic $p$-adic height pairing matrix of this curve with respect to the basis self.gens() for the Mordell-Weil group for a given odd prime p of good ordinary reduction. | 301d66444833e15425355df335abccca8dbadfca /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/301d66444833e15425355df335abccca8dbadfca/ell_rational_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4627,
335,
67,
4210,
67,
6017,
310,
67,
5667,
12,
2890,
16,
293,
16,
13382,
33,
3462,
16,
2072,
33,
7036,
16,
866,
67,
76,
879,
10370,
281,
281,
33,
5510,
4672,
436,
8395,
14169,
281... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4627,
335,
67,
4210,
67,
6017,
310,
67,
5667,
12,
2890,
16,
293,
16,
13382,
33,
3462,
16,
2072,
33,
7036,
16,
866,
67,
76,
879,
10370,
281,
281,
33,
5510,
4672,
436,
8395,
14169,
281... |
getGWConfig().constrains = escape(safe_unicode(value)) | getGWConfig().constrains = value | def set(self, value): getGWConfig().constrains = escape(safe_unicode(value)) | 070938d23071aedec649c8a62af7f37abc39f9d9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13072/070938d23071aedec649c8a62af7f37abc39f9d9/controlpanel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
460,
4672,
7162,
59,
809,
7675,
591,
701,
4167,
273,
4114,
12,
4626,
67,
9124,
12,
1132,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
460,
4672,
7162,
59,
809,
7675,
591,
701,
4167,
273,
4114,
12,
4626,
67,
9124,
12,
1132,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if not self.thread_started: logging.info("Movie data thread not started, waiting to " "request update for %s", item) addTimeout(1, self.request_update, "movie data update request", args=(item,)) return | def request_update(self, item): if self.in_shutdown: return if not self.thread_started: logging.info("Movie data thread not started, waiting to " "request update for %s", item) addTimeout(1, self.request_update, "movie data update request", args=(item,)) return | 1ba4c98f96fe2ceb6deb3abf18c2384f10813f44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/1ba4c98f96fe2ceb6deb3abf18c2384f10813f44/moviedata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
67,
2725,
12,
2890,
16,
761,
4672,
309,
365,
18,
267,
67,
15132,
30,
327,
309,
486,
365,
18,
5930,
67,
14561,
30,
2907,
18,
1376,
2932,
16727,
13120,
501,
2650,
486,
5746,
16,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
67,
2725,
12,
2890,
16,
761,
4672,
309,
365,
18,
267,
67,
15132,
30,
327,
309,
486,
365,
18,
5930,
67,
14561,
30,
2907,
18,
1376,
2932,
16727,
13120,
501,
2650,
486,
5746,
16,
7... | |
return obj[key] | try: return obj[key] except TypeError: return None | def get_value(self, obj, key): return obj[key] | 9dff7b737749386a017588a0f8487ca1d061b5b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12441/9dff7b737749386a017588a0f8487ca1d061b5b9/repository_tags.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1132,
12,
2890,
16,
1081,
16,
498,
4672,
327,
1081,
63,
856,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1132,
12,
2890,
16,
1081,
16,
498,
4672,
327,
1081,
63,
856,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def processViews(views, loadDeps, runDeps): | def processViews(views, loadDeps, runDeps, output): | def processViews(views, loadDeps, runDeps): global classes print ">>> Analysing %s views..." % len(views) classCounts = {} # Generating data structures for possible modules classMods = {} # for id in views: # Hint: IDs # # apiviewer # feedreader # webmail # apiviewer-feedreader # apiviewer-webmail # feedreader-webmail # apiviewer-feedreader-webmail # # Find all classes allIncludes = [] for id in views: allIncludes.extend(views[id]) allClasses = resolveDependencies(allIncludes, [], loadDeps, runDeps) print " - Using %s classes" % len(allClasses) # Caching dependencies of each view deps = {} for viewId in views: deps[viewId] = resolveDependencies(views[viewId], [], loadDeps, runDeps) print " - %s use %s classes" % (viewId, len(deps[viewId])) # Build bitmask ids for views # 1,2,4,8,16,32,64,128 bits = {} pos = 1 for id in views: bits[id] = pos pos = pos * 2 print bits # Revert map # apiviever = [1,4,8] bitIds = {} # TODO # Find out usage of classes and assign them to a bitmask using map usage = {} for classId in allClasses: usageId = 0 for viewId in views: if classId in deps[viewId]: usageId += bits[viewId] if usageId == 0: continue if not usage.has_key(usageId): usage[usageId] = [] usage[usageId].append(classId) # Debug print ">>> Bit results" for bit in usage: print " - Bit %s has %s classes" % (bit, len(usage[bit])) #print " %s" % ", ".join(usage[bit]) viewFiles = {} for viewId in views: bitId = bits[viewId] content = [] for num in usage: if num&bitId: content.insert(0, num) viewFiles[viewId] = content print viewFiles exportUsageToPackagesJson(usage) exportUsageToClassJson(usage) result = [] # Return result list return result | 0695d5fc7db251d077ab56c9991eee69ced5d073 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/0695d5fc7db251d077ab56c9991eee69ced5d073/generator2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
9959,
12,
7061,
16,
1262,
14430,
16,
1086,
14430,
16,
876,
4672,
2552,
3318,
225,
1172,
315,
23012,
1922,
3646,
310,
738,
87,
7361,
7070,
738,
562,
12,
7061,
13,
225,
667,
9211,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9959,
12,
7061,
16,
1262,
14430,
16,
1086,
14430,
16,
876,
4672,
2552,
3318,
225,
1172,
315,
23012,
1922,
3646,
310,
738,
87,
7361,
7070,
738,
562,
12,
7061,
13,
225,
667,
9211,
... |
return video | if video: return video | def _get_video(self, _id): if self.interactive: try: video = self.videos[int(_id)] except (KeyError,ValueError): pass else: return video _id, backend_name = self.parse_id(_id) backend_names = (backend_name,) if backend_name is not None else self.enabled_backends for backend, video in self.do('get_video', _id, backends=backend_names): return video | 56cc59cf5ebf0dc00a19bd190da7b6bd940c8d3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7471/56cc59cf5ebf0dc00a19bd190da7b6bd940c8d3b/videoob.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
9115,
12,
2890,
16,
389,
350,
4672,
309,
365,
18,
24761,
30,
775,
30,
6191,
273,
365,
18,
6768,
538,
63,
474,
24899,
350,
25887,
1335,
261,
653,
668,
16,
23610,
4672,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
9115,
12,
2890,
16,
389,
350,
4672,
309,
365,
18,
24761,
30,
775,
30,
6191,
273,
365,
18,
6768,
538,
63,
474,
24899,
350,
25887,
1335,
261,
653,
668,
16,
23610,
4672,
1... |
try: root._delObject('test') except AttributeError: pass | def setUp( self ): SecurityTest.setUp(self) | f8b16c94ed9650b5181b4f2212c671fd580300f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/f8b16c94ed9650b5181b4f2212c671fd580300f3/test_PortalFolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
365,
262,
30,
6036,
4709,
18,
542,
1211,
12,
2890,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
365,
262,
30,
6036,
4709,
18,
542,
1211,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
self.help_fcompiler = None | def initialize_options(self): self.fcompiler = None self.f77exec = None self.f90exec = None self.f77flags = None self.f90flags = None self.opt = None self.arch = None self.debug = None self.noopt = None self.noarch = None self.help_fcompiler = None return | 1bca125a3f0c1e86b7777adebcdde5671b713f92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/1bca125a3f0c1e86b7777adebcdde5671b713f92/config_compiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
67,
2116,
12,
2890,
4672,
365,
18,
74,
9576,
273,
599,
365,
18,
74,
4700,
4177,
273,
599,
365,
18,
74,
9349,
4177,
273,
599,
365,
18,
74,
4700,
7133,
273,
599,
365,
18,
74,
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,
4046,
67,
2116,
12,
2890,
4672,
365,
18,
74,
9576,
273,
599,
365,
18,
74,
4700,
4177,
273,
599,
365,
18,
74,
9349,
4177,
273,
599,
365,
18,
74,
4700,
7133,
273,
599,
365,
18,
74,
9... | |
class CountryContinentRedirect(MMSQLObject): | class CountryContinentRedirect(SQLObject): class sqlmeta: cacheValues = False | def ageFileDetails(): for d in Directory.select(): d.age_file_details() | ec0d40658f0447775d65e70acc1cb8593a9f2027 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13031/ec0d40658f0447775d65e70acc1cb8593a9f2027/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9388,
812,
3790,
13332,
364,
302,
316,
8930,
18,
4025,
13332,
302,
18,
410,
67,
768,
67,
6395,
1435,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9388,
812,
3790,
13332,
364,
302,
316,
8930,
18,
4025,
13332,
302,
18,
410,
67,
768,
67,
6395,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
parser.add_option('-j', '--jobs', default=8, type='int', | parser.add_option('-j', '--jobs', default=1, type='int', | def Main(argv): """Doesn't parse the arguments here, just find the right subcommand to execute.""" try: # Do it late so all commands are listed. CMDhelp.usage = ('\n\nCommands are:\n' + '\n'.join([ ' %-10s %s' % (fn[3:], Command(fn[3:]).__doc__.split('\n')[0].strip()) for fn in dir(sys.modules[__name__]) if fn.startswith('CMD')])) parser = optparse.OptionParser(version='%prog ' + __version__) parser.add_option('-j', '--jobs', default=8, type='int', help='Specify how many SCM commands can run in parallel; ' 'default=%default') parser.add_option('-v', '--verbose', action='count', default=0, help='Produces additional output for diagnostics. Can be ' 'used up to three times for more logging info.') parser.add_option('--gclientfile', dest='config_filename', default=os.environ.get('GCLIENT_FILE', '.gclient'), help='Specify an alternate %default file') # Integrate standard options processing. old_parser = parser.parse_args def Parse(args): (options, args) = old_parser(args) level = None if options.verbose == 2: level = logging.INFO elif options.verbose > 2: level = logging.DEBUG logging.basicConfig(level=level, format='%(module)s(%(lineno)d) %(funcName)s:%(message)s') options.entries_filename = options.config_filename + '_entries' if options.jobs < 1: parser.error('--jobs must be 1 or higher') # Always autoflush so buildbot doesn't kill us during lengthy operations. options.stdout = gclient_utils.StdoutAutoFlush(sys.stdout) # These hacks need to die. if not hasattr(options, 'revisions'): # GClient.RunOnDeps expects it even if not applicable. options.revisions = [] if not hasattr(options, 'head'): options.head = None if not hasattr(options, 'nohooks'): options.nohooks = True if not hasattr(options, 'deps_os'): options.deps_os = None if not hasattr(options, 'manually_grab_svn_rev'): options.manually_grab_svn_rev = None if not hasattr(options, 'force'): options.force = None return (options, args) parser.parse_args = Parse # We don't want wordwrapping in epilog (usually examples) parser.format_epilog = lambda _: parser.epilog or '' if argv: command = Command(argv[0]) if command: # 'fix' the usage and the description now that we know the subcommand. GenUsage(parser, argv[0]) return command(parser, argv[1:]) # Not a known command. Default to help. GenUsage(parser, 'help') return CMDhelp(parser, argv) except gclient_utils.Error, e: print >> sys.stderr, 'Error: %s' % str(e) return 1 | ba752ea109c939d42158491a11ded71925619e05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/ba752ea109c939d42158491a11ded71925619e05/gclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12740,
12,
19485,
4672,
3536,
10154,
82,
1404,
1109,
326,
1775,
2674,
16,
2537,
1104,
326,
2145,
18856,
358,
1836,
12123,
775,
30,
468,
2256,
518,
26374,
1427,
777,
4364,
854,
12889,
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,
12740,
12,
19485,
4672,
3536,
10154,
82,
1404,
1109,
326,
1775,
2674,
16,
2537,
1104,
326,
2145,
18856,
358,
1836,
12123,
775,
30,
468,
2256,
518,
26374,
1427,
777,
4364,
854,
12889,
18,
... |
error_handler=log.err) | error_handler=d.errback) | def on_sms_list_cb(messages): sms_found = False for msg in messages: if msg['index'] == indexes[0]: sms_found = True | 45c00959c14e666ef31b3f93137f14e6d66959e4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12036/45c00959c14e666ef31b3f93137f14e6d66959e4/test_dbus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
20984,
67,
1098,
67,
7358,
12,
6833,
4672,
16188,
67,
7015,
273,
1083,
364,
1234,
316,
2743,
30,
309,
1234,
3292,
1615,
3546,
422,
5596,
63,
20,
14542,
16188,
67,
7015,
273,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
20984,
67,
1098,
67,
7358,
12,
6833,
4672,
16188,
67,
7015,
273,
1083,
364,
1234,
316,
2743,
30,
309,
1234,
3292,
1615,
3546,
422,
5596,
63,
20,
14542,
16188,
67,
7015,
273,
1... |
s = f(os.path.join(self.build_src,d)) | s = f(build_dir) | def build_data_files_sources(self): if not self.data_files: return log.info('building data_files sources') from numpy.distutils.misc_util import get_data_files new_data_files = [] for data in self.data_files: if isinstance(data,str): new_data_files.append(data) elif isinstance(data,tuple): d,files = data funcs = filter(callable,files) files = filter(lambda f:not callable(f), files) for f in funcs: if f.func_code.co_argcount==1: s = f(os.path.join(self.build_src,d)) else: s = f() if s is not None: if isinstance(s,list): files.extend(s) elif isinstance(s,str): files.append(s) else: raise TypeError,`s` filenames = get_data_files((d,files)) new_data_files.append((d, filenames)) else: raise self.data_files[:] = new_data_files return | b88a3fcd3405258f57ba8ec7ebefbacf13ff5019 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/b88a3fcd3405258f57ba8ec7ebefbacf13ff5019/build_src.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
892,
67,
2354,
67,
10141,
12,
2890,
4672,
309,
486,
365,
18,
892,
67,
2354,
30,
327,
613,
18,
1376,
2668,
3510,
310,
501,
67,
2354,
5550,
6134,
628,
3972,
18,
4413,
5471,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
892,
67,
2354,
67,
10141,
12,
2890,
4672,
309,
486,
365,
18,
892,
67,
2354,
30,
327,
613,
18,
1376,
2668,
3510,
310,
501,
67,
2354,
5550,
6134,
628,
3972,
18,
4413,
5471,
1... |
shutil.rmtree(masterpath + "__") | def set_master(masterpath, srcpath): if os.path.exists(masterpath + "_"): shutil.rmtree(masterpath + "_") shutil.copytree(srcpath, masterpath + "_") xapian.WritableDatabase(masterpath + "__", xapian.DB_CREATE_OR_OVERWRITE) os.unlink(os.path.join(masterpath + "_", "uuid")) os.rename(os.path.join(masterpath + "__", "uuid"), os.path.join(masterpath + "_", "uuid")) shutil.rmtree(masterpath + "__") if os.path.exists(masterpath): os.rename(masterpath, masterpath + "__") os.rename(masterpath + '_', masterpath) if os.path.exists(masterpath + "__"): shutil.rmtree(masterpath + "__") | fb1ade204e7909f1d1bb6c16a3c8b04ad5ca6382 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/569/fb1ade204e7909f1d1bb6c16a3c8b04ad5ca6382/replicationtest2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
7525,
12,
7525,
803,
16,
1705,
803,
4672,
309,
1140,
18,
803,
18,
1808,
12,
7525,
803,
397,
8802,
4672,
11060,
18,
86,
17371,
12,
7525,
803,
397,
4192,
7923,
11060,
18,
3530,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
7525,
12,
7525,
803,
16,
1705,
803,
4672,
309,
1140,
18,
803,
18,
1808,
12,
7525,
803,
397,
8802,
4672,
11060,
18,
86,
17371,
12,
7525,
803,
397,
4192,
7923,
11060,
18,
3530,
... | |
tr_flag = False | def _child_get(node, self=None, tagname=None): tr_flag = True for n in node: if self and self.localcontext and n.get('rml_loop', False): oldctx = self.localcontext for ctx in eval(n.get('rml_loop'),{}, self.localcontext): tr_flag = False self.localcontext.update(ctx) if (tagname is None) or (n.tag==tagname): if n.get('rml_except', False): try: eval(n.get('rml_except'), {}, self.localcontext) except: continue if n.get('rml_tag'): try: (tag,attr) = eval(n.get('rml_tag'),{}, self.localcontext) n2 = copy.copy(n) n2.tag = tag n2.attrib.update(attr) yield n2 except: yield n else: yield n self.localcontext = oldctx if n.tag == 'tr' and tr_flag: yield n continue if self and self.localcontext and n.get('rml_except', False): try: eval(n.get('rml_except'), {}, self.localcontext) except: continue if (tagname is None) or (n.tag==tagname): yield n | 1f5a45028dbb9e9b367c553790273077b5015a22 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/1f5a45028dbb9e9b367c553790273077b5015a22/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3624,
67,
588,
12,
2159,
16,
365,
33,
7036,
16,
25586,
33,
7036,
4672,
433,
67,
6420,
273,
1053,
364,
290,
316,
756,
30,
309,
365,
471,
365,
18,
3729,
2472,
471,
290,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3624,
67,
588,
12,
2159,
16,
365,
33,
7036,
16,
25586,
33,
7036,
4672,
433,
67,
6420,
273,
1053,
364,
290,
316,
756,
30,
309,
365,
471,
365,
18,
3729,
2472,
471,
290,
18,
588,
... | |
"""Install selected packages.""" mode_title = {'DEFAULT':_('Install'),'LAST':_('Install Last'),'MISSING':_('Install Missing')} def __init__(self,mode='DEFAULT'): Link.__init__(self) self.mode = mode def AppendToMenu(self,menu,window,data): Link.AppendToMenu(self,menu,window,data) self.title = self.mode_title[self.mode] menuItem = wx.MenuItem(menu,self.id,self.title) menu.AppendItem(menuItem) def Execute(self,event): """Handle selection.""" dir = self.data.dir progress = balt.Progress(_("Installing..."),'\n'+' '*60) try: last = (self.mode == 'LAST') override = (self.mode != 'MISSING') self.data.install(self.selected,progress,last,override) finally: progress.Destroy() self.data.refresh(what='N') gInstallers.RefreshUIMods() | """Install selected packages.""" mode_title = {'DEFAULT':_('Install'),'LAST':_('Install Last'),'MISSING':_('Install Missing')} def __init__(self,mode='DEFAULT'): Link.__init__(self) self.mode = mode def AppendToMenu(self,menu,window,data): Link.AppendToMenu(self,menu,window,data) self.title = self.mode_title[self.mode] menuItem = wx.MenuItem(menu,self.id,self.title) menu.AppendItem(menuItem) def Execute(self,event): """Handle selection.""" dir = self.data.dir progress = balt.Progress(_("Installing..."),'\n'+' '*60) try: last = (self.mode == 'LAST') override = (self.mode != 'MISSING') self.data.install(self.selected,progress,last,override) finally: progress.Destroy() self.data.refresh(what='N') gInstallers.RefreshUIMods() | def Execute(self,event): """Handle selection.""" installer = self.data[self.selected[0]] installer.hasExtraData ^= True installer.refreshDataSizeCrc() installer.refreshStatus(self.data) self.data.refresh(what='N') self.gTank.RefreshUI() | 3ac43907fa076fea1e8d682219e2b28fc7419f7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/3ac43907fa076fea1e8d682219e2b28fc7419f7b/basher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7903,
12,
2890,
16,
2575,
4672,
3536,
3259,
4421,
12123,
16050,
273,
365,
18,
892,
63,
2890,
18,
8109,
63,
20,
13563,
16050,
18,
5332,
7800,
751,
10352,
1053,
16050,
18,
9144,
29414,
39,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7903,
12,
2890,
16,
2575,
4672,
3536,
3259,
4421,
12123,
16050,
273,
365,
18,
892,
63,
2890,
18,
8109,
63,
20,
13563,
16050,
18,
5332,
7800,
751,
10352,
1053,
16050,
18,
9144,
29414,
39,... |
started_only=True,is_root=False): | started_only=True, is_root=False): | def get_tasks_list(self, tags=None, status=["Active"], notag_only=False, started_only=True,is_root=False): l_tasks = [] for tid in self.ds.all_tasks(): task = self.get_task(tid) if task and not task.is_loaded(): task = None #This is status filtering if task and not task.get_status() in status: task = None #This is tag filtering #If we still have a task and we need to filter tags #(if tags is None, this test is skipped) if task and tags: if not task.has_tags(tags): task = None #Checking here the is_root because it has sense only with tags elif is_root and task.has_parents(tag=tags): task = None #If tags = [], we still check the is_root elif task and is_root: if task.has_parents(): #We accept children of a note for p in task.get_parents(): pp = self.get_task(p) if pp.get_status() != "Note": task = None #Now checking if it has no tag if task and notag_only: if not task.has_tags(notag_only=notag_only): task = None #This is started filtering if task and started_only: if not task.is_started(): task = None | fe0e64029f8a9c78fa454273c78e41e59d65013b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8234/fe0e64029f8a9c78fa454273c78e41e59d65013b/requester.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9416,
67,
1098,
12,
2890,
16,
2342,
33,
7036,
16,
1267,
33,
9614,
3896,
6,
6487,
486,
346,
67,
3700,
33,
8381,
16,
5746,
67,
3700,
33,
5510,
16,
353,
67,
3085,
33,
8381,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9416,
67,
1098,
12,
2890,
16,
2342,
33,
7036,
16,
1267,
33,
9614,
3896,
6,
6487,
486,
346,
67,
3700,
33,
8381,
16,
5746,
67,
3700,
33,
5510,
16,
353,
67,
3085,
33,
8381,
4... |
self.append(s, charset) | self.append(s, charset, errors) | def __init__(self, s=None, charset=None, maxlinelen=None, header_name=None, continuation_ws=' '): """Create a MIME-compliant header that can contain many character sets. | f4fdff715af7a9d595444065c523f8de5303895d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f4fdff715af7a9d595444065c523f8de5303895d/Header.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
272,
33,
7036,
16,
4856,
33,
7036,
16,
943,
7511,
292,
275,
33,
7036,
16,
1446,
67,
529,
33,
7036,
16,
17378,
67,
4749,
2218,
296,
4672,
3536,
1684,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
272,
33,
7036,
16,
4856,
33,
7036,
16,
943,
7511,
292,
275,
33,
7036,
16,
1446,
67,
529,
33,
7036,
16,
17378,
67,
4749,
2218,
296,
4672,
3536,
1684,
27... |
match = re.match(r'(\w+)(\(.*?\))?', type) coltype = match.group(1) | match = re.match(r'(\w+)(\(.*?\))?\s*(\w+)?\s*(\w+)?', type) col_type = match.group(1) | def reflecttable(self, connection, table): # to use information_schema: #ischema.reflecttable(self, table, ischema_names, use_mysql=True) c = connection.execute("describe " + table.name, {}) found_table = False while True: row = c.fetchone() if row is None: break #print "row! " + repr(row) if not found_table: tabletype, foreignkeyD = self.moretableinfo(connection, table=table) table.kwargs['mysql_engine'] = tabletype found_table = True | d4cbae66037338ea8f727cdaa6ce47844af2be0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1074/d4cbae66037338ea8f727cdaa6ce47844af2be0c/mysql.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3037,
2121,
12,
2890,
16,
1459,
16,
1014,
4672,
468,
358,
999,
1779,
67,
4821,
30,
468,
291,
1243,
18,
1734,
1582,
2121,
12,
2890,
16,
1014,
16,
353,
1243,
67,
1973,
16,
999,
67,
125... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3037,
2121,
12,
2890,
16,
1459,
16,
1014,
4672,
468,
358,
999,
1779,
67,
4821,
30,
468,
291,
1243,
18,
1734,
1582,
2121,
12,
2890,
16,
1014,
16,
353,
1243,
67,
1973,
16,
999,
67,
125... |
resp, lines = self.longcmd('XOVER ' + start + '-' + end) | resp, lines = self.longcmd('XOVER ' + start + '-' + end, file) | def xover(self,start,end): """Process an XOVER command (optional server extension) Arguments: - start: start of range - end: end of range Returns: - resp: server response if successful - list: list of (art-nr, subject, poster, date, id, references, size, lines)""" | a26854095be67418bc89eff4874b32e33d7e5bf6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a26854095be67418bc89eff4874b32e33d7e5bf6/nntplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
1643,
12,
2890,
16,
1937,
16,
409,
4672,
3536,
2227,
392,
1139,
12959,
1296,
261,
10444,
1438,
2710,
13,
13599,
30,
300,
787,
30,
787,
434,
1048,
300,
679,
30,
679,
434,
1048,
286... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
1643,
12,
2890,
16,
1937,
16,
409,
4672,
3536,
2227,
392,
1139,
12959,
1296,
261,
10444,
1438,
2710,
13,
13599,
30,
300,
787,
30,
787,
434,
1048,
300,
679,
30,
679,
434,
1048,
286... |
if userData['RealImageName'][0] != str(img.name): image_args += " -o %s" % str(img.name) + '/qualityFITS' | if userData['RealImageName'] != str(img.name): image_args += " -o %s" % os.path.join(img.name, 'qualityFITS') | def __getCondorSubmissionFile(self, request, idList): """ Generates a suitable Condor submission for processing images on the cluster. | 53d13a845ff9a780f7973b009d6ac016453b5338 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11651/53d13a845ff9a780f7973b009d6ac016453b5338/qualityfitsin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
12441,
280,
17865,
812,
12,
2890,
16,
590,
16,
29174,
4672,
3536,
31902,
279,
10631,
735,
72,
280,
8515,
364,
4929,
4602,
603,
326,
2855,
18,
2,
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,
1001,
588,
12441,
280,
17865,
812,
12,
2890,
16,
590,
16,
29174,
4672,
3536,
31902,
279,
10631,
735,
72,
280,
8515,
364,
4929,
4602,
603,
326,
2855,
18,
2,
-100,
-100,
-100,
-100,
-100,
... |
if include_users is not None and u['userName'] not in include_users: users.remove(u) elif u['userName'] in skip_users: users.remove(u) | if (include_users is None or str(u['userName']) in include_users) and u['userName'] not in skip_users: create_users.append(u) for u in create_users: | def main(argv): username = "admin" password = "admin" url = "http://localhost:8080/share" include_users = None skip_users = [ 'System' ] set_dashboards = True set_prefs = True update_profile = True set_avatars = True _debug = 0 if len(argv) > 0: # File name to load users from, or '-' for stdin filename = argv[0] # TODO Support stdin as input mechanism else: usage() sys.exit(1) try: opts, args = getopt.getopt(argv[1:], "hdu:p:U:", ["help", "username=", "password=", "url=", "users=", "skip-users=", "no-dashboards", "no-preferences", "no-update-profile", "no-avatars"]) except getopt.GetoptError, e: usage() sys.exit(1) for opt, arg in opts: if opt in ("-h", "--help"): usage() sys.exit() elif opt == '-d': _debug = 1 elif opt in ("-u", "--username"): username = arg elif opt in ("-p", "--password"): password = arg elif opt in ("-U", "--url"): url = arg elif opt == "--users": include_users = arg.split(',') elif opt == "--skip-users": skip_users = arg.split(',') elif opt == 'no-dashboards': set_dashboards = False elif opt == 'no-preferences': set_prefs = False elif opt == 'no-update-profile': update_profile = False elif opt == 'no-avatars': set_avatars = False sc = alfresco.ShareClient(url, debug=_debug) print "Log in (%s)" % (username) loginres = sc.doLogin(username, password) if not loginres['success']: print "Could not log in using specified credentials" sys.exit(1) users = json.loads(open(filename).read())['people'] for u in users: if include_users is not None and u['userName'] not in include_users: users.remove(u) elif u['userName'] in skip_users: users.remove(u) # Work around bug where create/update user calls do not accept null values # Create call does not like jobtitle being null; webtier update profile does not tolerate any being null for k in u.keys(): if u[k] is None: u[k] = "" if 'password' not in u: u['password'] = u['userName'] try: print "Create %s user(s)" % (len(users)) sc.createUsers(users, skip_users=skip_users) # Set user preferences for u in users: if 'preferences' in u and len(u['preferences']) > 0 and set_prefs: print "Setting preferences for user '%s'" % (u['userName']) sc.setUserPreferences(u['userName'], u['preferences']) finally: print "Log out (%s)" % (username) sc.doLogout() #TODO Check if a profile image or dashboard config is available before logging in thisdir = os.path.dirname(filename) for u in users: print "Log in (%s)" % (u['userName']) sc.doLogin(u['userName'], u['password']) try: # Add profile image if set_avatars: print "Setting profile image for user '%s'" % (u['userName']) if 'avatar' in u: try: sc.setProfileImage(u['userName'], thisdir + os.sep + str(u['avatar'])) except IOError, e: if e.errno == 2: # Ignore file not found errors pass else: raise e # Update user profile if update_profile: print "Updating profile information for user '%s'" % (u['userName']) sc.updateUserDetails(u) # Update dashboard if 'dashboardConfig' in u and set_dashboards: print "Updating dashboard configuration for user '%s'" % (u['userName']) sc.updateUserDashboardConfig(u) finally: print "Log out (%s)" % (u['userName']) sc.doLogout() | dcbf012c57656f19de039298576af4487bd41845 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8296/dcbf012c57656f19de039298576af4487bd41845/bootstrap-users.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
225,
2718,
273,
315,
3666,
6,
2201,
273,
315,
3666,
6,
880,
273,
315,
2505,
2207,
13014,
30,
3672,
3672,
19,
14419,
6,
2341,
67,
5577,
273,
599,
2488,
67,
5577,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
225,
2718,
273,
315,
3666,
6,
2201,
273,
315,
3666,
6,
880,
273,
315,
2505,
2207,
13014,
30,
3672,
3672,
19,
14419,
6,
2341,
67,
5577,
273,
599,
2488,
67,
5577,
... |
aDataFileManager = DataFileManager() | except: print "\'" + aSaveDirectory + "\'" + " file exists." aDataFileManager = ecell.DataFileManager.DataFileManager() | def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./'): | 6ea167579181f6f123d2a0c124f25670c196af67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/6ea167579181f6f123d2a0c124f25670c196af67/Session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
3328,
751,
12,
365,
16,
279,
5080,
15124,
780,
2218,
2187,
279,
13649,
29711,
21,
16,
279,
25255,
29711,
21,
16,
279,
4006,
29711,
21,
16,
279,
4755,
2853,
2218,
18,
2473,
4672,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1923,
3328,
751,
12,
365,
16,
279,
5080,
15124,
780,
2218,
2187,
279,
13649,
29711,
21,
16,
279,
25255,
29711,
21,
16,
279,
4006,
29711,
21,
16,
279,
4755,
2853,
2218,
18,
2473,
4672,
... |
def test_startswith(self): b = b'hello' self.assertFalse(bytearray().startswith(b"anything")) self.assertTrue(b.startswith(b"hello")) self.assertTrue(b.startswith(b"hel")) self.assertTrue(b.startswith(b"h")) self.assertFalse(b.startswith(b"hellow")) self.assertFalse(b.startswith(b"ha")) def test_endswith(self): b = b'hello' self.assertFalse(bytearray().endswith(b"anything")) self.assertTrue(b.endswith(b"hello")) self.assertTrue(b.endswith(b"llo")) self.assertTrue(b.endswith(b"o")) self.assertFalse(b.endswith(b"whello")) self.assertFalse(b.endswith(b"no")) def test_find(self): b = b'mississippi' self.assertEqual(b.find(b'ss'), 2) self.assertEqual(b.find(b'ss', 3), 5) self.assertEqual(b.find(b'ss', 1, 7), 2) self.assertEqual(b.find(b'ss', 1, 3), -1) self.assertEqual(b.find(b'w'), -1) self.assertEqual(b.find(b'mississippian'), -1) def test_rfind(self): b = b'mississippi' self.assertEqual(b.rfind(b'ss'), 5) self.assertEqual(b.rfind(b'ss', 3), 5) self.assertEqual(b.rfind(b'ss', 0, 6), 2) self.assertEqual(b.rfind(b'w'), -1) self.assertEqual(b.rfind(b'mississippian'), -1) def test_index(self): b = b'world' self.assertEqual(b.index(b'w'), 0) self.assertEqual(b.index(b'orl'), 1) self.assertRaises(ValueError, b.index, b'worm') self.assertRaises(ValueError, b.index, b'ldo') def test_rindex(self): b = b'world' self.assertEqual(b.rindex(b'w'), 0) self.assertEqual(b.rindex(b'orl'), 1) self.assertRaises(ValueError, b.rindex, b'worm') self.assertRaises(ValueError, b.rindex, b'ldo') def test_replace(self): b = b'mississippi' self.assertEqual(b.replace(b'i', b'a'), b'massassappa') self.assertEqual(b.replace(b'ss', b'x'), b'mixixippi') def test_translate(self): b = b'hello' rosetta = bytearray(range(0, 256)) rosetta[ord('o')] = ord('e') c = b.translate(rosetta, b'l') self.assertEqual(b, b'hello') self.assertEqual(c, b'hee') def test_split(self): b = b'mississippi' self.assertEqual(b.split(b'i'), [b'm', b'ss', b'ss', b'pp', b'']) self.assertEqual(b.split(b'ss'), [b'mi', b'i', b'ippi']) self.assertEqual(b.split(b'w'), [b]) def test_split_whitespace(self): for b in (b' arf barf ', b'arf\tbarf', b'arf\nbarf', b'arf\rbarf', b'arf\fbarf', b'arf\vbarf'): self.assertEqual(b.split(), [b'arf', b'barf']) self.assertEqual(b.split(None), [b'arf', b'barf']) self.assertEqual(b.split(None, 2), [b'arf', b'barf']) self.assertEqual(b' a bb c '.split(None, 0), [b'a bb c ']) self.assertEqual(b' a bb c '.split(None, 1), [b'a', b'bb c ']) self.assertEqual(b' a bb c '.split(None, 2), [b'a', b'bb', b'c ']) self.assertEqual(b' a bb c '.split(None, 3), [b'a', b'bb', b'c']) def test_split_bytearray(self): self.assertEqual(b'a b'.split(memoryview(b' ')), [b'a', b'b']) def test_split_string_error(self): self.assertRaises(TypeError, b'a b'.split, ' ') def test_rsplit(self): b = b'mississippi' self.assertEqual(b.rsplit(b'i'), [b'm', b'ss', b'ss', b'pp', b'']) self.assertEqual(b.rsplit(b'ss'), [b'mi', b'i', b'ippi']) self.assertEqual(b.rsplit(b'w'), [b]) def test_rsplit_whitespace(self): for b in (b' arf barf ', b'arf\tbarf', b'arf\nbarf', b'arf\rbarf', b'arf\fbarf', b'arf\vbarf'): self.assertEqual(b.rsplit(), [b'arf', b'barf']) self.assertEqual(b.rsplit(None), [b'arf', b'barf']) self.assertEqual(b.rsplit(None, 2), [b'arf', b'barf']) self.assertEqual(b' a bb c '.rsplit(None, 0), [b' a bb c']) self.assertEqual(b' a bb c '.rsplit(None, 1), [b' a bb', b'c']) self.assertEqual(b' a bb c '.rsplit(None, 2), [b' a', b'bb', b'c']) self.assertEqual(b' a bb c '.rsplit(None, 3), [b'a', b'bb', b'c']) def test_rsplit_bytearray(self): self.assertEqual(b'a b'.rsplit(memoryview(b' ')), [b'a', b'b']) def test_rsplit_string_error(self): self.assertRaises(TypeError, b'a b'.rsplit, ' ') def test_rsplit_unicodewhitespace(self): b = b"\x09\x0A\x0B\x0C\x0D\x1C\x1D\x1E\x1F" self.assertEqual(b.split(), [b'\x1c\x1d\x1e\x1f']) self.assertEqual(b.rsplit(), [b'\x1c\x1d\x1e\x1f']) ba = bytearray(b) self.assertEqual(ba.split(), [bytearray(b'\x1c\x1d\x1e\x1f')]) self.assertEqual(ba.rsplit(), [bytearray(b'\x1c\x1d\x1e\x1f')]) def test_partition(self): b = b'mississippi' self.assertEqual(b.partition(b'ss'), (b'mi', b'ss', b'issippi')) self.assertEqual(b.rpartition(b'w'), (b'', b'', b'mississippi')) def test_rpartition(self): b = b'mississippi' self.assertEqual(b.rpartition(b'ss'), (b'missi', b'ss', b'ippi')) self.assertEqual(b.rpartition(b'i'), (b'mississipp', b'i', b'')) def test_pickling(self): for proto in range(pickle.HIGHEST_PROTOCOL): for b in b"", b"a", b"abc", b"\xffab\x80", b"\0\0\377\0\0": ps = pickle.dumps(b, proto) q = pickle.loads(ps) self.assertEqual(b, q) def test_strip(self): b = b'mississippi' self.assertEqual(b.strip(b'i'), b'mississipp') self.assertEqual(b.strip(b'm'), b'ississippi') self.assertEqual(b.strip(b'pi'), b'mississ') self.assertEqual(b.strip(b'im'), b'ssissipp') self.assertEqual(b.strip(b'pim'), b'ssiss') self.assertEqual(b.strip(b), b'') def test_lstrip(self): b = b'mississippi' self.assertEqual(b.lstrip(b'i'), b'mississippi') self.assertEqual(b.lstrip(b'm'), b'ississippi') self.assertEqual(b.lstrip(b'pi'), b'mississippi') self.assertEqual(b.lstrip(b'im'), b'ssissippi') self.assertEqual(b.lstrip(b'pim'), b'ssissippi') def test_rstrip(self): b = b'mississippi' self.assertEqual(b.rstrip(b'i'), b'mississipp') self.assertEqual(b.rstrip(b'm'), b'mississippi') self.assertEqual(b.rstrip(b'pi'), b'mississ') self.assertEqual(b.rstrip(b'im'), b'mississipp') self.assertEqual(b.rstrip(b'pim'), b'mississ') def test_strip_whitespace(self): b = b' \t\n\r\f\vabc \t\n\r\f\v' self.assertEqual(b.strip(), b'abc') self.assertEqual(b.lstrip(), b'abc \t\n\r\f\v') self.assertEqual(b.rstrip(), b' \t\n\r\f\vabc') def test_strip_bytearray(self): self.assertEqual(b'abc'.strip(memoryview(b'ac')), b'b') self.assertEqual(b'abc'.lstrip(memoryview(b'ac')), b'bc') self.assertEqual(b'abc'.rstrip(memoryview(b'ac')), b'ab') def test_strip_string_error(self): self.assertRaises(TypeError, b'abc'.strip, 'b') self.assertRaises(TypeError, b'abc'.lstrip, 'b') self.assertRaises(TypeError, b'abc'.rstrip, 'b') def test_ord(self): b = b'\0A\x7f\x80\xff' self.assertEqual([ord(b[i:i+1]) for i in range(len(b))], [0, 65, 127, 128, 255]) | def test_insert(self): b = bytearray(b'msssspp') b.insert(1, ord('i')) b.insert(4, ord('i')) b.insert(-2, ord('i')) b.insert(1000, ord('i')) self.assertEqual(b, b'mississippi') self.assertRaises(TypeError, lambda: b.insert(0, b'1')) | ee68bbafb3455a5d2d59063851393925977e8adc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/ee68bbafb3455a5d2d59063851393925977e8adc/test_bytes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
6387,
12,
2890,
4672,
324,
273,
14552,
12,
70,
17784,
1049,
1049,
11858,
6134,
324,
18,
6387,
12,
21,
16,
4642,
2668,
77,
26112,
324,
18,
6387,
12,
24,
16,
4642,
2668,
77,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
6387,
12,
2890,
4672,
324,
273,
14552,
12,
70,
17784,
1049,
1049,
11858,
6134,
324,
18,
6387,
12,
21,
16,
4642,
2668,
77,
26112,
324,
18,
6387,
12,
24,
16,
4642,
2668,
77,
... | |
hbox = widget | hbox = gtk.HBox(spacing=3) hbox.pack_start(widget) if translate: button = gtk.Button() img = gtk.Image() img.set_from_stock('gtk-preferences', gtk.ICON_SIZE_BUTTON) button.set_image(img) button.set_relief(gtk.RELIEF_NONE) self.trans_box.append((button, name, fname, widget)) hbox.pack_start(button, fill=False, expand=False) | def wid_add(self, widget, name=None, expand=False, ypadding=2, rowspan=1, colspan=1, translate=False, fname=None, help_tip=False, fill=False): (table, width, height) = self.cont[-1] if colspan > self.col[-1]: colspan = self.col[-1] length = name and 1 or 0 if colspan + width + length > self.col[-1]: self.newline() (table, width, height) = self.cont[-1] yopt = False if expand: yopt = yopt | gtk.EXPAND if fill: yopt = yopt | gtk.FILL if colspan == 1 and length == 1: colspan = 2 if name: label = gtk.Label(name) eventbox = gtk.EventBox() eventbox.set_events(gtk.gdk.BUTTON_PRESS_MASK) self.trans_box_label.append((eventbox, name, fname)) eventbox.add(label) if help_tip: self.tooltips.set_tip(eventbox, help_tip) self.tooltips.enable() eventbox.show() if '_' in name: label.set_text_with_mnemonic(name) label.set_mnemonic_widget(widget) label.set_alignment(1.0, 0.5) table.attach(eventbox, width, width + 1, height, height + rowspan, yoptions=yopt, xoptions=gtk.FILL, ypadding=ypadding, xpadding=2) hbox = widget hbox.show_all() if translate: hbox = gtk.HBox(spacing=3) hbox.pack_start(widget) img = gtk.Image() img.set_from_stock('terp-translate', gtk.ICON_SIZE_MENU) ebox = gtk.EventBox() ebox.set_events(gtk.gdk.BUTTON_PRESS_MASK) self.trans_box.append((ebox, name, fname, widget)) | 49a255dbfd8dc896f11f960d9184a024445edd01 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9151/49a255dbfd8dc896f11f960d9184a024445edd01/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15481,
67,
1289,
12,
2890,
16,
3604,
16,
508,
33,
7036,
16,
4542,
33,
8381,
16,
677,
9598,
33,
22,
16,
1027,
3969,
33,
21,
16,
20856,
33,
21,
16,
4204,
33,
8381,
16,
5299,
33,
7036... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15481,
67,
1289,
12,
2890,
16,
3604,
16,
508,
33,
7036,
16,
4542,
33,
8381,
16,
677,
9598,
33,
22,
16,
1027,
3969,
33,
21,
16,
20856,
33,
21,
16,
4204,
33,
8381,
16,
5299,
33,
7036... |
global configlet_tree | def createIncomingContext(self): c = AstConf("extensions.conf") contextin = "in-%s" % self.name c.setSection(contextin) c.appendExten("_X.","Set(CDR(intrunk)=%s)" % self.name) if self.clid: needModule("func_callerid") c.appendExten("_X.","Set(CALLERID(name)=%s)" % self.clid) if self.contextin == 'phone' and self.phone: global configlet_tree obj = configlet_tree.getConfigletByName(self.phone) try: pbx = obj.pbx except AttributeError: pass c.appendExten("_X.", "Goto(%s,%s,1)" % (pbx,self.phone)) if self.contextin == 'ivr' and self.ivr: c.appendExten("_X.", "Goto(%s,s,1)" % self.ivr) c.appendExten("s","Set(CDR(intrunk)=%s)" % self.name) if self.clid: needModule("func_callerid") c.appendExten("s","Set(CALLERID(name)=%s)" % self.clid) if self.contextin == 'phone' and self.phone: global configlet_tree obj = configlet_tree.getConfigletByName(self.phone) try: pbx = obj.pbx except AttributeError: pass c.appendExten("s", "Goto(%s,%s,1)" % (pbx,self.phone)) if self.contextin == 'ivr' and self.ivr: c.appendExten("s", "Goto(%s,s,1)" % self.ivr) | a47a1f340b5698668d9883e7370f2eda5e32fe0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2627/a47a1f340b5698668d9883e7370f2eda5e32fe0e/configlets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
20370,
1042,
12,
2890,
4672,
276,
273,
16614,
3976,
2932,
9489,
18,
3923,
7923,
819,
267,
273,
315,
267,
6456,
87,
6,
738,
365,
18,
529,
276,
18,
542,
5285,
12,
2472,
267,
13,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
20370,
1042,
12,
2890,
4672,
276,
273,
16614,
3976,
2932,
9489,
18,
3923,
7923,
819,
267,
273,
315,
267,
6456,
87,
6,
738,
365,
18,
529,
276,
18,
542,
5285,
12,
2472,
267,
13,
2... | |
print("EXCEPTION: "+file+" unrecognized return value ("+str(rv)+")"+" ("+str(round(dt,2))+"s)") print_error(path, printerr) | print("EXCEPTION: "+file+" ended with unrecognized return value! ("+str(rv)+")"+" ("+str(round(dt,2))+"s)") | def run_tests(argv): clean = 0 printerr = 1 #scan for --help and --clean if len(argv) > 1: for arg in argv: if "--help" in arg: do_help(); exit(0) if "--clean" in arg: clean = 1 if "--error" in arg: if printerr == 0: printerr = 1 if printerr == 1: printerr = 0 print("Starting autotest script") there_dir = os.getcwd() err_ct = 0 ex_ct = 0 first_time = time.time() end_time = 0 #if clean == 1: # print("Go clean?") # determine where the script starts here_dir = os.getcwd() print("Starting from \'"+here_dir+"\'") #determine where we _want_ the script to start if len(argv) > 1: argn = 1 while argn < len(argv): if argv[argn][0] == '-': argn+=1 # ignore anything that looks like a flag else: there_dir = argv[argn] # take the first path and be done with it # poor form but we're not doing much complicated break #locate autotest dirs #autotestdirs = find_autotest_dirs(there_dir) autotestdirs = [] for path, dirs, files in os.walk(there_dir): if "autotest" in dirs: autotestdirs.append(os.path.abspath(os.path.join(path,"autotest"))) #for path in autotestdirs: # print("Found dir: \'"+path+"\'") #locate autotest test files #autotestfiles = find_autotest_files(autotestdirs) autotestfiles = [] for path in autotestdirs: for file in os.listdir(path): if file.startswith("test_") and file.endswith(".glm") and file[0] != '.': autotestfiles.append((path, file)) #for path, file in autotestfiles: # print("Found file: \'"+file+"\'") #build test dirs #for file in autotestfiles: errlist=[] cleanlist=[] for path, file in autotestfiles: err = False slice = file[:-4] currpath = os.getcwd() xpath = os.path.join(path,slice) # path/slice xfile = os.path.join(xpath,file) # path/slice/file.glm if not os.path.exists(xpath): os.mkdir(xpath) if os.path.exists(os.path.join(xpath,"gridlabd.xml")): os.remove(os.path.join(xpath,"gridlabd.xml")) shutil.copy2(os.path.join(path,file), xfile) # path/file to path/slice/file os.chdir(xpath) #print("cwd: "+xpath) # build conf files # moo? #run files with popen #run file with: outfile = open(os.path.join(xpath,"outfile.txt"), "w") errfile = open(os.path.join(xpath,"errfile.txt"), "w") #print("NOTICE: Running \'"+xfile+"\'") start_time = time.time(); rv = subprocess.call(["gridlabd",xfile],stdout=outfile,stderr=errfile) end_time = time.time(); dt = end_time - start_time outfile.close() errfile.close() if os.path.exists(os.path.join(xpath,"gridlabd.xml")): statinfo = os.stat(os.path.join(xpath, "gridlabd.xml")) if(statinfo.st_mtime > start_time): if rv == 0: # didn't succeed if gridlabd.xml exists & updated since runtime rv = 1 # handle results if "err_" in file or "_err" in file: if rv == 0: if "opt_" in file or "_opt" in file: print("WARNING: Optional "+file+" converged when it shouldn't've"+" ("+str(round(dt,2))+"s)") cleanlist.append((path, file)) err = False else: print("ERROR: "+file+" converged when it shouldn't've"+" ("+str(round(dt,2))+"s)") print_error(path, printerr) err_ct += 1 err = True elif rv == 2: print("SUCCESS: "+file+" failed to converge, as planned."+" ("+str(round(dt,2))+"s)") cleanlist.append((path, file)) elif rv == 1: print("EXCEPTION: "+file+" failed to load"+" ("+str(dt)+"s)") print_error(path, printerr) ex_ct += 1 err = True else: print("EXCEPTION: "+file+" unrecognized return value ("+str(rv)+")"+" ("+str(round(dt,2))+"s)") print_error(path, printerr) ex_ct += 1 err = True elif "exc_" in file or "_exc" in file: if rv == 0: if "opt_" in file or "_opt" in file: print("WARNING: Optional "+file+" loaded when it shouldn't've"+" ("+str(round(dt,2))+"s)") cleanlist.append((path, file)) err = False else: print("ERROR: "+file+" loaded when it shouldn't've"+" ("+str(round(dt,2))+"s)") err_ct += 1 err = True elif rv == 1: print("SUCCESS: "+file+" failed to load, as planned"+" ("+str(round(dt,2))+"s)") cleanlist.append((path, file)) else: print("EXCEPTION: "+file+" unrecognized return value ("+str(rv)+")"+" ("+str(round(dt,2))+"s)") print_error(path, printerr) ex_ct += 1 err = True else: if rv == 2: if "opt_" in file or "_opt" in file: print("WARNING: Optional "+file+" failed to converge"+" ("+str(round(dt,2))+"s)") cleanlist.append((path, file)) err = False else: err_ct += 1 print("ERROR: "+file+" failed to converge"+" ("+str(round(dt,2))+"s)") print_error(path, printerr) err = True elif rv == 1: print("EXCEPTION: "+file+" failed to load"+" ("+str(round(dt,2))+"s)") print_error(path, printerr) ex_ct += 1 err = True elif rv == 0: print("SUCCESS: "+file+" converged"+" ("+str(round(dt,2))+"s)") cleanlist.append((path, file)) else: print("EXCEPTION: "+file+": unrecognized return value ("+str(rv)+")"+" ("+str(round(dt,2))+"s)") print_error(path, printerr) ex_ct += 1 err = True if err: # zip target directory errlist.append((path,file)) os.chdir(currpath) #print("cwd: "+currpath) # end autotestfiles loop #cleanup as appropriate #for cleanfile, cleanpath in cleanlist: # for path, dirs, file in os.walk(cleanpath): # print("foo") #end #print("bar") last_time = time.time() dt = last_time - first_time #return success/failure print("Validation detected "+str(err_ct)+" models with errors and "+str(ex_ct)+" models with exceptions in "+str(round(dt,2))+" seconds.") for errpath, errfile in errlist: print(" * "+os.path.join(errpath, errfile)) exit(err_ct+ex_ct) | df94e5b8a9553981a05c88f42b7f6175b9153ec1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/43/df94e5b8a9553981a05c88f42b7f6175b9153ec1/validate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
19485,
4672,
2721,
273,
374,
1172,
370,
273,
404,
468,
9871,
364,
1493,
5201,
471,
1493,
6200,
309,
562,
12,
19485,
13,
405,
404,
30,
364,
1501,
316,
5261,
30,
309... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
16341,
12,
19485,
4672,
2721,
273,
374,
1172,
370,
273,
404,
468,
9871,
364,
1493,
5201,
471,
1493,
6200,
309,
562,
12,
19485,
13,
405,
404,
30,
364,
1501,
316,
5261,
30,
309... |
self._prompt_wait = [self._prompt] + [re.compile(x) for x in self._ask] | self._prompt_wait = [self._prompt] + [re.compile(x) for x in self._ask] + \ ['Break [0-9]+'] | def __init__(self, script_subdirectory=None, logfile=None, server=None): """ Create an instance of the Maxima interpreter. """ # TODO: Input and output prompts in maxima can be changed by # setting inchar and outchar.. eval_using_file_cutoff = 256 self.__eval_using_file_cutoff = eval_using_file_cutoff STARTUP = '%s/local/bin/sage-maxima.lisp'%SAGE_ROOT if not os.path.exists(STARTUP): raise RuntimeError, 'You must get the file local/bin/sage-maxima.lisp' Expect.__init__(self, name = 'maxima', prompt = '\(\%i[0-9]+\)', command = 'maxima -p "%s"'%STARTUP, maxread = 10000, script_subdirectory = script_subdirectory, restart_on_ctrlc = False, verbose_start = False, init_code = ['display2d : false', # no ascii art output #'load("mactex-utilities")' # latex instead of plain tex from tex command (broken in maxima-5.11.0!) ], logfile = logfile, eval_using_file_cutoff=eval_using_file_cutoff) self._display_prompt = '<sage-display>' # must match what is in the file local/ibn/sage-maxima.lisp!! self._output_prompt_re = re.compile('\(\%o[0-9]+\)') self._ask = ['zero or nonzero?', 'an integer?', 'positive, negative, or zero?', 'positive or negative?'] self._prompt_wait = [self._prompt] + [re.compile(x) for x in self._ask] self._error_re = re.compile('(debugmode|Incorrect syntax|Maxima encountered a Lisp error)') self._display2d = False | 46dff955cd3e501cc01027d1ffe9473bd5d06afd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/46dff955cd3e501cc01027d1ffe9473bd5d06afd/maxima.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2728,
67,
1717,
5149,
33,
7036,
16,
15204,
33,
7036,
16,
1438,
33,
7036,
4672,
3536,
1788,
392,
791,
434,
326,
4238,
13888,
16048,
18,
3536,
468,
2660,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2728,
67,
1717,
5149,
33,
7036,
16,
15204,
33,
7036,
16,
1438,
33,
7036,
4672,
3536,
1788,
392,
791,
434,
326,
4238,
13888,
16048,
18,
3536,
468,
2660,
3... |
self['threads'][thread]['directory'])) | self['threads'][thread]['directory'])))) | def check(self): global mechanize if not self['global']['urllib'] and not mechanize: print >> sys.stderr, """Using urllib2 instead of mechanize. setting\ | 0d66125a786b9ec925cf42d85180c8c854987932 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1664/0d66125a786b9ec925cf42d85180c8c854987932/rssdler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
4672,
2552,
1791,
7472,
554,
309,
486,
365,
3292,
6347,
21712,
718,
2941,
3546,
471,
486,
1791,
7472,
554,
30,
1172,
1671,
2589,
18,
11241,
16,
3536,
7736,
11527,
22,
3560... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
4672,
2552,
1791,
7472,
554,
309,
486,
365,
3292,
6347,
21712,
718,
2941,
3546,
471,
486,
1791,
7472,
554,
30,
1172,
1671,
2589,
18,
11241,
16,
3536,
7736,
11527,
22,
3560... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.