rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
jia = argmax(abs(c[inact_set])) j = inact_set[jia] C = c[j] | def lars(X, y): # n is the number of variables, p is the number of "predictors" or # basis vectors # the predictors are assumed to be standardized and y is centered. # in the example of the prostate data n would be the number n,p = X.shape mu = zeros(n) act_set = [] inact_set = range(p) k = 0 vs = 0 nvs = min(n-1,p) beta = zeros((2*nvs,p)) maxiter = nvs * 8 # initial cholesky decomposition of the gram matrix R = zeros((0,0)) while vs < nvs and k < maxiter: print "new iteration: vs = ", vs, " nvs = ", nvs, " k = ", k print "mu.shape = ", mu.shape #print "mu = ", mu # compute correlation with inactive set # and element that has the maximum correlation c = dot(X.T, y - mu) #c = c.reshape(1,len(c)) jia = argmax(abs(c[inact_set])) j = inact_set[jia] C = c[j] print "predictor ", j, " max corr with w/ current residual: ", C print "adding ", j, " to active set" print "R shape before insert: ", R.shape # add the most correlated predictor to the active set R = cholinsert(R,X[:,j],X[:,act_set]) act_set.append(j) inact_set.remove(j) vs += 1 print "R shape after insert ", R.shape print "active set = ", act_set print "inactive set = ", inact_set # get the signs of the correlations s = sign(c[act_set]) s = s.reshape(len(s),1) #print "R.shape = ", R.shape #print "s.shape = ", s.shape # move in the direction of the least squares solution GA1 = solve(R,solve(R.T, s)) AA = 1/sqrt(sum(GA1 * s)) w = AA * GA1 # equiangular direction - this should be a unit vector print "X[:,act_set].shape = ",X[:,act_set].shape #print "w.shape = ",w.shape u = dot(X[:,act_set], w).reshape(-1) #print "norm of u = ", norm(u) #print "u.shape = ", u.shape # if this is the last iteration i.e. all variables are in the # active set, then set the step toward the full least squares # solution if vs == nvs: print "last variable going all the way to least squares solution" gamma = C / AA else: a = dot(X.T,u) a = a.reshape((len(a),)) tmp = r_[(C - c[inact_set])/(AA - a[inact_set]), (C + c[inact_set])/(AA + a[inact_set])] gamma = min(r_[tmp[tmp > 0], array([C/AA]).reshape(-1)]) mu = mu + gamma * u if beta.shape[0] < k: beta = c_[beta, zeros((beta.shape[0],))] beta[k+1,act_set] = beta[k,act_set] + gamma*w.T.reshape(-1) k += 1 return beta | 0db785b39c36b490ef6940e674e6c7ea9ebc6107 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14601/0db785b39c36b490ef6940e674e6c7ea9ebc6107/lars.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5604,
87,
12,
60,
16,
677,
4672,
468,
290,
353,
326,
1300,
434,
3152,
16,
293,
353,
326,
1300,
434,
315,
14491,
1383,
6,
578,
468,
10853,
10046,
225,
468,
326,
7810,
1383,
854,
12034,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5604,
87,
12,
60,
16,
677,
4672,
468,
290,
353,
326,
1300,
434,
3152,
16,
293,
353,
326,
1300,
434,
315,
14491,
1383,
6,
578,
468,
10853,
10046,
225,
468,
326,
7810,
1383,
854,
12034,
... | |
makedirs(head, mode) | try: makedirs(head, mode) except OSError, e: if e.errno != EEXIST: raise | def makedirs(name, mode=0777): """makedirs(path [, mode=0777]) Super-mkdir; create a leaf directory and all intermediate ones. Works like mkdir, except that any intermediate path segment (not just the rightmost) will be created if it does not exist. This is recursive. """ head, tail = path.split(name) if not tail: head, tail = path.split(head) if head and tail and not path.exists(head): makedirs(head, mode) if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists return mkdir(name, mode) | 13c3e26f5044f63c940ac463612ee9161b2be422 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/13c3e26f5044f63c940ac463612ee9161b2be422/os.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12151,
12,
529,
16,
1965,
33,
20,
14509,
4672,
3536,
81,
9477,
10539,
12,
803,
306,
16,
1965,
33,
20,
14509,
5717,
225,
14845,
17,
26686,
31,
752,
279,
7839,
1867,
471,
777,
12110,
594... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12151,
12,
529,
16,
1965,
33,
20,
14509,
4672,
3536,
81,
9477,
10539,
12,
803,
306,
16,
1965,
33,
20,
14509,
5717,
225,
14845,
17,
26686,
31,
752,
279,
7839,
1867,
471,
777,
12110,
594... |
'unknown reason: %s' % e) | 'unknown reason: %s' % str(e)) | def initialize(self): """ Gets path of kvm_stat and verifies if debugfs needs to be mounted. """ self.stat_path = os_dep.command('kvm_stat') try: utils.system_output("%s --batch" % self.stat_path) except error.CmdError, e: if 'debugfs' in e: utils.system('mount -t debugfs debugfs /sys/kernel/debug') else: raise error.AutotestError('kvm_stat failed due to an ' 'unknown reason: %s' % e) | 36f6c3fa12f1665f8c599360237beeadf4820d20 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12268/36f6c3fa12f1665f8c599360237beeadf4820d20/kvm_stat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
4672,
3536,
11881,
589,
434,
417,
3489,
67,
5642,
471,
20761,
309,
1198,
2556,
4260,
358,
506,
20919,
18,
3536,
365,
18,
5642,
67,
803,
273,
1140,
67,
15037,
18,
3076,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
4672,
3536,
11881,
589,
434,
417,
3489,
67,
5642,
471,
20761,
309,
1198,
2556,
4260,
358,
506,
20919,
18,
3536,
365,
18,
5642,
67,
803,
273,
1140,
67,
15037,
18,
3076,
... |
elif algorithm == 'bober': | if not k is None: raise ValueError, "only the GAP algorithm works if k is specified." if algorithm == 'default' and k is None: return partitions_ext.number_of_partitions(n) elif algorithm == 'bober' and k is None: | def number_of_partitions(n,k=None, algorithm='bober'): r""" Returns the size of partitions_list(n,k). INPUT: n -- an integer k -- (default: None); if specified, instead returns the cardinality of the set of all (unordered) partitions of the positive integer n into sums with k summands. algorithm -- (default: 'bober') 'bober' -- use Jonathon Bober's implementation (*very* fast, but new and not well tested yet). 'gap' -- use GAP (VERY *slow*) 'pari' -- use PARI. Speed seems the same as GAP until $n$ is in the thousands, in which case PARI is faster. *But* PARI has a bug, e.g., on 64-bit Linux PARI-2.3.2 outputs numbpart(147007)%1000 as 536, but it should be 533!. So do not use this option. IMPLEMENTATION: Wraps GAP's NrPartitions or PARI's numbpart function. Use the function \code{partitions(n)} to return a generator over all partitions of $n$. It is possible to associate with every partition of the integer n a conjugacy class of permutations in the symmetric group on n points and vice versa. Therefore p(n) = NrPartitions(n) is the number of conjugacy classes of the symmetric group on n points. EXAMPLES: sage: v = list(partitions(5)); v [(1, 1, 1, 1, 1), (1, 1, 1, 2), (1, 2, 2), (1, 1, 3), (2, 3), (1, 4), (5,)] sage: len(v) 7 sage: number_of_partitions(5, algorithm='gap') 7 sage: number_of_partitions(5, algorithm='pari') 7 sage: number_of_partitions(5, algorithm='bober') 7 The input must be a nonnegative integer or a ValueError is raised. sage: number_of_partitions(-5) Traceback (most recent call last): ... ValueError: n (=-5) must be a nonnegative integer sage: number_of_partitions(10,2) 5 sage: number_of_partitions(10) 42 sage: number_of_partitions(3) 3 sage: number_of_partitions(10) 42 sage: number_of_partitions(3, algorithm='pari') 3 sage: number_of_partitions(10, algorithm='pari') 42 sage: number_of_partitions(40) 37338 sage: number_of_partitions(100) 190569292 A generating function for p(n) is given by the reciprocal of Euler's function: \[ \sum_{n=0}^\infty p(n)x^n = \prod_{k=1}^\infty \left(\frac {1}{1-x^k} \right). \] We use SAGE to verify that the first several coefficients do instead agree: sage: q = PowerSeriesRing(QQ, 'q', default_prec=9).gen() sage: prod([(1-q^k)^(-1) for k in range(1,9)]) ## partial product of 1 + q + 2*q^2 + 3*q^3 + 5*q^4 + 7*q^5 + 11*q^6 + 15*q^7 + 22*q^8 + O(q^9) sage: [number_of_partitions(k) for k in range(2,10)] [2, 3, 5, 7, 11, 15, 22, 30] REFERENCES: http://en.wikipedia.org/wiki/Partition_%28number_theory%29 """ n = ZZ(n) if n < 0: raise ValueError, "n (=%s) must be a nonnegative integer"%n elif n == 0: return ZZ(1) if algorithm == 'gap': if k==None: ans=gap.eval("NrPartitions(%s)"%(ZZ(n))) else: ans=gap.eval("NrPartitions(%s,%s)"%(ZZ(n),ZZ(k))) return ZZ(ans) elif algorithm == 'bober': return partitions_ext.number_of_partitions(n) elif algorithm == 'pari': if not k is None: raise ValueError, "cannot specify second argument k if the algorithm is PARI" return ZZ(pari(ZZ(n)).numbpart()) raise ValueError, "unknown algorithm '%s'"%algorithm | 6fc233ff2f5f18427811c02a46bab2f018e15c3f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/6fc233ff2f5f18427811c02a46bab2f018e15c3f/combinat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
21275,
12,
82,
16,
79,
33,
7036,
16,
4886,
2218,
1075,
744,
11,
4672,
436,
8395,
2860,
326,
963,
434,
10060,
67,
1098,
12,
82,
16,
79,
2934,
225,
12943,
30,
290,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
21275,
12,
82,
16,
79,
33,
7036,
16,
4886,
2218,
1075,
744,
11,
4672,
436,
8395,
2860,
326,
963,
434,
10060,
67,
1098,
12,
82,
16,
79,
2934,
225,
12943,
30,
290,
... |
args = (type(self).__name__, self._testMethodName, self._event_count, event_count) | args = (type(self).__name__, self.testname, self._event_count, event_count) | def tearDown(self): if hasattr(self, '_timer'): self._timer.cancel() hub = gevent.hub.get_hub() if self._switch_count is not None and hasattr(hub, 'switch_count'): msg = '' if hub.switch_count < self._switch_count: msg = 'hub.switch_count decreased?\n' elif hub.switch_count == self._switch_count: if self.switch_expected: msg = '%s.%s did not switch\n' % (type(self).__name__, self.testname) elif hub.switch_count > self._switch_count: if not self.switch_expected: msg = '%s.%s switched but expected not to\n' % (type(self).__name__, self.testname) if msg: print >> sys.stderr, 'WARNING: ' + msg | 810431d1aaac434cccd2b8252045cab1089b5cbb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10423/810431d1aaac434cccd2b8252045cab1089b5cbb/greentest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
309,
3859,
12,
2890,
16,
2070,
12542,
11,
4672,
365,
6315,
12542,
18,
10996,
1435,
11891,
273,
314,
2575,
18,
14986,
18,
588,
67,
14986,
1435,
309,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
268,
2091,
4164,
12,
2890,
4672,
309,
3859,
12,
2890,
16,
2070,
12542,
11,
4672,
365,
6315,
12542,
18,
10996,
1435,
11891,
273,
314,
2575,
18,
14986,
18,
588,
67,
14986,
1435,
309,
365,
... |
sys.stderr.write("""Error: Unable to create a ALEPH MARC to manipulate a record for which SYS is unknown! """ \ | sys.stderr.write("""Error: Unable to create ALEPH MARC to manipulate a record for which SYS is unknown! """ \ | def recxml2recmarc(xmltext, options): """The function that processes creating the records from an XML string, and prints these records to the standard output stream. @param xmltext: An XML MARC record in string form. @param options: Various options about the record to be created, as passed from the command line. @return: Nothing. """ ## create internal record structure from xmltext: if xmltext.find("<collection") != -1: ## this is a collection of records: try: ## parse XML into internal records structure records = create_records(xmltext, 1, 1) except: ## xml parsing failed: sys.stderr.write("""Error: Unable to parse xml file.\n""") sys.exit(1) ## now loop through each record, get its sysno, and convert it: for record in records: sysno = _get_sysno(record=record[0], options=options) if sysno is None: if options["text-marc"] == 1: ## cannot create text-marc for a record with no 001 (recid)! sys.stderr.write("""Error: Unable to correctly determine recid (001) - record skipped.\n""") continue elif options["aleph-marc"] == 1 and 1 in (options["append-mode"], options["delete-mode"], \ options["modify-mode"], options["replace-mode"]): ## cannot create ALEPH MARC to manipulate a record when SYS is unknown! sys.stderr.write("""Error: Unable to create a ALEPH MARC to manipulate a record for which SYS is unknown! """\ """Record skipped.\n""") continue elif options["aleph-marc"] == 1 and type(sysno) in (list, tuple): ## multiple values for SYS in aleph-mode - not permitted sys.stderr.write("""Error: Multiple values for SYS (970__a) are not permitted when running in ALEPH MARC mode. """ \ """Record skipped.\n""") continue sys.stdout.write("""%s""" % (print_record(record=record[0], sysno=sysno, options=options),)) else: ## assuming that this is just a single record - not encapsulated by collection tags: try: ## parse XML into internal record structure (record, st, e) = create_record(xmltext, 1, 1) except: ## xml parsing failed: sys.stderr.write("""Error: Unable to parse xml file.\n""") sys.exit(1) if record is None: ## there was no record: sys.stderr.write("""Error: Unable to read record from xml file.\n""") sys.exit(1) ## now get the sysno for the record: sysno = _get_sysno(record=record, options=options) if sysno is None: if options["text-marc"] == 1: ## cannot create text-marc for a record with no 001 (recid)! sys.stderr.write("""Error: Unable to correctly determine recid (001) - record skipped.\n""") sys.exit(1) elif options["aleph-marc"] == 1 and 1 in (options["append-mode"], options["delete-mode"], \ options["modify-mode"], options["replace-mode"]): ## cannot create ALEPH MARC to manipulate a record when SYS is unknown! sys.stderr.write("""Error: Unable to create a ALEPH MARC to manipulate a record for which SYS is unknown! """ \ """Record skipped.\n""") sys.exit(1) elif options["aleph-marc"] == 1 and type(sysno) in (list, tuple): ## multiple values for SYS in aleph-mode - not permitted sys.stderr.write("""Error: Multiple values for SYS (970__a) are not permitted when running in ALEPH MARC mode. """ \ """Record skipped.\n""") sys.exit(1) sys.stdout.write("""%s""" % (print_record(record=record, sysno=sysno, options=options),)) | aad09aa6fd02fc35e3bf444ede78fbba6c92f680 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/aad09aa6fd02fc35e3bf444ede78fbba6c92f680/xmlmarc2textmarclib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1950,
2902,
22,
3927,
3684,
71,
12,
2902,
955,
16,
702,
4672,
3536,
1986,
445,
716,
8488,
4979,
326,
3853,
628,
392,
3167,
533,
16,
471,
14971,
4259,
3853,
358,
326,
4529,
876,
1407,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1950,
2902,
22,
3927,
3684,
71,
12,
2902,
955,
16,
702,
4672,
3536,
1986,
445,
716,
8488,
4979,
326,
3853,
628,
392,
3167,
533,
16,
471,
14971,
4259,
3853,
358,
326,
4529,
876,
1407,
1... |
gLogger.error("LFCvsSEAgent.execute: Failed to get metadata.","%s %s" % (pfn,res['Value']['Failed'][pfn])) | gLogger.error( "LFCvsSEAgent.execute: Failed to get metadata.", "%s %s" % ( pfn, res['Value']['Failed'][pfn] ) ) | def execute(self): | ff946fabd16f68b844021b4c5e84a27f3c288165 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/ff946fabd16f68b844021b4c5e84a27f3c288165/LFCvsSEAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
Actor.notify.debug("couldn't find anim: %s" % (animName)) | assert Actor.notify.debug("couldn't find anim: %s" % (animName)) pass | def getAnimControl(self, animName, partName, lodName="lodRoot"): """getAnimControl(self, string, string, string="lodRoot") Search the animControl dictionary indicated by lodName for a given anim and part. Return the animControl if present, or None otherwise """ partDict = self.__animControlDict.get(lodName) # if this assertion fails, named lod was not present assert partDict != None | 08e9d1026e0fc70706f5e423dfa8e307b4d8c0e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/08e9d1026e0fc70706f5e423dfa8e307b4d8c0e8/Actor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
20892,
3367,
12,
2890,
16,
10536,
461,
16,
1087,
461,
16,
328,
369,
461,
1546,
80,
369,
2375,
6,
4672,
3536,
588,
20892,
3367,
12,
2890,
16,
533,
16,
533,
16,
533,
1546,
80,
369... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
20892,
3367,
12,
2890,
16,
10536,
461,
16,
1087,
461,
16,
328,
369,
461,
1546,
80,
369,
2375,
6,
4672,
3536,
588,
20892,
3367,
12,
2890,
16,
533,
16,
533,
16,
533,
1546,
80,
369... |
os.startfile == mac_start | os.startfile = mac_start | def bootstrap(renpy_base): global renpy # Get a working name for the game. name = os.path.basename(sys.argv[0]) if name.find(".") != -1: name = name[:name.find(".")] op = optparse.OptionParser() op.add_option('--arg', dest='args', default=[], action='append', help='Append an argument to a list that can be accessed as config.args.') op.add_option('--version', dest='version', default=False, action='store_true', help="Display the version of Ren'Py") op.add_option('--game', dest='game', default=None, help='The directory the game is in.') op.add_option("--savedir", dest='savedir', default=None, action='store', help='The directory in which to save data. Defaults to the saves directory under the game directory.') op.add_option('--lock', dest='lock', default=None, action='store', help=optparse.SUPPRESS_HELP) op.add_option('--python', dest='python', default=None, help=optparse.SUPPRESS_HELP) op.add_option('--compile', dest='compile', default=False, action='store_true', help="Causes Ren'Py to compile all .rpy files to .rpyc files, and then quit.") op.add_option('--lint', dest='lint', default=False, action='store_true', help='Run a number of expensive tests, to try to detect errors in the script.') op.add_option('--profile', dest='profile', action='store_true', default=False, help='Causes the amount of time it takes to draw the screen to be profiled.') op.add_option('--trace', dest='trace', action='count', default=0, help='Dump internal trace data to trace.txt. Use twice to dump in absurd detail.') op.add_option('--leak', dest='leak', action='store_true', default=False, help=optparse.SUPPRESS_HELP) op.add_option('--warp', dest='warp', default=None, help='This takes as an argument a filename:linenumber pair, and tries to warp to the statement before that line number.') op.add_option('--remote', dest='remote', action='store_true', help="Allows Ren'Py to be fed commands on stdin.") op.add_option('--rmpersistent', dest='rmpersistent', action='store_true', help="Deletes the persistent data, and exits.") op.add_option('--presplash', dest='presplash', default=None, help="Used internally to display the presplash screen.") options, args = op.parse_args() if options.presplash: import renpy.display.presplash renpy.display.presplash.show(options.presplash) if options.trace: enable_trace(options.trace) if options.python: import __main__ sys.argv = [ options.python ] + args execfile(options.python, __main__.__dict__, __main__.__dict__) sys.exit(0) args = list(args) if len(args) >= 1: basedir = os.path.abspath(args[0]) else: basedir = renpy_base # If we made it this far, we will be running the game, or at least # doing a lint. # os.chdir(renpy_base) # Look for the game directory. if options.game: gamedir = options.game else: gamedirs = [ name ] game_name = name while game_name: prefix = game_name[0] game_name = game_name[1:] if prefix == ' ' or prefix == '_': gamedirs.append(game_name) gamedirs.extend([ 'game', 'data',]) for i in gamedirs: if i == "renpy": continue gamedir = basedir + "/" + i if os.path.isdir(gamedir): break else: gamedir = basedir sys.path.insert(0, basedir) # Force windib on windows, unless the user explicitly overrides. if hasattr(sys, 'winver') and not 'SDL_VIDEODRIVER' in os.environ: os.environ['SDL_VIDEODRIVER'] = 'windib' # Show the presplash. if not options.lint and not options.compile and not options.version and not options.rmpersistent: import renpy.display.presplash renpy.display.presplash.start(gamedir) # This is a hack that makes garbage collection go in the right order, # hopefully. import subprocess subprocess.Popen.__sys = sys # If we're on a mac, install our own os.start. if sys.platform == "darwin": os.startfile == mac_start # Load up all of Ren'Py, in the right order. import renpy renpy.import_all() if options.version: print renpy.version sys.exit(0) keep_running = True report_error = None while keep_running: try: renpy.game.options = options renpy.config.renpy_base = renpy_base renpy.config.basedir = basedir renpy.config.gamedir = gamedir renpy.config.args = options.args renpy.main.main() keep_running = False except KeyboardInterrupt: break except renpy.game.UtterRestartException: # Only works after a full restart. report_error = renpy.display.error.ReportError() # On an UtterRestart, reload Ren'Py. renpy.reload_all() continue except renpy.game.ParseErrorException: if report_error and report_error.report('a parse error'): renpy.reload_all() keep_running = True else: keep_running = False except Exception, e: report_exception(e) if report_error and report_error.report('an exception'): renpy.reload_all() keep_running = True else: keep_running = False if options.leak: memory_profile() sys.exit(0) | b087b29a22f684d43c55f6b7621c26b7f06f27e6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10962/b087b29a22f684d43c55f6b7621c26b7f06f27e6/bootstrap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7065,
12,
1187,
2074,
67,
1969,
4672,
225,
2552,
1654,
2074,
225,
468,
968,
279,
5960,
508,
364,
326,
7920,
18,
508,
273,
1140,
18,
803,
18,
13909,
12,
9499,
18,
19485,
63,
20,
5717,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7065,
12,
1187,
2074,
67,
1969,
4672,
225,
2552,
1654,
2074,
225,
468,
968,
279,
5960,
508,
364,
326,
7920,
18,
508,
273,
1140,
18,
803,
18,
13909,
12,
9499,
18,
19485,
63,
20,
5717,
... |
security.declareProtected(CMFCorePermissions.View, 'modified') | security.declareProtected(permissions.View, 'modified') | def created(self): """Dublin Core element - date resource created, returned as DateTime. """ # allow for non-existent creation_date, existed always created = self.getField('creation_date').get(self) return created is None and FLOOR_DATE or created | bffbf06ccb0e344dcf82f7addf15838da46c2ba5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/bffbf06ccb0e344dcf82f7addf15838da46c2ba5/ExtensibleMetadata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2522,
12,
2890,
4672,
3536,
40,
29056,
4586,
930,
300,
1509,
1058,
2522,
16,
2106,
487,
3716,
18,
3536,
468,
1699,
364,
1661,
17,
19041,
6710,
67,
712,
16,
20419,
3712,
2522,
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,
2522,
12,
2890,
4672,
3536,
40,
29056,
4586,
930,
300,
1509,
1058,
2522,
16,
2106,
487,
3716,
18,
3536,
468,
1699,
364,
1661,
17,
19041,
6710,
67,
712,
16,
20419,
3712,
2522,
273,
365,
... |
def sub(w_bigint1, w_bigint2): if w_bigint1.sign < 0: if w_bigint2.sign < 0: result = _x_sub(w_bigint1, w_bigint2) | def sub(self, other): if self.sign < 0: if other.sign < 0: result = _x_sub(self, other) | def sub(w_bigint1, w_bigint2): if w_bigint1.sign < 0: if w_bigint2.sign < 0: result = _x_sub(w_bigint1, w_bigint2) else: result = _x_add(w_bigint1, w_bigint2) result.sign = -result.sign else: if w_bigint2.sign < 0: result = _x_add(w_bigint1, w_bigint2) else: result = _x_sub(w_bigint1, w_bigint2) result._normalize() return result | 87da397eba037ce53e8c5847c7c4b29acfda97b2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/87da397eba037ce53e8c5847c7c4b29acfda97b2/rbigint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
12,
2890,
16,
1308,
4672,
309,
365,
18,
2977,
411,
374,
30,
309,
1308,
18,
2977,
411,
374,
30,
563,
273,
389,
92,
67,
1717,
12,
2890,
16,
1308,
13,
469,
30,
563,
273,
389,
92,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
12,
2890,
16,
1308,
4672,
309,
365,
18,
2977,
411,
374,
30,
309,
1308,
18,
2977,
411,
374,
30,
563,
273,
389,
92,
67,
1717,
12,
2890,
16,
1308,
13,
469,
30,
563,
273,
389,
92,... |
return sorted(list(_assumptions)) | return list(_assumptions) | def assumptions(): """ List all current symbolic assumptions. EXAMPLES:: sage: var('x,y,z, w') (x, y, z, w) sage: forget() sage: assume(x^2+y^2 > 0) sage: assumptions() [x^2 + y^2 > 0] sage: forget(x^2+y^2 > 0) sage: assumptions() [] sage: assume(x > y) sage: assume(z > w) sage: list(sorted(assumptions(), lambda x,y:cmp(str(x),str(y)))) [x > y, z > w] sage: forget() sage: assumptions() [] """ return sorted(list(_assumptions)) | 0683a10fc6842244e7c7d2df27a712df1e127839 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/0683a10fc6842244e7c7d2df27a712df1e127839/assumptions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6287,
573,
13332,
3536,
987,
777,
783,
16754,
6287,
573,
18,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
569,
2668,
92,
16,
93,
16,
94,
16,
341,
6134,
261,
92,
16,
677,
16,
998,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6287,
573,
13332,
3536,
987,
777,
783,
16754,
6287,
573,
18,
225,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
569,
2668,
92,
16,
93,
16,
94,
16,
341,
6134,
261,
92,
16,
677,
16,
998,... |
if value: self.elementstack[-1][2].append(value) self.pop('license') | attrsD = FeedParserDict() attrsD['rel']='license' if value: attrsD['href']=value context.setdefault('links', []).append(attrsD) | def _start_cc_license(self, attrsD): self.push('license', 1) value = self._getAttribute(attrsD, 'rdf:resource') if value: self.elementstack[-1][2].append(value) self.pop('license') | 44482af2baebba8741223b8967e4efeaf8365c45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/44482af2baebba8741223b8967e4efeaf8365c45/feedparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1937,
67,
952,
67,
12687,
12,
2890,
16,
3422,
40,
4672,
365,
18,
6206,
2668,
12687,
2187,
404,
13,
460,
273,
365,
6315,
588,
1499,
12,
7039,
40,
16,
296,
19299,
30,
3146,
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,
1,
1,
1,
1,
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,
1937,
67,
952,
67,
12687,
12,
2890,
16,
3422,
40,
4672,
365,
18,
6206,
2668,
12687,
2187,
404,
13,
460,
273,
365,
6315,
588,
1499,
12,
7039,
40,
16,
296,
19299,
30,
3146,
6134,
... |
scopes.pop() | closeScope(scopes) | #enddef - closes a scope | 8ef90f9a112ed379de9d5ae4b3e974c09cd6ae77 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9355/8ef90f9a112ed379de9d5ae4b3e974c09cd6ae77/wmliterator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
409,
536,
300,
13445,
279,
2146,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
409,
536,
300,
13445,
279,
2146,
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,
-10... |
thumbNailFilter = etree.XPath('.//div[@class="episodethumb"]/img') descFilter = etree.XPath('.//div[@class="episodecontent"]/p') linkFilter = etree.XPath('.//div[@class="episodecontent"]/p//a[@href!="javascript:;"]') | thumbNailFilter = etree.XPath('.//div[@class="overlay_thumb_area"]//img') textFilter = etree.XPath('.//div[@class="overlay-bg-middle"]/p') titleFilter = etree.XPath('.//div[@class="overlay_thumb_area"]//a[@title!=""]/@title') descFilter = etree.XPath('.//div[@class="overlay-bg-middle"]/p[@class="overlay_extra overlay_spacer_top"]/text()') linkFilter = etree.XPath('.//div[@class="overlay_thumb_area"]//a[@title!=""]/@href') | def searchTitle(self, title, pagenumber, pagelen, ignoreError=False): '''Key word video search of the TheWB web site return an array of matching item elements return ''' orgURL = self.thewb_config.find('searchURLS').xpath(".//href")[0].text | 6f6daa366b2cfd2b5bb891ffe90ce1e7c399c2ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13713/6f6daa366b2cfd2b5bb891ffe90ce1e7c399c2ad/thewb_api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
4247,
12,
2890,
16,
2077,
16,
4262,
21998,
16,
4262,
292,
275,
16,
2305,
668,
33,
8381,
4672,
9163,
653,
2076,
6191,
1623,
434,
326,
1021,
59,
38,
3311,
2834,
327,
392,
526,
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,
1623,
4247,
12,
2890,
16,
2077,
16,
4262,
21998,
16,
4262,
292,
275,
16,
2305,
668,
33,
8381,
4672,
9163,
653,
2076,
6191,
1623,
434,
326,
1021,
59,
38,
3311,
2834,
327,
392,
526,
434,... |
print "DEBUG fyi: rotateAboutPointTemporaryCommand(%r) returning early since command stack locked" % isChecked | def rotateAboutPointTemporaryCommand(self, isChecked = False): """ @see: self.moveFromToTemporaryMode """ #@TODO: clean this up. This was written just after Rattlesnake rc2 #for FNANO presentation -- Ninad 2008-04-17 | 91fc4409cac345d57880216dd1ec61f151584b1e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/91fc4409cac345d57880216dd1ec61f151584b1e/Move_Command.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8534,
24813,
2148,
11685,
2189,
12,
2890,
16,
31041,
273,
1083,
4672,
3536,
632,
5946,
30,
365,
18,
8501,
1265,
774,
11685,
2309,
3536,
468,
36,
6241,
30,
2721,
333,
731,
18,
1220,
1703,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8534,
24813,
2148,
11685,
2189,
12,
2890,
16,
31041,
273,
1083,
4672,
3536,
632,
5946,
30,
365,
18,
8501,
1265,
774,
11685,
2309,
3536,
468,
36,
6241,
30,
2721,
333,
731,
18,
1220,
1703,... | |
parser = OptionParser() parser.add_option("--delhba", action="callback", callback=tcm_delhba, nargs=1, type="string", dest="HBA", help="Delete TCM Host Bus Adapter (HBA)") parser.add_option("--createdev", action="callback", callback=tcm_createvirtdev, nargs=2, type="string", dest="HBA/DEV <params>", help="Create TCM Storage Object") parser.add_option("--freedev", action="callback", callback=tcm_freevirtdev, nargs=1, type="string", dest="HBA/DEV", help="Free TCM Storage Object") parser.add_option("--listhbas", action="callback", callback=tcm_list_hbas, nargs=0, help="List TCM Host Bus Adapters (HBAs)") parser.add_option("--pr", action="callback", callback=tcm_show_persistent_reserve_info, nargs=1, type="string", dest="HBA/DEV", help="Show Persistent Reservation info") parser.add_option("--setudevpath", action="callback", callback=tcm_set_udev_path, nargs=2, type="string", dest="HBA/DEV <udev_path>", help="Set UDEV Path Information, only used when --createdev did not contain <udev_path> as parameter") parser.add_option("--setunitserial", action="callback", callback=tcm_set_wwn_unit_serial, nargs=2, type="string", dest="HBA/DEV <unit_serial>", help="Set T10 EVPD Unit Serial Information") parser.add_option("--unload", action="callback", callback=tcm_unload, nargs=0, help="Unload target_core_mod") parser.add_option("--version", action="callback", callback=tcm_version, nargs=0, help="Display target_core_mod version information") parser.add_option("--wwn", action="callback", callback=tcm_show_wwn_info, nargs=1, type="string", dest="HBA/DEV", help="Show WWN info") parser.parse_args() | def main(): parser = OptionParser() parser.add_option("--delhba", action="callback", callback=tcm_delhba, nargs=1, type="string", dest="HBA", help="Delete TCM Host Bus Adapter (HBA)") parser.add_option("--createdev", action="callback", callback=tcm_createvirtdev, nargs=2, type="string", dest="HBA/DEV <params>", help="Create TCM Storage Object") parser.add_option("--freedev", action="callback", callback=tcm_freevirtdev, nargs=1, type="string", dest="HBA/DEV", help="Free TCM Storage Object") parser.add_option("--listhbas", action="callback", callback=tcm_list_hbas, nargs=0, help="List TCM Host Bus Adapters (HBAs)") parser.add_option("--pr", action="callback", callback=tcm_show_persistent_reserve_info, nargs=1, type="string", dest="HBA/DEV", help="Show Persistent Reservation info") parser.add_option("--setudevpath", action="callback", callback=tcm_set_udev_path, nargs=2, type="string", dest="HBA/DEV <udev_path>", help="Set UDEV Path Information, only used when --createdev did not contain <udev_path> as parameter") parser.add_option("--setunitserial", action="callback", callback=tcm_set_wwn_unit_serial, nargs=2, type="string", dest="HBA/DEV <unit_serial>", help="Set T10 EVPD Unit Serial Information") parser.add_option("--unload", action="callback", callback=tcm_unload, nargs=0, help="Unload target_core_mod") parser.add_option("--version", action="callback", callback=tcm_version, nargs=0, help="Display target_core_mod version information") parser.add_option("--wwn", action="callback", callback=tcm_show_wwn_info, nargs=1, type="string", dest="HBA/DEV", help="Show WWN info") (options, args) = parser.parse_args() if len(sys.argv) == 1: parser.print_help() sys.exit(0) elif not re.search('--', sys.argv[1]): tcm_err("Unknown CLI option: " + sys.argv[1]) if __name__ == "__main__": main() | def tcm_version(option, opt_str, value, parser): os.system("cat /sys/kernel/config/target/version") return | 591c5bbced2ccfcf8854d626b12d8b465487d577 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8449/591c5bbced2ccfcf8854d626b12d8b465487d577/tcm_node.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1715,
81,
67,
1589,
12,
3482,
16,
2153,
67,
701,
16,
460,
16,
2082,
4672,
225,
1140,
18,
4299,
2932,
2574,
342,
9499,
19,
8111,
19,
1425,
19,
3299,
19,
1589,
7923,
327,
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,
1715,
81,
67,
1589,
12,
3482,
16,
2153,
67,
701,
16,
460,
16,
2082,
4672,
225,
1140,
18,
4299,
2932,
2574,
342,
9499,
19,
8111,
19,
1425,
19,
3299,
19,
1589,
7923,
327,
225,
2,
-100,... |
result = prefixes[node.type] + compress(node[0]) elif type in postfixes: | def compress(node): type = node.type result = None if type in simple: result = type elif type in prefixes: result = prefixes[node.type] + compress(node[0]) elif type in postfixes: if getattr(node, "postfix", False): result = postfixes[node.type] + compress(node[0]) else: result = compress(node[0]) + postfixes[node.type] elif type in dividers: result = dividers[node.type].join(map(compress, node)) else: try: result = globals()["__" + type](node) except KeyError: print("Compressor does not support type '%s' from line %s in file %s" % (type, node.line, node.getFileName())) print(node.toJson()) sys.exit(1) if getattr(node, "parenthesized", None): return "(%s)" % result else: return result | 755336729025479a4bfd68188acd5ca861fbbe4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/755336729025479a4bfd68188acd5ca861fbbe4e/Compressor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8099,
12,
2159,
4672,
618,
273,
756,
18,
723,
563,
273,
599,
225,
309,
618,
316,
4143,
30,
563,
273,
618,
1327,
618,
316,
9419,
30,
309,
3869,
12,
2159,
16,
315,
2767,
904,
3113,
108... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8099,
12,
2159,
4672,
618,
273,
756,
18,
723,
563,
273,
599,
225,
309,
618,
316,
4143,
30,
563,
273,
618,
1327,
618,
316,
9419,
30,
309,
3869,
12,
2159,
16,
315,
2767,
904,
3113,
108... | |
TEST_EXCEPTION = RuntimeError("test exception") | def setUp(self): self.TEST_EXCEPTION = RuntimeError("test exception") | def shouldThrow(): with ExitThrows(): pass | ba21f618a301a36b13a25c2d51e74562363c6d67 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/ba21f618a301a36b13a25c2d51e74562363c6d67/test_with.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1410,
8282,
13332,
598,
9500,
21845,
13332,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1410,
8282,
13332,
598,
9500,
21845,
13332,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
else | else: | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 224) else quickfix.StringField.__init__(self, 224, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
576,
3247,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
576,
3247,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738,... |
res = self.__openDirectory(path) | res = self.__openDirectory( path ) | def __getDirectoryContents(self,path,verbose=False): """ Returns a dictionary containing all of the contents of a directory. This includes the metadata associated to files (replicas, size, guid, status) and the subdirectories found. """ # First check that the directory exists res = self.__executeOperation(path,'exists') if not res['OK']: return res if not res['Value']: return S_ERROR('No such file or directory') | 6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
2853,
6323,
12,
2890,
16,
803,
16,
11369,
33,
8381,
4672,
3536,
2860,
279,
3880,
4191,
777,
434,
326,
2939,
434,
279,
1867,
18,
1220,
6104,
326,
1982,
3627,
358,
1390,
261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
2853,
6323,
12,
2890,
16,
803,
16,
11369,
33,
8381,
4672,
3536,
2860,
279,
3880,
4191,
777,
434,
326,
2939,
434,
279,
1867,
18,
1220,
6104,
326,
1982,
3627,
358,
1390,
261,
... |
"""Extracts a value from the xml string""" nodes = node.getElementsByTagName(name) if len(nodes): if nodes[index].firstChild: return _unescape_htmlentity(nodes[index].firstChild.data.strip()) else: return None | """Extracts a value from the xml string""" nodes = node.getElementsByTagName(name) if len(nodes): if nodes[index].firstChild: return _unescape_htmlentity(nodes[index].firstChild.data.strip()) else: return None | def _extract(node, name, index = 0): """Extracts a value from the xml string""" nodes = node.getElementsByTagName(name) if len(nodes): if nodes[index].firstChild: return _unescape_htmlentity(nodes[index].firstChild.data.strip()) else: return None | 312230e30b9a32836e57d3014b7461a466a3dbed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9926/312230e30b9a32836e57d3014b7461a466a3dbed/pylast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8004,
12,
2159,
16,
508,
16,
770,
273,
374,
4672,
3536,
12809,
279,
460,
628,
326,
2025,
533,
8395,
225,
2199,
273,
756,
18,
588,
3471,
10401,
12,
529,
13,
225,
309,
562,
12,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8004,
12,
2159,
16,
508,
16,
770,
273,
374,
4672,
3536,
12809,
279,
460,
628,
326,
2025,
533,
8395,
225,
2199,
273,
756,
18,
588,
3471,
10401,
12,
529,
13,
225,
309,
562,
12,
46... |
if len(station_list)!=1: | if len(station_list) != 1: | def getStationPAZ(network_id, station_id, datetime): """ """ # request station information station_list = client.station.getList(network_id=network_id, station_id=station_id, datetime=datetime) if len(station_list)!=1: return {} # request station resource res = client.station.getXMLResource(station_list[0]['resource_name']) # get poles node = res.station_control_header.response_poles_and_zeros poles_real = node.complex_pole.real_pole[:] poles_imag = node.complex_pole.imaginary_pole[:] poles = zip(poles_real, poles_imag) poles = [p[0] + p[1]*1j for p in poles] # get zeros node = res.station_control_header.response_poles_and_zeros zeros_real = node.complex_zero.real_zero[:][:] zeros_imag = node.complex_zero.imaginary_zero[:][:] zeros = zip(zeros_real, zeros_imag) zeros = [p[0] + p[1]*1j for p in zeros] # get gain # XXX: not sure about that! node = res.station_control_header gains = node.xpath('channel_sensitivity_gain/sensitivity_gain') gain = gains[-1] return {'poles': poles, 'zeroes': zeros, 'gain': gain} | eaae164587ff3e53e5bb057afc519a3a6dac28e5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10470/eaae164587ff3e53e5bb057afc519a3a6dac28e5/eventcluster.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
16672,
4066,
62,
12,
5185,
67,
350,
16,
13282,
67,
350,
16,
3314,
4672,
3536,
3536,
468,
590,
13282,
1779,
13282,
67,
1098,
273,
1004,
18,
17894,
18,
588,
682,
12,
5185,
67,
350,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16672,
4066,
62,
12,
5185,
67,
350,
16,
13282,
67,
350,
16,
3314,
4672,
3536,
3536,
468,
590,
13282,
1779,
13282,
67,
1098,
273,
1004,
18,
17894,
18,
588,
682,
12,
5185,
67,
350,
... |
[['dom', 'int'], | [['dom', 'str'], | def op_pincpu(self, _, req): fn = FormFn(self.xd.domain_pincpu, [['dom', 'int'], ['vcpu', 'str'], ['cpumap', 'str']]) val = fn(req.args, {'dom': self.dom.domid}) return val | 545cb431bdc40df334149b0b016457b69bd8b4df /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6195/545cb431bdc40df334149b0b016457b69bd8b4df/SrvDomain.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1061,
67,
13097,
11447,
12,
2890,
16,
389,
16,
1111,
4672,
2295,
273,
2748,
5372,
12,
2890,
18,
7669,
18,
4308,
67,
13097,
11447,
16,
306,
3292,
9859,
2187,
296,
701,
17337,
10228,
90,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1061,
67,
13097,
11447,
12,
2890,
16,
389,
16,
1111,
4672,
2295,
273,
2748,
5372,
12,
2890,
18,
7669,
18,
4308,
67,
13097,
11447,
16,
306,
3292,
9859,
2187,
296,
701,
17337,
10228,
90,
... |
(ComboProcessor, "IDC_ACTION_UNSURE", "Filter.unsure_action"), | (ComboProcessor, "IDC_ACTION_UNSURE", "Filter.unsure_action", _("Untouched,Moved,Copied")), | def WizardTrainer(mgr, config, progress): import os, manager, train bayes_base = os.path.join(mgr.data_directory, "$sbwiz$default_bayes_database") mdb_base = os.path.join(mgr.data_directory, "$sbwiz$default_message_database") fnames = [] for ext in ".pck", ".db": fnames.append(bayes_base+ext) fnames.append(mdb_base+ext) config.wizard.temp_training_names = fnames # determine which db manager to use, and create it. ManagerClass = manager.GetStorageManagerClass() db_manager = ManagerClass(bayes_base, mdb_base) classifier_data = manager.ClassifierData(db_manager, mgr) classifier_data.InitNew() rescore = config.training.rescore if rescore: stages = (_("Training"), .3), (_("Saving"), .1), (_("Scoring"), .6) else: stages = (_("Training"), .9), (_("Saving"), .1) progress.set_stages(stages) train.real_trainer(classifier_data, config, mgr.message_store, progress) # xxx - more hacks - we should pass the classifier data in. orig_classifier_data = mgr.classifier_data mgr.classifier_data = classifier_data # temporary try: progress.tick() if rescore: # Setup the "filter now" config to what we want. now_config = config.filter_now now_config.only_unread = False now_config.only_unseen = False now_config.action_all = False now_config.folder_ids = config.training.ham_folder_ids + \ config.training.spam_folder_ids now_config.include_sub = config.training.ham_include_sub or \ config.training.spam_include_sub import filter filter.filterer(mgr, config, progress) bayes = classifier_data.bayes progress.set_status(_("Completed training with %d spam and %d good messages") \ % (bayes.nspam, bayes.nham)) finally: mgr.wizard_classifier_data = classifier_data mgr.classifier_data = orig_classifier_data | 10491db4e7a3a059160ec55848768e52fb920909 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9857/10491db4e7a3a059160ec55848768e52fb920909/dialog_map.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
678,
13412,
1609,
14522,
12,
13552,
16,
642,
16,
4007,
4672,
1930,
1140,
16,
3301,
16,
4691,
324,
528,
281,
67,
1969,
273,
1140,
18,
803,
18,
5701,
12,
13552,
18,
892,
67,
5149,
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,
678,
13412,
1609,
14522,
12,
13552,
16,
642,
16,
4007,
4672,
1930,
1140,
16,
3301,
16,
4691,
324,
528,
281,
67,
1969,
273,
1140,
18,
803,
18,
5701,
12,
13552,
18,
892,
67,
5149,
16,
... |
input = f.read(512) if input == "": break | input = f.read(size = 512, waitForBytes = 512) | def __response__(self): """ Read the response sent back by the LSCsegFindServer. Parse out the return code with 0 for success and non-zero for error, and then the list of strings representing the returned result(s). | ee57ec4f852f4cbebc6c10f7aa39cc148f6ab013 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3589/ee57ec4f852f4cbebc6c10f7aa39cc148f6ab013/LSCsegFindClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2740,
972,
12,
2890,
4672,
3536,
2720,
326,
766,
3271,
1473,
635,
326,
511,
2312,
5680,
3125,
2081,
18,
2884,
596,
326,
327,
981,
598,
374,
364,
2216,
471,
1661,
17,
7124,
364,
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,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2740,
972,
12,
2890,
4672,
3536,
2720,
326,
766,
3271,
1473,
635,
326,
511,
2312,
5680,
3125,
2081,
18,
2884,
596,
326,
327,
981,
598,
374,
364,
2216,
471,
1661,
17,
7124,
364,
5... |
order_by, tables, clause = obj._order_calc(cursor, user, field_name, otype, context=context) | order_by, tables, tables_args = obj._order_calc(cursor, user, field_name, otype, context=context) | def _order_calc(self, cursor, user, field, otype, context=None): order_by = [] tables = [] field_name = None table_name = None link_field = None clause = '' | 151ca4d00596ae2adeea6a9a25f559f6b8e7f729 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9266/151ca4d00596ae2adeea6a9a25f559f6b8e7f729/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1019,
67,
12448,
12,
2890,
16,
3347,
16,
729,
16,
652,
16,
320,
723,
16,
819,
33,
7036,
4672,
1353,
67,
1637,
273,
5378,
4606,
273,
5378,
652,
67,
529,
273,
599,
1014,
67,
529,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1019,
67,
12448,
12,
2890,
16,
3347,
16,
729,
16,
652,
16,
320,
723,
16,
819,
33,
7036,
4672,
1353,
67,
1637,
273,
5378,
4606,
273,
5378,
652,
67,
529,
273,
599,
1014,
67,
529,
... |
p.plot = 1 | if plot: p.plot = 1 else: p.plot = 0 | def df(cur_u): """The gradient of the cost function. NOT USED right now. """ if gradient_u is not None and \ max(gradient_u - cur_u) < GRADIENT_THRESHOLD: print "Using existing gradient" else: print "Recalculating gradient" f(cur_u) return gradient | f13fa0823b3e7cf20d4468ee3fab52c74faf6bb9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7711/f13fa0823b3e7cf20d4468ee3fab52c74faf6bb9/shooting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3013,
12,
1397,
67,
89,
4672,
3536,
1986,
10292,
434,
326,
6991,
445,
18,
225,
4269,
14988,
40,
2145,
2037,
18,
3536,
309,
10292,
67,
89,
353,
486,
599,
471,
521,
943,
12,
20219,
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,
3013,
12,
1397,
67,
89,
4672,
3536,
1986,
10292,
434,
326,
6991,
445,
18,
225,
4269,
14988,
40,
2145,
2037,
18,
3536,
309,
10292,
67,
89,
353,
486,
599,
471,
521,
943,
12,
20219,
67,
... |
setup( name = "roundup", version = __version__, description = "A simple-to-use and -install issue-tracking system" | setup_args = { 'name': "roundup", 'version': __version__, 'description': "A simple-to-use and -install issue-tracking system" | def main(): # build list of scripts from their implementation modules roundup_scripts = map(scriptname, glob('roundup/scripts/[!_]*.py')) # template munching packagelist = [ 'roundup', 'roundup.cgi', 'roundup.cgi.PageTemplates', 'roundup.cgi.TAL', 'roundup.cgi.ZTUtils', 'roundup.backends', 'roundup.scripts', ] installdatafiles = [ ('share/roundup/cgi-bin', ['cgi-bin/roundup.cgi']), ] py_modules = ['roundup.demo',] # install man pages on POSIX platforms if os.name == 'posix': installdatafiles.append(('man/man1', ['doc/roundup-admin.1', 'doc/roundup-mailgw.1', 'doc/roundup-server.1', 'doc/roundup-demo.1'])) # add the templates to the data files lists from roundup.init import listTemplates templates = [t['path'] for t in listTemplates('templates').values()] for tdir in templates: # scan for data files for idir in '. detectors extensions html'.split(): idir = os.path.join(tdir, idir) if not os.path.isdir(idir): continue tfiles = [] for f in os.listdir(idir): if f.startswith('.'): continue ifile = os.path.join(idir, f) if os.path.isfile(ifile): tfiles.append(ifile) installdatafiles.append( (os.path.join('share', 'roundup', idir), tfiles) ) # add message files for (_dist_file, _mo_file) in list_message_files(): installdatafiles.append((os.path.dirname(_mo_file), [os.path.join("build", _mo_file)])) # perform the setup action from roundup import __version__ setup( name = "roundup", version = __version__, description = "A simple-to-use and -install issue-tracking system" " with command-line, web and e-mail interfaces. Highly" " customisable.", long_description = | b1533aef4e5285c30f61b0d75ffc8403a1945ebe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b1533aef4e5285c30f61b0d75ffc8403a1945ebe/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
1361,
666,
434,
8873,
628,
3675,
4471,
4381,
3643,
416,
67,
12827,
273,
852,
12,
4263,
529,
16,
4715,
2668,
2260,
416,
19,
12827,
19,
63,
5,
67,
5772,
18,
2074,
26112... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
468,
1361,
666,
434,
8873,
628,
3675,
4471,
4381,
3643,
416,
67,
12827,
273,
852,
12,
4263,
529,
16,
4715,
2668,
2260,
416,
19,
12827,
19,
63,
5,
67,
5772,
18,
2074,
26112... |
library_dirs=[dblib_dir], runtime_library_dirs=[dblib_dir], | library_dirs=dblib_dir, runtime_library_dirs=dblib_dir, | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | c6b4ea30c40d923a15612c5713674d94e2efc1fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/c6b4ea30c40d923a15612c5713674d94e2efc1fe/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... |
self.filter = 1 self.rsz = 'large' self.safe = 'off' | self.filter = FILTER_ON self.rsz = RSZ_LARGE self.safe = SAFE_OFF | def __init__(self,query,pages=10): self.pages = pages #Number of pages. default 10 self.query = query self.filter = 1 #Controls turning on or off the duplicate content filter. On = 1. self.rsz = 'large' #Results per page. small = 4 /large = 8 self.safe = 'off' #SafeBrowsing - active/moderate/off | 52bde302eb267a4f6ed28911af4539771bc8e9c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7667/52bde302eb267a4f6ed28911af4539771bc8e9c0/pygoogle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2271,
16,
7267,
33,
2163,
4672,
365,
18,
7267,
273,
4689,
1850,
468,
1854,
434,
4689,
18,
805,
1728,
365,
18,
2271,
273,
843,
365,
18,
2188,
273,
404,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2271,
16,
7267,
33,
2163,
4672,
365,
18,
7267,
273,
4689,
1850,
468,
1854,
434,
4689,
18,
805,
1728,
365,
18,
2271,
273,
843,
365,
18,
2188,
273,
404,
... |
msg = redmsg("The simulator dynamic library [sim.so on Mac or Linux, in " + self.dylib_path + | msg = redmsg("The simulator dynamic library [sim.so or sim.dll, in " + self.dylib_path + | def set_options_errQ(self): #e maybe split further into several setup methods? #bruce 051115 removed unused 'options' arg """Set movie alist (from simaspect or entire part); debug-msg if it was already set (and always ignore old value). Figure out and set filenames, including sim executable path. All inputs and outputs are self attrs or globals or other obj attrs... except, return error code if sim executable missing or on other errors detected by subrs. old docstring: Caller should specify the options for this simulator run (including the output file name); these might affect the input file we write for it and/or the arguments given to the simulator executable. Temporary old-code compatibility: use self._movie for simsetup params and other needed params, and store new ones into it. """ part = self.part movie = self._movie | 1b271c6587937f68aea28be8430dee01969ca7a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/1b271c6587937f68aea28be8430dee01969ca7a4/runSim.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2116,
67,
370,
53,
12,
2890,
4672,
468,
73,
6944,
1416,
9271,
1368,
11392,
3875,
2590,
35,
468,
2848,
3965,
15331,
2499,
3600,
3723,
10197,
296,
2116,
11,
1501,
3536,
694,
21360... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2116,
67,
370,
53,
12,
2890,
4672,
468,
73,
6944,
1416,
9271,
1368,
11392,
3875,
2590,
35,
468,
2848,
3965,
15331,
2499,
3600,
3723,
10197,
296,
2116,
11,
1501,
3536,
694,
21360... |
f.write(" CFR="+str(round(s.circ_from_rate,2))+" ") f.write(" CTR="+str(round(s.circ_to_rate,2))+" ") f.write(" CBR="+str(round(s.circ_bi_rate,2))+" ") f.write(" CFE="+str(round(s.avg_first_ext,2))+" ") f.write(" SBW="+str(round(s.sbw,2))+" ") f.write(" FBW="+str(round(s.filt_sbw,2))+" ") f.write(" PR="+str(round(s.percentile,1))+"\n") | f.write(" CFR="+str(cvt(s.circ_from_rate,2))+" ") f.write(" CTR="+str(cvt(s.circ_to_rate,2))+" ") f.write(" CBR="+str(cvt(s.circ_bi_rate,2))+" ") f.write(" CFE="+str(cvt(s.avg_first_ext,2))+" ") f.write(" SBW="+str(cvt(s.sbw,2))+" ") f.write(" FBW="+str(cvt(s.filt_sbw,2))+" ") f.write(" PR="+str(cvt(s.percentile,1))+"\n") f.flush() | def write_stats(f, pct_low=0, pct_high=100, order_by=None, recompute=False, stat_clause=None, filter_clause=None): ratio_key = """SQLSupport Statistics: SR=Stream avg ratio AR=Advertised bw ratio BRR=Adv. bw avg ratio CSR=Circ suspect ratio CFR=Circ Fail Ratio SSR=Stream suspect ratio SFR=Stream fail ratio CC=Circuit Count SC=Stream Count P=Percentile Rank U=Uptime (h)\n""" | c8ad6cda0735bca71a66e2ae8dc82c8034ffc7ce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3224/c8ad6cda0735bca71a66e2ae8dc82c8034ffc7ce/SQLSupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
5296,
12,
74,
16,
19857,
67,
821,
33,
20,
16,
19857,
67,
8766,
33,
6625,
16,
1353,
67,
1637,
33,
7036,
16,
30067,
33,
8381,
16,
610,
67,
18128,
33,
7036,
16,
1034,
67,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
5296,
12,
74,
16,
19857,
67,
821,
33,
20,
16,
19857,
67,
8766,
33,
6625,
16,
1353,
67,
1637,
33,
7036,
16,
30067,
33,
8381,
16,
610,
67,
18128,
33,
7036,
16,
1034,
67,
18... |
self.lbfgsinit = 0 self.ITR = 1 | self.ITR = None | def initialize(self): self.lbfgsinit = 0 self.ITR = 1 self.f_old = None self.r_old = None | 758df1e6225a0ea14ea8cf66ffcf1e4073732124 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1380/758df1e6225a0ea14ea8cf66ffcf1e4073732124/lbfgs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
4672,
225,
365,
18,
1285,
54,
273,
599,
365,
18,
74,
67,
1673,
273,
599,
365,
18,
86,
67,
1673,
273,
599,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
4672,
225,
365,
18,
1285,
54,
273,
599,
365,
18,
74,
67,
1673,
273,
599,
365,
18,
86,
67,
1673,
273,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
"resultsLog", "workspace", "displayInfo" | "resultsLog", "workspace", "displayInfo", "infoLineEdit" | def import_to_global(modname, attrs=None, math=False): """ import_to_global(modname, (a,b,c,...), math): like "from modname import a,b,c,...", but imports to global namespace (__main__). If math==True, also registers functions with QtiPlot's math function list. """ import sys import os sys.path.append(os.path.dirname(__file__)) mod = __import__(modname) for submod in modname.split(".")[1:]: mod = getattr(mod, submod) if attrs==None: attrs=dir(mod) for name in attrs: f = getattr(mod, name) setattr(__main__, name, f) # make functions available in QtiPlot's math function list if math and callable(f): qti.mathFunctions[name] = f | 228a6c50f2986e8b378eca1bd5adcb7a2f00cad3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2185/228a6c50f2986e8b378eca1bd5adcb7a2f00cad3/qtiplotrc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
869,
67,
6347,
12,
1711,
529,
16,
3422,
33,
7036,
16,
4233,
33,
8381,
4672,
3536,
1930,
67,
869,
67,
6347,
12,
1711,
529,
16,
261,
69,
16,
70,
16,
71,
16,
2777,
3631,
423... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
869,
67,
6347,
12,
1711,
529,
16,
3422,
33,
7036,
16,
4233,
33,
8381,
4672,
3536,
1930,
67,
869,
67,
6347,
12,
1711,
529,
16,
261,
69,
16,
70,
16,
71,
16,
2777,
3631,
423... |
setattr(self, prefix+varname, init_locals[varname]) | setattr(self, prefix+varname, tmp[varname]) | def adopt_init_args(exclusions=[], prefix="", frames_back=0): frame = sys._getframe(frames_back+1) varnames = frame.f_code.co_varnames exclusions.append(varnames[0]) # self init_locals = frame.f_locals self = init_locals[varnames[0]] for varname in varnames: if (varname not in exclusions): setattr(self, prefix+varname, init_locals[varname]) if ("__init__varnames__" not in exclusions): setattr(self, "__init__varnames__", varnames) | 4ea04b9447f6225f2694da1930c74e645f579721 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/4ea04b9447f6225f2694da1930c74e645f579721/introspection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1261,
3838,
67,
2738,
67,
1968,
12,
338,
25364,
22850,
6487,
1633,
1546,
3113,
7793,
67,
823,
33,
20,
4672,
2623,
273,
2589,
6315,
588,
3789,
12,
10278,
67,
823,
15,
21,
13,
569,
1973,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1261,
3838,
67,
2738,
67,
1968,
12,
338,
25364,
22850,
6487,
1633,
1546,
3113,
7793,
67,
823,
33,
20,
4672,
2623,
273,
2589,
6315,
588,
3789,
12,
10278,
67,
823,
15,
21,
13,
569,
1973,... |
def get_printer(self): | def get_printer(self, set_horz_margins=False): | def get_printer(self): printer = get_pdf_printer() printer.setPaperSize(QSizeF(self.size[0] * 10, self.size[1] * 10), QPrinter.Millimeter) printer.setPageMargins(0, 0, 0, 0, QPrinter.Point) printer.setOrientation(orientation(self.opts.orientation)) printer.setOutputFormat(QPrinter.PdfFormat) printer.setFullPage(True) return printer | 779dad005ec6600f9fca3ab5772540ce84f2c87f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/779dad005ec6600f9fca3ab5772540ce84f2c87f/writer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
30439,
12,
2890,
16,
444,
67,
76,
280,
94,
67,
10107,
87,
33,
8381,
4672,
12539,
273,
336,
67,
7699,
67,
30439,
1435,
12539,
18,
542,
27339,
1225,
12,
53,
1225,
42,
12,
2890... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
30439,
12,
2890,
16,
444,
67,
76,
280,
94,
67,
10107,
87,
33,
8381,
4672,
12539,
273,
336,
67,
7699,
67,
30439,
1435,
12539,
18,
542,
27339,
1225,
12,
53,
1225,
42,
12,
2890... |
LOG('XWFMailingList', INFO, 'found individual moderation: %s, %s' % (msg.sender, moderatedlist)) | m = '%s (%s): found individual moderation <%s> %s' % \ (self.getProperty('title', ''), self.getId(), msg.sender, moderatedlist) log.info(m) | def processModeration(self, REQUEST): # a hook for handling the moderation stage of processing the email mailString = getMailFromRequest(REQUEST) # TODO: erradicate splitMail usage (header, body) = MailBoxerTools.splitMail(mailString) | 022876f88e927316bd924ded9b9dc1cbc88f4167 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6274/022876f88e927316bd924ded9b9dc1cbc88f4167/XWFMailingList.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
1739,
7067,
12,
2890,
16,
12492,
4672,
468,
279,
3953,
364,
5057,
326,
681,
7067,
6009,
434,
4929,
326,
2699,
4791,
780,
273,
31991,
25074,
12,
5519,
13,
225,
468,
2660,
30,
6445,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1739,
7067,
12,
2890,
16,
12492,
4672,
468,
279,
3953,
364,
5057,
326,
681,
7067,
6009,
434,
4929,
326,
2699,
4791,
780,
273,
31991,
25074,
12,
5519,
13,
225,
468,
2660,
30,
6445,
... |
amsplot_file.write("\t\tif (!(" + mincut + minop + "Event.fHeader." + splitvar[1] + ")) return;\n") | amsplot_file.write("\t\tif (!(" + mincut + minop + "Event.fHeader." + splitvar[1] + ")) continue;\n") | def make_amsplot_file(filearray, options, full_variable): root_h = os.environ["AMSDir"] + "/include/root.h" if os.path.exists(root_h): root_h_file = file(root_h,"r") else: print "Header file \"" + root_h + "\" does not exist; EXIT" sys.exit() amsplot_file = file("amsplot.C","w") amsplot_file.write("int amsplot() {\n") amsplot_file.write("\tgROOT->Reset();\n") amsplot_file.write("\tgSystem->Load(\"$AMSDir/lib/linux/icc/ntuple.so\");\n") amsplot_file.write("\n\tTChain chain(\"AMSRoot\");\n") for filename in filearray: if "--list" in options: filelist = file(filename,"r") for rootfile in filelist.readlines(): rootfile = rootfile.rstrip() amsplot_file.write("\tchain.Add(\"" + rootfile + "\");\n") filelist.close() else: amsplot_file.write("\tchain.Add(\"" + filename +"\");\n") amsplot_file.write("\tchain.SetMakeClass(1);\n") amsplot_file.write("\n\tAMSEventR Event;\n") amsplot_file.write("\tEvent.SetBranchA(&chain);\n") match1 = re.search(r'^([^<>!=]+)([<>=!]+)(\w+[^<>!=]+)([<>=!]+)([^<>=!]+)$',full_variable) match2 = re.search(r'^(\w+[^<>!=]+)([<>=!]+)([^<>=!]+)$',full_variable) match3 = re.search(r'^([^<>!=]+)([<>=!]+)(\w+[^<>!=]+)$',full_variable) if match1: # print "min<var<max: " + match.group(1:) mincut = process_cut(match1.group(1)) minop = process_operator(match1.group(2)) variable = process_variable(match1.group(3),root_h_file) maxop = process_operator(match1.group(4)) maxcut = process_cut(match1.group(5)) elif match2: # print "var<max: " + match.group(1:) mincut = False minop = False variable = process_variable(match2.group(1),root_h_file) maxop = process_operator(match2.group(2)) maxcut = process_cut(match2.group(3)) elif match3: # print "min<var: " + match.group(1:) mincut = process_cut(match3.group(1)) minop = process_operator(match3.group(2)) variable = process_variable(match3.group(3),root_h_file) maxop = False maxcut = False else: # print "Only var: " + full_variable mincut = False minop = False variable = process_variable(full_variable,root_h_file) maxop = False maxcut = False splitvar = variable.split(".") amsplot_file.write("\n\th_test = new TH1F(\"h_test\",\"" + full_variable + "\",100,0.,0.);\n\n") amsplot_file.write("\tfor (int entry=0; entry<chain.GetEntries(); entry++) {\n") amsplot_file.write("\t\tchain.GetEntry(entry);\n") if len(splitvar)>1: if splitvar[0]!="Header": amsplot_file.write("\t\tfor (int i=0; i<Event.n" + splitvar[0] + "(); i++){\n" ) if mincut: amsplot_file.write("\t\t\tif (!(" + mincut + minop + "Event." + splitvar[0] + "(i)." + splitvar[1] + ")) continue;\n") if maxcut: amsplot_file.write("\t\t\tif (!(Event." + splitvar[0] + "(i)." + splitvar[1] + maxop + maxcut + ")) continue;\n") amsplot_file.write("\t\t\th_test->Fill(Event." + splitvar[0] + "(i)." + splitvar[1] + ");\n") amsplot_file.write("\t\t}\n") else: if mincut: amsplot_file.write("\t\tif (!(" + mincut + minop + "Event.fHeader." + splitvar[1] + ")) return;\n") if maxcut: amsplot_file.write("\t\tif (!(Event.fHeader." + splitvar[1] + maxop + maxcut + ")) return;\n") amsplot_file.write("\t\th_test->Fill(Event.fHeader." + splitvar[1] + ");\n") else: if mincut: amsplot_file.write("\t\tif (!(" + mincut + minop + "Event.n" + splitvar[0] + "())) return;\n") if maxcut: amsplot_file.write("\t\tif (!(Event.n" + splitvar[0] + "()" + maxop + maxcut + ")) return;\n") amsplot_file.write("\t\th_test->Fill(Event.n" + splitvar[0] + "());\n") amsplot_file.write("\t}\n\n" ) amsplot_file.write("\th_test->Draw();\n") amsplot_file.write("}\n\n") amsplot_file.close() | 9689e764b8b8e7923f8b5c34efc8c3a521914646 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6657/9689e764b8b8e7923f8b5c34efc8c3a521914646/amsplot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
301,
87,
4032,
67,
768,
12,
768,
1126,
16,
702,
16,
1983,
67,
6105,
4672,
1365,
67,
76,
273,
1140,
18,
28684,
9614,
2192,
55,
1621,
11929,
397,
2206,
6702,
19,
3085,
18,
76... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
301,
87,
4032,
67,
768,
12,
768,
1126,
16,
702,
16,
1983,
67,
6105,
4672,
1365,
67,
76,
273,
1140,
18,
28684,
9614,
2192,
55,
1621,
11929,
397,
2206,
6702,
19,
3085,
18,
76... |
or cmp(x.sortorder, y.sortorder)) | or cmp(x.sortorder, y.sortorder)) | def sorted_news_listing(self, p_objects=[], skey='', rkey=0): """Return sorted events""" results = [] if not skey or skey == 'news_date': p_objects.sort(lambda x,y: cmp(y.news_date, x.news_date) \ or cmp(x.sortorder, y.sortorder)) if not rkey: p_objects.reverse() results.extend(p_objects) else: if rkey: rkey=1 l_objects = utSortObjsByLocaleAttr(p_objects, skey, rkey, self.gl_get_selected_language()) results.extend(l_objects) return results | ffeb211164a19371c4ffa202b70c9aa9c9628d54 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3287/ffeb211164a19371c4ffa202b70c9aa9c9628d54/SEMIDESite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3115,
67,
18443,
67,
21228,
12,
2890,
16,
293,
67,
6911,
22850,
6487,
272,
856,
2218,
2187,
436,
856,
33,
20,
4672,
3536,
990,
3115,
2641,
8395,
1686,
273,
5378,
309,
486,
272,
856,
57... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3115,
67,
18443,
67,
21228,
12,
2890,
16,
293,
67,
6911,
22850,
6487,
272,
856,
2218,
2187,
436,
856,
33,
20,
4672,
3536,
990,
3115,
2641,
8395,
1686,
273,
5378,
309,
486,
272,
856,
57... |
if note[0].GetValue() is '': | if not note[0].GetValue(): | def OnNotes(self, event): full = True for note in self.annotations: if note[0].GetValue() is '': full = False if note[1].GetValue() is '': full = False if full: name = wx.TextCtrl(self.panel, -1, '') value = wx.TextCtrl(self.panel, -1, '') self.notebox.SetRows(self.notebox.GetRows()+1) self.notebox.Add(name) self.notebox.Add(value) self.annotations.append((name,value)) self.Bind(wx.EVT_TEXT, self.OnNotes, name) self.Bind(wx.EVT_TEXT, self.OnNotes, value) self.SendSizeEvent() | 0e4b71c28f452e890aac550085597534729bddfd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9486/0e4b71c28f452e890aac550085597534729bddfd/AnnotateFrame.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
18063,
12,
2890,
16,
871,
4672,
1983,
273,
1053,
364,
4721,
316,
365,
18,
14670,
30,
309,
486,
4721,
63,
20,
8009,
967,
620,
13332,
1983,
273,
1083,
309,
4721,
63,
21,
8009,
967,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
18063,
12,
2890,
16,
871,
4672,
1983,
273,
1053,
364,
4721,
316,
365,
18,
14670,
30,
309,
486,
4721,
63,
20,
8009,
967,
620,
13332,
1983,
273,
1083,
309,
4721,
63,
21,
8009,
967,... |
'matchingRules':MatchingRule | 'matchingRules':MatchingRule, 'matchingRulesUse':MatchingRuleUse, | def __init__(self,sub_schema,entry={}): ldap.cidict.cidict.__init__(self) for k,v in entry.items(): try: self[sub_schema.name2oid[AttributeType][k]] = v except KeyError: self[k] = v | b6f41870b706b7c894e5e073f60e00eafe2e147f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4610/b6f41870b706b7c894e5e073f60e00eafe2e147f/schema.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1717,
67,
4821,
16,
4099,
12938,
4672,
8079,
18,
13478,
933,
18,
13478,
933,
16186,
2738,
972,
12,
2890,
13,
364,
417,
16,
90,
316,
1241,
18,
3319,
13332... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1717,
67,
4821,
16,
4099,
12938,
4672,
8079,
18,
13478,
933,
18,
13478,
933,
16186,
2738,
972,
12,
2890,
13,
364,
417,
16,
90,
316,
1241,
18,
3319,
13332... |
content += unicode(s, charset) | if charset is not None: content += unicode(s, charset) else: content += unicode(s) | def process_incoming_mail(self, msg): to = self.get_email_address_ident(msg, 'To') reply_to = self.get_email_address_ident(msg, 'In-Reply-To') if not reply_to: print >>sys.stderr, 'This is not a reply (no Reply-To field)' return 1 | f5cf4795eb8ea05d8c450ce39e465c0c1db98a29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7471/f5cf4795eb8ea05d8c450ce39e465c0c1db98a29/monboob.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
31033,
67,
4408,
12,
2890,
16,
1234,
4672,
358,
273,
365,
18,
588,
67,
3652,
67,
2867,
67,
6392,
12,
3576,
16,
296,
774,
6134,
4332,
67,
869,
273,
365,
18,
588,
67,
3652,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
31033,
67,
4408,
12,
2890,
16,
1234,
4672,
358,
273,
365,
18,
588,
67,
3652,
67,
2867,
67,
6392,
12,
3576,
16,
296,
774,
6134,
4332,
67,
869,
273,
365,
18,
588,
67,
3652,
... |
return apply (os.path.join, tail) | if tail: return apply (os.path.join, tail) else: return '' | def get_package_dir (self, package): """Return the directory, relative to the top of the source distribution, where package 'package' should be found (at least according to the 'package_dir' option, if any).""" | 4258e786196ec9ba5005ca7bb37cde23cf56bf21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4258e786196ec9ba5005ca7bb37cde23cf56bf21/build_py.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5610,
67,
1214,
261,
2890,
16,
2181,
4672,
3536,
990,
326,
1867,
16,
3632,
358,
326,
1760,
434,
326,
1084,
7006,
16,
1625,
2181,
296,
5610,
11,
1410,
506,
1392,
261,
270,
4520... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5610,
67,
1214,
261,
2890,
16,
2181,
4672,
3536,
990,
326,
1867,
16,
3632,
358,
326,
1760,
434,
326,
1084,
7006,
16,
1625,
2181,
296,
5610,
11,
1410,
506,
1392,
261,
270,
4520... |
tst = gdaltest.GDALTest('BSB', file_to_test, 1, 54674, filename_absolute = 1 ) | tst = gdaltest.GDALTest('BSB', file_to_test, 1, 63005, filename_absolute = 1 ) | def bsb_online_1(): if not gdaltest.download_file('http://www.charts.noaa.gov/RNCs/14850.zip', '14850.zip'): return 'skip' try: os.stat('tmp/cache/14850_1.KAP') file_to_test = 'tmp/cache/14850_1.KAP' except: try: print 'Uncompressing ZIP file...' import zipfile zfobj = zipfile.ZipFile('tmp/cache/14850.zip') outfile = open('tmp/cache/14850_1.KAP', 'wb') outfile.write(zfobj.read('BSB_ROOT/14850/14850_1.KAP')) outfile.close() file_to_test = 'tmp/cache/14850_1.KAP' except: print 'Reading BSB from ZIP file (slow)...' file_to_test = '/vsizip/tmp/cache/14850.zip/BSB_ROOT/14850/14850_1.KAP' tst = gdaltest.GDALTest('BSB', file_to_test, 1, 54674, filename_absolute = 1 ) return tst.testOpen() | d89761938acb7a6a80ead2ce303f3a04d01c3f28 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10289/d89761938acb7a6a80ead2ce303f3a04d01c3f28/bsb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7081,
70,
67,
21026,
67,
21,
13332,
225,
309,
486,
15551,
2390,
395,
18,
7813,
67,
768,
2668,
2505,
2207,
5591,
18,
11563,
87,
18,
2135,
7598,
18,
75,
1527,
19,
54,
10346,
87,
19,
25... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7081,
70,
67,
21026,
67,
21,
13332,
225,
309,
486,
15551,
2390,
395,
18,
7813,
67,
768,
2668,
2505,
2207,
5591,
18,
11563,
87,
18,
2135,
7598,
18,
75,
1527,
19,
54,
10346,
87,
19,
25... |
if lower(HTTP_AUTHORIZATION[:6]) != 'basic ': return None | if lower(HTTP_AUTHORIZATION[:6]) != 'basic ': if roles is None: return '' return None | def old_validation(groups, HTTP_AUTHORIZATION, roles=UNSPECIFIED_ROLES): global base64 if base64 is None: import base64 if lower(HTTP_AUTHORIZATION[:6]) != 'basic ': return None [name,password] = string.splitfields( base64.decodestring( split(HTTP_AUTHORIZATION)[-1]), ':') if roles is None: return name keys=None try: keys=groups.keys except: try: groups=groups() # Maybe it was a method defining a group keys=groups.keys except: pass if keys is not None: # OK, we have a named group, so apply the roles to the named # group. if roles is UNSPECIFIED_ROLES: roles=keys() g=[] for role in roles: if groups.has_key(role): g.append(groups[role]) groups=g for d in groups: if d.has_key(name) and d[name]==password: return name if keys is None: # Not a named group, so don't go further raise 'Forbidden', ( """<strong>You are not authorized to access this resource""") return None | ce36b9e307df69ea62df6d1e120ffd941cc06920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ce36b9e307df69ea62df6d1e120ffd941cc06920/Publish.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1592,
67,
8685,
12,
4650,
16,
2239,
67,
17866,
2689,
16,
4900,
33,
2124,
13847,
13519,
67,
30797,
4672,
2552,
1026,
1105,
309,
1026,
1105,
353,
599,
30,
1930,
1026,
1105,
225,
309,
2612,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1592,
67,
8685,
12,
4650,
16,
2239,
67,
17866,
2689,
16,
4900,
33,
2124,
13847,
13519,
67,
30797,
4672,
2552,
1026,
1105,
309,
1026,
1105,
353,
599,
30,
1930,
1026,
1105,
225,
309,
2612,... |
m[0] = '3' m[PAGESIZE +3: PAGESIZE +3+3] = 'bar' | m[0] = b'3' m[PAGESIZE +3: PAGESIZE +3+3] = b'bar' | def test_basic(self): # Test mmap module on Unix systems and Windows | d5ab51392e332ac6a7a37b2fca62a82b1aee9ec7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/d5ab51392e332ac6a7a37b2fca62a82b1aee9ec7/test_mmap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13240,
12,
2890,
4672,
468,
7766,
30749,
1605,
603,
9480,
14908,
471,
8202,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
13240,
12,
2890,
4672,
468,
7766,
30749,
1605,
603,
9480,
14908,
471,
8202,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
print 'Mopath: no valid curves in file: %s' % filename | print 'Mopath: no valid curves in file.' | def loadNodePath(self, nodePath, fReset = 1): if fReset: self.reset() | 0c5dcd0b66c13f81753fbb2d6b00d42e7ffe2c25 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8543/0c5dcd0b66c13f81753fbb2d6b00d42e7ffe2c25/Mopath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
907,
743,
12,
2890,
16,
20758,
16,
284,
7013,
273,
404,
4672,
309,
284,
7013,
30,
365,
18,
6208,
1435,
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,
1262,
907,
743,
12,
2890,
16,
20758,
16,
284,
7013,
273,
404,
4672,
309,
284,
7013,
30,
365,
18,
6208,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
bc.apply(printer) | def test_beziercurve2d(): bc = BezierCurve2D([(0,0,0),(4,2,0),(2,4,0),(4,6,0),(0,8,0)]) bc.apply(printer) eval_code(bc) | 5af742fb7bba9aa7cc5692e378c2cd775320b880 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/799/5af742fb7bba9aa7cc5692e378c2cd775320b880/test_pyprinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2196,
18377,
16683,
22,
72,
13332,
6533,
273,
4823,
18377,
9423,
22,
40,
3816,
12,
20,
16,
20,
16,
20,
3631,
12,
24,
16,
22,
16,
20,
3631,
12,
22,
16,
24,
16,
20,
3631,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2196,
18377,
16683,
22,
72,
13332,
6533,
273,
4823,
18377,
9423,
22,
40,
3816,
12,
20,
16,
20,
16,
20,
3631,
12,
24,
16,
22,
16,
20,
3631,
12,
22,
16,
24,
16,
20,
3631,
... | |
@authorize(h.auth.has_planetfeed_role) | @authorize(h.auth.has_organiser_role) | def partners_programme(self): """ List of partners programme contacts [Partners Programme] """ partners_list = meta.Session.query(Product).filter(Product.category.has(name = 'Partners Programme')).all() c.text = "*Checkin and checkout dates aren't an accurate source." c.columns = ['Partner Type', 'Qty', 'Registration Name', 'Registration e-mail', 'Partners name', 'Partners e-mail', 'Partners mobile', 'Checkin*', 'Checkout*'] c.data = [] for item in partners_list: for invoice_item in item.invoice_items: if invoice_item.invoice.paid() and not invoice_item.invoice.is_void(): c.data.append([item.description, invoice_item.qty, invoice_item.invoice.person.firstname + " " + invoice_item.invoice.person.lastname, invoice_item.invoice.person.email_address, invoice_item.invoice.person.registration.partner_name, invoice_item.invoice.person.registration.partner_email, invoice_item.invoice.person.registration.partner_mobile, invoice_item.invoice.person.registration.checkin, invoice_item.invoice.person.registration.checkout ]) return table_response() | 1e9c9c895105fc6397c08b702746c3e45ec1364c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12856/1e9c9c895105fc6397c08b702746c3e45ec1364c/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1087,
9646,
67,
12890,
3501,
12,
2890,
4672,
3536,
987,
434,
1087,
9646,
5402,
3501,
14841,
306,
1988,
9646,
13586,
3501,
65,
3536,
1087,
9646,
67,
1098,
273,
2191,
18,
2157,
18,
2271,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1087,
9646,
67,
12890,
3501,
12,
2890,
4672,
3536,
987,
434,
1087,
9646,
5402,
3501,
14841,
306,
1988,
9646,
13586,
3501,
65,
3536,
1087,
9646,
67,
1098,
273,
2191,
18,
2157,
18,
2271,
1... |
updated_acl_entry = self.doclist.Put( | updated_acl_entry = self.editClient.Put( | def testCreateAndUpdateAndDeleteAcl(self): # Add new ACL scope = gdata.docs.Scope(value=self.EMAIL, type=self.SCOPE_TYPE) role = gdata.docs.Role(value=self.ROLE_VALUE) | 6a1d41e0ebd05471e1aa915fdf0a98f4af4bce69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5609/6a1d41e0ebd05471e1aa915fdf0a98f4af4bce69/service_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1684,
1876,
1891,
1876,
2613,
13538,
12,
2890,
4672,
468,
1436,
394,
10098,
2146,
273,
314,
892,
18,
8532,
18,
3876,
12,
1132,
33,
2890,
18,
14686,
16,
618,
33,
2890,
18,
19444,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1684,
1876,
1891,
1876,
2613,
13538,
12,
2890,
4672,
468,
1436,
394,
10098,
2146,
273,
314,
892,
18,
8532,
18,
3876,
12,
1132,
33,
2890,
18,
14686,
16,
618,
33,
2890,
18,
19444,
... |
(status, o) = self.call ('GET', '/objects', query=query) | (status, o) = self.call('GET', '/objects', query=query) | def query (self, query): """Runs the query to get the IDs of objects satisfying the query. If the query is successful, the list of ids is returned, as a list; otherwise, an error code is returned. """ (status, o) = self.call ('GET', '/objects', query=query) return status if status != STATUS.OK else o['ids'] | e75848841ac96982524448e932e12fd6ff9cbe0c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12637/e75848841ac96982524448e932e12fd6ff9cbe0c/fdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
843,
261,
2890,
16,
843,
4672,
3536,
9361,
326,
843,
358,
336,
326,
7115,
434,
2184,
9281,
14946,
326,
843,
18,
971,
326,
843,
353,
6873,
16,
326,
666,
434,
3258,
353,
2106,
16,
487,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
843,
261,
2890,
16,
843,
4672,
3536,
9361,
326,
843,
358,
336,
326,
7115,
434,
2184,
9281,
14946,
326,
843,
18,
971,
326,
843,
353,
6873,
16,
326,
666,
434,
3258,
353,
2106,
16,
487,
... |
pkg_count = _pkg_count(packages) | pkg_count = len(packages) | def _sync(self): (self.options, self.args) = self.parser.parse_args() if not self.options.label: print("repo label required. Try --help") sys.exit(0) try: status = self.pconn.sync(self.options.label) if status: packages = self.pconn.packages(self.options.label) pkg_count = _pkg_count(packages) print _(" Sync Successful. Repo [ %s ] now has a total of [ %s ] packages" % (self.options.label, pkg_count)) except RestlibException, re: log.error("Error: %s" % re) systemExit(re.code, re.msg) except Exception, e: log.error("Error: %s" % e) raise | da073711866ef56507833c3a029ea1448c2ef911 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10692/da073711866ef56507833c3a029ea1448c2ef911/pulpcli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8389,
12,
2890,
4672,
261,
2890,
18,
2116,
16,
365,
18,
1968,
13,
273,
365,
18,
4288,
18,
2670,
67,
1968,
1435,
309,
486,
365,
18,
2116,
18,
1925,
30,
1172,
2932,
7422,
1433,
19... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8389,
12,
2890,
4672,
261,
2890,
18,
2116,
16,
365,
18,
1968,
13,
273,
365,
18,
4288,
18,
2670,
67,
1968,
1435,
309,
486,
365,
18,
2116,
18,
1925,
30,
1172,
2932,
7422,
1433,
19... |
self.control = os.path.abspath(control) | self.control = os.path.realpath(control) self._is_continuation = cont | def __init__(self, control, jobtag, cont, harness_type=None, use_external_logging = False, drop_caches=True): """ control The control file (pathname of) jobtag The job tag string (eg "default") cont If this is the continuation of this job harness_type An alternative server harness """ self.drop_caches = drop_caches if self.drop_caches: print "Dropping caches" autotest_utils.drop_caches() | d8f5b4be8c249feab4668edd5afd3af180dd0809 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/d8f5b4be8c249feab4668edd5afd3af180dd0809/job.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3325,
16,
1719,
2692,
16,
466,
16,
366,
1303,
403,
67,
723,
33,
7036,
16,
999,
67,
9375,
67,
11167,
273,
1083,
16,
3640,
67,
17703,
281,
33,
5510,
4672... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3325,
16,
1719,
2692,
16,
466,
16,
366,
1303,
403,
67,
723,
33,
7036,
16,
999,
67,
9375,
67,
11167,
273,
1083,
16,
3640,
67,
17703,
281,
33,
5510,
4672... |
self.treeviewEpisodes.append_column( gtk.TreeViewColumn( '', toggle_cell, active=self.COLUMN_TOGGLE)) | toggle_column = gtk.TreeViewColumn('', toggle_cell, active=self.COLUMN_TOGGLE) toggle_column.set_clickable(True) self.treeviewEpisodes.append_column(toggle_column) | def new( self): self._config.connect_gtk_window(self.gPodderEpisodeSelector, 'episode_selector', True) if not hasattr( self, 'callback'): self.callback = None | efb1f147f09c18fcf2f7b3878a6ac07f267cf038 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12778/efb1f147f09c18fcf2f7b3878a6ac07f267cf038/episodeselector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
12,
365,
4672,
365,
6315,
1425,
18,
3612,
67,
4521,
79,
67,
5668,
12,
2890,
18,
75,
5800,
765,
18918,
11802,
4320,
16,
296,
29687,
67,
9663,
2187,
1053,
13,
309,
486,
3859,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
12,
365,
4672,
365,
6315,
1425,
18,
3612,
67,
4521,
79,
67,
5668,
12,
2890,
18,
75,
5800,
765,
18918,
11802,
4320,
16,
296,
29687,
67,
9663,
2187,
1053,
13,
309,
486,
3859,
12,
... |
if not (replicas.has_key(se) and (replicas[se] == pfn)): return S_ERROR("This LFN is already registered with another SE/PFN") return S_OK(False) | if not ( replicas.has_key( se ) and ( replicas[se] == pfn ) ): return S_ERROR( "This LFN is already registered with another SE/PFN" ) return S_OK( False ) | def __checkAddFile(self,lfn,pfn,size,se,guid,checksum): res = self.__getPathStat(lfn) if not res['OK']: if res['Message'] != 'No such file or directory': return S_ERROR("Failed to find pre-existance of LFN") else: fstat = res['Value'] if fstat.guid != guid: return S_ERROR("This LFN is already registered with another GUID") if fstat.filesize != size: return S_ERROR("This LFN is already registered with another size") if fstat.csumvalue != checksum: return S_ERROR("This LFN is already registered with another adler32") res = self.__getFileReplicas(lfn,True) if not res['OK']: return S_ERROR("Failed to obtain replicas for existing LFN") replicas = res['Value'] if not (replicas.has_key(se) and (replicas[se] == pfn)): return S_ERROR("This LFN is already registered with another SE/PFN") return S_OK(False) try: size = long(size) except: return S_ERROR("The size of the file must be an 'int','long' or 'string'") if not se: return S_ERROR("The SE for the file was not supplied.") if not pfn: return S_ERROR("The PFN for the file was not supplied.") if not lfn: return S_ERROR("The LFN for the file was not supplied.") if not guid: return S_ERROR("The GUID for the file was not supplied.") if not checksum: return S_ERROR("The adler32 for the file was not supplied.") return S_OK(True) | 6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1893,
986,
812,
12,
2890,
16,
80,
4293,
16,
84,
4293,
16,
1467,
16,
307,
16,
14066,
16,
15149,
4672,
400,
273,
365,
16186,
588,
743,
5000,
12,
80,
4293,
13,
309,
486,
400,
3292... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1893,
986,
812,
12,
2890,
16,
80,
4293,
16,
84,
4293,
16,
1467,
16,
307,
16,
14066,
16,
15149,
4672,
400,
273,
365,
16186,
588,
743,
5000,
12,
80,
4293,
13,
309,
486,
400,
3292... |
csc.dtype.char = csc.data.dtype.char | csc.dtype = csc.data.dtype | def _imag(self): csc = self.tocsc() csc.data = imag(csc.data) csc.dtype.char = csc.data.dtype.char csc.ftype = _transtabl[csc.dtype.char] return csc | 755141cd47edbf647cfcd8d09fd47ede3320459c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/755141cd47edbf647cfcd8d09fd47ede3320459c/sparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
15374,
12,
2890,
4672,
276,
1017,
273,
365,
18,
1391,
1017,
1435,
276,
1017,
18,
892,
273,
8902,
12,
71,
1017,
18,
892,
13,
276,
1017,
18,
8972,
273,
276,
1017,
18,
892,
18,
897... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
15374,
12,
2890,
4672,
276,
1017,
273,
365,
18,
1391,
1017,
1435,
276,
1017,
18,
892,
273,
8902,
12,
71,
1017,
18,
892,
13,
276,
1017,
18,
8972,
273,
276,
1017,
18,
892,
18,
897... |
self.setTabOrder(self.display_compass_checkbox,self.display_origin_axis_checkbox) | self.setTabOrder(self.display_compass_checkbox,self.display_compass_labels_checkbox) self.setTabOrder(self.display_compass_labels_checkbox,self.display_origin_axis_checkbox) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) | c76684571da81fcba257f890746ab0f891e8a720 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/c76684571da81fcba257f890746ab0f891e8a720/UserPrefsDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2938,
273,
599,
16,
529,
273,
599,
16,
17638,
273,
374,
16,
2242,
273,
374,
4672,
2238,
6353,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
17638,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2938,
273,
599,
16,
529,
273,
599,
16,
17638,
273,
374,
16,
2242,
273,
374,
4672,
2238,
6353,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
17638,
... |
som1=hlr_test.generate_som() | som1 = hlr_test.generate_som() | def frequency_to_energy(obj,**kwargs): """ This function converts a primary axis of a SOM or SO from frequency to energy. The frequency axis for a SOM must be in units of THz. The primary axis of a SO is assumed to be in units of THz. A tuple of [frequency, frequency_err2] (assumed to be in units of THz) can be converted to [energy, energy_err2]. Parameters: ---------- -> obj is the SOM, SO or tuple to be converted -> kwargs is a list of key word arguments that the function accepts: units= a string containing the expected units for this function. The default for this function is THz Return: ------ <- A SOM or SO with a primary axis in energy or a tuple converted to energy Exceptions: ---------- <- TypeError is raised if the incoming object is not a type the function recognizes <- RuntimeError is raised if the SOM x-axis units are not THz """ # import the helper functions import hlr_utils # set up for working through data (result,res_descr)=hlr_utils.empty_result(obj) (o_descr,d_descr)=hlr_utils.get_descr(obj) # Setup keyword arguments try: units = kwargs["units"] except KeyError: units = "THz" # Primary axis for transformation. If a SO is passed, the function, will # assume the axis for transformation is at the 0 position if o_descr == "SOM": axis = hlr_utils.hlr_1D_units(obj, units) else: axis = 0 result=hlr_utils.copy_som_attr(result,res_descr,obj,o_descr) if o_descr == "SOM": result = hlr_utils.hlr_force_units(result, "meV", axis) result.setAxisLabel(axis, "energy transfer") result.setYUnits("Counts/meV") result.setYLabel("Intensity") else: pass # iterate through the values import axis_manip for i in range(hlr_utils.get_length(obj)): val = hlr_utils.get_value(obj,i,o_descr,"x",axis) err2 = hlr_utils.get_err2(obj,i,o_descr,"x",axis) value=axis_manip.frequency_to_energy(val, err2) map_so = hlr_utils.get_map_so(obj,None,i) hlr_utils.result_insert(result,res_descr,value,map_so,"x",axis) return result | a236c851290ad512721cd258e386f61f2599d46c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/a236c851290ad512721cd258e386f61f2599d46c/hlr_frequency_to_energy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8670,
67,
869,
67,
15358,
12,
2603,
16,
636,
4333,
4672,
3536,
1220,
445,
7759,
279,
3354,
2654,
434,
279,
348,
1872,
578,
7460,
628,
8670,
358,
12929,
18,
1021,
8670,
2654,
364,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8670,
67,
869,
67,
15358,
12,
2603,
16,
636,
4333,
4672,
3536,
1220,
445,
7759,
279,
3354,
2654,
434,
279,
348,
1872,
578,
7460,
628,
8670,
358,
12929,
18,
1021,
8670,
2654,
364,
279,
... |
self.Report=MetarReport lines=self.Report.fullreport.split("\n") | self.Report = MetarReport lines = self.Report.fullreport.split("\n") | def ParseReport(self, MetarReport=None): """Take report with raw info only and return it with in parsed values filled in. Note: This function edits the WeatherReport object you supply!""" if self.Report is None and MetarReport is None: raise EmptyReportException, \ "No report given on init and ParseReport()." elif MetarReport is not None: self.Report=MetarReport | fe1cdcd11658fbbfba6d30dfe37a2f9dfce6a1a8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4602/fe1cdcd11658fbbfba6d30dfe37a2f9dfce6a1a8/pymetar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
4820,
12,
2890,
16,
21604,
297,
4820,
33,
7036,
4672,
3536,
13391,
2605,
598,
1831,
1123,
1338,
471,
327,
518,
598,
316,
2707,
924,
6300,
316,
18,
3609,
30,
1220,
445,
24450,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
4820,
12,
2890,
16,
21604,
297,
4820,
33,
7036,
4672,
3536,
13391,
2605,
598,
1831,
1123,
1338,
471,
327,
518,
598,
316,
2707,
924,
6300,
316,
18,
3609,
30,
1220,
445,
24450,
326,
... |
entriesbygid.setdefault(e.gr_gid, []).append(e) entriesbyname.setdefault(e.gr_name, []).append(e) | def test_values(self): entries = grp.getgrall() entriesbygid = {} entriesbyname = {} | 10712bf02edf9dc6453a644a1361efdd2ba7215a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/10712bf02edf9dc6453a644a1361efdd2ba7215a/test_grp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2372,
12,
2890,
4672,
3222,
273,
14295,
18,
588,
3197,
454,
1435,
3222,
1637,
15780,
273,
2618,
3222,
1637,
529,
273,
2618,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2372,
12,
2890,
4672,
3222,
273,
14295,
18,
588,
3197,
454,
1435,
3222,
1637,
15780,
273,
2618,
3222,
1637,
529,
273,
2618,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
m=param_re.match(challenge) | m=_param_re.match(challenge) | def _final_challenge(self,challenge): """Process the second challenge from the server and return the response. :Parameters: - `challenge`: the challenge from server. :Types: - `challenge`: `str` :return: the response or a failure indicator. :returntype: `sasl.Response` or `sasl.Failure`""" if self.rspauth_checked: return Failure("extra-challenge") challenge=challenge.split('\x00')[0] rspauth=None while challenge: m=param_re.match(challenge) if not m: self.__logger.debug("Challenge syntax error: %r" % (challenge,)) return Failure("bad-challenge") challenge=m.group("rest") var=m.group("var") val=m.group("val") self.__logger.debug("%r: %r" % (var,val)) if var=="rspauth": rspauth=val if not rspauth: self.__logger.debug("Final challenge without rspauth") return Failure("bad-success") if rspauth==self.response_auth: self.rspauth_checked=1 return Response("") else: self.__logger.debug("Wrong rspauth value - peer is cheating?") self.__logger.debug("my rspauth: %r" % (self.response_auth,)) return Failure("bad-success") | 1e1db4225095c220966b09e2e9bd16f3ebaf7760 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12769/1e1db4225095c220966b09e2e9bd16f3ebaf7760/digest_md5.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6385,
67,
25092,
12,
2890,
16,
25092,
4672,
3536,
2227,
326,
2205,
12948,
628,
326,
1438,
471,
327,
326,
766,
18,
225,
294,
2402,
30,
300,
1375,
25092,
68,
30,
326,
12948,
628,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6385,
67,
25092,
12,
2890,
16,
25092,
4672,
3536,
2227,
326,
2205,
12948,
628,
326,
1438,
471,
327,
326,
766,
18,
225,
294,
2402,
30,
300,
1375,
25092,
68,
30,
326,
12948,
628,
14... |
self.file=file self.path=path | self.file = file self.path = path | def __init__(self, file, path): | b7e7a72c1344601dbf61dee6f050b0b59093e02b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/b7e7a72c1344601dbf61dee6f050b0b59093e02b/tempfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
585,
16,
589,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
585,
16,
589,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'\\documentclass{article}\\usepackage{fullpage}\\usepackage{amsmath}\n\\usepackage{amssymb}\n\\usepackage{amsfonts}\\usepackage{graphicx}\\usepackage{pstricks}\\pagestyle{empty}\n\n\\begin{document}\n\\begin{center}{\\Large\\bf Why was six afraid of seven?}\\end{center}\n\\vspace{40mm}\\[7\\]\n\n\\vfill\\hrule\\vfill\n\n\\[8\\]\n\n\\vfill\\hrule\\vfill\n\n\\[9\\]\n\\end{document}' """ | '\\documentclass{article}\\usepackage{fullpage}\\usepackage{amsmath}\n\\usepackage{amssymb}\n\\usepackage{amsfonts}\\usepackage{graphicx}\\usepackage{pstricks}\\pagestyle{empty}\n\n\n\\newcommand{\\ZZ}{\\mathbf{Z}}\n\\newcommand{\\RR}{\\mathbf{R}}\n\\newcommand{\\CC}{\\mathbf{C}}\n\\newcommand{\\QQ}{\\mathbf{Q}}\n\\newcommand{\\QQbar}{\\overline{\\mathbf{Q}}}\n\\newcommand{\\GF}[1]{\\mathbf{F}_{ """ from sage.misc.latex_macros import sage_latex_macros MACROS="\n" + "\n".join(sage_latex_macros) + "\n" | def _latex_file_(objects, title='SAGE', debug=False, \ sep='', tiny=False, math_left='\\[', math_right='\\]', extra_preamble=''): r"""nodetex Produce a string to be used as a LaTeX file, containing a representation of each object in objects. INPUT: - ``objects`` - list (or object) - ``title`` - string (default: 'Sage'): title for the document - ``math_left`` - string (default: '\\['), left delimiter for math mode - ``math_right`` - string (default: '\\]'), right delimiter for math mode - ``debug`` - bool (default: False): print verbose output - ``sep`` - string (default: ''): separator between math objects - ``tiny`` - bool (default: False): use 'tiny' font. - ``extra_preamble`` - string (default: ''): extra LaTeX commands, inserted before "\\begin{document}" This creates a string intended to be a LaTeX file containing the LaTeX representations of objects. It contains the following: - a header (with documentclass and usepackage commands) - ``extra_preamble`` - the title (centered) - a size specification if ``tiny`` is True - LaTeX representation of the first element of ``objects``, surrounded by ``math_left`` and ``math_right`` Then if ``objects`` contains more than one element, for each remaining element: - the string ``sep``: you can use this, for example, to add vertical space between objects with ``sep='\\vspace{15mm}'``, or to add a horizontal line between objects with ``sep='\\hrule'``, or to insert a page break between objects with ``sep='\\newpage'``. - the LaTeX representation of the element The string ends with '\\end{document}'. EXAMPLES:: sage: from sage.misc.latex import _latex_file_ sage: _latex_file_(3, title="The number three") '\\documentclass{article}\\usepackage{fullpage}\\usepackage{amsmath}\n\\usepackage{amssymb}\n\\usepackage{amsfonts}\\usepackage{graphicx}\\usepackage{pstricks}\\pagestyle{empty}\n\n\\begin{document}\n\\begin{center}{\\Large\\bf The number three}\\end{center}\n\\vspace{40mm}\\[3\\]\n\\end{document}' sage: _latex_file_([7, 8, 9], title="Why was six afraid of seven?", sep='\\vfill\\hrule\\vfill') '\\documentclass{article}\\usepackage{fullpage}\\usepackage{amsmath}\n\\usepackage{amssymb}\n\\usepackage{amsfonts}\\usepackage{graphicx}\\usepackage{pstricks}\\pagestyle{empty}\n\n\\begin{document}\n\\begin{center}{\\Large\\bf Why was six afraid of seven?}\\end{center}\n\\vspace{40mm}\\[7\\]\n\n\\vfill\\hrule\\vfill\n\n\\[8\\]\n\n\\vfill\\hrule\\vfill\n\n\\[9\\]\n\\end{document}' """ process = True if hasattr(objects, '_latex_'): objects = [objects] if hasattr(objects, '__doc__') and hasattr(objects, 'func_name'): process = False title = "\\begin{verbatim}%s\\end{verbatim}"%objects.func_name objects = [objects.__doc__] if not isinstance(objects, list): objects = [objects] if tiny: size='\\tiny\n' else: size='' s = LATEX_HEADER s += '%s\n\\begin{document}\n\\begin{center}{\\Large\\bf %s}\\end{center}\n%s'%( extra_preamble, title, size) #s += "(If something is missing it may be on the next page or there may be errors in the latex. Use view with {\\tt debug=True}.)\\vfill" s += '\\vspace{40mm}' if process: for i in range(len(objects)): x = objects[i] L = latex(x) if not '\\begin{verbatim}' in L: s += '%s%s%s'%(math_left, latex(x), math_right) else: s += '%s'%latex(x) if i < len(objects)-1: s += '\n\n%s\n\n'%sep else: s += "\n\n".join([str(x) for x in objects]) s += '\n\\end{document}' if debug: print s return s | 91af508cdde1069384f708697df18a9a4ea2968c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/91af508cdde1069384f708697df18a9a4ea2968c/latex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
26264,
67,
768,
67,
12,
6911,
16,
2077,
2218,
55,
2833,
2187,
1198,
33,
8381,
16,
521,
5478,
2218,
2187,
24405,
33,
8381,
16,
4233,
67,
4482,
2218,
1695,
63,
2187,
4233,
67,
4083,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26264,
67,
768,
67,
12,
6911,
16,
2077,
2218,
55,
2833,
2187,
1198,
33,
8381,
16,
521,
5478,
2218,
2187,
24405,
33,
8381,
16,
4233,
67,
4482,
2218,
1695,
63,
2187,
4233,
67,
4083,... |
self.action['domain'] or '[]') | self.action['pyson_domain']) | def __init__(self, window, attrs=None): self.act_id = int(attrs['name']) self._window = window self.screen = None self.tree = None | eeb0c8c8fb0f2e1e50e9efcf641ff30642e4e8fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9151/eeb0c8c8fb0f2e1e50e9efcf641ff30642e4e8fa/action.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2742,
16,
3422,
33,
7036,
4672,
365,
18,
621,
67,
350,
273,
509,
12,
7039,
3292,
529,
19486,
365,
6315,
5668,
273,
2742,
365,
18,
9252,
273,
599,
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,
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,
2742,
16,
3422,
33,
7036,
4672,
365,
18,
621,
67,
350,
273,
509,
12,
7039,
3292,
529,
19486,
365,
6315,
5668,
273,
2742,
365,
18,
9252,
273,
599,
365,
... |
t1 = QCanvasText (str(dist[ind][v]), self) | t1 = QCanvasText ("%i (%2.1f %%)" % (dist[ind][v], 100*dist[ind][v]/(len(data) or 1)), self) | def displayStat(self, data, ind, dist): if not data: return attr = data.domain[ind] attr_name = QCanvasText (attr.name, self) attr_name.move(10, 10) attr_name.show() title_str = "Category" if attr.varType == orange.VarTypes.Continuous: title_str = "Values" category = QCanvasText (title_str, self) category.move(self.hbias-20, 30) category.setTextFlags(Qt.AlignRight) category.show() | f6689f5082dfc572890d208ac104a0f4c27d0fec /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/f6689f5082dfc572890d208ac104a0f4c27d0fec/OWAttributeStatistics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
5000,
12,
2890,
16,
501,
16,
1547,
16,
2411,
4672,
309,
486,
501,
30,
327,
225,
1604,
273,
501,
18,
4308,
63,
728,
65,
1604,
67,
529,
273,
2238,
12971,
1528,
261,
1747,
18,
529... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
5000,
12,
2890,
16,
501,
16,
1547,
16,
2411,
4672,
309,
486,
501,
30,
327,
225,
1604,
273,
501,
18,
4308,
63,
728,
65,
1604,
67,
529,
273,
2238,
12971,
1528,
261,
1747,
18,
529... |
ca.pluralequation ='(n != 1)' | ca.pluralequation = '(n != 1)' | def create_default_languages(): from pootle_app.core import Language af = Language(code="af") af.fullname = u"Afrikaans" af.specialchars = u"ëïêôûáéíóúý" af.nplurals = '2' af.pluralequation = "(n != 1)" af.save() | 705dd9e8bba1245496893550d0b060f0049a0893 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11388/705dd9e8bba1245496893550d0b060f0049a0893/initdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
1886,
67,
14045,
13332,
628,
293,
1632,
298,
67,
2910,
18,
3644,
1930,
9889,
225,
10073,
273,
9889,
12,
710,
1546,
1727,
7923,
10073,
18,
21885,
273,
582,
6,
12664,
566,
7282,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
1886,
67,
14045,
13332,
628,
293,
1632,
298,
67,
2910,
18,
3644,
1930,
9889,
225,
10073,
273,
9889,
12,
710,
1546,
1727,
7923,
10073,
18,
21885,
273,
582,
6,
12664,
566,
7282,
... |
self.log.exception("Failed to schedule or activate %s" % (inst.name)) | if (inst.name not in muffle): self.log.exception("Failed to schedule or activate %s" % (inst.name)) muffle[inst.name] = True | def start(self): oldInstances = {} muffle = {} while True: try: # Generate a list of VMs/host hosts = {} load = {} for h in self.client.getHosts(): hosts[h.id] = h load[h.id] = [] load[None] = [] _instances = self.client.getInstances() instances = {} for i in _instances: instances[i.id] = i for i in instances.itervalues(): if (i.hostId or i.state == InstanceState.Pending): load[i.hostId] = load[i.hostId] + [i.id] # Check for VMs that have exited for i in oldInstances: if (i not in instances): for hook in self.hooks: hook.postDestroy(oldInstances[i]) # Schedule new VMs oldInstances = instances if (len(load.get(None, [])) > 0): for i in load[None]: inst = instances[i] try: minMax = None minMaxHost = None targetHost = inst.hints.get("targetHost", None) try: allowElsewhere = boolean(inst.hints.get("allowElsewhere", "False")) except Exception, e: allowElsewhere = False if (targetHost != None): for h in hosts.values(): if ((str(h.id) == targetHost or h.name == targetHost)): if (h.up == True and h.state == HostState.Normal): memUsage = reduce(lambda x, y: x + instances[y].memory, load[h.id], inst.memory) coreUsage = reduce(lambda x, y: x + instances[y].cores, load[h.id], inst.cores) if (memUsage <= h.memory and coreUsage <= h.cores): minMax = len(load[h.id]) minMaxHost = h if ((targetHost == None or allowElsewhere) and minMaxHost == None): for h in hosts.values(): if (h.up == True and h.state == HostState.Normal): if (minMax is None or (self.densePack and len(load[h.id]) > minMax) or (not self.densePack and len(load[h.id]) < minMax)): memUsage = reduce(lambda x, y: x + instances[y].memory, load[h.id], inst.memory) coreUsage = reduce(lambda x, y: x + instances[y].cores, load[h.id], inst.cores) if (memUsage <= h.memory and coreUsage <= h.cores): minMax = len(load[h.id]) minMaxHost = h if (minMaxHost): if (not inst.hints.get("__resume_source", None)): for hook in self.hooks: hook.preCreate(inst) self.log.info("Scheduling instance %s (%d mem, %d cores, %d uid) on host %s" % (inst.name, inst.memory, inst.cores, inst.userId, minMaxHost.name)) self.client.activateVm(i, minMaxHost) load[minMaxHost.id] = load[minMaxHost.id] + [i] muffle.clear() else: if (inst.name not in muffle): self.log.info("Failed to find a suitable place to schedule %s" % (inst.name)) muffle[inst.name] = True except Exception, e: self.log.exception("Failed to schedule or activate %s" % (inst.name)) time.sleep(self.scheduleDelay) except TashiException, e: self.log.exception("Tashi exception") time.sleep(self.scheduleDelay) except Exception, e: self.log.exception("General exception") time.sleep(self.scheduleDelay) | be978030818815145cb6b6415a050f79d76ced19 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5161/be978030818815145cb6b6415a050f79d76ced19/primitive.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
4672,
1592,
5361,
273,
2618,
312,
10148,
273,
2618,
1323,
1053,
30,
775,
30,
468,
6654,
279,
666,
434,
776,
6947,
19,
2564,
7206,
273,
2618,
1262,
273,
2618,
364,
366,
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,
787,
12,
2890,
4672,
1592,
5361,
273,
2618,
312,
10148,
273,
2618,
1323,
1053,
30,
775,
30,
468,
6654,
279,
666,
434,
776,
6947,
19,
2564,
7206,
273,
2618,
1262,
273,
2618,
364,
366,
3... |
for (oldPath, newPath) in self.renames: | for (oldPath, newPath, msg) in self.renames: | def apply(self): | 9e9969f45daafddcbb99e4e9dc5b3d6042825259 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/9e9969f45daafddcbb99e4e9dc5b3d6042825259/update.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
edges = Set() | edges = set() | def import_graph(modules, docindex, linker, context=None, **options): graph = DotGraph('Import Graph for %s' % name_list(modules), node_defaults={'shape':'box', 'width': 0, 'height': 0}, edge_defaults={'sametail':True}) # Options if options.get('dir', 'RL') != 'TB': # default: right-to-left. graph.body += 'rankdir=%s\n' % options.get('dir', 'RL') # Add a node for each module. nodes = add_valdoc_nodes(graph, modules, linker, context) # Edges. edges = Set() for dst in modules: if dst.imports in (None, UNKNOWN): continue for var_name in dst.imports: for i in range(len(var_name), 0, -1): val_doc = docindex.get_valdoc(DottedName(*var_name[:i])) if isinstance(val_doc, ModuleDoc): if val_doc in nodes and dst in nodes: edges.add((nodes[val_doc], nodes[dst])) break graph.edges = [DotGraphEdge(src,dst) for (src,dst) in edges] return graph | 8ef87f79a31bd78539934474395f14d31c533ab2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/8ef87f79a31bd78539934474395f14d31c533ab2/dotgraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
4660,
12,
6400,
16,
997,
1615,
16,
28058,
16,
819,
33,
7036,
16,
2826,
2116,
4672,
2667,
273,
17502,
4137,
2668,
5010,
5601,
364,
738,
87,
11,
738,
508,
67,
1098,
12,
6400,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
4660,
12,
6400,
16,
997,
1615,
16,
28058,
16,
819,
33,
7036,
16,
2826,
2116,
4672,
2667,
273,
17502,
4137,
2668,
5010,
5601,
364,
738,
87,
11,
738,
508,
67,
1098,
12,
6400,
... |
return map(lambda element: element[5:], commands) | return map(self._get_cmd_name, commands) | def _get_cmd_list(self): """Returns a list of all known commands""" # find all command functions commands = filter(lambda element: element.startswith('_cmd_'), ConsoleIFace.__dict__.keys()) # strip the prefix from command functions return map(lambda element: element[5:], commands) | f24f12b48a571183e88090f9b172a58c7473e935 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2215/f24f12b48a571183e88090f9b172a58c7473e935/tel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
4172,
67,
1098,
12,
2890,
4672,
3536,
1356,
279,
666,
434,
777,
4846,
4364,
8395,
468,
1104,
777,
1296,
4186,
4364,
273,
1034,
12,
14661,
930,
30,
930,
18,
17514,
1918,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
4172,
67,
1098,
12,
2890,
4672,
3536,
1356,
279,
666,
434,
777,
4846,
4364,
8395,
468,
1104,
777,
1296,
4186,
4364,
273,
1034,
12,
14661,
930,
30,
930,
18,
17514,
1918,
2... |
if 'debugcount' not in form: raise ValueError('You must provide a debugcount parameter') debugcount = form.pop('debugcount') try: debugcount = int(debugcount) except ValueError: raise ValueError('Bad value for debugcount') if debugcount not in self.debug_infos: raise ValueError( 'Debug %s no longer found (maybe it has expired?)' % debugcount) debug_info = self.debug_infos[debugcount] return func(self, debug_info=debug_info, **form) except ValueError, e: form['headers']['status'] = '500 Server Error' return '<html>There was an error: %s</html>' % html_quote(e) | debugcount = int(debugcount) except ValueError: raise ValueError('Bad value for debugcount') if debugcount not in self.debug_infos: raise ValueError( 'Debug %s no longer found (maybe it has expired?)' % debugcount) debug_info = self.debug_infos[debugcount] return func(self, debug_info=debug_info, **form) | def debug_info_replacement(self, **form): try: if 'debugcount' not in form: raise ValueError('You must provide a debugcount parameter') debugcount = form.pop('debugcount') try: debugcount = int(debugcount) except ValueError: raise ValueError('Bad value for debugcount') if debugcount not in self.debug_infos: raise ValueError( 'Debug %s no longer found (maybe it has expired?)' % debugcount) debug_info = self.debug_infos[debugcount] return func(self, debug_info=debug_info, **form) except ValueError, e: form['headers']['status'] = '500 Server Error' return '<html>There was an error: %s</html>' % html_quote(e) | bfceb7aa266724f818b7696526816d18411f0d39 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12946/bfceb7aa266724f818b7696526816d18411f0d39/middleware.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
67,
1376,
67,
24394,
12,
2890,
16,
2826,
687,
4672,
775,
30,
309,
296,
4148,
1883,
11,
486,
316,
646,
30,
1002,
2068,
2668,
6225,
1297,
5615,
279,
1198,
1883,
1569,
6134,
1198,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
67,
1376,
67,
24394,
12,
2890,
16,
2826,
687,
4672,
775,
30,
309,
296,
4148,
1883,
11,
486,
316,
646,
30,
1002,
2068,
2668,
6225,
1297,
5615,
279,
1198,
1883,
1569,
6134,
1198,
1... |
def copy(self): """ Returns an instance of Database with default mutable=True. """ new_loc = tmp_filename() + '.db' os.system('cp '+ self.__dblocation__ + ' ' + new_loc) D = SQLDatabase(filename=new_loc, skeleton=copy(self.__skeleton__)) return D def save(self, filename): """ ROBERT : Read the following e.g.'s carefully. You might want to change them before distributing (i.e. os.system('rm '+save_loc)) But this should be a good intro to a bunch of functionality. (I mostly put it in for you). It covers creating a mutable db, saving it and opening it as an immutable db. Then it shows modification and the new awesome show method. (This is my most recent example - the show method is probably better than getting a cursor each time for the doctests so I wanted to put it in since I typically did that the other way -- i.e.: delete_rows method examples). EXAMPLES: sage: from sage.databases.db import DB_HOME sage: save_loc = DB_HOME + 'simon.db' sage: DB = SQLDatabase() sage: DB.create_table('simon',{'a1':{'sql':'bool','primary_key':False}, 'b2':{'sql':'int', 'primary_key':False}}) sage: DB.add_data('simon',[(0,0),(1,1),(1,2)]) sage: DB.save(save_loc) sage: immut = GenericSQLDatabase(save_loc) sage: immut.show('simon') a1 b2 ---------------------------------------- 0 0 1 1 1 2 sage: DB.show('simon') a1 b2 ---------------------------------------- 0 0 1 1 1 2 sage: p = SQLQuery(DB, {'table_name':'simon', 'display_cols':'b2', 'dillhole':['b2','>', 0]}) sage: DB.delete_rows(p) sage: DB.show('simon') a1 b2 ---------------------------------------- 0 0 sage: immut.show('simon') a1 b2 ---------------------------------------- 0 0 1 1 1 2 sage: import os sage: os.system('rm ' + save_loc) """ try: self.__connection__.execute('commit') except: pass os.system('cp ' + self.__dblocation__ + ' ' + filename) | def copy(self): """ Returns an instance of Database with default mutable=True. """ # copy .db file new_loc = tmp_filename() + '.db' os.system('cp '+ self.__dblocation__ + ' ' + new_loc) D = SQLDatabase(filename=new_loc, skeleton=copy(self.__skeleton__)) return D | 12098d45ba68813e42a6a22032a2f2e6d360e158 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/12098d45ba68813e42a6a22032a2f2e6d360e158/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
4672,
3536,
2860,
392,
791,
434,
5130,
598,
805,
16074,
33,
5510,
18,
3536,
468,
1610,
263,
1966,
585,
394,
67,
1829,
273,
1853,
67,
3459,
1435,
397,
2418,
1966,
11,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
4672,
3536,
2860,
392,
791,
434,
5130,
598,
805,
16074,
33,
5510,
18,
3536,
468,
1610,
263,
1966,
585,
394,
67,
1829,
273,
1853,
67,
3459,
1435,
397,
2418,
1966,
11,
11... | |
r = self.readline(msg + ' ') | r = self._readline(msg + ' ') | def prompt(self, msg, pat=None, default="y", matchflags=0): if not self.interactive: return default try: r = self.readline(msg + ' ') if not pat or re.match(pat, r, matchflags): return r else: self.write(_("unrecognized response\n")) except EOFError: raise util.Abort(_('response expected')) | 7a409e54e91b9b7ffcdf89aef215de5470295aeb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/7a409e54e91b9b7ffcdf89aef215de5470295aeb/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6866,
12,
2890,
16,
1234,
16,
9670,
33,
7036,
16,
805,
1546,
93,
3113,
845,
7133,
33,
20,
4672,
309,
486,
365,
18,
24761,
30,
327,
805,
775,
30,
436,
273,
365,
6315,
896,
1369,
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,
6866,
12,
2890,
16,
1234,
16,
9670,
33,
7036,
16,
805,
1546,
93,
3113,
845,
7133,
33,
20,
4672,
309,
486,
365,
18,
24761,
30,
327,
805,
775,
30,
436,
273,
365,
6315,
896,
1369,
12,
... |
data[rownum] = tuple(line) | first_list.append(line) | def genfromdta(fname, excludelist=None, missing_flt=-999., missing_str=""): """ Returns an ndarray from a Stata .dta file. Parameters ---------- fname missing_values excludelist missing_flt missing_str """ | 73ad5e7974b9a18985ca336431deb4d3086d92a7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12658/73ad5e7974b9a18985ca336431deb4d3086d92a7/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
2080,
72,
2351,
12,
12749,
16,
4687,
1100,
5449,
33,
7036,
16,
3315,
67,
31864,
29711,
11984,
12990,
3315,
67,
701,
1546,
6,
4672,
3536,
2860,
392,
8304,
628,
279,
934,
396,
263,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
2080,
72,
2351,
12,
12749,
16,
4687,
1100,
5449,
33,
7036,
16,
3315,
67,
31864,
29711,
11984,
12990,
3315,
67,
701,
1546,
6,
4672,
3536,
2860,
392,
8304,
628,
279,
934,
396,
263,
... |
fullname_last_dot_postition = fullname.rfind(".") | if fullname.endswith(".gz"): fullname_last_dot_postition = fullname[:-3].rfind(".") else: fullname_last_dot_postition = fullname.rfind(".") | def BuildFileList(self): """lists all files attached to the bibdoc""" self.docfiles = [] if os.path.exists(self.basedir): for fil in os.listdir(self.basedir): if fil != ".recid" and fil != ".docid" and fil != "." and fil != "..": filepath = "%s/%s" % (self.basedir,fil) fileversion = re.sub(".*;","",fil) fullname = fil.replace(";%s" % fileversion,"") fullname_last_dot_postition = fullname.rfind(".") if fullname_last_dot_postition == -1: fullname_basename = fullname fullname_extension = "" else: fullname_basename = fullname[:fullname_last_dot_postition] fullname_extension = fullname[fullname_last_dot_postition+1:] self.docfiles.append(BibDocFile(filepath,self.type,fileversion,fullname_basename,fullname_extension,self.id)) | 3e557930fa96c3176d96cb62b226f318f8de6ff8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/3e557930fa96c3176d96cb62b226f318f8de6ff8/file.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3998,
26098,
12,
2890,
4672,
3536,
9772,
777,
1390,
7495,
358,
326,
25581,
2434,
8395,
365,
18,
2434,
2354,
273,
5378,
309,
1140,
18,
803,
18,
1808,
12,
2890,
18,
31722,
4672,
364,
661,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3998,
26098,
12,
2890,
4672,
3536,
9772,
777,
1390,
7495,
358,
326,
25581,
2434,
8395,
365,
18,
2434,
2354,
273,
5378,
309,
1140,
18,
803,
18,
1808,
12,
2890,
18,
31722,
4672,
364,
661,
... |
self._trackPathCache[path] = track self._trackPathList.append(path) | if path not in self._trackPathCache: self._trackPathCache[path] = track self._trackPathList.append(path) else: assert track is self._trackPathCache[path] | def addTrackToCache(self, track): self._logger.debug("Adding track to cache.") if len(self._trackCache) > 10000: del self._trackCache[self._trackIDList.pop(0)] id = track.getID() self._trackCache[id] = track self._trackIDList.append(id) | 13ec90dbe732a7182949fb565abae8ffbcffc86e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8545/13ec90dbe732a7182949fb565abae8ffbcffc86e/Track.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
4402,
774,
1649,
12,
2890,
16,
3298,
4672,
365,
6315,
4901,
18,
4148,
2932,
13962,
3298,
358,
1247,
1199,
13,
309,
562,
12,
2890,
6315,
4101,
1649,
13,
405,
12619,
30,
1464,
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,
527,
4402,
774,
1649,
12,
2890,
16,
3298,
4672,
365,
6315,
4901,
18,
4148,
2932,
13962,
3298,
358,
1247,
1199,
13,
309,
562,
12,
2890,
6315,
4101,
1649,
13,
405,
12619,
30,
1464,
365,
... |
EXAMPLES:: indirect doctest sage: for z in FormalSum([(1,2), (5, 'a'), (-3, 7)]): print z (5, 'a') | EXAMPLES:: sage: for z in FormalSum([(1,2), (5, 1000), (-3, 7)]): print z | def __iter__(self): """ EXAMPLES:: indirect doctest | f694767c840c72be7302e5a460f8f17135b3051a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f694767c840c72be7302e5a460f8f17135b3051a/formal_sum.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
3536,
5675,
8900,
11386,
2866,
4202,
16807,
31263,
395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
3536,
5675,
8900,
11386,
2866,
4202,
16807,
31263,
395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
<body bgcolor=" <body bgcolor=" | <body bgcolor=" <body bgcolor=" | def reset(): """Return a string that resets the CGI and browser to a known state.""" return '''<!--: spam | 09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
13332,
3536,
990,
279,
533,
716,
20063,
326,
385,
13797,
471,
4748,
358,
279,
4846,
919,
12123,
327,
9163,
5586,
413,
30,
24824,
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,
0,
0,
0,
0,
0,
0,
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,
2715,
13332,
3536,
990,
279,
533,
716,
20063,
326,
385,
13797,
471,
4748,
358,
279,
4846,
919,
12123,
327,
9163,
5586,
413,
30,
24824,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
shutil.rmtree(os.path.join(destdir, modname, 'build')) shutil.rmtree(os.path.join(destdir, modname, modname+'.egg-info')) | shutil.rmtree(os.path.join(pkgdir, modname, 'build')) shutil.rmtree(os.path.join(pkgdir, modname, modname+'.egg-info')) | def mod2egg(argv, groups= { 'openmdao.component': Component, 'openmdao.driver': Driver, #'openmdao.case_iterator': CaseIterator, #'openmdao.resource_allocator': ResourceAllocator, 'openmdao.trait': TraitType }): parser = OptionParser() parser.usage = "mod2egg.py [options] <module_name>" parser.add_option("-v","--version", action="store", type="string", dest="version", help="specify the version number (label) for the egg") parser.add_option("-d","--dest", action="store", type="string", dest="dest", help="specify the destination directory for the egg") parser.add_option("","--desc", action="store", type="string", dest="desc", help="specify a description for the egg") parser.add_option("-a","--author", action="store", type="string", dest="author", help="specify the author of the egg") parser.add_option("-e","--email", action="store", type="string", dest="author_email", help="specify a contact email for the egg") parser.add_option("-i","--install_dir", action="store", type="string", dest="install_dir", help="install the egg in the specified directory") parser.add_option("-l","--license", action="store", type="string", dest="license", help="specify a license for all files in the egg") parser.add_option("-u","--url", action="store", type="string", dest="url", help="specify URL of the web page for the egg") parser.add_option("-z","--zipped_egg", action="store_true", dest="zipped", default=False, help="egg is zip safe") parser.add_option("","--verbose", action="store_true", dest="verbose", default=False, help="generate verbose output while building") parser.add_option("-k","--keep", action="store_true", dest="keep", default=False, help="keep the package directory structure used to build the egg") parser.add_option("-n","--noegg", action="store_true", dest="noegg", default=False, help="don't actually build an egg") (options, args) = parser.parse_args(argv) if len(args) == 0: raise Mod2EggError('No module specified', parser) elif len(args) > 1: raise Mod2EggError('Only one module is allowed', parser) if not os.path.exists(args[0]): raise Mod2EggError("module %s does not exist" % args[0], parser) if not args[0].endswith('.py'): raise Mod2EggError("%s is not a python module" % args[0], parser) if not options.version: raise Mod2EggError("distribution version has not been specified", parser) modname = os.path.basename(os.path.splitext(args[0])[0]) modpath = os.path.abspath(os.path.dirname(args[0])) old_sys_path = copy.copy(sys.path) old_sys_modules = sys.modules.copy() sys.path = [modpath]+sys.path if options.install_dir: if not os.path.isdir(options.install_dir): raise Mod2EggError("install directory %s does not exist\n" % options.install_dir) ename = _find_egg([options.install_dir], modname, options.version) # be a little extra paranoid about accidental overwriting of an # egg without updating its version if ename: raise Mod2EggError("egg %s already exists in directory %s" %\ (ename, os.path.abspath(options.install_dir))) if os.path.isabs(options.install_dir): idir_abs = options.install_dir else: idir_abs = os.path.join(os.getcwd(), options.install_dir) else: idir_abs = None destdir = options.dest or os.getcwd() destdir = os.path.abspath(destdir) if options.keep: pkgdir = destdir else: pkgdir = tempfile.mkdtemp() ename = _find_egg([destdir], modname, options.version) # be a little extra paranoid about accidental overwriting of an # egg without updating its version if ename: raise Mod2EggError("egg %s already exists in directory %s" %\ (ename, os.path.abspath(destdir))) mod = __import__(modname) plugins = groups.copy() for name in plugins.keys(): plugins[name] = [] othermods = set() # find any classes in the module so we can see if they're # OpenMDAO plugin types for name, val in inspect.getmembers(mod): valmod = inspect.getmodule(val) if inspect.isclass(val): if valmod is mod: for gname, klass in groups.items(): if issubclass(val, klass): plugins[gname].append(name) if valmod is not None and valmod is not mod and valmod.__name__ is not None: othermods.add(valmod.__name__) # for each module imported by our module, find the distrib that contains it depends = set() for omod in othermods: found = False for dist in pkg_resources.working_set: path = omod.replace('.','/') for ext in ['.py','.pyc','.pyd']: fname = path+ext try: if dist.has_resource(fname): depends.add(str(dist.as_requirement())) found = True break except AttributeError: pass # some stdlib dists barf when has_resource is called if found: break # now put sys.path and sys.modules back to the way they were sys.path = old_sys_path sys.modules = old_sys_modules orig_dir = os.getcwd() # create package dir os.makedirs(os.path.join(pkgdir, modname, modname)) os.chdir(os.path.join(pkgdir, modname)) # create the entry point dict entrypts = {} try: for group,pulist in plugins.items(): if len(pulist) > 0: if group not in entrypts: entrypts[group] = [] for pu in pulist: entrypts[group].append('%s = %s:%s' % (pu,modname,pu)) setup_template = ''' | 503a7075cfdfdc284e9773abbfacdb036627556e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12610/503a7075cfdfdc284e9773abbfacdb036627556e/mod2egg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
681,
22,
23171,
12,
19485,
16,
3252,
33,
288,
296,
3190,
1264,
6033,
18,
4652,
4278,
5435,
16,
296,
3190,
1264,
6033,
18,
7407,
4278,
9396,
16,
25767,
3190,
1264,
6033,
18,
3593,
67,
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,
681,
22,
23171,
12,
19485,
16,
3252,
33,
288,
296,
3190,
1264,
6033,
18,
4652,
4278,
5435,
16,
296,
3190,
1264,
6033,
18,
7407,
4278,
9396,
16,
25767,
3190,
1264,
6033,
18,
3593,
67,
9... |
return get_node_title('event_types', id) | return self.get_node_title('event_types', id) | def getEventTypeTitle(self, id): """ Return the title of an item for the selection list for event types. """ return get_node_title('event_types', id) | ac0f3b2c1a95eeb647ea1882afc24b29bb2fd23a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/ac0f3b2c1a95eeb647ea1882afc24b29bb2fd23a/NySite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9832,
559,
4247,
12,
2890,
16,
612,
4672,
3536,
2000,
326,
2077,
434,
392,
761,
364,
326,
4421,
666,
364,
871,
1953,
18,
3536,
327,
336,
67,
2159,
67,
2649,
2668,
2575,
67,
2352,
2187,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9832,
559,
4247,
12,
2890,
16,
612,
4672,
3536,
2000,
326,
2077,
434,
392,
761,
364,
326,
4421,
666,
364,
871,
1953,
18,
3536,
327,
336,
67,
2159,
67,
2649,
2668,
2575,
67,
2352,
2187,... |
this = apply(_quickfix.new_AllocTransType, args) | this = _quickfix.new_AllocTransType(*args) | def __init__(self, *args): this = apply(_quickfix.new_AllocTransType, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
8763,
1429,
559,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
8763,
1429,
559,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
3... |
"ATSFont.pxd", | def generate_c_from_pyrex(extension, build_dir): if not sys.platform == 'darwin': print 'No %s will be built for this platform.' % (extension.name) return from distutils.dep_util import newer_group name = extension.name.split('.')[-1] source = extension.depends[0] target = os.path.join(build_dir, name+'.c') | c8ed45735db9c743732e9ddf1cf4aaab9d1495c2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13166/c8ed45735db9c743732e9ddf1cf4aaab9d1495c2/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
71,
67,
2080,
67,
2074,
266,
92,
12,
6447,
16,
1361,
67,
1214,
4672,
309,
486,
2589,
18,
9898,
422,
296,
28076,
4278,
1172,
296,
2279,
738,
87,
903,
506,
6650,
364,
333,
40... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
71,
67,
2080,
67,
2074,
266,
92,
12,
6447,
16,
1361,
67,
1214,
4672,
309,
486,
2589,
18,
9898,
422,
296,
28076,
4278,
1172,
296,
2279,
738,
87,
903,
506,
6650,
364,
333,
40... | |
"ALTER TABLE ir_module_module ADD demo BOOLEAN DEFAULT False", | "ALTER TABLE ir_module_module ADD demo BOOLEAN", "ALTER TABLE ir_module_module SET demo DEFAULT False", | def change_column(cr, table, column, new_type, copy): commands = [ "ALTER TABLE %s RENAME COLUMN %s TO temp_column" % (table, column), "ALTER TABLE %s ADD COLUMN %s %s" % (table, column, new_type), "ALTER TABLE %s DROP COLUMN temp_column" % table ] if copy: commands.insert( 2, "UPDATE %s SET %s=temp_column::%s" % (table, column, new_type)) for command in commands: cr.execute(command) | e09b89697412035328e4bb3fbf63d815e7af5b7d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12853/e09b89697412035328e4bb3fbf63d815e7af5b7d/pre.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
67,
2827,
12,
3353,
16,
1014,
16,
1057,
16,
394,
67,
723,
16,
1610,
4672,
4364,
273,
306,
315,
18843,
7567,
738,
87,
534,
21150,
13473,
738,
87,
8493,
1906,
67,
2827,
6,
738,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
67,
2827,
12,
3353,
16,
1014,
16,
1057,
16,
394,
67,
723,
16,
1610,
4672,
4364,
273,
306,
315,
18843,
7567,
738,
87,
534,
21150,
13473,
738,
87,
8493,
1906,
67,
2827,
6,
738,
2... |
if extra_chrome_flags is not None: | if extra_chrome_flags: | def __init__(self, methodName='runTest', extra_chrome_flags=None): """Initialize PyUITest. | 1c7ab112b8fd89fc71616f789ad0474489b02d18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/1c7ab112b8fd89fc71616f789ad0474489b02d18/pyauto.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4918,
2218,
2681,
4709,
2187,
2870,
67,
343,
10896,
67,
7133,
33,
7036,
4672,
3536,
7520,
4707,
57,
1285,
395,
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,
4918,
2218,
2681,
4709,
2187,
2870,
67,
343,
10896,
67,
7133,
33,
7036,
4672,
3536,
7520,
4707,
57,
1285,
395,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 788) else quickfix.IntField.__init__(self, 788, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
2371,
5482,
13,
469,
9549,
904,
18,
1702,
974,
16186,
2738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
2371,
5482,
13,
469,
9549,
904,
18,
1702,
974,
16186,
2738,
... |
['docutils/writers/latex2e/latex2e.tex']), | ['docutils/writers/latex2e/default.tex', 'docutils/writers/latex2e/titlepage.tex',]), | def do_setup(): kwargs = package_data.copy() extras = get_extras() if extras: kwargs['py_modules'] = extras kwargs['classifiers'] = classifiers # Install data files properly. Note that we use a different # hack for Python 2.2, which does not *always* work, though; # see # <http://article.gmane.org/gmane.text.docutils.user/2867>. # So for Python 2.3+, we prefer this hack. kwargs['cmdclass'] = {'install_data': smart_install_data, 'build_py': build_py, 'build_data': build_data} dist = setup(**kwargs) return dist | 4b019d43bdea1a1fbb171f3b195bd92da54fd902 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1532/4b019d43bdea1a1fbb171f3b195bd92da54fd902/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
8401,
13332,
1205,
273,
2181,
67,
892,
18,
3530,
1435,
11875,
273,
336,
67,
23687,
1435,
309,
11875,
30,
1205,
3292,
2074,
67,
6400,
3546,
273,
11875,
1205,
3292,
1106,
3383,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
8401,
13332,
1205,
273,
2181,
67,
892,
18,
3530,
1435,
11875,
273,
336,
67,
23687,
1435,
309,
11875,
30,
1205,
3292,
2074,
67,
6400,
3546,
273,
11875,
1205,
3292,
1106,
3383,
35... |
self.body.append(self.comment('depart_field_list')) | self.dedent('depart_field_list') | def depart_field_list(self, node): self.body.append(self.comment('depart_field_list')) | 33fb604531cb0884e8062b15ab6fc530c3335af8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5620/33fb604531cb0884e8062b15ab6fc530c3335af8/manpage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
1518,
67,
1098,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
12,
2890,
18,
3469,
2668,
323,
2680,
67,
1518,
67,
1098,
26112,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
1518,
67,
1098,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
12,
2890,
18,
3469,
2668,
323,
2680,
67,
1518,
67,
1098,
26112,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
stream.seek(stream.tell() - block_size + idx - len(prefix)) | pos = stream.tell() - actual_block_size + idx - len(prefix) stream.seek(pos) | def get_document_info(stream): """ Extract the \info block from an RTF file. Return the info block as a string and the position in the file at which it starts. @param stream: File like object pointing to the RTF file. """ block_size = 4096 stream.seek(0) found, block = False, "" while not found: prefix = block[-6:] block = prefix + stream.read(block_size) if len(block) == len(prefix): break idx = block.find(r'{\info') if idx >= 0: found = True stream.seek(stream.tell() - block_size + idx - len(prefix)) else: if block.find(r'\sect') > -1: break if not found: return None, 0 data, count, = cStringIO.StringIO(), 0 pos = stream.tell() while True: ch = stream.read(1) if ch == '\\': data.write(ch + stream.read(1)) continue if ch == '{': count += 1 elif ch == '}': count -= 1 data.write(ch) if count == 0: break return data.getvalue(), pos | 547e984accf3e44b8b205ca5759481b9e249c475 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/547e984accf3e44b8b205ca5759481b9e249c475/rtf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5457,
67,
1376,
12,
3256,
4672,
3536,
8152,
326,
521,
1376,
1203,
628,
392,
13060,
42,
585,
18,
2000,
326,
1123,
1203,
487,
279,
533,
471,
326,
1754,
316,
326,
585,
622,
1492,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5457,
67,
1376,
12,
3256,
4672,
3536,
8152,
326,
521,
1376,
1203,
628,
392,
13060,
42,
585,
18,
2000,
326,
1123,
1203,
487,
279,
533,
471,
326,
1754,
316,
326,
585,
622,
1492,... |
return min([s.size for s in self.snapshots]) | return min(self.snapshots, key=snapshot_size) | def minimum(self): return min([s.size for s in self.snapshots]) | 00f6d858aea77b2669540778bf66324fc3ba45f8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12624/00f6d858aea77b2669540778bf66324fc3ba45f8/diskspace-report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5224,
12,
2890,
4672,
327,
1131,
3816,
87,
18,
1467,
364,
272,
316,
365,
18,
26918,
5717,
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,
5224,
12,
2890,
4672,
327,
1131,
3816,
87,
18,
1467,
364,
272,
316,
365,
18,
26918,
5717,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.response.out.write(template.render(path, '')) | self.response.out.write(template.render(path, {})) | def get(self): path = os.path.join(os.path.dirname(__file__), '..', 'views','session_timeout.html') self.response.out.write(template.render(path, '')) | a8fc2bb2266556635861bee40bbd7fe9979135e4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5139/a8fc2bb2266556635861bee40bbd7fe9979135e4/route.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
589,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
972,
768,
972,
3631,
11597,
2187,
296,
7061,
17023,
3184,
67,
4538,
18,
2620,
6134,
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,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
589,
273,
1140,
18,
803,
18,
5701,
12,
538,
18,
803,
18,
12287,
12,
972,
768,
972,
3631,
11597,
2187,
296,
7061,
17023,
3184,
67,
4538,
18,
2620,
6134,
365,
18,
... |
if not hasattr(fs,'list'): form['BODY']=other['BODY']=fs.value | if not hasattr(fs,'list') or fs.list is None: form['BODY']=other['BODY']=fs.value | def __init__(self, | 5a194cb1e8ac4dfaf8df47395c0af4d00c62b4dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5a194cb1e8ac4dfaf8df47395c0af4d00c62b4dc/Publish.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
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... |
if isinstance(value, xobj.XObj): doc = xobj.Document() doc._xobj.elements.append(name) setattr(doc, name, value) return self.__class__(value.id, self._client, doc, parent=self) | return self._client.cache(value.id, self._client, value, parent=self) | def _getObj(self, name, value): # Wrap this instance with an rObj. if hasattr(value, 'id'): # Wrap the xobj in an xobj document so that it can be serialized # later. if isinstance(value, xobj.XObj): doc = xobj.Document() doc._xobj.elements.append(name) setattr(doc, name, value) return self.__class__(value.id, self._client, doc, parent=self) | 3313d042df4985bef89ce45cecf597816a15faa9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7637/3313d042df4985bef89ce45cecf597816a15faa9/proxy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
2675,
12,
2890,
16,
508,
16,
460,
4672,
468,
4266,
333,
791,
598,
392,
436,
2675,
18,
309,
3859,
12,
1132,
16,
296,
350,
11,
4672,
468,
4266,
326,
619,
2603,
316,
392,
619,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2675,
12,
2890,
16,
508,
16,
460,
4672,
468,
4266,
333,
791,
598,
392,
436,
2675,
18,
309,
3859,
12,
1132,
16,
296,
350,
11,
4672,
468,
4266,
326,
619,
2603,
316,
392,
619,... |
o.write("%s() {\n%s\n}\n" % (var, val)) | o.write("%s() {\n%s\n}\n" % (varExpanded, val)) | def emit_var(var, o=sys.__stdout__, d = init(), all=False): """Emit a variable to be sourced by a shell.""" if getVarFlag(var, "python", d): return 0 try: if all: oval = getVar(var, d, 0) val = getVar(var, d, 1) except KeyboardInterrupt: raise except: excname = str(sys.exc_info()[0]) if excname == "bb.build.FuncFailed": raise o.write('# expansion of %s threw %s\n' % (var, excname)) return 0 if all: o.write('# %s=%s\n' % (var, oval)) if type(val) is not types.StringType: return 0 if getVarFlag(var, 'matchesenv', d): return 0 if (var.find("-") != -1 or var.find(".") != -1 or var.find('{') != -1 or var.find('}') != -1 or var.find('+') != -1) and not all: return 0 val.rstrip() if not val: return 0 if getVarFlag(var, "func", d): | 8440c4c71d5e5db581f69a4c5331d520bbc87285 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2672/8440c4c71d5e5db581f69a4c5331d520bbc87285/data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3626,
67,
1401,
12,
1401,
16,
320,
33,
9499,
16186,
10283,
972,
16,
302,
273,
1208,
9334,
777,
33,
8381,
4672,
3536,
17982,
279,
2190,
358,
506,
1084,
72,
635,
279,
5972,
12123,
309,
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,
3626,
67,
1401,
12,
1401,
16,
320,
33,
9499,
16186,
10283,
972,
16,
302,
273,
1208,
9334,
777,
33,
8381,
4672,
3536,
17982,
279,
2190,
358,
506,
1084,
72,
635,
279,
5972,
12123,
309,
2... |
input = dialog_question(_("Return to default"), msg, button1=yes, button2=no) if input == yes: | if True: | def on_default(self): yes = _("Yes") no = _("No") msg = _("Would you reset all settings to default ?") input = dialog_question(_("Return to default"), msg, button1=yes, button2=no) if input == yes: cp = ConfigParser() cp.read(conf.conf_file) for tab in conf.settings: for setting in tab['settings']: if setting.has_key('group'): items = setting['group'] else: items = [ setting ] for item in items: cp.remove_option(item['sectid'], item['confid']) cp.write(open(conf.conf_file, "w")) reload(conf) | 4805cf97272ac02671e3daa65d0346c781877dc7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1208/4805cf97272ac02671e3daa65d0346c781877dc7/gui_pyqt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
1886,
12,
2890,
4672,
12465,
273,
389,
2932,
22352,
7923,
1158,
225,
273,
389,
2932,
2279,
7923,
1234,
273,
389,
2932,
59,
1006,
1846,
2715,
777,
1947,
358,
805,
692,
7923,
225,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
1886,
12,
2890,
4672,
12465,
273,
389,
2932,
22352,
7923,
1158,
225,
273,
389,
2932,
2279,
7923,
1234,
273,
389,
2932,
59,
1006,
1846,
2715,
777,
1947,
358,
805,
692,
7923,
225,... |
print(fmt % tuple(['-'*15] * len(fields))) | print(fmt % tuple([ '-' * (w - 2) for w in widths ])) | def display_table(self, db, desc, sql, args = [], fields = []): """Display multirow query as a table.""" | 625ee69b6d4897932f15432d16840606be7bbdfd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14597/625ee69b6d4897932f15432d16840606be7bbdfd/adminscript.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
2121,
12,
2890,
16,
1319,
16,
3044,
16,
1847,
16,
833,
273,
5378,
16,
1466,
273,
5378,
4672,
3536,
4236,
3309,
492,
843,
487,
279,
1014,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
67,
2121,
12,
2890,
16,
1319,
16,
3044,
16,
1847,
16,
833,
273,
5378,
16,
1466,
273,
5378,
4672,
3536,
4236,
3309,
492,
843,
487,
279,
1014,
12123,
2,
-100,
-100,
-100,
-100,
-10... |
iter = difflinestates(states, prevstates) | iter = difflinestates(pstates, states) | def display(fn, rev, states, prevstates): datefunc = ui.quiet and util.shortdate or util.datestr found = False filerevmatches = {} r = prev.get(fn, -1) if opts.get('all'): iter = difflinestates(states, prevstates) else: iter = [('', l) for l in prevstates] for change, l in iter: cols = [fn, str(r)] if opts.get('line_number'): cols.append(str(l.linenum)) if opts.get('all'): cols.append(change) if opts.get('user'): cols.append(ui.shortuser(get(r)[1])) if opts.get('date'): cols.append(datefunc(get(r)[2])) if opts.get('files_with_matches'): c = (fn, r) if c in filerevmatches: continue filerevmatches[c] = 1 else: cols.append(l.line) ui.write(sep.join(cols), eol) found = True return found | 3a9f0b4458b06c37a69f901f77dd0fd0cb66c628 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/3a9f0b4458b06c37a69f901f77dd0fd0cb66c628/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
12,
4293,
16,
5588,
16,
5493,
16,
2807,
7992,
4672,
1509,
644,
273,
5915,
18,
20380,
471,
1709,
18,
6620,
712,
578,
1709,
18,
9683,
313,
1392,
273,
1083,
661,
822,
90,
8436,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2562,
12,
4293,
16,
5588,
16,
5493,
16,
2807,
7992,
4672,
1509,
644,
273,
5915,
18,
20380,
471,
1709,
18,
6620,
712,
578,
1709,
18,
9683,
313,
1392,
273,
1083,
661,
822,
90,
8436,
273,... |
sp = subprocess.Popen(cmd, cwd=cwd, stdout=stdout) output = sp.communicate()[0] | logging.debug(cmd) try: sp = subprocess.Popen(cmd, cwd=cwd, stdout=stdout) output = sp.communicate()[0] except OSError: raise gclient_utils.Error("git command '%s' failed to run." % ' '.join(cmd) + "\nCheck that you have git installed.") | def _Run(self, args, cwd=None, checkrc=True, redirect_stdout=True): # TODO(maruel): Merge with Capture? if cwd is None: cwd = self.checkout_path stdout=None if redirect_stdout: stdout=subprocess.PIPE if cwd == None: cwd = self.checkout_path cmd = [self.COMMAND] cmd.extend(args) sp = subprocess.Popen(cmd, cwd=cwd, stdout=stdout) output = sp.communicate()[0] if checkrc and sp.returncode: raise gclient_utils.Error('git command %s returned %d' % (args[0], sp.returncode)) if output is not None: return output.strip() | a28d87db49c30431f4bf81d5b8e787c72b26d72d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/a28d87db49c30431f4bf81d5b8e787c72b26d72d/gclient_scm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1997,
12,
2890,
16,
833,
16,
7239,
33,
7036,
16,
866,
1310,
33,
5510,
16,
3136,
67,
10283,
33,
5510,
4672,
468,
2660,
12,
3684,
20317,
4672,
8964,
598,
18477,
35,
309,
7239,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1997,
12,
2890,
16,
833,
16,
7239,
33,
7036,
16,
866,
1310,
33,
5510,
16,
3136,
67,
10283,
33,
5510,
4672,
468,
2660,
12,
3684,
20317,
4672,
8964,
598,
18477,
35,
309,
7239,
353,
... |
def generate_pattern_card(t, c, n, s, scale): | def generate_pattern_card(shape, color, number, fill, scale): | def generate_pattern_card(t, c, n, s, scale): svg = SVG() svg.set_scale(scale) svg.set_stroke_width(0.5) svg.set_colors([BLACK, COLOR_PAIRS[c][1]]) svg_string = svg.header() svg_string += svg.pattern_card(CARD_TYPES[t], COLOR_PAIRS[c], n+1, FILL_STYLES[s]) svg_string += svg.footer() return svg_string | 3abdde2d4415b99e072401aa95cc310d13046e05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7609/3abdde2d4415b99e072401aa95cc310d13046e05/gencards.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
4951,
67,
3327,
12,
4867,
16,
2036,
16,
1300,
16,
3636,
16,
3159,
4672,
9804,
273,
11281,
1435,
9804,
18,
542,
67,
5864,
12,
5864,
13,
9804,
18,
542,
67,
16181,
67,
2819,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
4951,
67,
3327,
12,
4867,
16,
2036,
16,
1300,
16,
3636,
16,
3159,
4672,
9804,
273,
11281,
1435,
9804,
18,
542,
67,
5864,
12,
5864,
13,
9804,
18,
542,
67,
16181,
67,
2819,
1... |
res = self._query(req) | res = self._query( req ) | def getPrognosisProblematics(self,prognosis): """ Get all the active files with the given problematic """ req = "SELECT FileID,LFN,PFN,Size,SE,GUID,Prognosis FROM Problematics WHERE Prognosis = '%s' AND Status = 'New' ORDER BY Retries,LastUpdate;" % prognosis res = self._query(req) if not res['OK']: return res problematics = [] for fileid,lfn,pfn,size,se,guid,prognosis in res['Value']: problematics.append({'FileID':fileid,'LFN':lfn,'PFN':pfn,'Size':size,'SE':se,'GUID':guid,'Prognosis':prognosis}) return S_OK(problematics) | c0ad35468416f798369c9462d5f8a11a19686a43 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/c0ad35468416f798369c9462d5f8a11a19686a43/DataIntegrityDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3570,
1600,
538,
291,
13719,
270,
2102,
12,
2890,
16,
685,
1600,
538,
291,
4672,
3536,
968,
777,
326,
2695,
1390,
598,
326,
864,
6199,
2126,
3536,
1111,
273,
315,
4803,
1387,
734,
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,
3570,
1600,
538,
291,
13719,
270,
2102,
12,
2890,
16,
685,
1600,
538,
291,
4672,
3536,
968,
777,
326,
2695,
1390,
598,
326,
864,
6199,
2126,
3536,
1111,
273,
315,
4803,
1387,
734,
16,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.