rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
app = gateway.applevel(r''' | app = gateway.applevel(r''' import codecs | def ord__String(space, w_str): u_str = w_str._value if len(u_str) != 1: raise OperationError( space.w_TypeError, space.wrap("ord() expected a character, but string " "of length %d found"%(len(w_str._value),))) return space.wrap(ord(u_str)) | 41e03f3183e83e91eb621d1a4ce9293608eabccb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/41e03f3183e83e91eb621d1a4ce9293608eabccb/stringobject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4642,
972,
780,
12,
2981,
16,
341,
67,
701,
4672,
582,
67,
701,
273,
341,
67,
701,
6315,
1132,
309,
562,
12,
89,
67,
701,
13,
480,
404,
30,
1002,
4189,
668,
12,
3476,
18,
91,
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,
4642,
972,
780,
12,
2981,
16,
341,
67,
701,
4672,
582,
67,
701,
273,
341,
67,
701,
6315,
1132,
309,
562,
12,
89,
67,
701,
13,
480,
404,
30,
1002,
4189,
668,
12,
3476,
18,
91,
67,
... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 919) else quickfix.IntField.__init__(self, 919, 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,
2468,
3657,
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,
2468,
3657,
13,
469,
9549,
904,
18,
1702,
974,
16186,
2738,
... |
if self.blockItem.isShown: try: blockName = self.blockItem.blockName splitter = list(self.blockItem.childrenBlocks)[1] splitterBlockName = splitter.blockName except (AttributeError, IndexError): pass else: if blockName == 'CalendarSummaryView' and \ splitterBlockName == 'MainCalendarCanvasSplitter' and \ splitter.widget.GetSashPosition() < 0: position = int (splitter.size.height * splitter.splitPercentage + 0.5) splitter.widget.SetSashPosition(position) splitter.widget.adjustSplit(position) | def wxSynchronizeWidget(self, useHints=False): super (wxBoxContainer, self).wxSynchronizeWidget () | 1a7938e46c57cd6b99ad91584247625110c83e60 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/1a7938e46c57cd6b99ad91584247625110c83e60/ContainerBlocks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7075,
19298,
554,
4609,
12,
2890,
16,
999,
13368,
33,
8381,
4672,
2240,
261,
27226,
3514,
2170,
16,
365,
2934,
27226,
19298,
554,
4609,
1832,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7075,
19298,
554,
4609,
12,
2890,
16,
999,
13368,
33,
8381,
4672,
2240,
261,
27226,
3514,
2170,
16,
365,
2934,
27226,
19298,
554,
4609,
1832,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
closelist = self.single_sockets.values() | closelist = [sock for sock in self.single_sockets.values() if not isinstance(sock, InterruptSocket)] | def do_poll(self, t): r = self.poll.poll(t*timemult) if r is None: connects = len(self.single_sockets) to_close = int(connects*0.05)+1 # close 5% of sockets self.max_connects = connects-to_close closelist = self.single_sockets.values() shuffle(closelist) closelist = closelist[:to_close] for sock in closelist: if DEBUG: print >> sys.stderr,"SocketHandler: do_poll closing connection",sock.get_ip() self._close_socket(sock) return [] return r | f82455a8225ab39833d6b69bd84826c1e568cf11 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9686/f82455a8225ab39833d6b69bd84826c1e568cf11/SocketHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
13835,
12,
2890,
16,
268,
4672,
436,
273,
365,
18,
13835,
18,
13835,
12,
88,
14,
8584,
351,
406,
13,
309,
436,
353,
599,
30,
23441,
273,
562,
12,
2890,
18,
7526,
67,
7814,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13835,
12,
2890,
16,
268,
4672,
436,
273,
365,
18,
13835,
18,
13835,
12,
88,
14,
8584,
351,
406,
13,
309,
436,
353,
599,
30,
23441,
273,
562,
12,
2890,
18,
7526,
67,
7814,
... |
signal.signal(signal.SIGHUP, self.rehash) signal.signal(signal.SIGTERM, self.term) | signal.signal(signal.SIGHUP, self.onREHASH) signal.signal(signal.SIGTERM, self.onTERM) | def __init__(self, event, env): Component.__init__(self, event) | 5e0797288ce80ec439c29b038de52bd516501a6b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3020/5e0797288ce80ec439c29b038de52bd516501a6b/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
871,
16,
1550,
4672,
5435,
16186,
2738,
972,
12,
2890,
16,
871,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
871,
16,
1550,
4672,
5435,
16186,
2738,
972,
12,
2890,
16,
871,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
s = size(h + '3P2P') +\ PySet_MINSIZE*struct.calcsize('lP') + self.l + self.P | s = size(h + '3P2P' + PySet_MINSIZE*'lP' + 'lP') | def delx(self): del self.__x | 6d08a0b563d4a5f82571f7fb0b8a13a918ebcf2b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/6d08a0b563d4a5f82571f7fb0b8a13a918ebcf2b/test_sys.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
92,
12,
2890,
4672,
1464,
365,
16186,
92,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
92,
12,
2890,
4672,
1464,
365,
16186,
92,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
while self.parser.elementInScope("select"): self.parser.openElements.pop() self.parser.resetInsertionMode() | if self.parser.elementInScope(name, True): if self.parser.openElements[-1].name != "select": node = self.parser.openElements.pop() while node != "select" node = self.parser.openElements.pop() self.parser.resetInsertionMode() else: self.parser.parseError() | def endTagSelect(self, name="select"): # XXX innerHTML case ... | 08e63fa88e0f4b18448d6ebc8577407cdaaf9faa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10463/08e63fa88e0f4b18448d6ebc8577407cdaaf9faa/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29765,
3391,
12,
2890,
16,
508,
1546,
4025,
6,
4672,
468,
11329,
14129,
648,
1372,
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,
29765,
3391,
12,
2890,
16,
508,
1546,
4025,
6,
4672,
468,
11329,
14129,
648,
1372,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"1000": 001750, "1000 B-14": 001750, | "1000": 001750, "1000 B-14": 001750, | def test_sp_dec(): testdata = { "16372": 037764, "16372 B-14": 037764, "-.38888": 063434, "-83": 077654, "-83 B-14": 077654, "-79": 077660, "-79 B-14": 077660, "41": 000051, "41 B-14": 000051, "76": 000114, "76 B-14": 000114, "52": 000064, "52 B-14": 000064, "-30": 077741, "-30 B-14": 077741, "120": 000170, "120 B-14": 000170, "120D": 000170, "+120D": 000170, "+120": 000170, "+120D*": 000170, "+120*": 000170, "-0 B-14": 077777, "-0": 077777, "1000": 001750, "1000 B-14": 001750, "-71 B-14": 077670, "-71": 077670, "2": 000002, "2 B-14": 000002, "9000": 021450, "7199": 016037, "-07199": 061740, "-0000": 077777 } return test(Number.DECIMAL, 1, testdata) | bf56514f65402998750eab30f37322a633ce0505 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8152/bf56514f65402998750eab30f37322a633ce0505/number.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1752,
67,
4924,
13332,
1842,
892,
273,
288,
315,
2313,
6418,
22,
6877,
5411,
17107,
4700,
1105,
16,
315,
2313,
6418,
22,
225,
605,
17,
3461,
6877,
1377,
17107,
4700,
1105,
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,
1842,
67,
1752,
67,
4924,
13332,
1842,
892,
273,
288,
315,
2313,
6418,
22,
6877,
5411,
17107,
4700,
1105,
16,
315,
2313,
6418,
22,
225,
605,
17,
3461,
6877,
1377,
17107,
4700,
1105,
16,
... |
else | else: | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 574) else quickfix.StringField.__init__(self, 574, 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,
1381,
5608,
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,
1381,
5608,
13,
469,
30,
9549,
904,
18,
780,
974,
16186,
2738... |
from pprint import pformat | def update_file_info(self, item): """ C{update_file_info} is called only when: - When you enter a directory (once for each item but only when the item was modified since the last time it was listed) - When you refresh (once for each item visible) - When an item viewable from the current window is created or modified This is insufficient for our purpose because: - You're not notified about items you don't see (which is needed to keep the emblem for the directories above the item up-to-date) @type item: NautilusVFSFile @param item: """ if not self.valid_uri(item.get_uri()): return path = realpath(unicode(gnomevfs.get_local_path_from_uri(item.get_uri()), "utf-8")) # log.debug("update_file_info() called for %s" % path) # Always replace the item in the table with the one we receive, because # for example if an item is deleted and recreated the NautilusVFSFile # we had before will be invalid (think pointers and such). self.nautilusVFSFile_table[path] = item # This check should be pretty obvious :-) # TODO: how come the statuses for a few directories are incorrect # when we remove this line (detected as working copies, even though # they are not)? That shouldn't happen. is_in_a_or_a_working_copy = self.vcs_client.is_in_a_or_a_working_copy(path) if not is_in_a_or_a_working_copy: return # Do our magic... # I have added extra logic in cb_status, using a list # (paths_from_callback) that should allow us to work around this for # now. But it'd be good to have an actual status monitor. # Useful for figuring out order of calls. See "cb_status". # log.debug("%s: In update_status" % threading.currentThread()) found = False status = None from pprint import pformat with self.callback_paths_lock: # Could replace with (st for st in self.... if st.path ...).next() # Need to catch exception for idx in xrange(len(self.statuses_from_callback)): found = (self.statuses_from_callback[idx].path) == path if found: break if found: # We're here because we were triggered by a callback status = self.statuses_from_callback[idx] del self.statuses_from_callback[idx] log.debug("Found status in callback list: %s" % pformat(status.__dict__)) # Don't bother the checker if we already have the info from a callback if not found: status = \ self.status_checker.check_status(path, recurse=True, summary=True, callback=True, invalidate=self.always_invalidate) log.debug("Using immediate status: %s" % pformat(status.__dict__)) | 6268447808016e08552fea26797a7dc725fdd8d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5119/6268447808016e08552fea26797a7dc725fdd8d3/RabbitVCS.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
768,
67,
1376,
12,
2890,
16,
761,
4672,
3536,
225,
385,
95,
2725,
67,
768,
67,
1376,
97,
353,
2566,
1338,
1347,
30,
225,
300,
5203,
1846,
6103,
279,
1867,
261,
8243,
364,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
768,
67,
1376,
12,
2890,
16,
761,
4672,
3536,
225,
385,
95,
2725,
67,
768,
67,
1376,
97,
353,
2566,
1338,
1347,
30,
225,
300,
5203,
1846,
6103,
279,
1867,
261,
8243,
364,
1... | |
elif currentConfigSelectionElement(currLnb.diseqcRepeats) == "Two": | elif currentConfigSelectionElement(currLnb.diseqcRepeats) == "two": | def updateAdvanced(self, sec, slotid): lnbSat = {} for x in range(1,33): lnbSat[x] = [] for x in self.NimManager.satList: lnb = config.Nims[slotid].advanced.sat[x[1]].lnb.value if lnb != 0: print "add", x[1], "to", lnb lnbSat[lnb].append(x[1]) for x in range(1,33): if len(lnbSat[x]) > 0: currLnb = config.Nims[slotid].advanced.lnb[x] sec.addLNB() | f9ac4210fa12ea7399e2b129aae9532aa6fbfc2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/f9ac4210fa12ea7399e2b129aae9532aa6fbfc2e/NimManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
23618,
12,
2890,
16,
1428,
16,
4694,
350,
4672,
328,
6423,
15163,
273,
2618,
364,
619,
316,
1048,
12,
21,
16,
3707,
4672,
328,
6423,
15163,
63,
92,
65,
273,
5378,
364,
619,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
23618,
12,
2890,
16,
1428,
16,
4694,
350,
4672,
328,
6423,
15163,
273,
2618,
364,
619,
316,
1048,
12,
21,
16,
3707,
4672,
328,
6423,
15163,
63,
92,
65,
273,
5378,
364,
619,
316,
... |
elif discType == 3: | elif discType == self.D_FREQUENCY: | def computeDiscretizer(self, i, idx, onlyDefaults=False): attr = self.data.domain[idx] indiData = self.indiData[idx] | 9a3bb5d5397a9a71bb0ca6aaa8a1203ab70bcd43 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/9a3bb5d5397a9a71bb0ca6aaa8a1203ab70bcd43/OWInteractiveDiscretization.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
28912,
1349,
1824,
12,
2890,
16,
277,
16,
2067,
16,
1338,
7019,
33,
8381,
4672,
1604,
273,
365,
18,
892,
18,
4308,
63,
3465,
65,
1547,
77,
751,
273,
365,
18,
728,
77,
751,
63,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3671,
28912,
1349,
1824,
12,
2890,
16,
277,
16,
2067,
16,
1338,
7019,
33,
8381,
4672,
1604,
273,
365,
18,
892,
18,
4308,
63,
3465,
65,
1547,
77,
751,
273,
365,
18,
728,
77,
751,
63,
... |
name: str The name of the temporary file which should hold the cached HTTP requests and responses. | name: str (optional) The file name of session file to be used. The file is loaded from the temporary directory of this machine. If no name is passed in, a default name will be constructed using the cache_name_prefix, cache_case_name, and cache_test_name of this object. | def use_cached_session(self, name, real_http_client=None): """Attempts to load recordings from a previous live request. If a temp file with the recordings exists, then it is used to fulfill requests. If the file does not exist, then a real client is used to actually make the desired HTTP requests. Requests and responses are recorded and will be written to the desired temprary cache file when close_session is called. | 7700a3d89d9b507e202ecb8eaeffc4f27fbadbf8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6580/7700a3d89d9b507e202ecb8eaeffc4f27fbadbf8/mock_http_core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
999,
67,
7097,
67,
3184,
12,
2890,
16,
508,
16,
2863,
67,
2505,
67,
2625,
33,
7036,
4672,
3536,
10113,
358,
1262,
1409,
899,
628,
279,
2416,
8429,
590,
18,
225,
971,
279,
1906,
585,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
999,
67,
7097,
67,
3184,
12,
2890,
16,
508,
16,
2863,
67,
2505,
67,
2625,
33,
7036,
4672,
3536,
10113,
358,
1262,
1409,
899,
628,
279,
2416,
8429,
590,
18,
225,
971,
279,
1906,
585,
... |
return _getElementsByTagNameNSHelper(self, namespaceURI, localName, []) | return _getElementsByTagNameNSHelper(self, namespaceURI, localName, NodeList()) | def getElementsByTagNameNS(self, namespaceURI, localName): return _getElementsByTagNameNSHelper(self, namespaceURI, localName, []) | 190052b779b7543367444194a1c4243f94187b59 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/190052b779b7543367444194a1c4243f94187b59/minidom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11034,
3156,
12,
2890,
16,
19421,
16,
11927,
4672,
327,
389,
588,
3471,
10401,
3156,
2276,
12,
2890,
16,
19421,
16,
11927,
16,
5378,
13,
2,
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,
11034,
3156,
12,
2890,
16,
19421,
16,
11927,
4672,
327,
389,
588,
3471,
10401,
3156,
2276,
12,
2890,
16,
19421,
16,
11927,
16,
5378,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
upsfile.close() dataFiles.append(["ups", [tableName]]) | upsFile.close() dataFiles.append(["ups", [upsFileName]]) | def getPackages(): packages = [PkgName] dataList = [] for dirPath, dirNames, fileNames in os.walk(PkgDir): if ".svn" in dirNames: dirNames.remove(".svn") dirName = os.path.basename(dirPath) print "dirName=", dirName tryInit = os.path.join(dirPath, "__init__.py") print "tryInit=", tryInit if os.path.exists(os.path.join(dirPath, "__init__.py")): pkgName = dirPath.replace("/", ".") packages.append(pkgName) else: # package data dataList += [os.path.join(dirPath, fileName) for fileName in fileNames if not fileName.startswith(".")] return packages, {PkgName: dataList} | c2db375310df01b14b7de0de1241e3cdff950e9b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6236/c2db375310df01b14b7de0de1241e3cdff950e9b/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30401,
1023,
13332,
5907,
273,
306,
11264,
461,
65,
501,
682,
273,
5378,
364,
15891,
16,
1577,
1557,
16,
27375,
316,
1140,
18,
11348,
12,
11264,
1621,
4672,
309,
3552,
31505,
6,
316,
157... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30401,
1023,
13332,
5907,
273,
306,
11264,
461,
65,
501,
682,
273,
5378,
364,
15891,
16,
1577,
1557,
16,
27375,
316,
1140,
18,
11348,
12,
11264,
1621,
4672,
309,
3552,
31505,
6,
316,
157... |
return self._wrapper._engine.connection_provider._pool.checkedin() | try: return self._wrapper._engine.connection_provider._pool.checkedin() except: return 'n/a' | def getCheckedin(self): """ """ return self._wrapper._engine.connection_provider._pool.checkedin() | 831088074276639001c5c59b2f18beca49d00b78 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6817/831088074276639001c5c59b2f18beca49d00b78/da.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
11454,
267,
12,
2890,
4672,
3536,
3536,
327,
365,
6315,
8376,
6315,
8944,
18,
4071,
67,
6778,
6315,
6011,
18,
4532,
267,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
11454,
267,
12,
2890,
4672,
3536,
3536,
327,
365,
6315,
8376,
6315,
8944,
18,
4071,
67,
6778,
6315,
6011,
18,
4532,
267,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
print "angular" | def _load_measurements(self, pubsub_evt): print "_load_measurements" dict = pubsub_evt.data for i in dict: m = dict[i] print "m:", m.name if m.type == const.LINEAR: print "linear" mr = LinearMeasure(m.colour) else: print "angular" mr = AngularMeasure(m.colour) self.current = (m, mr) self.measures.append(self.current) for point in m.points: print "point:", point x, y, z = point actors = mr.AddPoint(x, y, z) print "actors:", actors ps.Publisher().sendMessage(("Add actors", m.location), (actors, m.slice_number)) self.current = None | cc2c99a6188aecdd662aaa567ce10137ad64fe08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10228/cc2c99a6188aecdd662aaa567ce10137ad64fe08/measures.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
945,
67,
26550,
12,
2890,
16,
23288,
67,
73,
11734,
4672,
1172,
4192,
945,
67,
26550,
6,
2065,
273,
23288,
67,
73,
11734,
18,
892,
364,
277,
316,
2065,
30,
312,
273,
2065,
63,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
945,
67,
26550,
12,
2890,
16,
23288,
67,
73,
11734,
4672,
1172,
4192,
945,
67,
26550,
6,
2065,
273,
23288,
67,
73,
11734,
18,
892,
364,
277,
316,
2065,
30,
312,
273,
2065,
63,
7... | |
self.assertException(Player.screenshot()) | self.assertException(Player.screenshot) | def checkCanvasScreenshot(): bmp = offscreenCanvas.screenshot() self.compareBitmapToFile(bmp, "testOffscreenScreenshot", False) | 23b8888744ad7c13b099776e36e9cc39954c384d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7300/23b8888744ad7c13b099776e36e9cc39954c384d/OffscreenTest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12971,
29354,
13332,
324,
1291,
273,
3397,
9252,
12971,
18,
29435,
1435,
365,
18,
9877,
12224,
15450,
12,
70,
1291,
16,
315,
3813,
7210,
9252,
29354,
3113,
1083,
13,
2,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12971,
29354,
13332,
324,
1291,
273,
3397,
9252,
12971,
18,
29435,
1435,
365,
18,
9877,
12224,
15450,
12,
70,
1291,
16,
315,
3813,
7210,
9252,
29354,
3113,
1083,
13,
2,
-100,
-100,
... |
if self._charset: try: text = unicode(text, self._charset) except UnicodeDecodeError, err: self.warning("Unable to convert string to Unicode: " + unicode(err)) self._charset = None text = unicode(text, "ISO-8859-1") else: text = unicode(text, "ISO-8859-1") | text = self._convertText(text) | def createValue(self, human=True): # Compress data address (in bits) and size (in bytes) if human: addr = self.absolute_address + self._content_offset * 8 size = self._content_size else: addr = self.absolute_address size = self._size/8 if size == 0: # Empty string return u"" | 45ac1adbbae69d7ff487eb3d2a954981d6b9f44f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/45ac1adbbae69d7ff487eb3d2a954981d6b9f44f/string_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
620,
12,
2890,
16,
8672,
33,
5510,
4672,
468,
25698,
501,
1758,
261,
267,
4125,
13,
471,
963,
261,
267,
1731,
13,
309,
8672,
30,
3091,
273,
365,
18,
12547,
67,
2867,
397,
365,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
620,
12,
2890,
16,
8672,
33,
5510,
4672,
468,
25698,
501,
1758,
261,
267,
4125,
13,
471,
963,
261,
267,
1731,
13,
309,
8672,
30,
3091,
273,
365,
18,
12547,
67,
2867,
397,
365,
6... |
if pidfile_pid.isdigit() and glue.utils.pid_exists(int(pidfile_pid)): raise RuntimeError, ("pidfile %s contains pid (%s) of a running " "process" % (lockfile, pidfile_pid)) else: print ("pidfile %s contains stale pid %s; writing new lock" % (lockfile, pidfile_pid)) | if pidfile_pid.isdigit(): if glue.utils.pid_exists(int(pidfile_pid)): raise RuntimeError, ("pidfile %s contains pid (%s) of a running " "process" % (lockfile, pidfile_pid)) else: print ("pidfile %s contains stale pid %s; writing new lock" % (lockfile, pidfile_pid)) | def get_lock(lockfile): """ Tries to write a lockfile containing the current pid. Excepts if the lockfile already contains the pid of a running process. Although this should prevent a lock from being granted twice, it can theoretically deny a lock unjustly in the unlikely event that the original process is gone but another unrelated process has been assigned the same pid by the OS. """ pidfile = open(lockfile, "a+") # here we do some meta-locking by getting an exclusive lock on the # pidfile before reading it, to prevent two daemons from seeing a # stale lock at the same time, and both trying to run try: fcntl.flock(pidfile.fileno(), fcntl.LOCK_EX|fcntl.LOCK_NB) except IOError,e: raise RuntimeError, "failed to lock %s: %s" % (lockfile, e) # we got the file lock, so check the pid therein pidfile.seek(0) pidfile_pid = pidfile.readline().strip() if pidfile_pid.isdigit() and glue.utils.pid_exists(int(pidfile_pid)): raise RuntimeError, ("pidfile %s contains pid (%s) of a running " "process" % (lockfile, pidfile_pid)) else: print ("pidfile %s contains stale pid %s; writing new lock" % (lockfile, pidfile_pid)) # the pidfile didn't exist or was stale, so grab a new lock pidfile.truncate(0) pidfile.write("%d\n" % os.getpid()) pidfile.close() # should be entirely unecessary, but paranoia always served me well confirm_lock(lockfile) return True | 20ef9ea2342fd3519ff726d0835a1a6ff89c88a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3589/20ef9ea2342fd3519ff726d0835a1a6ff89c88a2/pidfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
739,
12,
739,
768,
4672,
3536,
10000,
281,
358,
1045,
279,
2176,
768,
4191,
326,
783,
4231,
18,
225,
25209,
87,
309,
326,
2176,
768,
1818,
1914,
326,
4231,
434,
279,
3549,
120... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
739,
12,
739,
768,
4672,
3536,
10000,
281,
358,
1045,
279,
2176,
768,
4191,
326,
783,
4231,
18,
225,
25209,
87,
309,
326,
2176,
768,
1818,
1914,
326,
4231,
434,
279,
3549,
120... |
all_overdrive.add(e['overdrive']) | all_overdrive.update(e['overdrive']) | def get_pub_year(e): pub_date = e.get('publish_date', None) if pub_date: m = re_year.search(pub_date) if m: return m.group(1) | 1f59a633a586aae63d8fdf6c3e3fa95ae39dae26 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3913/1f59a633a586aae63d8fdf6c3e3fa95ae39dae26/update_work.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
10174,
67,
6874,
12,
73,
4672,
5634,
67,
712,
273,
425,
18,
588,
2668,
6543,
67,
712,
2187,
599,
13,
309,
5634,
67,
712,
30,
312,
273,
283,
67,
6874,
18,
3072,
12,
10174,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10174,
67,
6874,
12,
73,
4672,
5634,
67,
712,
273,
425,
18,
588,
2668,
6543,
67,
712,
2187,
599,
13,
309,
5634,
67,
712,
30,
312,
273,
283,
67,
6874,
18,
3072,
12,
10174,
... |
TheAddressTable.Add(frame_dict[OBJECT_FILE], frame_dict[INSTRUCTION_POINTER]) | TheAddressTable.Add(frame_dict[OBJECT_FILE], frame_dict[INSTRUCTION_POINTER]) | def gatherFrames(node, source_dir): frames = [] for frame in node.getElementsByTagName("frame"): frame_dict = { INSTRUCTION_POINTER : getTextOf(frame, INSTRUCTION_POINTER), OBJECT_FILE : getTextOf(frame, OBJECT_FILE), FUNCTION_NAME : getTextOf(frame, FUNCTION_NAME), SRC_FILE_DIR : removeCommonRoot( source_dir, getTextOf(frame, SRC_FILE_DIR)), SRC_FILE_NAME : getTextOf(frame, SRC_FILE_NAME), SRC_LINE : getTextOf(frame, SRC_LINE) } frames += [frame_dict] if frame_dict[FUNCTION_NAME] in _TOP_OF_STACK_POINTS: break global TheAddressTable if TheAddressTable != None and frame_dict[SRC_LINE] == "": # Try using gdb TheAddressTable.Add(frame_dict[OBJECT_FILE], frame_dict[INSTRUCTION_POINTER]) return frames | 7dac2b9e1162ea7f20002cf329583aa5fd046226 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/7dac2b9e1162ea7f20002cf329583aa5fd046226/memcheck_analyze.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11090,
15162,
12,
2159,
16,
1084,
67,
1214,
4672,
7793,
273,
5378,
364,
2623,
316,
756,
18,
588,
3471,
10401,
2932,
3789,
6,
4672,
2623,
67,
1576,
273,
288,
2120,
3902,
27035,
67,
2419,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11090,
15162,
12,
2159,
16,
1084,
67,
1214,
4672,
7793,
273,
5378,
364,
2623,
316,
756,
18,
588,
3471,
10401,
2932,
3789,
6,
4672,
2623,
67,
1576,
273,
288,
2120,
3902,
27035,
67,
2419,
... |
usetime = float(mytime) / max((30-len(history)),3) | usetime = float(mytime) / max((30-len(board.history)),3) | def go (): """ Finds and prints the best move from the current position """ searchLock.acquire() # TODO: Length info should be put in the book. # Btw. 10 is not enough. Try 20 if len(board.history) < 14: movestr = getBestOpening(board) if movestr: mvs = [parseSAN(board, movestr)] if len(board.history) >= 14 or not movestr: global mytime, increment lsearch.searching = True if mytime == None: mvs, scr = alphaBeta (board, sd) else: # We bet that the game will be about 30 moves. That gives us # starttime / 30 seconds per turn + the incremnt. # TODO: Create more sophisticated method. usetime = float(mytime) / max((30-len(history)),3) usetime = max (usetime, 5) # We don't wan't to search for e.g. 0 secs starttime = time() endtime = starttime + usetime print "Time left: %d seconds; Thinking for %d seconds" % \ (mytime, usetime) for depth in range(1,sd+1): mvs, scr = alphaBeta (board, depth) if time() > endtime: break mytime -= time() - starttime mytime += increment if not mvs: if scr == 0: print "result", reprResult[DRAW] elif scr < 0: if board.color == WHITE: print "result", reprResult[BLACKWON] else: print "result", reprResult[WHITEWON] else: if board.color == WHITE: print "result", reprResult[WHITEWON] else: print "result", reprResult[BLACKWON] return print "moves were:", " ".join(listToSan(board, mvs)) lsearch.movesearches = 0 lsearch.nodes = 0 lsearch.searching = False move = mvs[0] print "move", toSAN(board, move) board.applyMove(move) searchLock.release() | 98757f231a455915156406d6e000528d2bfbd273 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5339/98757f231a455915156406d6e000528d2bfbd273/PyChess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1960,
1832,
30,
3536,
4163,
87,
471,
14971,
326,
3796,
3635,
628,
326,
783,
1754,
3536,
225,
1623,
2531,
18,
1077,
1039,
1435,
225,
468,
2660,
30,
11311,
1123,
1410,
506,
1378,
316,
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,
1960,
1832,
30,
3536,
4163,
87,
471,
14971,
326,
3796,
3635,
628,
326,
783,
1754,
3536,
225,
1623,
2531,
18,
1077,
1039,
1435,
225,
468,
2660,
30,
11311,
1123,
1410,
506,
1378,
316,
326,... |
n = '.'.join(name[:len(name)-i]) | def build_docs(names, inspect=True, parse=True): names = [DottedName(name) for name in names] # Create our tool chain inspector = DocInspector() parser = DocParser(inspector.inspect(__builtins__)) merger = DocMerger() docstring_parser = DocstringParser() inheriter = DocInheriter() parsedocs = [] inspectdocs = [] for name in names: if parse: parsedocs.append(parser.find(name)) else: parsedocs.append(None) # Inspecting if inspect: for i in range(len(name)): try: n = '.'.join(name[:len(name)-i]) val = __import__(n) for identifier in name[1:]: val = getattr(val, identifier) inspectdocs.append(inspector.inspect(val)) break except ImportError: pass else: print 'Could not import %s' % name inspectdocs.append(None) else: inspectdocs.append(None) # Merge all docs. merged_docs = [] for name, parsedoc, inspectdoc in zip(names, parsedocs, inspectdocs): if inspectdoc is None and parsedoc is None: print 'Warning: No docs for %s' % name elif inspectdoc is None: merged_docs.append(parsedoc) elif parsedoc is None: merged_docs.append(inspectdoc) else: merged_docs.append(merger.merge(inspectdoc, parsedoc)) # Construct a dictionary mapping name -> ValueDoc, and use that # dictionary to create an index. doc_dict = dict(zip(names, merged_docs)) docindex = DocIndex(doc_dict) # Parse all docstrings. for val_doc in docindex.reachable_valdocs: docstring_parser.parse_docstring(val_doc) if isinstance(val_doc, ClassDoc): if val_doc.local_variables is not UNKNOWN: for var_doc in val_doc.local_variables.values(): docstring_parser.parse_docstring(var_doc) if isinstance(val_doc, NamespaceDoc): if val_doc.variables is not UNKNOWN: for var_doc in val_doc.variables.values(): docstring_parser.parse_docstring(var_doc) # Inheritance. inheriter.inherit(docindex) | 39028ad155a48d1e14faba061237da8a4813af2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/39028ad155a48d1e14faba061237da8a4813af2e/driver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
8532,
12,
1973,
16,
5334,
33,
5510,
16,
1109,
33,
5510,
4672,
1257,
273,
306,
10412,
2344,
461,
12,
529,
13,
364,
508,
316,
1257,
65,
225,
468,
1788,
3134,
5226,
2687,
22700,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
8532,
12,
1973,
16,
5334,
33,
5510,
16,
1109,
33,
5510,
4672,
1257,
273,
306,
10412,
2344,
461,
12,
529,
13,
364,
508,
316,
1257,
65,
225,
468,
1788,
3134,
5226,
2687,
22700,... | |
for error in tserrors: errstring += error | for (descr, (etype, mount, need)) in tserrors: errstring += descr | def doTransaction(self): """takes care of package downloading, checking, user confirmation and actually RUNNING the transaction""" | 58c23422b7c442f58ff92e368d304c73c4985179 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/58c23422b7c442f58ff92e368d304c73c4985179/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
3342,
12,
2890,
4672,
3536,
88,
3223,
7671,
434,
2181,
23742,
16,
6728,
16,
729,
14296,
471,
6013,
23574,
326,
2492,
8395,
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,
0,
0,
0,
0,
0,
0,
0,
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,
741,
3342,
12,
2890,
4672,
3536,
88,
3223,
7671,
434,
2181,
23742,
16,
6728,
16,
729,
14296,
471,
6013,
23574,
326,
2492,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
(config.get(prefs.THEME_NAME) is not None) and (config.get(prefs.THEME_DIRECTORY) is not None)): | (config.get(prefs.THEME_NAME) is not None)): | def onFirstRun(self): logging.info("Spawning Miro Guide...") guideURL = unicode(config.get(prefs.CHANNEL_GUIDE_URL)) if guide.getGuideByURL(guideURL) is None: guide.ChannelGuide(guideURL, unicode(config.get(prefs.CHANNEL_GUIDE_ALLOWED_URLS)).split()) | 67ff5593848959e82358c233d9dd2de48ed6c265 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/67ff5593848959e82358c233d9dd2de48ed6c265/theme.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3759,
1997,
12,
2890,
4672,
2907,
18,
1376,
2932,
3389,
2219,
2093,
490,
11373,
13018,
7070,
13,
7343,
1785,
273,
5252,
12,
1425,
18,
588,
12,
1484,
2556,
18,
15814,
67,
17525,
41,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3759,
1997,
12,
2890,
4672,
2907,
18,
1376,
2932,
3389,
2219,
2093,
490,
11373,
13018,
7070,
13,
7343,
1785,
273,
5252,
12,
1425,
18,
588,
12,
1484,
2556,
18,
15814,
67,
17525,
41,
... |
class OptionFrame (tk.Frame): """A Frame containing Controls that control command-line options. """ def __init__(self, master=None): """Create an OptionFrame with the given master and control widgets. master: Tkinter widget that will contain this OptionFrame args: Positional arguments to pass to Frame constructor kwargs: Keyword arguments to pass to Frame constructor """ tk.Frame.__init__(self, master, *args, **kwargs) self.controls = {} def add(self, option, widget): """Add a widget controlling the given option. """ assert isinstance(widget, tk.Widget) self.controls[option] = widget def get(self, option): """Get the value of the given option from its associated widget. """ return self.controls[option].get() def set(self, option, value): """Set the value of the widget associated with the given option. """ self.controls[option].set(value) def arglist(self): """Return a list of command-line arguments for all options. """ args = [] for option, widget in self.controls.items(): value = widget.get() if value == True: args.append("-%s" % option) elif value: args.append("-%s" % option) args.append(value) return args | def set(self, value): """Set sub-widget's value.""" self.widget.set(value) | ac756e9bfa740df0ff497bc9bb0b414d357eefc4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4675/ac756e9bfa740df0ff497bc9bb0b414d357eefc4/meta.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
460,
4672,
3536,
694,
720,
17,
6587,
1807,
460,
12123,
365,
18,
6587,
18,
542,
12,
1132,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
12,
2890,
16,
460,
4672,
3536,
694,
720,
17,
6587,
1807,
460,
12123,
365,
18,
6587,
18,
542,
12,
1132,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
return "The Rubik's cube group with genrators R,L,F,B,U,D in SymmetricGroup(48)." | return "The Rubik's cube group with genrators R,L,F,B,U,D in SymmetricGroup(48)." | def __str__(self): | d6e55544eeb2c8853758824e2c33afd9265928af /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/d6e55544eeb2c8853758824e2c33afd9265928af/cubegroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
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,
-10... |
seek_to = widgets.watcher.time[0] | seek_to = player.playlist.get_position() | def __input_check(self, source, condition): c = os.read(source, 1) if c == "<": self.__previous_song() elif c == ">": self.__next_song() elif c == "-": self.__play_pause() elif c == ")": player.playlist.paused = False elif c == "|": player.playlist.paused = True elif c == "0": player.playlist.seek(0) elif c == "v": c2 = os.read(source, 3) if c2 == "+": self.volume.set_value(self.volume.get_value() + 0.05) elif c2 == "-": self.volume.set_value(self.volume.get_value() - 0.05) else: try: self.volume.set_value(int(c2) / 100.0) except ValueError: pass elif c == "&": c2 = os.read(source, 1) if c2 in "012": self.shuffle.set_active(int(c2)) elif c2 == "t": self.shuffle.set_active( int(not bool(self.shuffle.get_active()))) elif c == "@": c2 = os.read(source, 1) if c2 == "0": self.repeat.set_active(False) elif c2 == "t": self.repeat.set_active(not self.repeat.get_active()) else: self.repeat.set_active(True) elif c == "!": self.present() elif c == "q": self.__make_query(os.read(source, 4096)) elif c == "s": time = os.read(source, 20) seek_to = widgets.watcher.time[0] if time[0] == "+": seek_to += util.parse_time(time[1:]) * 1000 elif time[0] == "-": seek_to -= util.parse_time(time[1:]) * 1000 else: seek_to = util.parse_time(time) * 1000 seek_to = min(widgets.watcher.time[1] - 1, max(0, seek_to)) player.playlist.seek(seek_to) elif c == "p": filename = os.read(source, 4096) if library.add(filename): widgets.watcher.added(filename) if filename in library: song = library[filename] if song not in self.playlist.pl: e_fn = sre.escape(filename) self.__make_query("filename = /^%s/c" % e_fn) player.playlist.go_to(library[filename]) player.playlist.paused = False else: print to(_("W: Unable to load %s") % filename) elif c == "d": filename = os.read(source, 4096) for added, changed, removed in library.scan([filename]): pass if added: widgets.watcher.added(added) if changed: widgets.watcher.changed(changed) if removed: widgets.watcher.removed(removed) if added or changed or removed: widgets.watcher.refresh() self.__make_query("filename = /^%s/c" % sre.escape(filename)) | e6e351b5c12145e3074743d9e941ebe090bbcb93 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/e6e351b5c12145e3074743d9e941ebe090bbcb93/widgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2630,
67,
1893,
12,
2890,
16,
1084,
16,
2269,
4672,
276,
273,
1140,
18,
896,
12,
3168,
16,
404,
13,
309,
276,
422,
3532,
6877,
365,
16186,
11515,
67,
816,
75,
1435,
1327,
276,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2630,
67,
1893,
12,
2890,
16,
1084,
16,
2269,
4672,
276,
273,
1140,
18,
896,
12,
3168,
16,
404,
13,
309,
276,
422,
3532,
6877,
365,
16186,
11515,
67,
816,
75,
1435,
1327,
276,
... |
values=cls.values.items() | values=values | def _create_schema_item(cls, view): if hasattr(cls, 'constants'): return Types.ConstantEnumeration( None, view['Schema'], itemFor(Types.ConstantEnumeration, view), values=cls.values.items() ) else: return Types.Enumeration( None, view['Schema'], itemFor(Types.Enumeration, view), values=list(cls.values) ) | 509c9c30f5e66cb2f823c4354399436ed0d5d3f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/509c9c30f5e66cb2f823c4354399436ed0d5d3f3/schema.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
4821,
67,
1726,
12,
6429,
16,
1476,
4672,
309,
3859,
12,
6429,
16,
296,
13358,
11,
4672,
327,
7658,
18,
6902,
21847,
12,
599,
16,
1476,
3292,
3078,
17337,
761,
1290,
12,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
4821,
67,
1726,
12,
6429,
16,
1476,
4672,
309,
3859,
12,
6429,
16,
296,
13358,
11,
4672,
327,
7658,
18,
6902,
21847,
12,
599,
16,
1476,
3292,
3078,
17337,
761,
1290,
12,... |
if target_iswin: exe = exe + "_" is24 = hasattr(sys, "version_info") and sys.version_info[:2] >= (2,4) exe = exe + "67"[is24] exe = exe + "rd"[self.debug] exe = exe + "wc"[self.console] else: if not self.console: exe = exe + 'w' if self.debug: exe = exe + '_d' | if not self.console: exe = exe + 'w' if self.debug: exe = exe + '_d' | def _bootloader_postfix(self, exe): if target_iswin: exe = exe + "_" is24 = hasattr(sys, "version_info") and sys.version_info[:2] >= (2,4) exe = exe + "67"[is24] exe = exe + "rd"[self.debug] exe = exe + "wc"[self.console] else: if not self.console: exe = exe + 'w' if self.debug: exe = exe + '_d' return exe | c0cee3b7723667ae2845b4ae375ebabb164c3eb9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11925/c0cee3b7723667ae2845b4ae375ebabb164c3eb9/Build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7137,
6714,
67,
2767,
904,
12,
2890,
16,
15073,
4672,
3639,
309,
486,
365,
18,
8698,
30,
15073,
273,
15073,
397,
296,
91,
11,
309,
365,
18,
4148,
30,
15073,
273,
15073,
397,
2070,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
7137,
6714,
67,
2767,
904,
12,
2890,
16,
15073,
4672,
3639,
309,
486,
365,
18,
8698,
30,
15073,
273,
15073,
397,
296,
91,
11,
309,
365,
18,
4148,
30,
15073,
273,
15073,
397,
2070,... |
if channel_id == 0: return 0 | if channel_id: channels[channel_id] = [time.time() + CHANNEL_TIMEOUT, ""] print >>sys.stderr, "crawler: _acquire_channel_id:", show_permid_short(permid), len(channels), "channels used" | def _acquire_channel_id(self, permid): if permid in self._channels: channels = self._channels[permid] else: channels = {} self._channels[permid] = channels | 1a756a891e14660826a25bba2bbf8634ea99d4ae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9686/1a756a891e14660826a25bba2bbf8634ea99d4ae/Crawler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1077,
1039,
67,
4327,
67,
350,
12,
2890,
16,
4641,
350,
4672,
309,
4641,
350,
316,
365,
6315,
9114,
30,
5750,
273,
365,
6315,
9114,
63,
12160,
350,
65,
469,
30,
5750,
273,
2618,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1077,
1039,
67,
4327,
67,
350,
12,
2890,
16,
4641,
350,
4672,
309,
4641,
350,
316,
365,
6315,
9114,
30,
5750,
273,
365,
6315,
9114,
63,
12160,
350,
65,
469,
30,
5750,
273,
2618,
... |
this = apply(_quickfix.new_BidSpotRate, args) | this = _quickfix.new_BidSpotRate(*args) | def __init__(self, *args): this = apply(_quickfix.new_BidSpotRate, 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,
17763,
17292,
4727,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
17763,
17292,
4727,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
... |
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.connect((host, port)) self.sslobj = ssl.wrap_socket(self.sock, self.keyfile, self.certfile) def read(self, size): """Read 'size' bytes from remote.""" chunks = [] read = 0 while read < size: data = self.sslobj.read(size-read) read += len(data) chunks.append(data) return ''.join(chunks) def readline(self): """Read line from remote.""" line = [] while 1: char = self.sslobj.read(1) line.append(char) if char == "\n": return ''.join(line) def send(self, data): """Send data to remote.""" bytes = len(data) while bytes > 0: sent = self.sslobj.write(data) if sent == bytes: break data = data[sent:] bytes = bytes - sent def shutdown(self): """Close I/O established in "open".""" self.sock.close() def socket(self): """Return socket instance used to connect to IMAP4 server. socket = <instance>.socket() | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((host, port)) self.sock = ssl.wrap_socket(sock, self.keyfile, self.certfile) self.file = self.sock.makefile('rb') def ssl(self): """Return SSLObject instance used to communicate with the IMAP4 server. ssl = ssl.wrap_socket(<instance>.socket) | def open(self, host = '', port = IMAP4_SSL_PORT): """Setup connection to remote server on "host:port". (default: localhost:standard IMAP4 SSL port). This connection will be used by the routines: read, readline, send, shutdown. """ self.host = host self.port = port self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.connect((host, port)) self.sslobj = ssl.wrap_socket(self.sock, self.keyfile, self.certfile) | 0edfe45cf47801ac945acf496d62219af995e8b1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/0edfe45cf47801ac945acf496d62219af995e8b1/imaplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
1479,
273,
10226,
1756,
273,
6246,
2203,
24,
67,
6745,
67,
6354,
4672,
3536,
7365,
1459,
358,
2632,
1438,
603,
315,
2564,
30,
655,
9654,
261,
1886,
30,
17365,
30,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
1479,
273,
10226,
1756,
273,
6246,
2203,
24,
67,
6745,
67,
6354,
4672,
3536,
7365,
1459,
358,
2632,
1438,
603,
315,
2564,
30,
655,
9654,
261,
1886,
30,
17365,
30,
1... |
'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theorical Revenue', | 'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theoretical Revenue', | def _theorical_margin_calc(self, cr, uid, ids, name, arg, context=None): res = {} for account in self.browse(cr, uid, ids, context=context): res[account.id] = account.ca_theorical + account.total_cost for id in ids: res[id] = round(res.get(id, 0.0),2) return res | 0ca6e99f67d85abaf2272302141555f7d648e2b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0ca6e99f67d85abaf2272302141555f7d648e2b2/account_analytic_analysis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5787,
10129,
67,
10107,
67,
12448,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
1501,
16,
819,
33,
7036,
4672,
400,
273,
2618,
364,
2236,
316,
365,
18,
25731,
12,
3353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5787,
10129,
67,
10107,
67,
12448,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
1501,
16,
819,
33,
7036,
4672,
400,
273,
2618,
364,
2236,
316,
365,
18,
25731,
12,
3353,
... |
dataPath = os.path.realpath( "%s/%s" % ( rootPath, dataPath ) ) | dataPath = os.path.realpath( "%s/%s" % ( gConfig.getValue( '/LocalSite/InstancePath', rootPath ), dataPath ) ) | def initializeMonitoringHandler( serviceInfo ): #Check that the path is writable monitoringSection = PathFinder.getServiceSection( "Framework/Monitoring" ) #Get data location dataPath = gConfig.getValue( "%s/DataLocation" % monitoringSection, "data/monitoring" ) dataPath = dataPath.strip() if "/" != dataPath[0]: dataPath = os.path.realpath( "%s/%s" % ( rootPath, dataPath ) ) gLogger.info( "Data will be written into %s" % dataPath ) try: os.makedirs( dataPath ) except: pass try: testFile = "%s/mon.jarl.test" % dataPath fd = file( testFile, "w" ) fd.close() os.unlink( testFile ) except IOError: gLogger.fatal( "Can't write to %s" % dataPath ) return S_ERROR( "Data location is not writable" ) #Define globals gServiceInterface.initialize( dataPath ) if not gServiceInterface.initializeDB(): return S_ERROR( "Can't start db engine" ) gMonitor.registerActivity( "cachedplots", "Cached plot images", "Monitoring plots", "plots", gMonitor.OP_SUM ) gMonitor.registerActivity( "drawnplots", "Drawn plot images", "Monitoring plots", "plots", gMonitor.OP_SUM ) return S_OK() | 9c7c04b6baa39d8aa37a160ecc5d20d5122050b6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9c7c04b6baa39d8aa37a160ecc5d20d5122050b6/MonitoringHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
18410,
1503,
12,
1156,
966,
262,
30,
468,
1564,
716,
326,
589,
353,
9691,
16309,
5285,
273,
2666,
8441,
18,
588,
1179,
5285,
12,
315,
13701,
19,
18410,
6,
262,
468,
967,
501,
211... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
18410,
1503,
12,
1156,
966,
262,
30,
468,
1564,
716,
326,
589,
353,
9691,
16309,
5285,
273,
2666,
8441,
18,
588,
1179,
5285,
12,
315,
13701,
19,
18410,
6,
262,
468,
967,
501,
211... |
if config.gcc.cxxflags: cmd.extend(config.gcc.cxxflags.split(' ')) | cxxflags = [flag for flag in config.gcc.cxxflags.split(' ') if flag] cmd.extend(cxxflags) | def gcc_module_compile_str(module_name, src_code, location=None, include_dirs=[], lib_dirs=[], libs=[], preargs=[]): """ :param module_name: string (this has been embedded in the src_code :param src_code: a complete c or c++ source listing for the module :param location: a pre-existing filesystem directory where the cpp file and .so will be written :param include_dirs: a list of include directory names (each gets prefixed with -I) :param lib_dirs: a list of library search path directory names (each gets prefixed with -L) :param libs: a list of libraries to link with (each gets prefixed with -l) :param preargs: a list of extra compiler arguments :returns: dynamically-imported python module of the compiled code. """ #TODO: Do not do the dlimport in this function if preargs is None: preargs = [] else: preargs = list(preargs) if sys.platform != 'win32': # Under Windows it looks like fPIC is useless. Compiler warning: # '-fPIC ignored for target (all code is position independent)' preargs.append('-fPIC') no_opt = False include_dirs = std_include_dirs() + include_dirs libs = std_libs() + libs lib_dirs = std_lib_dirs() + lib_dirs if sys.platform == 'win32': python_inc = distutils.sysconfig.get_python_inc() # Typical include directory: C:\Python26\include libname = os.path.basename(os.path.dirname(python_inc)).lower() # Also add directory containing the Python library to the library # directories. python_lib_dir = os.path.join(os.path.dirname(python_inc), 'libs') lib_dirs = [python_lib_dir] + lib_dirs else: # Typical include directory: /usr/include/python2.6 python_inc = distutils.sysconfig.get_python_inc() libname = os.path.basename(python_inc) #DSE Patch 1 for supporting OSX frameworks; add -framework Python if sys.platform=='darwin' : preargs.extend(['-undefined','dynamic_lookup']) # link with the framework library *if specifically requested* # config.mac_framework_link is by default False, since on some mac # installs linking with -framework causes a Bus Error if python_inc.count('Python.framework')>0 and config.cmodule.mac_framework_link: preargs.extend(['-framework','Python']) # patch from Benjamin Schrauwen # April 14, 2009 if distutils.sysconfig.get_config_var('CFLAGS').rfind('x86_64') < 0: # If on mac, and not a 64-bit version of python, switch to 32 bit compilation preargs.extend(['-m32']) # sometimes, the linker cannot find -lpython so we need to tell it # explicitly where it is located # this returns somepath/lib/python2.x python_lib = distutils.sysconfig.get_python_lib(plat_specific=1, \ standard_lib=1) python_lib = os.path.dirname(python_lib) if python_lib not in lib_dirs: lib_dirs.append(python_lib) workdir = location cppfilename = os.path.join(location, 'mod.cpp') cppfile = file(cppfilename, 'w') debug('Writing module C++ code to', cppfilename) ofiles = [] rval = None cppfile.write(src_code) cppfile.close() lib_filename = os.path.join(location, '%s.%s' % (module_name, get_lib_extension())) debug('Generating shared lib', lib_filename) cmd = ['g++', get_gcc_shared_library_arg(), '-g'] if no_opt: cmd.extend(p for p in preargs if not p.startswith('-O')) else: cmd.extend(preargs) if config.gcc.cxxflags: cmd.extend(config.gcc.cxxflags.split(' ')) cmd.extend('-I%s'%idir for idir in include_dirs) cmd.extend(['-o',lib_filename]) cmd.append(cppfilename) cmd.extend(['-L%s'%ldir for ldir in lib_dirs]) cmd.extend(['-l%s'%l for l in libs]) debug('Running cmd', ' '.join(cmd)) p = subprocess.Popen(cmd) status = p.wait() if status: print '===============================' for i, l in enumerate(src_code.split('\n')): #gcc put its messages to stderr, so we add ours now print >> sys.stderr, '%05i\t%s'%(i+1, l) print '===============================' raise Exception('g++ return status', status) #touch the __init__ file file(os.path.join(location, "__init__.py"),'w').close() return dlimport(lib_filename) | 4f455fdffe392b2424a8d42aa73238d7c5219b9c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/4f455fdffe392b2424a8d42aa73238d7c5219b9c/cmodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
314,
952,
67,
2978,
67,
11100,
67,
701,
12,
2978,
67,
529,
16,
1705,
67,
710,
16,
2117,
33,
7036,
16,
2341,
67,
8291,
22850,
6487,
2561,
67,
8291,
22850,
6487,
15042,
22850,
6487,
675,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
314,
952,
67,
2978,
67,
11100,
67,
701,
12,
2978,
67,
529,
16,
1705,
67,
710,
16,
2117,
33,
7036,
16,
2341,
67,
8291,
22850,
6487,
2561,
67,
8291,
22850,
6487,
15042,
22850,
6487,
675,... |
(p,v,t) = _RegEnumValue(k,i) | (p,v,t) = RegEnumValue(k,i) | def get_msvc_paths (path, version='6.0', platform='x86'): """Get a list of devstudio directories (include, lib or path). Return a list of strings; will be empty list if unable to access the registry or appropriate registry keys not found.""" if not _can_read_reg: return [] L = [] if path=='lib': path= 'Library' path = string.upper(path + ' Dirs') K = ('Software\\Microsoft\\Devstudio\\%s\\' + 'Build System\\Components\\Platforms\\Win32 (%s)\\Directories') % \ (version,platform) for base in (_HKEY_CLASSES_ROOT, _HKEY_LOCAL_MACHINE, _HKEY_CURRENT_USER, _HKEY_USERS): try: k = _RegOpenKeyEx(base,K) i = 0 while 1: try: (p,v,t) = _RegEnumValue(k,i) if string.upper(p) == path: V = string.split(v,';') for v in V: if v == '' or v in L: continue L.append(v) break i = i + 1 except _RegError: break except _RegError: pass return L | 1027e3fde9b9cb6eb470cc13e48fbd2208658b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1027e3fde9b9cb6eb470cc13e48fbd2208658b32/msvccompiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
959,
4227,
67,
4481,
261,
803,
16,
1177,
2218,
26,
18,
20,
2187,
4072,
2218,
92,
5292,
11,
4672,
3536,
967,
279,
666,
434,
4461,
334,
4484,
6402,
261,
6702,
16,
2561,
578,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
959,
4227,
67,
4481,
261,
803,
16,
1177,
2218,
26,
18,
20,
2187,
4072,
2218,
92,
5292,
11,
4672,
3536,
967,
279,
666,
434,
4461,
334,
4484,
6402,
261,
6702,
16,
2561,
578,
5... |
st = p.communicate() out = p.stdout if st == 0: for line in out.splitlines(): | stdout, stderr = p.communicate() if p.returncode == 0: for line in stdout.splitlines(): | def _can_target(cmd, arch): """Return true is the command supports the -arch flag for the given architecture.""" newcmd = cmd[:] newcmd.extend(["-arch", arch, "-v"]) p = Popen(newcmd, stderr=STDOUT, stdout=PIPE) st = p.communicate() out = p.stdout if st == 0: for line in out.splitlines(): m = re.search(_R_ARCHS[arch], line) if m: return True return False | 683a8d0b65c1d55f3793abb80a4af486e7232492 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/683a8d0b65c1d55f3793abb80a4af486e7232492/gnu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4169,
67,
3299,
12,
4172,
16,
6637,
4672,
3536,
990,
638,
353,
326,
1296,
6146,
326,
300,
991,
2982,
364,
326,
864,
27418,
12123,
394,
4172,
273,
1797,
10531,
65,
394,
4172,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4169,
67,
3299,
12,
4172,
16,
6637,
4672,
3536,
990,
638,
353,
326,
1296,
6146,
326,
300,
991,
2982,
364,
326,
864,
27418,
12123,
394,
4172,
273,
1797,
10531,
65,
394,
4172,
18,
1... |
libraries.append('quiputils') | libraries = ['quiputils'] + libraries | def find_wrap_sources(makefile, quip_root): source_dirs = [] wrap_sources = [] wrap_types = [] libraries = [] targets = [] libatoms_dir = os.path.join(quip_root, 'libAtoms/') wrap_sources += [os.path.join(libatoms_dir, s) for s in ['System.f95', 'ExtendableStr.f95', 'MPI_context.f95', 'Units.f95', 'linearalgebra.f95', 'Dictionary.f95', 'Table.f95', 'PeriodicTable.f95', 'Atoms.f95', 'DynamicalSystem.f95', 'clusters.f95','Structures.f95', 'DomainDecomposition.f95', 'CInOutput.f95', 'ParamReader.f95', 'frametools.f95']] wrap_types += ['inoutput', 'mpi_context', 'dictionary', 'table', 'atoms', 'connection', 'dynamicalsystem', 'domaindecomposition', 'cinoutput', 'extendable_str'] source_dirs.append(libatoms_dir) libraries.append('atoms') targets.append((quip_root, 'libAtoms')) if 'HAVE_GP' in makefile and int(makefile['HAVE_GP']) == 1: gp_dir = os.path.join(quip_root, 'gp') source_dirs.append(gp_dir) libraries.append('gp') targets.append((quip_root, 'gp')) wrap_sources += [os.path.join(gp_dir, s) for s in ['clustering.f95']] wrap_types += ['lst', 'clstr'] quip_core_dir = os.path.join(quip_root, 'QUIP_Core/') source_dirs.append(quip_core_dir) wrap_sources += [os.path.join(quip_core_dir, s) for s in ['Potential.f95']] wrap_types += ['potential'] libraries.append('quip') targets.append((quip_root, 'QUIP_Core')) do_tools = not 'QUIPPY_NO_TOOLS' in makefile or ('QUIPPY_NO_TOOLS' in makefile and not int(makefile['QUIPPY_NO_TOOLS'])) do_crack = not 'QUIPPY_NO_CRACK' in makefile or ('QUIPPY_NO_CRACK' in makefile and not int(makefile['QUIPPY_NO_CRACK'])) if do_tools or do_crack: quip_utils_dir = os.path.join(quip_root, 'QUIP_Utils/') source_dirs.append(quip_utils_dir) libraries.append('quiputils') targets.append((quip_root, 'QUIP_Utils')) if do_tools: wrap_sources += [os.path.join(quip_utils_dir, s) for s in ['elasticity.f95']] if do_crack: wrap_sources += [os.path.join(quip_utils_dir,f) for f in ('crackparams.f95', 'cracktools.f95')] wrap_types += ['crackparams'] return source_dirs, wrap_sources, wrap_types, libraries, targets | bafb6f2dbf4c9d632582d9e81d414329d0bc12ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8914/bafb6f2dbf4c9d632582d9e81d414329d0bc12ad/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
4113,
67,
10141,
12,
6540,
768,
16,
719,
625,
67,
3085,
4672,
1084,
67,
8291,
273,
5378,
2193,
67,
10141,
273,
5378,
2193,
67,
2352,
282,
273,
5378,
14732,
273,
5378,
5774,
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,
1104,
67,
4113,
67,
10141,
12,
6540,
768,
16,
719,
625,
67,
3085,
4672,
1084,
67,
8291,
273,
5378,
2193,
67,
10141,
273,
5378,
2193,
67,
2352,
282,
273,
5378,
14732,
273,
5378,
5774,
2... |
context.loc = pa | context.setLoc(pa) | def parse_SETLOC(self, context, operands): retval = False if operands: expr = Expression(context, operands) if expr.complete: pa = expr.value context.currentRecord.target = pa context.currentRecord.complete = True context.loc = pa retval = True else: context.error("missing operand") return retval | ce86b3471a6458fe73066034f9048fcbd69ffe33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8152/ce86b3471a6458fe73066034f9048fcbd69ffe33/directive.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
4043,
29450,
12,
2890,
16,
819,
16,
14883,
4672,
5221,
273,
1083,
309,
14883,
30,
3065,
273,
5371,
12,
2472,
16,
14883,
13,
309,
3065,
18,
6226,
30,
6790,
273,
3065,
18,
1132... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
4043,
29450,
12,
2890,
16,
819,
16,
14883,
4672,
5221,
273,
1083,
309,
14883,
30,
3065,
273,
5371,
12,
2472,
16,
14883,
13,
309,
3065,
18,
6226,
30,
6790,
273,
3065,
18,
1132... |
elif type(field) == gtk.TextView: | elif type(field) == BirthdayField: | def switch_mode(self, edit=False, save=False): self.edit = edit self.addButton.set_sensitive(edit) self.saveButton.set_property("visible", edit) self.editButton.set_property("visible", not edit) self.imagechangeButton.set_property("visible", edit) self.imageremoveButton.set_property("visible", edit and self.hasphoto) self.changeButton.set_property("visible", edit) | a8a4c6ca09f6afe3062c9a37ce6363c545145985 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2651/a8a4c6ca09f6afe3062c9a37ce6363c545145985/arkadas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1620,
67,
3188,
12,
2890,
16,
3874,
33,
8381,
16,
1923,
33,
8381,
4672,
365,
18,
4619,
273,
3874,
365,
18,
1289,
3616,
18,
542,
67,
23481,
12,
4619,
13,
365,
18,
5688,
3616,
18,
542,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1620,
67,
3188,
12,
2890,
16,
3874,
33,
8381,
16,
1923,
33,
8381,
4672,
365,
18,
4619,
273,
3874,
365,
18,
1289,
3616,
18,
542,
67,
23481,
12,
4619,
13,
365,
18,
5688,
3616,
18,
542,... |
J = self.index_set() | J = self.index_object() | def idwt(self,other="haar",wavelet_k=2): """ Implements the gsl WaveletTransform.backward in dwt.pyx. other must be an element of {"haar", "daubechies", "daubechies_centered", "haar_centered", "bspline", "bspline_centered"}. Assumes the length of the sample is a power of 2. Uses the GSL function gsl_wavelet_transform_backward. See the above docstring for dwt for further details. | 5d0c7d543a1b24ac0a1d29ac68884870541a3a98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/5d0c7d543a1b24ac0a1d29ac68884870541a3a98/dft.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
612,
6046,
12,
2890,
16,
3011,
1546,
3395,
297,
3113,
24801,
808,
67,
79,
33,
22,
4672,
3536,
29704,
326,
314,
2069,
678,
842,
808,
4059,
18,
29275,
316,
302,
6046,
18,
2074,
92,
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,
612,
6046,
12,
2890,
16,
3011,
1546,
3395,
297,
3113,
24801,
808,
67,
79,
33,
22,
4672,
3536,
29704,
326,
314,
2069,
678,
842,
808,
4059,
18,
29275,
316,
302,
6046,
18,
2074,
92,
18,
... |
def externalpatch(patcher, args, patchname, ui, strip, cwd, files): | def externalpatch(patcher, patchname, ui, strip, cwd, files): | def externalpatch(patcher, args, patchname, ui, strip, cwd, files): """use <patcher> to apply <patchname> to the working directory. returns whether patch was applied with fuzz factor.""" fuzz = False if cwd: args.append('-d %s' % util.shellquote(cwd)) fp = util.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip, util.shellquote(patchname))) for line in fp: line = line.rstrip() ui.note(line + '\n') if line.startswith('patching file '): pf = util.parse_patch_output(line) printed_file = False files.setdefault(pf, None) elif line.find('with fuzz') >= 0: fuzz = True if not printed_file: ui.warn(pf + '\n') printed_file = True ui.warn(line + '\n') elif line.find('saving rejects to file') >= 0: ui.warn(line + '\n') elif line.find('FAILED') >= 0: if not printed_file: ui.warn(pf + '\n') printed_file = True ui.warn(line + '\n') code = fp.close() if code: raise PatchError(_("patch command failed: %s") % util.explain_exit(code)[0]) return fuzz | 5fa420a2a2858de74ae86c5d9337ab239fb155b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/5fa420a2a2858de74ae86c5d9337ab239fb155b3/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3903,
2272,
12,
2272,
264,
16,
4729,
529,
16,
5915,
16,
2569,
16,
7239,
16,
1390,
4672,
3536,
1202,
411,
2272,
264,
34,
358,
2230,
411,
2272,
529,
34,
358,
326,
5960,
1867,
18,
1135,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3903,
2272,
12,
2272,
264,
16,
4729,
529,
16,
5915,
16,
2569,
16,
7239,
16,
1390,
4672,
3536,
1202,
411,
2272,
264,
34,
358,
2230,
411,
2272,
529,
34,
358,
326,
5960,
1867,
18,
1135,
... |
print "%10s -(%10s %d)-> %10s" % (fro.getSymbol().encode(ENCODING), label.getSymbol().encode(ENCODING), self.link[(fro,to,label)].getWeight() * 100, to.getSymbol().encode(ENCODING)) | print "%10s -(%10s %d)-> %10s" % (froS.encode(ENCODING), labelS.encode(ENCODING), self.link[(froS,froT,toS,toT,labelS,labelT)] .getWeight() * 100, toS.encode(ENCODING)) | def showLinks(self,stateId=None): "Show all the links in the Concept Network" for (fro,to,label) in self.link: if label: if not stateId: print "%10s -(%10s %d)-> %10s" % (fro.getSymbol().encode(ENCODING), label.getSymbol().encode(ENCODING), self.link[(fro,to,label)].getWeight() * 100, to.getSymbol().encode(ENCODING)) else: state = self.getState(stateId) print "%10s -(%10s %d)-> %10s" % (fro.getSymbol().encode(ENCODING), label.getSymbol().encode(ENCODING), self.link[(fro,to,label)].getWeight(state) * 100, to.getSymbol().encode(ENCODING)) else: print "%10s ------(%d)-------> %10s" % (fro.getSymbol().encode(ENCODING), self.link[(fro,to,label)].getWeight() * 100, to.getSymbol().encode(ENCODING)) | c854365881cedd2aea0b58afe21c063dbb848eba /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13131/c854365881cedd2aea0b58afe21c063dbb848eba/ConceptNetwork.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
7100,
12,
2890,
16,
2019,
548,
33,
7036,
4672,
315,
5706,
777,
326,
4716,
316,
326,
27842,
5128,
6,
364,
261,
74,
303,
16,
869,
16,
1925,
13,
316,
365,
18,
1232,
30,
309,
1433,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
7100,
12,
2890,
16,
2019,
548,
33,
7036,
4672,
315,
5706,
777,
326,
4716,
316,
326,
27842,
5128,
6,
364,
261,
74,
303,
16,
869,
16,
1925,
13,
316,
365,
18,
1232,
30,
309,
1433,... |
sys.stderr.write(" Reconnecting at %s\n"%(time.ctime(time.time()),)) self.elvin = Elvin.Elvin(Elvin.EC_NAMEDHOST, self.host, self.port, None, self._error_cb) | log.log( "<eddieElvin>_reconnect(), Reconnecting to Elvin: %s:%d" % (self.host,self.port), 4 ) self.elvin = Elvin.Elvin(Elvin.EC_NAMEDHOST, self.host, self.port, None, self._error_cb) | def _reconnect(self): | b371bce3d0f20227567cdc4143d5681185cfddfc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3643/b371bce3d0f20227567cdc4143d5681185cfddfc/eddieElvin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
25913,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
25913,
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,
-... |
ypname += '-' | d['version'] = inst.get('version') | def build_yname(pkgname, inst): """Build yum appropriate package name.""" ypname = pkgname if inst.get('version') != 'any': ypname += '-' if inst.get('epoch', False): ypname += "%s:" % inst.get('epoch') if inst.get('version', False) and inst.get('version') != 'any': ypname += "%s" % (inst.get('version')) if inst.get('release', False) and inst.get('release') != 'any': ypname += "-%s" % (inst.get('release')) if inst.get('arch', False) and inst.get('arch') != 'any': ypname += ".%s" % (inst.get('arch')) return ypname | 806c613f255b54d2c580b303361a7934d0324f08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/806c613f255b54d2c580b303361a7934d0324f08/YUMng.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
93,
529,
12,
10657,
529,
16,
1804,
4672,
3536,
3116,
677,
379,
5505,
2181,
508,
12123,
29647,
529,
273,
29348,
309,
1804,
18,
588,
2668,
1589,
6134,
480,
296,
2273,
4278,
302,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
93,
529,
12,
10657,
529,
16,
1804,
4672,
3536,
3116,
677,
379,
5505,
2181,
508,
12123,
29647,
529,
273,
29348,
309,
1804,
18,
588,
2668,
1589,
6134,
480,
296,
2273,
4278,
302,
... |
not os.path.isdir(vnc_bind_address): raise errors.HypervisorError("Instance vnc bind address must be either" " an ip address or an existing directory") | not os.path.isdir(vnc_bind_address): raise errors.HypervisorError("Instance vnc bind address must be either" " an ip address or an existing directory") | def ValidateParameters(self, hvparams): """Check the given parameters for validity. | 146afafbbda543d0991daac9d58b0f62a2a47164 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/146afafbbda543d0991daac9d58b0f62a2a47164/hv_kvm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3554,
2402,
12,
2890,
16,
366,
90,
2010,
4672,
3536,
1564,
326,
864,
1472,
364,
13800,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
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,
3554,
2402,
12,
2890,
16,
366,
90,
2010,
4672,
3536,
1564,
326,
864,
1472,
364,
13800,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
return getattr(self.session.loginchecker.users, self.session.username, None) | return getattr(self.session.loginchecker.users, self.session.username.encode("utf-8"), None) | def getusernode(self): """gets the user's prefs node""" if self.session.isopen: return getattr(self.session.loginchecker.users, self.session.username, None) else: return None | 9682b4ec6520c064481b1d9264d56bc2608fc073 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11388/9682b4ec6520c064481b1d9264d56bc2608fc073/translatepage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
1355,
2159,
12,
2890,
4672,
3536,
14665,
326,
729,
1807,
15503,
756,
8395,
309,
365,
18,
3184,
18,
291,
3190,
30,
327,
3869,
12,
2890,
18,
3184,
18,
5819,
19243,
18,
5577,
16,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
1355,
2159,
12,
2890,
4672,
3536,
14665,
326,
729,
1807,
15503,
756,
8395,
309,
365,
18,
3184,
18,
291,
3190,
30,
327,
3869,
12,
2890,
18,
3184,
18,
5819,
19243,
18,
5577,
16,
365... |
if isinstance(file_name, list) : | if (file_name is None) : return [] elif isinstance(file_name, list) : | def get_param_files (self, file_param_name) : file_name = self._param_files.get(file_param_name) if isinstance(file_name, list) : return file_name else : return [ file_name ] | 9d2f407d576c4b5a7bbc09802abb69a898240065 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/9d2f407d576c4b5a7bbc09802abb69a898240065/file_cache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
891,
67,
2354,
261,
2890,
16,
585,
67,
891,
67,
529,
13,
294,
585,
67,
529,
273,
365,
6315,
891,
67,
2354,
18,
588,
12,
768,
67,
891,
67,
529,
13,
309,
261,
768,
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,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
891,
67,
2354,
261,
2890,
16,
585,
67,
891,
67,
529,
13,
294,
585,
67,
529,
273,
365,
6315,
891,
67,
2354,
18,
588,
12,
768,
67,
891,
67,
529,
13,
309,
261,
768,
67,
529... |
return str(self._parent.delpat[self.value]) | if self.format == "string": return str(self._parent.delpat[self.value]) elif self.format == "dual_string": return str(self._parent.gampat[self.value]) elif self.format == "simple": return str(self.value) else: raise NotImplementedError | def __repr__(self): return str(self._parent.delpat[self.value]) | d2a686bf9ab89d9b3dc380fd04fb8c00dd4ae45b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/d2a686bf9ab89d9b3dc380fd04fb8c00dd4ae45b/fast_crystals.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
327,
609,
12,
2890,
6315,
2938,
18,
72,
1992,
270,
63,
2890,
18,
1132,
5717,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
327,
609,
12,
2890,
6315,
2938,
18,
72,
1992,
270,
63,
2890,
18,
1132,
5717,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
prefs_key=True): | prefs_key = True): | def qt4message(msg, always=False): if debug_prefs.debug_pref("Enable QT4 TODO messages", debug_prefs.Choice_boolean_False, prefs_key=True): if __linenum(always): print 'Qt 4 MESSAGE: ' + msg | cca576cf8798366875286f6eb559227b1be45d1e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/cca576cf8798366875286f6eb559227b1be45d1e/qt4transition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25672,
24,
2150,
12,
3576,
16,
3712,
33,
8381,
4672,
309,
1198,
67,
1484,
2556,
18,
4148,
67,
25724,
2932,
8317,
2238,
56,
24,
2660,
2743,
3113,
1198,
67,
1484,
2556,
18,
10538,
67,
64... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25672,
24,
2150,
12,
3576,
16,
3712,
33,
8381,
4672,
309,
1198,
67,
1484,
2556,
18,
4148,
67,
25724,
2932,
8317,
2238,
56,
24,
2660,
2743,
3113,
1198,
67,
1484,
2556,
18,
10538,
67,
64... |
os.mkdir(root+"var/db/pkg/"+mycategory+"/"+mypackage,0755) | os.mkdir(root+"var/db/pkg/"+mycategory+"/"+mypackage,0755) | def prepare_db(mycategory,mypackage): if not os.path.isdir(root+"var"): os.mkdir(root+"var",0755) if not os.path.isdir(root+"var/db"): os.mkdir(root+"var/db",0755) if not os.path.isdir(root+"var/db/pkg"): os.mkdir(root+"var/db/pkg",0755) if not os.path.isdir(root+"var/db/pkg/"+mycategory): os.mkdir(root+"var/db/pkg/"+mycategory,0755) if not os.path.isdir(root+"var/db/pkg/"+mycategory+"/"+mypackage): os.mkdir(root+"var/db/pkg/"+mycategory+"/"+mypackage,0755) | 96798fc4231d42befd1b30836093b0523bec3804 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2807/96798fc4231d42befd1b30836093b0523bec3804/portage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
67,
1966,
12,
4811,
4743,
16,
81,
879,
1270,
4672,
309,
486,
1140,
18,
803,
18,
291,
1214,
12,
3085,
9078,
1401,
6,
4672,
1140,
18,
26686,
12,
3085,
9078,
1401,
3113,
8642,
2539,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
67,
1966,
12,
4811,
4743,
16,
81,
879,
1270,
4672,
309,
486,
1140,
18,
803,
18,
291,
1214,
12,
3085,
9078,
1401,
6,
4672,
1140,
18,
26686,
12,
3085,
9078,
1401,
3113,
8642,
2539,... |
print_warning(req, "No match found, trying similar queries...", "", "<p>","<p>") | print_warning(req, "No exact match found, trying similar queries...", "", "<p>","<p>") | def perform_request_search(req=None, cc=cdsname, c=None, p="", f="", rg="10", sf="", so="d", sp="", of="hb", ot="", as="0", p1="", f1="", m1="", op1="", p2="", f2="", m2="", op2="", p3="", f3="", m3="", sc="0", jrec="0", id="-1", idb="-1", sysnb="", search="SEARCH", d1y="", d1m="", d1d="", d2y="", d2m="", d2d=""): """Perform search, without checking for authentication. Return list of recIDs found, if of=id. Otherwise create web page.""" # wash all passed arguments: cc = wash_url_argument(cc, 'str') p = wash_url_argument(p, 'str') f = wash_url_argument(f, 'str') rg = wash_url_argument(rg, 'int') sf = wash_url_argument(sf, 'str') so = wash_url_argument(so, 'str') sp = wash_url_argument(sp, 'string') of = wash_url_argument(of, 'str') if type(ot) is list: ot = string.join(ot,",") ot = wash_url_argument(ot, 'str') as = wash_url_argument(as, 'int') p1 = wash_url_argument(p1, 'str') f1 = wash_url_argument(f1, 'str') m1 = wash_url_argument(m1, 'str') op1 = wash_url_argument(op1, 'str') p2 = wash_url_argument(p2, 'str') f2 = wash_url_argument(f2, 'str') m2 = wash_url_argument(m2, 'str') op2 = wash_url_argument(op2, 'str') p3 = wash_url_argument(p3, 'str') f3 = wash_url_argument(f3, 'str') m3 = wash_url_argument(m3, 'str') sc = wash_url_argument(sc, 'int') jrec = wash_url_argument(jrec, 'int') id = wash_url_argument(id, 'int') idb = wash_url_argument(idb, 'int') sysnb = wash_url_argument(sysnb, 'int') search = wash_url_argument(search, 'str') d1y = wash_url_argument(d1y, 'str') d1m = wash_url_argument(d1m, 'str') d1d = wash_url_argument(d1d, 'str') d2y = wash_url_argument(d2y, 'str') d2m = wash_url_argument(d2m, 'str') d2d = wash_url_argument(d2d, 'str') day1, day2 = wash_dates(d1y, d1m, d1d, d2y, d2m, d2d) # deduce user id: uid = getUid(req) # start output if of.startswith('x'): # we are doing XML output: req.content_type = "text/xml" req.send_http_header() req.write("""<?xml version="1.0" encoding="UTF-8"?>\n""") if of.startswith("xm"): req.write("""<collection xmlns="http://www.loc.gov/MARC21/slim">\n""") else: req.write("""<collection>\n""") elif of.startswith('t') or str(of[0:3]).isdigit(): # we are doing plain text output: req.content_type = "text/plain" req.send_http_header() elif of == "id": # we are passing list of recIDs pass else: # we are doing HTML output: req.content_type = "text/html" req.send_http_header() # write header: req.write(create_header(cc, as, uid)) if sysnb or id>0: ## 1 - detailed record display if sysnb: # ALEPH sysnb is passed, so deduce MySQL id for the record: id = get_mysql_recid_from_aleph_sysno(sysnb) if of=="hb": of = "hd" if record_exists(id): if idb<=id: # sanity check idb=id+1 print_records(req, range(id,idb), -1, -9999, of, ot) else: # record does not exist if of.startswith("h"): (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) out = """<table width="100%%" cellspacing="0" cellpadding="0" border="0"> <tr valign="top"> <td> %s </td> <td class="pagestriperight"> %s </td> </tr> </table>""" % \ (create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search), create_google_box(p, f, p1, p2, p3)) req.write(out) print_warning(req, "Requested record does not seem to exist.", None, "<p>") elif search == "Browse": ## 2 - browse needed (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) # write search box: if of.startswith("h"): out = """<table width="100%%" cellspacing="0" cellpadding="0" border="0"> <tr valign="top"> <td> %s </td> <td class="pagestriperight"> %s </td> </tr> </table>""" % \ (create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search), create_google_box(p, f, p1, p2, p3)) req.write(out) if as==1 or (p1 or p2 or p3): browse_pattern(req, colls_to_search, p1, f1, rg) browse_pattern(req, colls_to_search, p2, f2, rg) browse_pattern(req, colls_to_search, p3, f3, rg) else: browse_pattern(req, colls_to_search, p, f, rg) else: ## 3 - search needed # wash passed collection arguments: (cc, colls_to_display, colls_to_search) = wash_colls(cc, c, sc) p = wash_pattern(p) f = wash_field(f) # write search box: if of.startswith("h"): out = """<table width="100%%" cellspacing="0" cellpadding="0" border="0"> <tr valign="top"> <td> %s </td> <td class="pagestriperight"> %s </td> </tr> </table>""" % \ (create_search_box(cc, colls_to_display, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d, search), create_google_box(p, f, p1, p2, p3)) req.write(out) # run search: t1 = os.times()[4] if as == 1 or (p1 or p2 or p3): # 3A - advanced search results_final = search_pattern(req, "", "", colls_to_search) if p1: results_tmp = search_pattern(req, p1, f1, colls_to_search, m1) for coll in colls_to_search: # join results for first advanced search boxen results_final[coll].intersect(results_tmp[coll]) if p2: results_tmp = search_pattern(req, p2, f2, colls_to_search, m2) for coll in colls_to_search: # join results for first and second advanced search boxen if op1 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op1 == "o": # or results_final[coll].union(results_tmp[coll]) elif op1 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op1, "Error") if p3: results_tmp = search_pattern(req, p3, f3, colls_to_search, m3) for coll in colls_to_search: # join results for second and third advanced search boxen if op2 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op2 == "o": # or results_final[coll].union(results_tmp[coll]) elif op2 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op1, "Error") for coll in colls_to_search: results_final[coll].calculate_nbhits() else: # 3B - simple search search_cache_key = p+"@"+f+"@"+string.join(colls_to_search,",") if search_cache.has_key(search_cache_key): # is the result in search cache? results_final = search_cache[search_cache_key] else: results_final = search_pattern(req, p, f, colls_to_search) search_cache[search_cache_key] = results_final if len(search_cache) > cfg_search_cache_size: # is the cache full? (sanity cleaning) search_cache.clear() # search done; was there a time restriction? if yes, apply it now: if day1 != "": results_of_time_restriction = search_in_bibrec(day1, day2) for coll in colls_to_search: results_final[coll].intersect(results_of_time_restriction) results_final[coll].calculate_nbhits() t2 = os.times()[4] cpu_time = t2 - t1 # find total number of records found in each collection results_final_nb_total = 0 results_final_nb = {} for coll in colls_to_search: results_final_nb[coll] = results_final[coll]._nbhits results_final_nb_total += results_final_nb[coll] # was there at least one hit? if results_final_nb_total == 0: # nope, so try silently dash-slash-etc-less matches first: if as==1 or (p1 or p2 or p3): if re.search(r'\w[^a-zA-Z0-9]\w',p1) or \ re.search(r'\w[^a-zA-Z0-9]\w',p2) or \ re.search(r'\w[^a-zA-Z0-9]\w',p3): if p1.startswith('"') and p1.endswith('"'): # is it ACC query? p1 = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1_\\2", p1) else: # it is WRD query p1 = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1 \\2", p1) if p1.startswith('"') and p1.endswith('"'): # is it ACC query? p2 = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1_\\2", p2) else: # it is WRD query p2 = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1 \\2", p2) if p3.startswith('"') and p3.endswith('"'): # is it ACC query? p3 = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1_\\2", p3) else: # it is WRD query p3 = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1 \\2", p3) if of.startswith('h'): print_warning(req, "No match found, trying similar queries...", "", "<p>","<p>") results_final = search_pattern(req, "", "", colls_to_search) if p1: results_tmp = search_pattern(req, p1, f1, colls_to_search, m1) for coll in colls_to_search: # join results for first advanced search boxen results_final[coll].intersect(results_tmp[coll]) if p2: results_tmp = search_pattern(req, p2, f2, colls_to_search, m2) for coll in colls_to_search: # join results for first and second advanced search boxen if op1 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op1 == "o": # or results_final[coll].union(results_tmp[coll]) elif op1 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op1, "Error") if p3: results_tmp = search_pattern(req, p3, f3, colls_to_search, m3) for coll in colls_to_search: # join results for second and third advanced search boxen if op2 == "a": # add results_final[coll].intersect(results_tmp[coll]) elif op2 == "o": # or results_final[coll].union(results_tmp[coll]) elif op2 == "n": # not results_final[coll].difference(results_tmp[coll]) else: print_warning(req, "Invalid set operation %s." % op1, "Error") for coll in colls_to_search: results_final[coll].calculate_nbhits() results_final_nb[coll] = results_final[coll]._nbhits results_final_nb_total += results_final_nb[coll] else: if re.search(r'\w[^a-zA-Z0-9]\w',p): if p.startswith('"') and p.endswith('"'): # is it ACC query? p = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1_\\2", p) else: # it is WRD query p = re.sub(r'(\w)[^a-zA-Z0-9](\w)', "\\1 \\2", p) if of.startswith('h'): print_warning(req, "No match found, trying %s..." % p, "", "<p>","<p>") results_final = search_pattern(req, p, f, colls_to_search, None) for coll in colls_to_search: results_final_nb[coll] = results_final[coll]._nbhits results_final_nb_total += results_final_nb[coll] # once again, was there at least one hit? if results_final_nb_total == 0: # nope, so try similar queries: if of.startswith('h'): print_warning(req, "No match found, trying similar queries...", "", "<p>","<p>") req.write("<p>") if as==1 or (p1 or p2 or p3): if p1: search_pattern(req, p1, f1, colls_to_search, m1, 1) if p2: search_pattern(req, p2, f2, colls_to_search, m2, 1) if p3: search_pattern(req, p3, f3, colls_to_search, m3, 1) else: search_pattern(req, p, f, colls_to_search, None, 1) else: # yes, some hits found, so print results overview: if of == "id": # we have been asked to return list of recIDs results_final_for_all_colls = HitList() for coll in colls_to_search: results_final_for_all_colls.union(results_final[coll]) return results_final_for_all_colls.items() elif of.startswith("h"): req.write(print_results_overview(colls_to_search, results_final_nb_total, results_final_nb, cpu_time)) # print records: if len(colls_to_search)>1: cpu_time = -1 # we do not want to have search time printed on each collection for coll in colls_to_search: if results_final[coll]._nbhits: if of.startswith("h"): req.write(print_search_info(p, f, sf, so, sp, of, ot, coll, results_final_nb[coll], jrec, rg, as, p1, p2, p3, f1, f2, f3, m1, m2, m3, op1, op2, d1y, d1m, d1d, d2y, d2m, d2d, cpu_time)) results_final_sorted = results_final[coll].items() if sf: results_final_sorted = sort_records(req, results_final_sorted, sf, so, sp) print_records(req, results_final_sorted, jrec, rg, of, ot) if of.startswith("h"): req.write(print_search_info(p, f, sf, so, sp, of, ot, coll, results_final_nb[coll], jrec, rg, as, p1, p2, p3, f1, f2, f3, m1, m2, m3, op1, op2, d1y, d1m, d1d, d2y, d2m, d2d, cpu_time, 1)) # log query: try: log_query(req.get_remote_host(), req.args, uid) except: # do not log query if req is None (used by CLI interface) pass log_query_info("ss", p, f, colls_to_search, results_final_nb_total) # 4 -- write footer: if of.startswith('h'): req.write(create_footer()) elif of.startswith('x'): req.write("""</collection>\n""") # 5 - return value if of == "id": return [] else: return "\n" | 0f644a3e9a21fa49065fbfbec95493378ff259fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/0f644a3e9a21fa49065fbfbec95493378ff259fb/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
3072,
12,
3658,
33,
7036,
16,
4946,
33,
71,
2377,
529,
16,
276,
33,
7036,
16,
293,
1546,
3113,
284,
1546,
3113,
14524,
1546,
2163,
3113,
9033,
1546,
3113,
1427,
154... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
2293,
67,
3072,
12,
3658,
33,
7036,
16,
4946,
33,
71,
2377,
529,
16,
276,
33,
7036,
16,
293,
1546,
3113,
284,
1546,
3113,
14524,
1546,
2163,
3113,
9033,
1546,
3113,
1427,
154... |
def __init__(self, enquire, fields): self._enquire = enquire | def __init__(self, query, db, fields): self._query = query self._db = db | def __init__(self, enquire, fields): self._enquire = enquire self._fields = fields self._max = enquire.get_mset(0,0).get_matches_upper_bound() | f98a1b035426b63440283a9fa3869757f6518410 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/f98a1b035426b63440283a9fa3869757f6518410/catalog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
843,
16,
1319,
16,
1466,
4672,
365,
6315,
2271,
273,
843,
365,
6315,
1966,
273,
1319,
365,
6315,
2821,
273,
1466,
365,
6315,
1896,
273,
570,
1039,
18,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
843,
16,
1319,
16,
1466,
4672,
365,
6315,
2271,
273,
843,
365,
6315,
1966,
273,
1319,
365,
6315,
2821,
273,
1466,
365,
6315,
1896,
273,
570,
1039,
18,
58... |
return 1 + self.getLevels() | return 1 + self.getLevel() | def getSectionLevel(self): return 1 + self.getLevels() | 92d4a245884ee7f61891bea4533a69e3fc179cd9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12391/92d4a245884ee7f61891bea4533a69e3fc179cd9/advtree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22103,
2355,
12,
2890,
4672,
327,
404,
397,
365,
18,
588,
12240,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22103,
2355,
12,
2890,
4672,
327,
404,
397,
365,
18,
588,
12240,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
next = 'http://www.youtube.com/get_video?video_id=' + vid + '&t=' + r2.group(1) + '&fmt=%d' % fmt_id | d = {'video_id': vid, 't': r2.group(1), 'fmt': fmt_id} next = 'http://www.youtube.com/get_video?video_id=%(video_id)s&t=%(t)s&eurl=&el=&ps=&asv=&fmt=%(fmt)s' % d | def get_real_download_url(url, preferred_fmt_id=18): vid = get_youtube_id(url) if vid is not None: page = None url = 'http://www.youtube.com/watch?v=' + vid while page is None: req = util.http_request(url, method='GET') if 'location' in req.msg: url = req.msg['location'] else: page = req.read() # Try to find the best video format available for this video # (http://forum.videohelp.com/topic336882-1800.html#1912972) r3 = re.compile('.*"fmt_map"\:\s+"([^"]+)".*').search(page) if not r3: r3 = re.compile('&fmt_map=([^&]+).*').search(page) if r3: formats_available = urllib.unquote(r3.group(1)).split(',') else: formats_available = [] if gpodder.ui.diablo: # Hardcode fmt_id 5 for Maemo (for performance reasons) - we could # also use 13 and 17 here, but the quality is very low then. There # seems to also be a 6, but I could not find a video with that yet. fmt_id = 5 elif gpodder.ui.fremantle: # This provides good quality video, seems to be always available # and is playable fluently in Media Player if preferred_fmt_id == 5: fmt_id = 5 else: fmt_id = 18 else: # As a fallback, use fmt_id 18 (seems to be always available) fmt_id = 18 # This will be set to True if the search below has already "seen" # our preferred format, but has not yet found a suitable available # format for the given video. seen_preferred = False for id, wanted, description in supported_formats: # If we see our preferred format, accept formats below if id == preferred_fmt_id: seen_preferred = True # If the format is available and preferred (or lower), # use the given format for our fmt_id if wanted in formats_available and seen_preferred: log('Found available YouTube format: %s (fmt_id=%d)', \ description, id) fmt_id = id break r2 = re.compile('.*"t"\:\s+"([^"]+)".*').search(page) if not r2: r2 = re.compile('.*&t=([^&]+)').search(page) if r2: next = 'http://www.youtube.com/get_video?video_id=' + vid + '&t=' + r2.group(1) + '&fmt=%d' % fmt_id log('YouTube link resolved: %s => %s', url, next) return next return url | 756aac8e7096f066f35f3a9f519ec061f826b1a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12778/756aac8e7096f066f35f3a9f519ec061f826b1a6/youtube.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7688,
67,
7813,
67,
718,
12,
718,
16,
9119,
67,
8666,
67,
350,
33,
2643,
4672,
18339,
273,
336,
67,
31749,
67,
350,
12,
718,
13,
309,
18339,
353,
486,
599,
30,
1363,
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,
336,
67,
7688,
67,
7813,
67,
718,
12,
718,
16,
9119,
67,
8666,
67,
350,
33,
2643,
4672,
18339,
273,
336,
67,
31749,
67,
350,
12,
718,
13,
309,
18339,
353,
486,
599,
30,
1363,
273,
... |
self.prev_percentage = self.percentage() if value != self.maxval: self.fd.write(self._format_line() + '\r') else: self.finished = True self.fd.write(self._format_line() + '\n') | self.next_update = self._next_update() self.fd.write(self._format_line() + '\r') | def update(self, value): "Updates the progress bar to a new value." assert 0 <= value <= self.maxval self.currval = value if not self._need_update() or self.finished: return if not self.start_time: self.start_time = time.time() self.seconds_elapsed = time.time() - self.start_time self.prev_percentage = self.percentage() if value != self.maxval: self.fd.write(self._format_line() + '\r') else: self.finished = True self.fd.write(self._format_line() + '\n') | c109edddd8f1b11193779fab960ac9b94b56e2c9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11527/c109edddd8f1b11193779fab960ac9b94b56e2c9/progressbar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
460,
4672,
315,
5121,
326,
4007,
4653,
358,
279,
394,
460,
1199,
1815,
374,
1648,
460,
1648,
365,
18,
1896,
1125,
365,
18,
17016,
1125,
273,
460,
309,
486,
365,
631... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
460,
4672,
315,
5121,
326,
4007,
4653,
358,
279,
394,
460,
1199,
1815,
374,
1648,
460,
1648,
365,
18,
1896,
1125,
365,
18,
17016,
1125,
273,
460,
309,
486,
365,
631... |
else: child_title = parent.child_title | def select_file(self): """Open a file selection dialog box""" fname = self.item.from_string(unicode(self.edit.text())) if isinstance(fname, list): fname = os.path.dirname(fname[0]) parent = self.parent_layout.parent _temp = sys.stdout sys.stdout = None if len(fname) == 0: fname = self.basedir _formats = self.item.get_prop_value("data", "formats") formats = [unicode(format).lower() for format in _formats] filter_lines = [(_("%s files")+" (*.%s)") % (format.upper(), format) for format in formats] if len(formats) > 1: filter_lines.append(_("All supported files")+" (*.%s)" \ % " *.".join(formats)) if fname is None: fname = "" if isinstance(parent, QGroupBox): child_title = parent.parent().child_title else: child_title = parent.child_title fname = self.filedialog(parent, child_title(self.item), fname, "\n".join(filter_lines)) sys.stdout = _temp if fname: if isinstance(fname, QStringList): fname = str([str(path) for path in fname]) self.edit.setText(fname) | cc8cdfe8300af1041f9db1db8e791b7e33b35295 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2056/cc8cdfe8300af1041f9db1db8e791b7e33b35295/qtitemwidgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
67,
768,
12,
2890,
4672,
3536,
3678,
279,
585,
4421,
6176,
3919,
8395,
5299,
273,
365,
18,
1726,
18,
2080,
67,
1080,
12,
9124,
12,
2890,
18,
4619,
18,
955,
1435,
3719,
309,
1549,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
67,
768,
12,
2890,
4672,
3536,
3678,
279,
585,
4421,
6176,
3919,
8395,
5299,
273,
365,
18,
1726,
18,
2080,
67,
1080,
12,
9124,
12,
2890,
18,
4619,
18,
955,
1435,
3719,
309,
1549,... | |
self.prefixlen = int(addr[1]) | self._prefixlen = int(addr[1]) | def __init__(self, ipaddr): """Instantiate a new IPv6 object. | fff47fe8f2324dff8c8e9a139755e429be20efed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3510/fff47fe8f2324dff8c8e9a139755e429be20efed/ipaddr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2359,
4793,
4672,
3536,
22438,
279,
394,
7853,
26,
733,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
2359,
4793,
4672,
3536,
22438,
279,
394,
7853,
26,
733,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
skipyes = len(code); emit(0) | skipyes = _len(code); emit(0) | def fixup(literal, flags=flags): return _sre.getlower(literal, flags) | 2177055b902a7e649c7988bb4499ab5115b4ea1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2177055b902a7e649c7988bb4499ab5115b4ea1d/sre_compile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
416,
12,
13107,
16,
2943,
33,
7133,
4672,
327,
389,
87,
266,
18,
588,
8167,
12,
13107,
16,
2943,
13,
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,
2917,
416,
12,
13107,
16,
2943,
33,
7133,
4672,
327,
389,
87,
266,
18,
588,
8167,
12,
13107,
16,
2943,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
elif sym == 2: | elif enc == 2: | def convert_case(sym): """ return (lower, upper) for internal use. :note: direct port of http://cgit.freedesktop.org/xcb/util/tree/keysyms/keysyms.c#n361 """ lower = sym upper = sym enc = sym >> 8 if sym == 0: # latin1 if ((sym >= keysymdef.XK_A) and (sym <= keysymdef.XK_Z)): lower += (keysymdef.XK_a - keysymdef.XK_A) elif ((sym >= keysymdef.XK_a) and (sym <= keysymdef.XK_z)): upper -= (keysymdef.XK_a - keysymdef.XK_A) elif ((sym >= keysymdef.XK_Agrave) and (sym <= keysymdef.XK_Odiaeresis)): lower += (keysymdef.XK_agrave - keysymdef.XK_Agrave) elif ((sym >= keysymdef.XK_agrave) and (sym <= keysymdef.XK_odiaeresis)): upper -= (keysymdef.XK_agrave - keysymdef.XK_Agrave) elif ((sym >= keysymdef.XK_Ooblique) and (sym <= keysymdef.XK_Thorn)): lower += (keysymdef.XK_oslash - keysymdef.XK_Ooblique) elif ((sym >= keysymdef.XK_oslash) and (sym <= keysymdef.XK_thorn)): upper -= (keysymdef.XK_oslash - keysymdef.XK_Ooblique) elif sym == 1: # latin2 # Assume the KeySym is a legal value (ignore discontinuities) if (sym == keysymdef.XK_Aogonek): lower = keysymdef.XK_aogonek elif (sym >= keysymdef.XK_Lstroke and sym <= keysymdef.XK_Sacute): lower += (keysymdef.XK_lstroke - keysymdef.XK_Lstroke) elif (sym >= keysymdef.XK_Scaron and sym <= keysymdef.XK_Zacute): lower += (keysymdef.XK_scaron - keysymdef.XK_Scaron) elif (sym >= keysymdef.XK_Zcaron and sym <= keysymdef.XK_Zabovedot): lower += (keysymdef.XK_zcaron - keysymdef.XK_Zcaron) elif (sym == keysymdef.XK_aogonek): upper = keysymdef.XK_Aogonek elif (sym >= keysymdef.XK_lstroke and sym <= keysymdef.XK_sacute): upper -= (keysymdef.XK_lstroke - keysymdef.XK_Lstroke) elif (sym >= keysymdef.XK_scaron and sym <= keysymdef.XK_zacute): upper -= (keysymdef.XK_scaron - keysymdef.XK_Scaron) elif (sym >= keysymdef.XK_zcaron and sym <= keysymdef.XK_zabovedot): upper -= (keysymdef.XK_zcaron - keysymdef.XK_Zcaron) elif (sym >= keysymdef.XK_Racute and sym <= keysymdef.XK_Tcedilla): lower += (keysymdef.XK_racute - keysymdef.XK_Racute) elif (sym >= keysymdef.XK_racute and sym <= keysymdef.XK_tcedilla): upper -= (keysymdef.XK_racute - keysymdef.XK_Racute) elif sym == 2: # latin3 # Assume the KeySym is a legal value (ignore discontinuities) if (sym >= keysymdef.XK_Hstroke and sym <= keysymdef.XK_Hcircumflex): lower += (keysymdef.XK_hstroke - keysymdef.XK_Hstroke) elif (sym >= keysymdef.XK_Gbreve and sym <= keysymdef.XK_Jcircumflex): lower += (keysymdef.XK_gbreve - keysymdef.XK_Gbreve) elif (sym >= keysymdef.XK_hstroke and sym <= keysymdef.XK_hcircumflex): upper -= (keysymdef.XK_hstroke - keysymdef.XK_Hstroke) elif (sym >= keysymdef.XK_gbreve and sym <= keysymdef.XK_jcircumflex): upper -= (keysymdef.XK_gbreve - keysymdef.XK_Gbreve) elif (sym >= keysymdef.XK_Cabovedot and sym <= keysymdef.XK_Scircumflex): lower += (keysymdef.XK_cabovedot - keysymdef.XK_Cabovedot) elif (sym >= keysymdef.XK_cabovedot and sym <= keysymdef.XK_scircumflex): upper -= (keysymdef.XK_cabovedot - keysymdef.XK_Cabovedot) elif sym == 3: # latin4 # Assume the KeySym is a legal value (ignore discontinuities) if (sym >= keysymdef.XK_Rcedilla and sym <= keysymdef.XK_Tslash): lower += (keysymdef.XK_rcedilla - keysymdef.XK_Rcedilla) elif (sym >= keysymdef.XK_rcedilla and sym <= keysymdef.XK_tslash): upper -= (keysymdef.XK_rcedilla - keysymdef.XK_Rcedilla) elif (sym == keysymdef.XK_ENG): lower = keysymdef.XK_eng elif (sym == keysymdef.XK_eng): upper = keysymdef.XK_ENG elif (sym >= keysymdef.XK_Amacron and sym <= keysymdef.XK_Umacron): lower += (keysymdef.XK_amacron - keysymdef.XK_Amacron) elif (sym >= keysymdef.XK_amacron and sym <= keysymdef.XK_umacron): upper -= (keysymdef.XK_amacron - keysymdef.XK_Amacron) elif sym == 6: # cyrillic # Assume the KeySym is a legal value (ignore discontinuities) if (sym >= keysymdef.XK_Serbian_DJE and sym <= keysymdef.XK_Serbian_DZE): lower -= (keysymdef.XK_Serbian_DJE - keysymdef.XK_Serbian_dje) elif (sym >= keysymdef.XK_Serbian_dje and sym <= keysymdef.XK_Serbian_dze): upper += (keysymdef.XK_Serbian_DJE - keysymdef.XK_Serbian_dje) elif (sym >= keysymdef.XK_Cyrillic_YU and sym <= keysymdef.XK_Cyrillic_HARDSIGN): lower -= (keysymdef.XK_Cyrillic_YU - keysymdef.XK_Cyrillic_yu) elif (sym >= keysymdef.XK_Cyrillic_yu and sym <= keysymdef.XK_Cyrillic_hardsign): upper += (keysymdef.XK_Cyrillic_YU - keysymdef.XK_Cyrillic_yu) elif sym == 7: # greek if (sym >= keysymdef.XK_Greek_ALPHAaccent and sym <= keysymdef.XK_Greek_OMEGAaccent): lower += (keysymdef.XK_Greek_alphaaccent - keysymdef.XK_Greek_ALPHAaccent) elif (sym >= keysymdef.XK_Greek_alphaaccent and sym <= keysymdef.XK_Greek_omegaaccent and sym != keysymdef.XK_Greek_iotaaccentdieresis and sym != keysymdef.XK_Greek_upsilonaccentdieresis): upper -= (keysymdef.XK_Greek_alphaaccent - keysymdef.XK_Greek_ALPHAaccent) elif (sym >= keysymdef.XK_Greek_ALPHA and sym <= keysymdef.XK_Greek_OMEGA): lower += (keysymdef.XK_Greek_alpha - keysymdef.XK_Greek_ALPHA) elif (sym >= keysymdef.XK_Greek_alpha and sym <= keysymdef.XK_Greek_omega and sym != keysymdef.XK_Greek_finalsmallsigma): upper -= (keysymdef.XK_Greek_alpha - keysymdef.XK_Greek_ALPHA) elif sym == 0x14: # armenian if (sym >= keysymdef.XK_Armenian_AYB and sym <= keysymdef.XK_Armenian_fe): lower = sym | 1 upper = sym & ~1 return lower, upper | fcc1b7c56d3ac296156afd7a5dd9eff2848a18d5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10761/fcc1b7c56d3ac296156afd7a5dd9eff2848a18d5/keysyms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
3593,
12,
8117,
4672,
3536,
327,
261,
8167,
16,
3854,
13,
364,
2713,
999,
18,
225,
294,
7652,
30,
2657,
1756,
434,
1062,
2207,
71,
6845,
18,
74,
15656,
281,
11869,
18,
3341,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
3593,
12,
8117,
4672,
3536,
327,
261,
8167,
16,
3854,
13,
364,
2713,
999,
18,
225,
294,
7652,
30,
2657,
1756,
434,
1062,
2207,
71,
6845,
18,
74,
15656,
281,
11869,
18,
3341,
... |
self.cached_files = [] | self.cached_files = {} | def __init__(self): self.cached_files = [] | 9d3222c5a0a78f47be05b2e5ac2e720998035afb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8186/9d3222c5a0a78f47be05b2e5ac2e720998035afb/pkg_resources.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
7097,
67,
2354,
273,
5378,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
7097,
67,
2354,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return tuple([QuotientRingElement(self.parent(),v) for v in self.__rep.variables()]) | return tuple([self.parent()(v) for v in self.__rep.variables()]) | def variables(self): """ EXAMPLES:: sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a) <class 'sage.rings.quotient_ring_element.QuotientRingElement'> sage: a.variables() (a,) sage: b.variables() (b,) sage: s = a^2 + b^2 + 1; s 1 sage: s.variables() () sage: (a+b).variables() (a, b) """ return tuple([QuotientRingElement(self.parent(),v) for v in self.__rep.variables()]) | fc3fae1786d321a0c137a5fed83a122c88d61d29 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/fc3fae1786d321a0c137a5fed83a122c88d61d29/quotient_ring_element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3152,
12,
2890,
4672,
3536,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
534,
22782,
92,
16,
93,
34,
273,
2238,
53,
8526,
31,
348,
22782,
69,
16,
70,
34,
273,
534,
18,
372,
83,
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,
3152,
12,
2890,
4672,
3536,
5675,
8900,
11386,
2866,
225,
272,
410,
30,
534,
22782,
92,
16,
93,
34,
273,
2238,
53,
8526,
31,
348,
22782,
69,
16,
70,
34,
273,
534,
18,
372,
83,
12,
... |
self._table = Table(tableData, colWidths=(availWidth,), style=self.tableStyle) | self._table = Table(tableData, colWidths=(availWidth,), style=self.tableStyle) | def drawTOCEntryEnd(canvas, kind, label): '''Callback to draw dots and page numbers after each entry.''' page, level = [ int(x) for x in label.split(',') ] x, y = canvas._curr_tx_info['cur_x'], canvas._curr_tx_info['cur_y'] style = self.levelStyles[level] pagew = stringWidth(' %d' % page, style.fontName, style.fontSize) if self.dotsMinLevel >= 0 and level >= self.dotsMinLevel: dotw = stringWidth(' . ', style.fontName, style.fontSize) dotsn = int((availWidth-x-pagew)/dotw) else: dotsn = dotw = 0 | d97e82cb7278382d065be008ee571313be90209b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3878/d97e82cb7278382d065be008ee571313be90209b/tableofcontents.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
4296,
39,
1622,
1638,
12,
15424,
16,
3846,
16,
1433,
4672,
9163,
2428,
358,
3724,
19522,
471,
1363,
5600,
1839,
1517,
1241,
1093,
6309,
1363,
16,
1801,
273,
306,
509,
12,
92,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
4296,
39,
1622,
1638,
12,
15424,
16,
3846,
16,
1433,
4672,
9163,
2428,
358,
3724,
19522,
471,
1363,
5600,
1839,
1517,
1241,
1093,
6309,
1363,
16,
1801,
273,
306,
509,
12,
92,
13,
... |
raise TypeError("argument %s must be %s, not %s" % (arg, expected, type(v).__name__)) | return TypeError("argument %s must be %s, not %s" % (arg, expected, type(v).__name__)) | def type_err(arg, expected, v): raise TypeError("argument %s must be %s, not %s" % (arg, expected, type(v).__name__)) | bf0f51ca7a6db8dd183ff8eb9551cdf860775651 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/bf0f51ca7a6db8dd183ff8eb9551cdf860775651/_classobj.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
618,
67,
370,
12,
3175,
16,
2665,
16,
331,
4672,
327,
3580,
2932,
3446,
738,
87,
1297,
506,
738,
87,
16,
486,
738,
87,
6,
738,
261,
3175,
16,
2665,
16,
618,
12,
90,
2934,
972,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
618,
67,
370,
12,
3175,
16,
2665,
16,
331,
4672,
327,
3580,
2932,
3446,
738,
87,
1297,
506,
738,
87,
16,
486,
738,
87,
6,
738,
261,
3175,
16,
2665,
16,
618,
12,
90,
2934,
972,
529,... |
return msg | return msg, words def check_words(words, bayes, spam_offset, ham_offset): for word, existing_info in words.items(): new_info = bayes._wordinfoget(word) if existing_info.spamcount+spam_offset != new_info.spamcount or \ existing_info.hamcount+ham_offset != new_info.hamcount: TestFailed("Word check for '%s failed. " "old spam/ham=%d/%d, new spam/ham=%d/%d," "spam_offset=%d, ham_offset=%d" % \ (word, existing_info.spamcount, existing_info.hamcount, new_info.spamcount, new_info.hamcount, spam_offset, ham_offset)) | def CreateTestMessage(self, spam_status): words = [] if spam_status != SPAM: words.extend(FindTopWords(self.manager.bayes, 50, False)) if spam_status != HAM: words.extend(FindTopWords(self.manager.bayes, 50, True)) # Create a new blank message with our words msg = self.manager.outlook.CreateItem(0) msg.Body = "\n".join(words) msg.Subject = TEST_SUBJECT return msg | dd7298bdea1152d90803967bf28763a9a3f36f01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/dd7298bdea1152d90803967bf28763a9a3f36f01/tester.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
4709,
1079,
12,
2890,
16,
24824,
67,
2327,
4672,
4511,
273,
5378,
309,
24824,
67,
2327,
480,
11405,
2192,
30,
4511,
18,
14313,
12,
3125,
3401,
7363,
12,
2890,
18,
4181,
18,
70,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
4709,
1079,
12,
2890,
16,
24824,
67,
2327,
4672,
4511,
273,
5378,
309,
24824,
67,
2327,
480,
11405,
2192,
30,
4511,
18,
14313,
12,
3125,
3401,
7363,
12,
2890,
18,
4181,
18,
70,
5... |
other.yuv = c.yuv | other.hsva = c.hsva | def test_yuv__sanity_testing_converted_should_not_raise(self): fails = 0 for i, (r,g,b,a) in enumerate(rgba_combinations): c = pygame.Color (r,g,b,a) other = pygame.Color(0) try: other.yuv = c.yuv except ValueError: fails += 1 self.assertEqual ( (fails, i+1), (0, i+1), '(fails, combos) == (0, combos)' ) | c6e7f322382f4acb4620e49e674de647c9ab082a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1298/c6e7f322382f4acb4620e49e674de647c9ab082a/color_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
93,
16303,
972,
87,
10417,
67,
3813,
310,
67,
6283,
329,
67,
13139,
67,
902,
67,
11628,
12,
2890,
4672,
6684,
273,
374,
225,
364,
277,
16,
261,
86,
16,
75,
16,
70,
16,
69... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
93,
16303,
972,
87,
10417,
67,
3813,
310,
67,
6283,
329,
67,
13139,
67,
902,
67,
11628,
12,
2890,
4672,
6684,
273,
374,
225,
364,
277,
16,
261,
86,
16,
75,
16,
70,
16,
69... |
def loadProfiles(self): | def loadSettings(self): if not os.path.exists(PROFILEDIR): os.mkdir(PROFILEDIR) | def loadProfiles(self): self.setProfiles(load_profiles(PROFILEDIR)) | 23d77842c2ff47e2526f559948644ca80ad406ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3907/23d77842c2ff47e2526f559948644ca80ad406ee/masstagging.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
2628,
12,
2890,
4672,
309,
486,
1140,
18,
803,
18,
1808,
12,
22462,
4537,
4672,
1140,
18,
26686,
12,
22462,
4537,
13,
365,
18,
542,
12450,
12,
945,
67,
18314,
12,
22462,
4537,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2628,
12,
2890,
4672,
309,
486,
1140,
18,
803,
18,
1808,
12,
22462,
4537,
4672,
1140,
18,
26686,
12,
22462,
4537,
13,
365,
18,
542,
12450,
12,
945,
67,
18314,
12,
22462,
4537,
37... |
if inst.poll(_deadstate=sys.maxint) >= 0: | if inst._internal_poll(_deadstate=sys.maxint) >= 0: | def _cleanup(): for inst in _active[:]: if inst.poll(_deadstate=sys.maxint) >= 0: try: _active.remove(inst) except ValueError: # This can happen if two threads create a new Popen instance. # It's harmless that it was already removed, so ignore. pass | db6e32953062734c10a57e25c13d5b6aadb12e85 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/db6e32953062734c10a57e25c13d5b6aadb12e85/subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
16732,
13332,
364,
1804,
316,
389,
3535,
10531,
14542,
309,
1804,
6315,
7236,
67,
13835,
24899,
22097,
2019,
33,
9499,
18,
1896,
474,
13,
1545,
374,
30,
775,
30,
389,
3535,
18,
4479... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16732,
13332,
364,
1804,
316,
389,
3535,
10531,
14542,
309,
1804,
6315,
7236,
67,
13835,
24899,
22097,
2019,
33,
9499,
18,
1896,
474,
13,
1545,
374,
30,
775,
30,
389,
3535,
18,
4479... |
(weburl, url_args, results_in_Home._nbhits), "") | (weburl, url_args, results_in_Home._nbhits)) | def search_pattern(req, p=None, f=None, colls=[], m=None, hit_hints=0): """Searches for pattern 'p' and field 'f' and returns dict of recIDs HitLists per each collection in 'colls'. - Optionally, the function accepts the match type argument 'm'. If it is set (e.g. from advanced search interface), then it performs this kind of matching. If it is not set, then a guess is made. - Calls search_in_bibwords() and/or search_in_bibxxx() functions. - If hit_hints is set, than print lots of hints on current search. Useful for debugging and/or when search gives zero hits. - Called by main().""" ## create empty output results set: results_out = {} for coll in colls: results_out[coll] = HitList() results_out[coll]._nbhits = 0 ## if p is not defined, return all hits in given collections: if not p: for coll in colls: results_out[coll]._set = collrecs_cache[coll]._set results_out[coll]._nbhits = collrecs_cache[coll]._nbhits return results_out ## now we are sure to have some p: good. ## create search units: opft_items = create_opft_search_units(req, p, f, m) #req.write("<p>%s" % opft_items) ## search regardless of collection: results_in_any_collection = HitList() results_in_any_collection_empty = 1 # to be able to skip first set operation for opft_item in opft_items: results_for_opft_item = {} oi, pi, fi, ti = opft_item[0], opft_item[1], opft_item[2], opft_item[3] # firstly, launch search for this pattern item: if ti == 'a' or ti == 'r': # we are doing either direct bibxxx search or phrase search or regexp search results_for_opft_item = search_in_bibxxx(req, pi, fi, ti) elif ti == 'w': # we are doing bibwords search results_for_opft_item = search_in_bibwords(req, pi, fi) else: print_warning(req, "Search type '%s' is not defined." % ti, "Error") return None if hit_hints: results_for_opft_item.calculate_nbhits() if results_for_opft_item._nbhits == 0: text = "Search term <em>%s</em>" % pi if fi: text += " inside <em>%s</em> " % fi print_warning(req, "%s did not match any record. Nearest terms in any collection are: %s" % (text, create_nearest_terms_box(req.args, pi, fi)), "") return results_out # empty if dbg: print_warning(req, "Item <strong>%s:%s</strong> gave %d hits." % (fi, pi, results_for_opft_item._nbhits), "") # secondly, apply the set intersect/union/disjunction functions: if dbg: t1 = os.times()[4] if results_in_any_collection_empty: results_in_any_collection = results_for_opft_item results_in_any_collection_empty = 0 else: if oi == '+': results_in_any_collection.intersect(results_for_opft_item) elif oi == '-': results_in_any_collection.difference(results_for_opft_item) elif oi == '|': results_in_any_collection.union(results_for_opft_item) else: print_warning(req, "Invalid set operation %s." % oi, "Error") if dbg: t2 = os.times()[4] print_warning(req, "Set operation '%s' took %.2f seconds." % (oi, (t2 - t1)), "Profile") ## before doing collection intersection, see how many hits we have now: results_in_any_collection.calculate_nbhits() ## return all hits if no collection list specified (useful for WebSearch Admin to determine collection ## recID universe): if colls == []: return results_in_any_collection ## were there no hits at all before doing collection intersection? if results_in_any_collection._nbhits == 0: # pattern not found in any public/private collection: if hit_hints: text = """All search terms matched but boolean query returned no hits. Please combine your search terms differently.""" url_args = req.args text += """<blockquote><table class="nearesttermsbox" cellpadding="0" cellspacing="0" border="0">""" for opft_item in opft_items: oi, pi, fi, ti = opft_item[0], opft_item[1], opft_item[2], opft_item[3] url_args_new = re.sub(r'(^|\&)p=.*?(\&|$)', r'\1p='+urllib.quote(pi)+r'\2', url_args) url_args_new = re.sub(r'(^|\&)f=.*?(\&|$)', r'\1f='+urllib.quote(fi)+r'\2', url_args_new) text += """<tr><td class="nearesttermsboxbody" align="right">%s</td><td class="nearesttermsboxbody" width="15"> </td><td class="nearesttermsboxbody" align="left"><a class="nearestterms" href="%s/search.py?%s">%s</a></td></tr>""" % \ (get_word_nbhits(pi, fi), weburl, url_args_new, pi) text += """</table></blockquote>""" print_warning(req, text, "") return results_out # still empty ## intersect with collection universe: if dbg: t1 = os.times()[4] if colls: for coll in colls: results_out[coll]._set = Numeric.bitwise_and(results_in_any_collection._set, collrecs_cache[coll]._set) if dbg: t2 = os.times()[4] print_warning(req, "Intersecting with collection hitlist universe took %.2f seconds." % ((t2 - t1)), "Profile") ## count number of hits in given collections: results_out_nb_hits_total = 0 for coll in colls: results_out[coll].calculate_nbhits() results_out_nb_hits_total += results_out[coll]._nbhits if results_out_nb_hits_total == 0: # pattern had been found but not in the collections chosen by the user: if hit_hints: # try to search in Home: results_in_Home = HitList() results_in_Home._set = Numeric.bitwise_and(results_in_any_collection._set, collrecs_cache[cdsname]._set) results_in_Home.calculate_nbhits() if results_in_Home._nbhits > 0: # some hits found in Home, so propose this search: url_args = req.args url_args = re.sub(r'(^|\&)cc=.*?(\&|$)', r'\2', url_args) url_args = re.sub(r'(^|\&)c=.*?(\&[^c]+=|$)', r'\2', url_args) url_args = re.sub(r'^\&+', '', url_args) url_args = re.sub(r'\&+$', '', url_args) print_warning(req, """Match found in other public collections: <a class="nearestterms" href="%s/search.py?%s">%d hits</a>.""" % (weburl, url_args, results_in_Home._nbhits), "") else: # no hits found in Home, recommend different search terms: text = """No public collection matched your query. If you were looking for a non-public document, please choose the desired restricted collection first.""" print_warning(req, text, "") return results_out | 535ed6a8d836745c0ddd7f1016fbe145d7c7bebd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/535ed6a8d836745c0ddd7f1016fbe145d7c7bebd/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
4951,
12,
3658,
16,
293,
33,
7036,
16,
284,
33,
7036,
16,
645,
3251,
22850,
6487,
312,
33,
7036,
16,
6800,
67,
24598,
33,
20,
4672,
3536,
16294,
364,
1936,
296,
84,
11,
471... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
4951,
12,
3658,
16,
293,
33,
7036,
16,
284,
33,
7036,
16,
645,
3251,
22850,
6487,
312,
33,
7036,
16,
6800,
67,
24598,
33,
20,
4672,
3536,
16294,
364,
1936,
296,
84,
11,
471... |
if action.isupper() and action not in self.get_actions(): raise TracError, '%s is not a valid action.' % action | def revoke_permission(self, username, action): """Revokes the permission of the specified user to perform an action.""" # TODO: Validate that this permission does in fact exist if action.isupper() and action not in self.get_actions(): raise TracError, '%s is not a valid action.' % action | c6f3b6c5ccafff9c6f4d03ca41c33c880fbf7ab3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c6f3b6c5ccafff9c6f4d03ca41c33c880fbf7ab3/perm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18007,
67,
9827,
12,
2890,
16,
2718,
16,
1301,
4672,
3536,
10070,
601,
281,
326,
4132,
434,
326,
1269,
729,
358,
3073,
392,
1301,
12123,
468,
2660,
30,
3554,
716,
333,
4132,
1552,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18007,
67,
9827,
12,
2890,
16,
2718,
16,
1301,
4672,
3536,
10070,
601,
281,
326,
4132,
434,
326,
1269,
729,
358,
3073,
392,
1301,
12123,
468,
2660,
30,
3554,
716,
333,
4132,
1552,
316,
... | |
103590: ' ftbfs@fedoraproject.org', | 103590: 'ftbfs@fedoraproject.org', 100460 : 'sindrepb@fedoraproject.org', 102180: 'jesusr@redhat.com', | def __init__(self, baseURL, username=None, password=None, debug=False): super(AccountSystem, self).__init__(baseURL=baseURL, username=username, password=password, debug=debug) # Preseed a list of FAS accounts with bugzilla addresses # This allows us to specify a different email for bugzilla than is # in the FAS db. It is a hack, however, until FAS has a field for the # bugzilla address. self.__bugzilla_email = { # Konstantin Ryabitsev: mricon@gmail.com 100029: 'icon@fedoraproject.org', # Sean Reifschneider: jafo@tummy.com 100488: 'jafo-redhat@tummy.com', # Karen Pease: karen-pease@uiowa.edu 100281: 'meme@daughtersoftiresias.org', # Robert Scheck: redhat@linuxnetz.de 100093: 'redhat-bugzilla@linuxnetz.de', # Scott Bakers: bakers@web-ster.com 100881: 'scott@perturb.org', # Colin Charles: byte@aeon.com.my 100014: 'byte@fedoraproject.org', # W. Michael Petullo: mike@flyn.org 100136: 'redhat@flyn.org', # Elliot Lee: sopwith+fedora@gmail.com 100060: 'sopwith@redhat.com', # Control Center Team: Bugzilla user but email doesn't exist 9908: 'control-center-maint@redhat.com', # Máirín Duffy 100548: 'duffy@redhat.com', # Muray McAllister: murray.mcallister@gmail.com 102321: 'mmcallis@redhat.com', # William Jon McCann: mccann@jhu.edu 102489: 'jmccann@redhat.com', # Matt Domsch's rebuild script -- bz email goes to /dev/null 103590: ' ftbfs@fedoraproject.org', } # A few people have an email account that is used in owners.list but # have setup a bugzilla account for their primary account system email # address now. Map these here. self.__alternate_email = { # Damien Durand: splinux25@gmail.com 'splinux@fedoraproject.org': 100406, # Kevin Fenzi: kevin@tummy.com 'kevin-redhat-bugzilla@tummy.com': 100037, } for bugzillaMap in self.__bugzilla_email.items(): self.__alternate_email[bugzillaMap[1]] = bugzillaMap[0] | b789a617db89c50a98db199bea9d063817757d06 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9952/b789a617db89c50a98db199bea9d063817757d06/fas2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
17480,
16,
2718,
33,
7036,
16,
2201,
33,
7036,
16,
1198,
33,
8381,
4672,
2240,
12,
3032,
3163,
16,
365,
2934,
972,
2738,
972,
12,
1969,
1785,
33,
1969,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
17480,
16,
2718,
33,
7036,
16,
2201,
33,
7036,
16,
1198,
33,
8381,
4672,
2240,
12,
3032,
3163,
16,
365,
2934,
972,
2738,
972,
12,
1969,
1785,
33,
1969,
... |
'factory': getPythonPath(adapter[4][0]) | 'factory': path, 'factory_url': url | def getRequiredAdapters(self): """Get adapters where this interface is required.""" service = zapi.getService(self.context, 'Adapters') context = removeAllProxies(self.context) adapters = [] for adapter in service.getRegisteredMatching(required=context): adapters.append({ 'provided': getPythonPath(adapter[1]), 'required': [getPythonPath(iface) for iface in adapter[2]], 'name': adapter[3], 'factory': getPythonPath(adapter[4][0]) }) return adapters | 8473912e22d1506b9091ee78e7e1c2f1b2eab272 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9672/8473912e22d1506b9091ee78e7e1c2f1b2eab272/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19881,
26620,
12,
2890,
4672,
3536,
967,
17272,
1625,
333,
1560,
353,
1931,
12123,
1156,
273,
998,
2425,
18,
588,
1179,
12,
2890,
18,
2472,
16,
296,
26620,
6134,
819,
273,
12787,
21488,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19881,
26620,
12,
2890,
4672,
3536,
967,
17272,
1625,
333,
1560,
353,
1931,
12123,
1156,
273,
998,
2425,
18,
588,
1179,
12,
2890,
18,
2472,
16,
296,
26620,
6134,
819,
273,
12787,
21488,
... |
MarkerInterface,\ | def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) | 85e69b65134313ec3f3db57e106088fcd5133b18 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/85e69b65134313ec3f3db57e106088fcd5133b18/XMLSchema.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
8832,
12,
2890,
16,
756,
4672,
365,
18,
542,
2498,
12,
2159,
13,
2939,
273,
365,
18,
588,
6323,
12,
2159,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
8832,
12,
2890,
16,
756,
4672,
365,
18,
542,
2498,
12,
2159,
13,
2939,
273,
365,
18,
588,
6323,
12,
2159,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
comments = ' '.join(value) comments = re.sub('\s{2,}', ' ', comments) comments = re.sub('([a-zA-Z]{1})(- )','\\1', comments) | comments = ' '.join(value) comments = re.sub('\s{2,}', ' ', comments) comments = re.sub('([a-zA-Z]{1})(- )','\\1', comments) | def format_comments(self, value): """Comments are given as 10 separate fields. The algorithm for constructing the final comments value is this: 1. Join the fields, inserting a space between each field. 2. Replace multiple spaces with one space. 3. Collapse hyphenated words, since some of the Colleague data-entry folks will hyphenate words to break them across comments fields.""" assert type(value) in (list, tuple) | 20eab91c91a9f72ec790d8c5d1fb9261b7b89028 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4025/20eab91c91a9f72ec790d8c5d1fb9261b7b89028/formatters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
9231,
12,
2890,
16,
460,
4672,
3536,
9051,
854,
864,
487,
1728,
9004,
1466,
18,
225,
1021,
4886,
364,
27389,
326,
727,
5678,
460,
353,
333,
30,
404,
18,
225,
4214,
326,
1466,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
9231,
12,
2890,
16,
460,
4672,
3536,
9051,
854,
864,
487,
1728,
9004,
1466,
18,
225,
1021,
4886,
364,
27389,
326,
727,
5678,
460,
353,
333,
30,
404,
18,
225,
4214,
326,
1466,
... |
self.crc = zlib.crc32("") | self.crc = zlib.crc32("") & 0xffffffffL | def _init_read(self): self.crc = zlib.crc32("") self.size = 0 | b89f2d2678f1fca7a4d86c238af02858955efd8e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/b89f2d2678f1fca7a4d86c238af02858955efd8e/gzip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
896,
12,
2890,
4672,
365,
18,
22988,
273,
24220,
18,
22988,
1578,
2932,
7923,
473,
374,
28857,
48,
365,
18,
1467,
273,
374,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
896,
12,
2890,
4672,
365,
18,
22988,
273,
24220,
18,
22988,
1578,
2932,
7923,
473,
374,
28857,
48,
365,
18,
1467,
273,
374,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
('product', "specify a product.")): | ('product', "specify a product."), ('platform', "specify the platform.")): | def main(): error = False parser = OptionParser( usage="%prog [options]") parser.add_option("--mar-path", action="store", dest="marPath", help="[Required] Specify the absolute path where the MAR file is found.") parser.add_option("--application-ini-file", action="store", dest="applicationIniFile", help="[Required] Specify the absolute path to the application.ini file.") parser.add_option("-l", "--locale", action="store", dest="locale", help="[Required] Specify which locale we are generating the snippet for.") parser.add_option("-p", "--product", action="store", dest="product", help="[Required] This option is used to generate the URL to download the MAR file.") parser.add_option("--download-base-URL", action="store", dest="downloadBaseURL", help="This option indicates under which.") parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="This option increases the output of the script.") (options, args) = parser.parse_args() for req, msg in (('marPath', "the absolute path to the where the MAR file is"), ('applicationIniFile', "the absolute path to the application.ini file."), ('locale', "a locale."), ('product', "specify a product.")): if not hasattr(options, req): parser.error('You must specify %s' % msg) if not options.downloadBaseURL or options.downloadBaseURL == '': options.downloadBaseURL = 'http://ftp.mozilla.org/pub/mozilla.org/%s/nightly' % options.product snippet = generateSnippet(options.marPath, options.applicationIniFile, options.locale, options.downloadBaseURL, options.product) f = open(os.path.join(options.marPath, 'complete.update.snippet'), 'wb') f.write(snippet) f.close() if options.verbose: # Show in our logs what the contents of the snippet are print snippet | 1c1af9bdb54019c5fa27ba31c96ae4f15b46e142 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/1c1af9bdb54019c5fa27ba31c96ae4f15b46e142/generatesnippet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
555,
273,
1083,
2082,
273,
18862,
12,
4084,
11613,
14654,
306,
2116,
4279,
13,
2082,
18,
1289,
67,
3482,
2932,
413,
3684,
17,
803,
3113,
1301,
1546,
2233,
3113,
1570,
1546,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
555,
273,
1083,
2082,
273,
18862,
12,
4084,
11613,
14654,
306,
2116,
4279,
13,
2082,
18,
1289,
67,
3482,
2932,
413,
3684,
17,
803,
3113,
1301,
1546,
2233,
3113,
1570,
1546,
... |
print "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] | msg = "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] appendTextview(self.textviewStdOut, msg) | def pick(self, event): #import ipdb; ipdb.set_trace() #We want to round from the picking location to #the time value of the nearest time sample: samp_rate = self.streams[self.stPt][0].stats.sampling_rate pickSample = event.xdata * samp_rate pickSample = round(pickSample) pickSample = pickSample / samp_rate # we need the position of the cursor location # in the seismogram array: xpos = pickSample * samp_rate # Set new P Pick if self.flagPhase==0 and event.key==self.dictKeybindings['setPick']: self.delPLine() self.delPLabel() self.delPsynthLine() self.dicts[self.stPt]['P'] = pickSample self.drawPLine() self.drawPLabel() self.drawPsynthLine() self.drawPsynthLabel() #check if the new P pick lies outside of the Error Picks try: if self.dicts[self.stPt]['P']<self.dicts[self.stPt]['PErr1']: self.delPErr1Line() self.delPErr1() except: pass try: if self.dicts[self.stPt]['P']>self.dicts[self.stPt]['PErr2']: self.delPErr2Line() self.delPErr2() except: pass # Update all subplots self.redraw() # Console output print "P Pick set at %.3f" % self.dicts[self.stPt]['P'] # Set P Pick weight if self.dicts[self.stPt].has_key('P'): if self.flagPhase==0 and event.key==self.dictKeybindings['setPWeight0']: self.delPLabel() self.dicts[self.stPt]['PWeight']=0 self.drawPLabel() self.redraw() print "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] if self.flagPhase==0 and event.key==self.dictKeybindings['setPWeight1']: self.delPLabel() self.dicts[self.stPt]['PWeight']=1 print "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] self.drawPLabel() self.redraw() if self.flagPhase==0 and event.key==self.dictKeybindings['setPWeight2']: self.delPLabel() self.dicts[self.stPt]['PWeight']=2 print "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] self.drawPLabel() self.redraw() if self.flagPhase==0 and event.key==self.dictKeybindings['setPWeight3']: self.delPLabel() self.dicts[self.stPt]['PWeight']=3 print "P Pick weight set to %i"%self.dicts[self.stPt]['PWeight'] self.drawPLabel() self.redraw() # Set P Pick polarity if self.dicts[self.stPt].has_key('P'): if self.flagPhase==0 and event.key==self.dictKeybindings['setPPolUp']: self.delPLabel() self.dicts[self.stPt]['PPol']='up' self.drawPLabel() self.redraw() print "P Pick polarity set to %s"%self.dicts[self.stPt]['PPol'] if self.flagPhase==0 and event.key==self.dictKeybindings['setPPolPoorUp']: self.delPLabel() self.dicts[self.stPt]['PPol']='poorup' self.drawPLabel() self.redraw() print "P Pick polarity set to %s"%self.dicts[self.stPt]['PPol'] if self.flagPhase==0 and event.key==self.dictKeybindings['setPPolDown']: self.delPLabel() self.dicts[self.stPt]['PPol']='down' self.drawPLabel() self.redraw() print "P Pick polarity set to %s"%self.dicts[self.stPt]['PPol'] if self.flagPhase==0 and event.key==self.dictKeybindings['setPPolPoorDown']: self.delPLabel() self.dicts[self.stPt]['PPol']='poordown' self.drawPLabel() self.redraw() print "P Pick polarity set to %s"%self.dicts[self.stPt]['PPol'] # Set P Pick onset if self.dicts[self.stPt].has_key('P'): if self.flagPhase == 0 and event.key == self.dictKeybindings['setPOnsetImpulsive']: self.delPLabel() self.dicts[self.stPt]['POnset'] = 'impulsive' self.drawPLabel() self.redraw() print "P pick onset set to %s" % self.dicts[self.stPt]['POnset'] elif self.flagPhase == 0 and event.key == self.dictKeybindings['setPOnsetEmergent']: self.delPLabel() self.dicts[self.stPt]['POnset'] = 'emergent' self.drawPLabel() self.redraw() print "P pick onset set to %s" % self.dicts[self.stPt]['POnset'] # Set new S Pick if self.flagPhase==1 and event.key==self.dictKeybindings['setPick']: self.delSLine() self.delSLabel() self.delSsynthLine() self.dicts[self.stPt]['S'] = pickSample self.dicts[self.stPt]['Saxind'] = self.axs.index(event.inaxes) self.drawSLine() self.drawSLabel() self.drawSsynthLine() self.drawSsynthLabel() #check if the new S pick lies outside of the Error Picks try: if self.dicts[self.stPt]['S']<self.dicts[self.stPt]['SErr1']: self.delSErr1Line() self.delSErr1() except: pass try: if self.dicts[self.stPt]['S']>self.dicts[self.stPt]['SErr2']: self.delSErr2Line() self.delSErr2() except: pass # Update all subplots self.redraw() # Console output print "S Pick set at %.3f" % self.dicts[self.stPt]['S'] # Set S Pick weight if self.dicts[self.stPt].has_key('S'): if self.flagPhase==1 and event.key==self.dictKeybindings['setSWeight0']: self.delSLabel() self.dicts[self.stPt]['SWeight']=0 self.drawSLabel() self.redraw() print "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSWeight1']: self.delSLabel() self.dicts[self.stPt]['SWeight']=1 self.drawSLabel() self.redraw() print "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSWeight2']: self.delSLabel() self.dicts[self.stPt]['SWeight']=2 self.drawSLabel() self.redraw() print "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSWeight3']: self.delSLabel() self.dicts[self.stPt]['SWeight']=3 self.drawSLabel() self.redraw() print "S Pick weight set to %i"%self.dicts[self.stPt]['SWeight'] # Set S Pick polarity if self.dicts[self.stPt].has_key('S'): if self.flagPhase==1 and event.key==self.dictKeybindings['setSPolUp']: self.delSLabel() self.dicts[self.stPt]['SPol']='up' self.drawSLabel() self.redraw() print "S Pick polarity set to %s"%self.dicts[self.stPt]['SPol'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSPolPoorUp']: self.delSLabel() self.dicts[self.stPt]['SPol']='poorup' self.drawSLabel() self.redraw() print "S Pick polarity set to %s"%self.dicts[self.stPt]['SPol'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSPolDown']: self.delSLabel() self.dicts[self.stPt]['SPol']='down' self.drawSLabel() self.redraw() print "S Pick polarity set to %s"%self.dicts[self.stPt]['SPol'] if self.flagPhase==1 and event.key==self.dictKeybindings['setSPolPoorDown']: self.delSLabel() self.dicts[self.stPt]['SPol']='poordown' self.drawSLabel() self.redraw() print "S Pick polarity set to %s"%self.dicts[self.stPt]['SPol'] # Set S Pick onset if self.dicts[self.stPt].has_key('S'): if self.flagPhase == 1 and event.key == self.dictKeybindings['setSOnsetImpulsive']: self.delSLabel() self.dicts[self.stPt]['SOnset'] = 'impulsive' self.drawSLabel() self.redraw() print "S pick onset set to %s" % self.dicts[self.stPt]['SOnset'] elif self.flagPhase == 1 and event.key == self.dictKeybindings['setSOnsetEmergent']: self.delSLabel() self.dicts[self.stPt]['SOnset'] = 'emergent' self.drawSLabel() self.redraw() print "S pick onset set to %s" % self.dicts[self.stPt]['SOnset'] # Remove P Pick if self.flagPhase==0 and event.key==self.dictKeybindings['delPick']: # Try to remove all existing Pick lines and P Pick variable self.delPLine() self.delP() self.delPWeight() self.delPPol() self.delPOnset() self.delPLabel() # Try to remove existing Pick Error 1 lines and variable self.delPErr1Line() self.delPErr1() # Try to remove existing Pick Error 2 lines and variable self.delPErr2Line() self.delPErr2() # Update all subplots self.redraw() # Remove S Pick if self.flagPhase==1 and event.key==self.dictKeybindings['delPick']: # Try to remove all existing Pick lines and P Pick variable self.delSLine() self.delS() self.delSWeight() self.delSPol() self.delSOnset() self.delSLabel() # Try to remove existing Pick Error 1 lines and variable self.delSErr1Line() self.delSErr1() # Try to remove existing Pick Error 2 lines and variable self.delSErr2Line() self.delSErr2() # Update all subplots self.redraw() # Set new P Pick uncertainties if self.flagPhase==0 and event.key==self.dictKeybindings['setPickError']: # Set Flag to determine scenario try: # Set left Error Pick if pickSample < self.dicts[self.stPt]['P']: errFlag=1 # Set right Error Pick else: errFlag=2 # Set no Error Pick (no P Pick yet) except: return # Case 1 if errFlag==1: # Define global variables seen outside # Remove old lines from the plot before plotting the new ones self.delPErr1Line() # Save time value of sample nearest to error pick self.dicts[self.stPt]['PErr1'] = pickSample # Plot the lines for the P Error pick in all three traces self.drawPErr1Line() # Update all subplots self.redraw() # Console output print "P Error Pick 1 set at %.3f" % \ self.dicts[self.stPt]['PErr1'] # Case 2 if errFlag==2: # Define global variables seen outside # Remove old lines from the plot before plotting the new ones self.delPErr2Line() # Save time value of sample nearest to error pick self.dicts[self.stPt]['PErr2'] = pickSample # Plot the lines for the P Error pick in all three traces self.drawPErr2Line() # Update all subplots self.redraw() # Console output print "P Error Pick 2 set at %.3f" % \ self.dicts[self.stPt]['PErr2'] # Set new S Pick uncertainties if self.flagPhase==1 and event.key==self.dictKeybindings['setPickError']: # Set Flag to determine scenario try: # Set left Error Pick if pickSample < self.dicts[self.stPt]['S']: errFlag=1 # Set right Error Pick else: errFlag=2 # Set no Error Pick (no S Pick yet) except: return # Case 1 if errFlag==1: # Define global variables seen outside # Remove old lines from the plot before plotting the new ones self.delSErr1Line() # Save sample value of error pick (round to integer sample value) self.dicts[self.stPt]['SErr1'] = pickSample # Plot the lines for the S Error pick in all three traces self.drawSErr1Line() # Update all subplots self.redraw() # Console output print "S Error Pick 1 set at %.3f" % \ self.dicts[self.stPt]['SErr1'] # Case 2 if errFlag==2: # Define global variables seen outside # Remove old lines from the plot before plotting the new ones self.delSErr2Line() # Save sample value of error pick (round to integer sample value) self.dicts[self.stPt]['SErr2'] = pickSample # Plot the lines for the S Error pick in all three traces self.drawSErr2Line() # Update all subplots self.redraw() # Console output print "S Error Pick 2 set at %.3f" % \ self.dicts[self.stPt]['SErr2'] # Magnitude estimation picking: if self.flagPhase==2 and event.key==self.dictKeybindings['setMagMin'] and len(self.axs) > 2: if event.inaxes == self.axs[1]: self.delMagMinCross1() ydata=event.inaxes.lines[0].get_ydata() #get the first line hoping that it is the seismogram! cutoffSamples=xpos-self.magPickWindow #remember, how much samples there are before our small window! We have to add this number for our MagMinT estimation! self.dicts[self.stPt]['MagMin1']=np.min(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) # save time of magnitude minimum in seconds tmp_magtime = cutoffSamples + np.argmin(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) tmp_magtime = tmp_magtime / samp_rate self.dicts[self.stPt]['MagMin1T'] = tmp_magtime #delete old MagMax Pick, if new MagMin Pick is higher try: if self.dicts[self.stPt]['MagMin1'] > self.dicts[self.stPt]['MagMax1']: self.delMagMaxCross1() self.delMagMax1() except: pass self.drawMagMinCross1() self.redraw() print "Minimum for magnitude estimation set: %s at %.3f" % \ (self.dicts[self.stPt]['MagMin1'], self.dicts[self.stPt]['MagMin1T']) elif event.inaxes == self.axs[2]: self.delMagMinCross2() ydata=event.inaxes.lines[0].get_ydata() #get the first line hoping that it is the seismogram! cutoffSamples=xpos-self.magPickWindow #remember, how much samples there are before our small window! We have to add this number for our MagMinT estimation! self.dicts[self.stPt]['MagMin2']=np.min(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) # save time of magnitude minimum in seconds tmp_magtime = cutoffSamples + np.argmin(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) tmp_magtime = tmp_magtime / samp_rate self.dicts[self.stPt]['MagMin2T'] = tmp_magtime #delete old MagMax Pick, if new MagMin Pick is higher try: if self.dicts[self.stPt]['MagMin2'] > self.dicts[self.stPt]['MagMax2']: self.delMagMaxCross2() self.delMagMax2() except: pass self.drawMagMinCross2() self.redraw() print "Minimum for magnitude estimation set: %s at %.3f" % \ (self.dicts[self.stPt]['MagMin2'], self.dicts[self.stPt]['MagMin2T']) if self.flagPhase==2 and event.key==self.dictKeybindings['setMagMax'] and len(self.axs) > 2: if event.inaxes == self.axs[1]: self.delMagMaxCross1() ydata=event.inaxes.lines[0].get_ydata() #get the first line hoping that it is the seismogram! cutoffSamples=xpos-self.magPickWindow #remember, how much samples there are before our small window! We have to add this number for our MagMinT estimation! self.dicts[self.stPt]['MagMax1']=np.max(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) # save time of magnitude maximum in seconds tmp_magtime = cutoffSamples + np.argmax(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) tmp_magtime = tmp_magtime / samp_rate self.dicts[self.stPt]['MagMax1T'] = tmp_magtime #delete old MagMax Pick, if new MagMax Pick is higher try: if self.dicts[self.stPt]['MagMin1'] > self.dicts[self.stPt]['MagMax1']: self.delMagMinCross1() self.delMagMin1() except: pass self.drawMagMaxCross1() self.redraw() print "Maximum for magnitude estimation set: %s at %.3f" % \ (self.dicts[self.stPt]['MagMax1'], self.dicts[self.stPt]['MagMax1T']) elif event.inaxes == self.axs[2]: self.delMagMaxCross2() ydata=event.inaxes.lines[0].get_ydata() #get the first line hoping that it is the seismogram! cutoffSamples=xpos-self.magPickWindow #remember, how much samples there are before our small window! We have to add this number for our MagMinT estimation! self.dicts[self.stPt]['MagMax2']=np.max(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) # save time of magnitude maximum in seconds tmp_magtime = cutoffSamples + np.argmax(ydata[xpos-self.magPickWindow:xpos+self.magPickWindow]) tmp_magtime = tmp_magtime / samp_rate self.dicts[self.stPt]['MagMax2T'] = tmp_magtime #delete old MagMax Pick, if new MagMax Pick is higher try: if self.dicts[self.stPt]['MagMin2'] > self.dicts[self.stPt]['MagMax2']: self.delMagMinCross2() self.delMagMin2() except: pass self.drawMagMaxCross2() self.redraw() print "Maximum for magnitude estimation set: %s at %.3f" % \ (self.dicts[self.stPt]['MagMax2'],self.dicts[self.stPt]['MagMax2T']) if self.flagPhase == 2 and event.key == self.dictKeybindings['delMagMinMax']: if event.inaxes == self.axs[1]: self.delMagMaxCross1() self.delMagMinCross1() self.delMagMin1() self.delMagMax1() elif event.inaxes == self.axs[2]: self.delMagMaxCross2() self.delMagMinCross2() self.delMagMin2() self.delMagMax2() else: return self.redraw() | b822b77814749ba0fa0b0a638d2c2e8ccf514f6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/b822b77814749ba0fa0b0a638d2c2e8ccf514f6c/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6002,
12,
2890,
16,
871,
4672,
468,
5666,
2359,
1966,
31,
2359,
1966,
18,
542,
67,
5129,
1435,
468,
3218,
2545,
358,
3643,
628,
326,
6002,
310,
2117,
358,
468,
5787,
813,
460,
434,
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,
6002,
12,
2890,
16,
871,
4672,
468,
5666,
2359,
1966,
31,
2359,
1966,
18,
542,
67,
5129,
1435,
468,
3218,
2545,
358,
3643,
628,
326,
6002,
310,
2117,
358,
468,
5787,
813,
460,
434,
326... |
if not chars: return self.tk.call(self._w, 'column', 'width', col, width) else: return self.tk.call(self._w, 'column', 'width', col, '-char', chars) | if not chars: return self.tk.call(self._w, 'column', 'width', col, width) else: return self.tk.call(self._w, 'column', 'width', col, '-char', chars) | def column_width(self, col=0, width=None, chars=None): | 86af7ef7e3f4448abc89aa941517a84075d99a38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/86af7ef7e3f4448abc89aa941517a84075d99a38/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1057,
67,
2819,
12,
2890,
16,
645,
33,
20,
16,
1835,
33,
7036,
16,
5230,
33,
7036,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1057,
67,
2819,
12,
2890,
16,
645,
33,
20,
16,
1835,
33,
7036,
16,
5230,
33,
7036,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
api_doc.canonical_name is not UNKNOWN): | api_doc.canonical_name not in (None, UNKNOWN)): | def pp_apidoc(api_doc, doublespace=0, depth=5, exclude=(), include=(), backpointers=None): """ @return: A multiline pretty-printed string representation for the given C{APIDoc}. @param doublespace: If true, then extra lines will be inserted to make the output more readable. @param depth: The maximum depth that pp_apidoc will descend into descendent VarDocs. To put no limit on depth, use C{depth=-1}. @param exclude: A list of names of attributes whose values should not be shown. @param backpointers: For internal use. """ pyid = id(api_doc.__dict__) if backpointers is None: backpointers = {} if (hasattr(api_doc, 'canonical_name') and api_doc.canonical_name is not UNKNOWN): name = '%s for %s' % (api_doc.__class__.__name__, api_doc.canonical_name) elif hasattr(api_doc, 'name') and api_doc.name is not UNKNOWN: name = '%s for %s' % (api_doc.__class__.__name__, api_doc.name) else: name = api_doc.__class__.__name__ if pyid in backpointers: return '%s [%s] (defined above)' % (name, backpointers[pyid]) if depth == 0: if hasattr(api_doc, 'name') and api_doc.name is not None: return '%s...' % api_doc.name else: return '...' backpointers[pyid] = len(backpointers) s = '%s [%s]' % (name, backpointers[pyid]) # Only print non-empty fields: fields = [field for field in api_doc.__dict__.keys() if (field in include or (getattr(api_doc, field) is not UNKNOWN and field not in exclude))] if include: fields = [field for field in dir(api_doc) if field in include] else: fields = [field for field in api_doc.__dict__.keys() if (getattr(api_doc, field) is not UNKNOWN and field not in exclude)] fields.sort() for field in fields: fieldval = getattr(api_doc, field) if doublespace: s += '\n |' s += '\n +- %s' % field if (isinstance(fieldval, types.ListType) and len(fieldval)>0 and isinstance(fieldval[0], APIDoc)): s += _pp_list(api_doc, fieldval, doublespace, depth, exclude, include, backpointers, (field is fields[-1])) elif (isinstance(fieldval, types.DictType) and len(fieldval)>0 and isinstance(fieldval.values()[0], APIDoc)): s += _pp_dict(api_doc, fieldval, doublespace, depth, exclude, include, backpointers, (field is fields[-1])) elif isinstance(fieldval, APIDoc): s += _pp_apidoc(api_doc, fieldval, doublespace, depth, exclude, include, backpointers, (field is fields[-1])) else: s += ' = ' + _pp_val(api_doc, fieldval, doublespace, depth, exclude, include, backpointers) return s | f79f1151c9e11128caae386252db1b14aeb334e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/f79f1151c9e11128caae386252db1b14aeb334e7/apidoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8228,
67,
438,
350,
504,
12,
2425,
67,
2434,
16,
31446,
909,
33,
20,
16,
3598,
33,
25,
16,
4433,
33,
9334,
2341,
33,
9334,
1473,
10437,
87,
33,
7036,
4672,
3536,
632,
2463,
30,
432,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8228,
67,
438,
350,
504,
12,
2425,
67,
2434,
16,
31446,
909,
33,
20,
16,
3598,
33,
25,
16,
4433,
33,
9334,
2341,
33,
9334,
1473,
10437,
87,
33,
7036,
4672,
3536,
632,
2463,
30,
432,
... |
of conductor N. If N is 0, return the total number of curves in the database. | of conductor N. If N is 0, return the total number of isogeny classes of curves in the database. | def number_of_isogeny_classes(self, N=0): """ Returns the number of isogeny classes of curves in the database of conductor N. If N is 0, return the total number of curves in the database. | 744afc21f8d5aaa26af78f056bca854defd17092 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/744afc21f8d5aaa26af78f056bca854defd17092/cremona.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
291,
19409,
93,
67,
4701,
12,
2890,
16,
423,
33,
20,
4672,
3536,
2860,
326,
1300,
434,
353,
19409,
93,
3318,
434,
24106,
316,
326,
2063,
434,
356,
1828,
280,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
291,
19409,
93,
67,
4701,
12,
2890,
16,
423,
33,
20,
4672,
3536,
2860,
326,
1300,
434,
353,
19409,
93,
3318,
434,
24106,
316,
326,
2063,
434,
356,
1828,
280,
423,
... |
packageName = self.packageInfo["Title"] rootFolder = packageName + ".pkg" contFolder = join(rootFolder, "Contents") resourceFolder = join(contFolder, "Resources") os.mkdir(rootFolder) | contFolder = join(self.PackageRootFolder, "Contents") self.packageResourceFolder = join(contFolder, "Resources") os.mkdir(self.PackageRootFolder) | def _makeFolders(self): "Create package folder structure." | d932aaa96ea8845f4755fa2da90712cb71b9e9c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d932aaa96ea8845f4755fa2da90712cb71b9e9c4/buildpkg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
14885,
12,
2890,
4672,
315,
1684,
2181,
3009,
3695,
1199,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
14885,
12,
2890,
4672,
315,
1684,
2181,
3009,
3695,
1199,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
fn = osFilenameToFilenameType(message.filename) singleclick.parse_command_line_args([fn]) | singleclick.parse_command_line_args([message.filename]) | def handle_open_individual_file(self, message): fn = osFilenameToFilenameType(message.filename) singleclick.parse_command_line_args([fn]) | 626eae8888708e9989c8a7011dd6aa461d046d3e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/626eae8888708e9989c8a7011dd6aa461d046d3e/messagehandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
3190,
67,
22032,
5557,
67,
768,
12,
2890,
16,
883,
4672,
2295,
273,
1140,
5359,
774,
5359,
559,
12,
2150,
18,
3459,
13,
2202,
7475,
18,
2670,
67,
3076,
67,
1369,
67,
1968,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1640,
67,
3190,
67,
22032,
5557,
67,
768,
12,
2890,
16,
883,
4672,
2295,
273,
1140,
5359,
774,
5359,
559,
12,
2150,
18,
3459,
13,
2202,
7475,
18,
2670,
67,
3076,
67,
1369,
67,
1968,
... |
Q = str(numpy.array(Q).transpose()) Q = Q.replace(']\n [',';').replace('\n ', '').replace(' ', ',') Q = Q[1:len(Q)-1] adj = pari(Q).qflll()[self.d] | pari_string = '['+';'.join([','.join(["%s"%i for i in row]) for row in zip(*Q)])+']' adj = pari(pari_string).qflll()[self.d] | def __init__(self, F, m, B, a=None): r""" Initialization routine (constructor). | 0870d17746fc4dfaa2781fe878deda3182a14f98 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/0870d17746fc4dfaa2781fe878deda3182a14f98/totallyreal_rel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
478,
16,
312,
16,
605,
16,
279,
33,
7036,
4672,
436,
8395,
26586,
12245,
261,
12316,
2934,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
478,
16,
312,
16,
605,
16,
279,
33,
7036,
4672,
436,
8395,
26586,
12245,
261,
12316,
2934,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return from_cycles(sum([len(c) for c in cycle_list]), cycle_list) | return from_cycles(max([max(c) for c in cycle_list]), cycle_list) | def Permutation(l): """ Convert l to a Permutation, where l is a list of integers, tuple of integers, tuple of tuples of integers, list of tuples of integers, or a string in cycle notation. Tuples are interpreted as cycles; lists of integers as one-line permutation notation. Returns a member of the Permutation class. EXAMPLES: sage: Permutation([2,1]) [2, 1] sage: Permutation([2, 1, 4, 5, 3]) [2, 1, 4, 5, 3] sage: Permutation('(1,2)') [2, 1] sage: Permutation('(1,2)(3,4,5)') [2, 1, 4, 5, 3] sage: Permutation( ((1,2),(3,4,5)) ) [2, 1, 4, 5, 3] sage: Permutation( [(1,2),(3,4,5)] ) [2, 1, 4, 5, 3] sage: Permutation( ((1,2)) ) [2, 1] sage: Permutation( (1,2) ) [2, 1] sage: Permutation( ((1,2),) ) [2, 1] sage: p = Permutation((1, 2, 5)); p [2, 5, 3, 4, 1] sage: type(p) <class 'sage.combinat.permutation.Permutation_class'> """ if isinstance(l, Permutation_class): return l #if l is a string, then assume it is in cycle notation elif isinstance(l, str): cycles = l.split(")(") cycles[0] = cycles[0][1:] cycles[-1] = cycles[-1][:-1] cycle_list = [] for c in cycles: cycle_list.append(map(int, c.split(","))) return from_cycles(sum([len(c) for c in cycle_list]), cycle_list) # if it's a tuple or nonempty list of tuples, also assume cycle # notation elif isinstance(l, tuple) or \ (isinstance(l, list) and len(l) > 0 and all(map(lambda x: isinstance(x, tuple), l))): if len(l) >= 1: if isinstance(l[0], tuple): n = max( map(max, l) ) return from_cycles(n, map(list, l)) else: n = max(l) l = [list(l)] return from_cycles(n, l) else: raise ValueError, "cannot convert l (= %s) to a Permutation"%l # otherwise, it gets processed by CombinatorialObject's __init__. else: return Permutation_class(l) | 37399534adb25cbcb02f8e72ff0afeccd9a90f3f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/37399534adb25cbcb02f8e72ff0afeccd9a90f3f/permutation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13813,
9245,
12,
80,
4672,
3536,
4037,
328,
358,
279,
13813,
9245,
16,
1625,
328,
353,
279,
666,
434,
12321,
16,
3193,
434,
12321,
16,
3193,
434,
10384,
434,
12321,
16,
666,
434,
10384,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13813,
9245,
12,
80,
4672,
3536,
4037,
328,
358,
279,
13813,
9245,
16,
1625,
328,
353,
279,
666,
434,
12321,
16,
3193,
434,
12321,
16,
3193,
434,
10384,
434,
12321,
16,
666,
434,
10384,
... |
print queueDict | def __getPilotOptions(self,queue,pilotsToSubmit): """ Prepare pilot options """ queueDict = self.queueDict[queue]['ParametersDict'] print queueDict vo = gConfig.getValue( "/DIRAC/VirtualOrganization", "unknown" ) if vo == 'unknown': self.log.error('Virtual Organization is not defined in the configuration') return None pilotOptions = [ "-V '%s'" % vo ] setup = gConfig.getValue( "/DIRAC/Setup", "unknown" ) if setup == 'unknown': self.log.error('Setup is not defined in the configuration') return None pilotOptions.append( '-S %s' % setup ) diracVersion = gConfig.getValue( "/Operations/%s/%s/Versions/PilotVersion" % (vo,setup), "unknown" ) if diracVersion == 'unknown': self.log.error('Setup is not defined in the configuration') return None pilotOptions.append( '-r %s' % diracVersion ) ownerDN = self.genericPilotDN ownerGroup = self.genericPilotGroup result = gProxyManager.requestToken( ownerDN, ownerGroup, pilotsToSubmit*5 ) if not result[ 'OK' ]: self.log.error( ERROR_TOKEN, result['Message'] ) return S_ERROR( ERROR_TOKEN ) ( token, numberOfUses ) = result[ 'Value' ] pilotOptions.append( '-o /Security/ProxyToken=%s' % token ) # Use Filling mode pilotOptions.append( '-M %s' % 5 ) | de53db04094ffe536f00b063457d17fbef5ab7b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/de53db04094ffe536f00b063457d17fbef5ab7b7/SiteDirector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
52,
22797,
1320,
12,
2890,
16,
4000,
16,
84,
330,
6968,
774,
11620,
4672,
3536,
7730,
293,
22797,
702,
3536,
225,
2389,
5014,
273,
365,
18,
4000,
5014,
63,
4000,
23962,
2402,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
52,
22797,
1320,
12,
2890,
16,
4000,
16,
84,
330,
6968,
774,
11620,
4672,
3536,
7730,
293,
22797,
702,
3536,
225,
2389,
5014,
273,
365,
18,
4000,
5014,
63,
4000,
23962,
2402,
... | |
entity.location = Point(self.node_location[1], self.node_location[0], srid=4326) | entity.location = Point(self.node_location, srid=4326) | def endElement(self, name): if name in ('node','way') and self.valid: try: types = self.find_types(self.tags) except ValueError: self.ignore_count += 1 return | 49e31fe3ef4aa2a9a8a7861170df02e006c0f7a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14173/49e31fe3ef4aa2a9a8a7861170df02e006c0f7a6/osm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14840,
12,
2890,
16,
508,
4672,
309,
508,
316,
7707,
2159,
17023,
1888,
6134,
471,
365,
18,
877,
30,
775,
30,
1953,
273,
365,
18,
4720,
67,
2352,
12,
2890,
18,
4156,
13,
1335,
2068,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14840,
12,
2890,
16,
508,
4672,
309,
508,
316,
7707,
2159,
17023,
1888,
6134,
471,
365,
18,
877,
30,
775,
30,
1953,
273,
365,
18,
4720,
67,
2352,
12,
2890,
18,
4156,
13,
1335,
2068,
... |
- ``ManinSymbol`` - the `i`'th Manin symbol in the list. | ``ManinSymbol`` - the `i`'th Manin symbol in the list. | def manin_symbol(self, i): """ Returns the i'th ManinSymbol in this ManinSymbolList. | e265517a575a65b09b817a2b1feaf73c31f0ba93 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/e265517a575a65b09b817a2b1feaf73c31f0ba93/manin_symbols.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3161,
267,
67,
7175,
12,
2890,
16,
277,
4672,
3536,
2860,
326,
277,
1404,
76,
8660,
267,
5335,
316,
333,
8660,
267,
5335,
682,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3161,
267,
67,
7175,
12,
2890,
16,
277,
4672,
3536,
2860,
326,
277,
1404,
76,
8660,
267,
5335,
316,
333,
8660,
267,
5335,
682,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if self._int[prec] == '5': for digit in self._int[prec+1:]: if digit != '0': break else: return self._round_down(prec) return self._round_half_up(prec) | if _exact_half(self._int, prec): return -1 else: return self._round_half_up(prec) | def _round_half_down(self, prec): """Round 5 down""" if self._int[prec] == '5': for digit in self._int[prec+1:]: if digit != '0': break else: return self._round_down(prec) return self._round_half_up(prec) | 2ec7415db5ad63c4e4b27ee793214071454f6fe5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/2ec7415db5ad63c4e4b27ee793214071454f6fe5/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2260,
67,
20222,
67,
2378,
12,
2890,
16,
13382,
4672,
3536,
11066,
1381,
2588,
8395,
309,
365,
6315,
474,
63,
4036,
65,
422,
296,
25,
4278,
364,
8035,
316,
365,
6315,
474,
63,
403... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2260,
67,
20222,
67,
2378,
12,
2890,
16,
13382,
4672,
3536,
11066,
1381,
2588,
8395,
309,
365,
6315,
474,
63,
4036,
65,
422,
296,
25,
4278,
364,
8035,
316,
365,
6315,
474,
63,
403... |
host, port = (serv.find(':') == -1 and "%s:%d" % (serv, DEFAULT_PORT) or serv).split(':') | host, port = (':' not in serv and "%s:%d" % (serv, DEFAULT_PORT) or serv).split(':') | def set_job_servers(self, servers, pre_connect = False): """TODO: set job servers, without shutting down dups, and shutting down old ones gracefully""" self.connections = [] for serv in servers: host, port = (serv.find(':') == -1 and "%s:%d" % (serv, DEFAULT_PORT) or serv).split(':') port = int(port) connection = GearmanConnection(addr=(host, port)) if pre_connect: connection.connect() self.connections.append( connection ) | 68bc0d3bdf16ddfb7072131ae21fb71a41099312 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14772/68bc0d3bdf16ddfb7072131ae21fb71a41099312/sync.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
4688,
67,
14247,
12,
2890,
16,
7084,
16,
675,
67,
3612,
273,
1083,
4672,
3536,
6241,
30,
444,
1719,
7084,
16,
2887,
24376,
2588,
9417,
87,
16,
471,
24376,
2588,
1592,
5945,
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,
444,
67,
4688,
67,
14247,
12,
2890,
16,
7084,
16,
675,
67,
3612,
273,
1083,
4672,
3536,
6241,
30,
444,
1719,
7084,
16,
2887,
24376,
2588,
9417,
87,
16,
471,
24376,
2588,
1592,
5945,
25... |
if not cid.exists(): | if not cid: | def perform(self): """ Looks up the consumer id and latest pkg profile info and cals the api to update the consumer profile """ bundle = Consumer() cid = bundle.getid() if not cid.exists(): log.error("Not Registered") return try: cconn = ConsumerConnection(host=cfg.server.host or "localhost", port=cfg.server.port or 443) pkginfo = PackageProfile().getPackageList() cconn.profile(cid.read(), pkginfo) log.info("Profile updated successfully for consumer %s" % cid.read()) except RestlibException, re: log.error("Error: %s" % re) except Exception, e: log.error("Error: %s" % e) | e6fb55158ad3be250c84b3dcac6fafef0ca20aee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10692/e6fb55158ad3be250c84b3dcac6fafef0ca20aee/pulp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
12,
2890,
4672,
3536,
10176,
87,
731,
326,
4765,
612,
471,
4891,
3475,
3042,
1123,
471,
276,
1031,
326,
1536,
358,
1089,
326,
4765,
3042,
3536,
3440,
273,
9326,
1435,
7504,
273,
34... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
12,
2890,
4672,
3536,
10176,
87,
731,
326,
4765,
612,
471,
4891,
3475,
3042,
1123,
471,
276,
1031,
326,
1536,
358,
1089,
326,
4765,
3042,
3536,
3440,
273,
9326,
1435,
7504,
273,
34... |
to get the L{form<cgi.FieldStorage>} with syntax as:: | to get the ``form`` with syntax as:: | def pyblosxom_app_factory(global_config, **local_config): """ App factory for paste. """ from paste import cgitb_catcher conf = global_config.copy() conf.update(local_config) conf.update(dict(local_config=local_config, global_config=global_config)) if "configpydir" in conf: sys.path.insert(0, conf["configpydir"]) return cgitb_catcher.make_cgitb_middleware(PyBlosxomWSGIApp(configini=conf), global_config) | 2d889182f07a1e20247eba2168cf4d18f81fcdab /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11836/2d889182f07a1e20247eba2168cf4d18f81fcdab/pyblosxom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2395,
70,
383,
30319,
362,
67,
2910,
67,
6848,
12,
6347,
67,
1425,
16,
2826,
3729,
67,
1425,
4672,
3536,
4677,
3272,
364,
19401,
18,
3536,
628,
19401,
1930,
276,
6845,
70,
67,
14683,
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,
2395,
70,
383,
30319,
362,
67,
2910,
67,
6848,
12,
6347,
67,
1425,
16,
2826,
3729,
67,
1425,
4672,
3536,
4677,
3272,
364,
19401,
18,
3536,
628,
19401,
1930,
276,
6845,
70,
67,
14683,
2... |
self.res_find_all = parent.res_find_all | if isinstance(parent, node_res_dir): self.res_find_all = parent.res_find_all else: self.res_find_all = False | def __init__(self, path, dir_id, parent, context, res_model, res_bo, res_id = None): super(node_res_obj,self).__init__(path, parent,context) assert parent #todo: more info from dirr self.dir_id = dir_id self.mimetype = 'application/x-directory' # 'httpd/unix-directory' self.create_date = parent.create_date # TODO: the write date should be MAX(file.write).. self.write_date = parent.write_date self.content_length = 0 self.uidperms = parent.uidperms & 15 self.unixperms = 040000 | _uid2unixperms(self.uidperms, True) self.uuser = parent.uuser self.ugroup = parent.ugroup self.res_model = res_model self.domain = parent.domain self.displayname = path self.dctx_dict = parent.dctx_dict self.res_find_all = parent.res_find_all if res_bo: self.res_id = res_bo.id dc2 = self.context.context.copy() dc2.update(self.dctx) dc2['res_model'] = res_model dc2['res_id'] = res_bo.id dc2['this'] = res_bo for fld,expr in self.dctx_dict.items(): try: self.dctx[fld] = safe_eval(expr, dc2) except Exception,e: print "Cannot eval %s for %s" % (expr, fld) print e pass else: self.res_id = res_id | 0cb5ccb45d72356e72b0fb025b06360d62a3fbf6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/0cb5ccb45d72356e72b0fb025b06360d62a3fbf6/nodes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
589,
16,
1577,
67,
350,
16,
982,
16,
819,
16,
400,
67,
2284,
16,
400,
67,
1075,
16,
400,
67,
350,
273,
599,
4672,
2240,
12,
2159,
67,
455,
67,
2603,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
589,
16,
1577,
67,
350,
16,
982,
16,
819,
16,
400,
67,
2284,
16,
400,
67,
1075,
16,
400,
67,
350,
273,
599,
4672,
2240,
12,
2159,
67,
455,
67,
2603,
... |
self.stream.write( "</%s:RDF>\n" % self.namespaces[self.rdfns] ) | self.stream.write( "</rdf:RDF>\n" ) | def end(self): if self.current_subject != None: self.subject_end() self.stream.write( "</%s:RDF>\n" % self.namespaces[self.rdfns] ) | 1313813332adaaa3197b56a7142c1558cf12f9f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7049/1313813332adaaa3197b56a7142c1558cf12f9f2/serializer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
12,
2890,
4672,
309,
365,
18,
2972,
67,
7857,
480,
599,
30,
365,
18,
7857,
67,
409,
1435,
365,
18,
3256,
18,
2626,
12,
6823,
9,
87,
30,
30137,
5333,
82,
6,
738,
365,
18,
16078... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
679,
12,
2890,
4672,
309,
365,
18,
2972,
67,
7857,
480,
599,
30,
365,
18,
7857,
67,
409,
1435,
365,
18,
3256,
18,
2626,
12,
6823,
9,
87,
30,
30137,
5333,
82,
6,
738,
365,
18,
16078... |
text = replaceExcept(oldtext, categoryR, '', ['nowiki', 'comment', 'math', 'pre']) | text = replaceExcept(oldtext, categoryR, '', ['nowiki', 'comment', 'math', 'pre']) | def replaceCategoryInPlace(oldtext, oldcat, newcat, site = None): """Replaces the category oldcat with the category newcat and then returns the modified Wiki source. """ #Note that this doesn't work yet and it has some very strange side-effects. if site is None: site = getSite() catNamespace = '|'.join(site.category_namespaces()) title = oldcat.titleWithoutNamespace() if not title: return # title might not be formatted correctly on the wiki if title[0].isalpha() and not site.nocapitalize: title = "[%s%s]" % (title[0].upper(), title[0].lower()) + title[1:] categoryR = re.compile(r'\[\[\s*(%s)\s*:\s*%s\s*\]\]' % (catNamespace, title)) if newcat is None: text = replaceExcept(oldtext, categoryR, '', ['nowiki', 'comment', 'math', 'pre']) else: text = replaceExcept(oldtext, categoryR, '[[Category:%s]]' % newcat.titleWithoutNamespace(), ['nowiki', 'comment', 'math', 'pre']) categoryR = re.compile(r'\[\[\s*(%s)\s*:%s\]\]' % (catNamespace, oldcat.titleWithoutNamespace().replace(' ','_'))) if newcat is None: text = replaceExcept(text, categoryR, '', ['nowiki', 'comment', 'math', 'pre']) else: text = replaceExcept(text, categoryR, '[[Category:%s]]' % newcat.titleWithoutNamespace(), ['nowiki', 'comment', 'math', 'pre']) return text | 6d2fe36714ef990259922b1b3541eacae5e76130 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/6d2fe36714ef990259922b1b3541eacae5e76130/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
4457,
382,
6029,
12,
1673,
955,
16,
1592,
2574,
16,
394,
2574,
16,
2834,
273,
599,
4672,
3536,
15189,
326,
3150,
1592,
2574,
598,
326,
3150,
394,
2574,
471,
1508,
1135,
326,
4358,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
4457,
382,
6029,
12,
1673,
955,
16,
1592,
2574,
16,
394,
2574,
16,
2834,
273,
599,
4672,
3536,
15189,
326,
3150,
1592,
2574,
598,
326,
3150,
394,
2574,
471,
1508,
1135,
326,
4358,
... |
msg = 'The operation cannot be completed, probably due to the following:\n' \ | msg = inst.pgerror + '\n' msg += 'The operation cannot be completed, probably due to the following:\n' \ | def wrapper(self, dbname, *args, **kwargs): try: if not pooler.get_pool(dbname)._ready: raise except_osv('Database not ready', 'Currently, this database is not fully loaded and can not be used.') return f(self, dbname, *args, **kwargs) except orm.except_orm, inst: if inst.name == 'AccessError': self.logger.debug("AccessError", exc_info=True) self.abortResponse(1, inst.name, 'warning', inst.value) except except_osv, inst: self.abortResponse(1, inst.name, inst.exc_type, inst.value) except IntegrityError, inst: for key in self._sql_error.keys(): if key in inst[0]: self.abortResponse(1, 'Constraint Error', 'warning', self._sql_error[key]) if inst.pgcode == errorcodes.NOT_NULL_VIOLATION: msg = 'The operation cannot be completed, probably due to the following:\n' \ '- deletion: you may be trying to delete a record while other records still reference it\n' \ '- creation/update: a mandatory field is not correctly set' self.logger.debug("IntegrityError", exc_info=True) try: context = inst.pgerror.split('"public".')[1] model_name = table = context.split('"')[1] model = table.replace("_",".") model_obj = self.get(model) if model_obj: model_name = model_obj._description or model_obj._name msg += '\n\n[object with reference: %s - %s]' % (model_name, model) except Exception: pass self.abortResponse(1, 'Integrity Error', 'warning', msg) else: self.abortResponse(1, 'Integrity Error', 'warning', inst[0]) except Exception, e: self.logger.exception("Uncaught exception") raise | cfd53a3d2a48bf6e26dc38c84422e6795a874bd3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/cfd53a3d2a48bf6e26dc38c84422e6795a874bd3/osv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4053,
12,
2890,
16,
18448,
16,
380,
1968,
16,
2826,
4333,
4672,
775,
30,
309,
486,
2845,
264,
18,
588,
67,
6011,
12,
20979,
2934,
67,
1672,
30,
1002,
1335,
67,
538,
90,
2668,
4254,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4053,
12,
2890,
16,
18448,
16,
380,
1968,
16,
2826,
4333,
4672,
775,
30,
309,
486,
2845,
264,
18,
588,
67,
6011,
12,
20979,
2934,
67,
1672,
30,
1002,
1335,
67,
538,
90,
2668,
4254,
4... |
Sub(event_type, "public").text = "%s" % self.flagPublicEvent | Sub(event_type, "public").text = "%s" % \ self.checkbuttonPublicEvent.get_active() | def dicts2XML(self): """ Returns information of all dictionaries as xml file """ xml = Element("event") Sub(Sub(xml, "event_id"), "value").text = self.dictEvent['xmlEventID'] event_type = Sub(xml, "event_type") Sub(event_type, "value").text = "manual" Sub(event_type, "user").text = self.username Sub(event_type, "public").text = "%s" % self.flagPublicEvent # XXX standard values for unset keys!!!???!!!??? epidists = [] # go through all stream-dictionaries and look for picks for i in range(len(self.streams)): d = self.dicts[i] st = self.streams[i] | 4e8f536428831ce605c623aa5fc17a6b33b5b712 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10346/4e8f536428831ce605c623aa5fc17a6b33b5b712/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15838,
22,
4201,
12,
2890,
4672,
3536,
2860,
1779,
434,
777,
16176,
487,
2025,
585,
3536,
2025,
273,
225,
3010,
2932,
2575,
7923,
2592,
12,
1676,
12,
2902,
16,
315,
2575,
67,
350,
6,
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,
15838,
22,
4201,
12,
2890,
4672,
3536,
2860,
1779,
434,
777,
16176,
487,
2025,
585,
3536,
2025,
273,
225,
3010,
2932,
2575,
7923,
2592,
12,
1676,
12,
2902,
16,
315,
2575,
67,
350,
6,
3... |
def N6q(self, p): | def N7q(self, p): | def N6q(self, p): return (1-p[0])*(1+p[2])/8.0 | fe068c7d5a9a7a2245d29d05c23d7dc62cec27ce /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8645/fe068c7d5a9a7a2245d29d05c23d7dc62cec27ce/TestFIATLagrange.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
27,
85,
12,
2890,
16,
293,
4672,
327,
261,
21,
17,
84,
63,
20,
5717,
21556,
21,
15,
84,
63,
22,
5717,
19,
28,
18,
20,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
27,
85,
12,
2890,
16,
293,
4672,
327,
261,
21,
17,
84,
63,
20,
5717,
21556,
21,
15,
84,
63,
22,
5717,
19,
28,
18,
20,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
], CONTEXT) | ], 0, None, None, CONTEXT) | def test0050char(self): ''' Test Char. ''' char1_id = self.char.create({ 'char': 'Test', }, CONTEXT) self.assert_(char1_id) | 52062c763bf1737b3f2071e48338f60845edc54d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9266/52062c763bf1737b3f2071e48338f60845edc54d/test_tryton.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
713,
3361,
3001,
12,
2890,
4672,
9163,
7766,
3703,
18,
9163,
1149,
21,
67,
350,
273,
365,
18,
3001,
18,
2640,
12590,
296,
3001,
4278,
296,
4709,
2187,
19879,
13862,
13,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
713,
3361,
3001,
12,
2890,
4672,
9163,
7766,
3703,
18,
9163,
1149,
21,
67,
350,
273,
365,
18,
3001,
18,
2640,
12590,
296,
3001,
4278,
296,
4709,
2187,
19879,
13862,
13,
365,
18,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.