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
if isDead(self.proxiedItem) and isFirst and not isDead(master):
if isDead(self.proxiedItem) and isFirst and not isDead(master.itsItem):
def propagateChange(self, name, value): proxiedEvent = EventStamp(self.proxiedItem) master = proxiedEvent.getMaster() isFirst = (proxiedEvent != master and proxiedEvent.recurrenceID == master.effectiveStartTime) table = {'this' : proxiedEvent.changeThis, 'thisandfuture' : proxiedEvent.changeThisAndFuture} table[self.currentlyModifying](name, value) # If the recurrence change caused our item to get deleted, and # we were the first occurrence, try to make our item point to # the new occurrence instead. This takes care of the case where # the recurrence proxy has been asked to make two THISANDFUTURE # changes on an event, like Bug 7448. # if isDead(self.proxiedItem) and isFirst and not isDead(master): newEvent = master.getRecurrenceID(master.effectiveStartTime) if newEvent is not None: self.proxiedItem = newEvent.itsItem
008fa6b7797a8a544301a7a1f4663367a5ebf6b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/008fa6b7797a8a544301a7a1f4663367a5ebf6b3/RecurrenceDialog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13551, 3043, 12, 2890, 16, 508, 16, 460, 4672, 21875, 1133, 273, 2587, 8860, 12, 2890, 18, 20314, 2092, 1180, 13, 225, 4171, 273, 21875, 1133, 18, 588, 7786, 1435, 17447, 273, 261, 20314...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13551, 3043, 12, 2890, 16, 508, 16, 460, 4672, 21875, 1133, 273, 2587, 8860, 12, 2890, 18, 20314, 2092, 1180, 13, 225, 4171, 273, 21875, 1133, 18, 588, 7786, 1435, 17447, 273, 261, 20314...
:rtype : The newly created VpnGateway :return : A :class:`boto.vpc.vpngateway.VpnGateway object
:rtype: The newly created VpnGateway :return: A :class:`boto.vpc.vpngateway.VpnGateway` object
def create_vpn_gateway(self, type, availability_zone=None): """ Create a new Vpn Gateway
953eb471ca2be49c4f821f024a3e0a6347048a4f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1098/953eb471ca2be49c4f821f024a3e0a6347048a4f/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 27769, 67, 11127, 12, 2890, 16, 618, 16, 13395, 67, 3486, 33, 7036, 4672, 3536, 1788, 279, 394, 31531, 11381, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 27769, 67, 11127, 12, 2890, 16, 618, 16, 13395, 67, 3486, 33, 7036, 4672, 3536, 1788, 279, 394, 31531, 11381, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
'playlist': item
'playlist': item, 'songs': len(songs), 'time': playtime, 'ptime': hmsFromSeconds(playtime)
def listplaylists(self, *args): data = self._safe_cmd(self.con.listplaylists, args) for index in range(len(data)): item = data[index]['playlist'] data[index] = { 'title': item, 'type': 'playlist', 'playlist': item } return data
02561c1e38a2d157269df452c083119912c49b61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4699/02561c1e38a2d157269df452c083119912c49b61/mpd_proxy2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 1601, 9772, 12, 2890, 16, 380, 1968, 4672, 501, 273, 365, 6315, 4626, 67, 4172, 12, 2890, 18, 591, 18, 1098, 1601, 9772, 16, 833, 13, 364, 770, 316, 1048, 12, 1897, 12, 892, 371...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 1601, 9772, 12, 2890, 16, 380, 1968, 4672, 501, 273, 365, 6315, 4626, 67, 4172, 12, 2890, 18, 591, 18, 1098, 1601, 9772, 16, 833, 13, 364, 770, 316, 1048, 12, 1897, 12, 892, 371...
self.endTagBody(impliedTagToken("body")) if not self.parser.innerHTML:
if self.tree.elementInScope("body"): self.endTagBody(impliedTagToken("body"))
def endTagHtml(self, token): self.endTagBody(impliedTagToken("body")) if not self.parser.innerHTML: self.parser.phase.processEndTag(token)
33cb109a3190acbbd68ca45ea0a1083908f6b7b0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9368/33cb109a3190acbbd68ca45ea0a1083908f6b7b0/html5parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29765, 4353, 12, 2890, 16, 1147, 4672, 225, 309, 365, 18, 3413, 18, 2956, 382, 3876, 2932, 3432, 6, 4672, 365, 18, 409, 1805, 2250, 12, 381, 3110, 1805, 1345, 2932, 3432, 6, 3719, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29765, 4353, 12, 2890, 16, 1147, 4672, 225, 309, 365, 18, 3413, 18, 2956, 382, 3876, 2932, 3432, 6, 4672, 365, 18, 409, 1805, 2250, 12, 381, 3110, 1805, 1345, 2932, 3432, 6, 3719, 365,...
movex = -scale*(maxx+minx)/2 movey = -scale*(maxy+miny)/2
movex = (maxx+minx)/2 movey = (maxy+miny)/2
def oasa_mol_to_bkchem_mol( mol, paper): m = molecule.molecule( paper) if None in reduce( operator.add, [[a.x, a.y] for a in mol.atoms], []): calc_position = 0 else: calc_position = 1 minx = None maxx = None miny = None maxy = None # atoms for a in mol.vertices: a2 = oasa_atom_to_bkchem_atom( a, paper, m) m.insert_atom( a2) if calc_position: # data for rescaling if not maxx or a2.x > maxx: maxx = a2.x if not minx or a2.x < minx: minx = a2.x if not miny or a2.y < miny: miny = a2.y if not maxy or a2.y > maxy: maxy = a2.y # bonds bond_lengths = [] for b in mol.edges: b2 = oasa_bond_to_bkchem_bond( b, paper) aa1, aa2 = b.vertices atom1 = m.atoms[ mol.vertices.index( aa1)] atom2 = m.atoms[ mol.vertices.index( aa2)] m.add_edge( atom1, atom2, b2) b2.molecule = m if calc_position: bond_lengths.append( math.sqrt( (b2.atom1.x-b2.atom2.x)**2 + (b2.atom1.y-b2.atom2.y)**2)) # rescale if calc_position: bl = sum( bond_lengths) / len( bond_lengths) scale = Screen.any_to_px( paper.standard.bond_length) / bl movex = -scale*(maxx+minx)/2 movey = -scale*(maxy+miny)/2 trans = transform3d.transform3d() trans.set_move( movex, movey, 0) trans.set_scaling( scale) trans.set_move( 320, 240, 0) for a in m.atoms: a.x, a.y, a.z = trans.transform_xyz( a.x, a.y, a.z) return m
7d644b1d74fecb072d33e593580eede91f1bf3de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4298/7d644b1d74fecb072d33e593580eede91f1bf3de/oasa_bridge.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 320, 345, 69, 67, 21260, 67, 869, 67, 24600, 1036, 67, 21260, 12, 12629, 16, 15181, 4672, 312, 273, 13661, 18, 81, 10545, 12, 15181, 13, 309, 599, 316, 5459, 12, 3726, 18, 1289, 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, 320, 345, 69, 67, 21260, 67, 869, 67, 24600, 1036, 67, 21260, 12, 12629, 16, 15181, 4672, 312, 273, 13661, 18, 81, 10545, 12, 15181, 13, 309, 599, 316, 5459, 12, 3726, 18, 1289, 16, ...
return marshal.dumps((self.id,stat))
if callable(self.id): id=self.id() else: id=self.id return marshal.dumps((id,stat))
def manage_FTPlist(self,REQUEST): """Directory listing for FTP. In the case of non-Foldoid objects, the listing should contain one object, the object itself.""" stat=marshal.loads(self.manage_FTPstat(REQUEST)) return marshal.dumps((self.id,stat))
49421aab63124d2f32cc771c8264083a5d0a9304 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/49421aab63124d2f32cc771c8264083a5d0a9304/SimpleItem.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10680, 67, 17104, 1098, 12, 2890, 16, 5519, 4672, 3536, 2853, 11591, 364, 19324, 18, 657, 326, 648, 434, 1661, 17, 15592, 839, 2184, 16, 326, 11591, 1410, 912, 1245, 733, 16, 326, 733, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10680, 67, 17104, 1098, 12, 2890, 16, 5519, 4672, 3536, 2853, 11591, 364, 19324, 18, 657, 326, 648, 434, 1661, 17, 15592, 839, 2184, 16, 326, 11591, 1410, 912, 1245, 733, 16, 326, 733, ...
hosts = [host.__add__((host[1].split("."), host[0].split(".", 1)))
hosts = [(host[1].split("."), host[0].split(".", 1))
def buildZones(self): '''Pre-build and stash zone files''' cursor = connection.cursor()
f930ee284c1d068927d686b340db09b3fc2764fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/f930ee284c1d068927d686b340db09b3fc2764fe/Hostbase.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 13600, 12, 2890, 4672, 9163, 1386, 17, 3510, 471, 23017, 4157, 1390, 26418, 3347, 273, 1459, 18, 9216, 1435, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1361, 13600, 12, 2890, 4672, 9163, 1386, 17, 3510, 471, 23017, 4157, 1390, 26418, 3347, 273, 1459, 18, 9216, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
cursor = self.connection.cursor()
try: cursor = self.connection.cursor() except: self.connection = sqlite.connect(self.path) cursor = self.connection.cursor()
def connect(self): if not self.connection: self.connection = sqlite.connect(self.path) cursor = self.connection.cursor() return (self.connection, cursor)
05571a04ace204f3c3b05b892132f0ae8e525fb7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2682/05571a04ace204f3c3b05b892132f0ae8e525fb7/shaManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3077, 12, 2890, 4672, 309, 486, 365, 18, 4071, 30, 365, 18, 4071, 273, 16184, 18, 3612, 12, 2890, 18, 803, 13, 775, 30, 3347, 273, 365, 18, 4071, 18, 9216, 1435, 1335, 30, 365, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3077, 12, 2890, 4672, 309, 486, 365, 18, 4071, 30, 365, 18, 4071, 273, 16184, 18, 3612, 12, 2890, 18, 803, 13, 775, 30, 3347, 273, 365, 18, 4071, 18, 9216, 1435, 1335, 30, 365, 18, ...
The following is Trac is not recognized as being a field at this time, so the fraction field is not the quotient ring itself::
The following is Trac is not recognized as being a field at this time, so the fraction field is not the quotient ring itself::
def is_prime(self, **kwds): r""" Return ``True`` if this ideal is prime.
74eb5b0603b6272744b6913b613a8e918759309e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/74eb5b0603b6272744b6913b613a8e918759309e/multi_polynomial_ideal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 16382, 12, 2890, 16, 2826, 25577, 4672, 436, 8395, 2000, 12176, 5510, 10335, 309, 333, 23349, 353, 17014, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 16382, 12, 2890, 16, 2826, 25577, 4672, 436, 8395, 2000, 12176, 5510, 10335, 309, 333, 23349, 353, 17014, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.syllableTable = self.getReadingEntities() return entity.lower() in self.syllableTable
self._syllableTable = self.getReadingEntities() return entity.lower() in self._syllableTable
def isReadingEntity(self, entity): """ Returns true if the given entity is recognised by the romanisation operator, i.e. it is a valid entity of the reading returned by the segmentation method.
01cc0f3b3089a2c824402c7d0c59f75b7c5af166 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11128/01cc0f3b3089a2c824402c7d0c59f75b7c5af166/operator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 15714, 1943, 12, 2890, 16, 1522, 4672, 3536, 2860, 638, 309, 326, 864, 1522, 353, 14603, 5918, 635, 326, 24137, 304, 10742, 3726, 16, 277, 18, 73, 18, 518, 353, 279, 923, 1522, 43...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 15714, 1943, 12, 2890, 16, 1522, 4672, 3536, 2860, 638, 309, 326, 864, 1522, 353, 14603, 5918, 635, 326, 24137, 304, 10742, 3726, 16, 277, 18, 73, 18, 518, 353, 279, 923, 1522, 43...
if ((totalcpu/totaltime) >= cpulimit): totalcpu += percentused*elapsedtime else: totalcpu += max(percentused, cpulimit)*elapsedtime
totalcpu += percentused*elapsedtime
def enforce_cpu_quota(readfobj, cpulimit, frequency, childpid): global totaltime, totalcpu elapsedtime, percentused = get_time_and_cpu_percent(readfobj) # They get a free pass (likely their first or last time) if elapsedtime == 0.0: #print "Time, Rolling, Average, Instant" return #if totaltime > 120: # linux_killme() # return # Used to calculate real average #rawcpu += percentused*elapsedtime # Only calculate if Hybrid Throttle is enabled if HYBRID_THROTTLE: # Increment total time totaltime += elapsedtime # Increment CPU use if ((totalcpu/totaltime) >= cpulimit): totalcpu += percentused*elapsedtime # Don't apply max function, allow the average to drop else: # Set a minimum for percentused, enfore a use it or lose it policy totalcpu += max(percentused, cpulimit)*elapsedtime totalAvg = (totalcpu/totaltime) # Update rolling info if len(rollingCPU) == ROLLING_PERIOD: rollingCPU.pop(0) rollingIntervals.pop(0) rollingCPU.append(percentused*elapsedtime) rollingIntervals.append(elapsedtime) # Caclulate Averages add = lambda x, y: x+y rollingTotalCPU = reduce(add, rollingCPU) rollingTotalTime = reduce(add, rollingIntervals) rollingAvg = rollingTotalCPU/rollingTotalTime # Determine which average to use if HYBRID_THROTTLE and totalAvg > rollingAvg: punishableAvg = totalAvg stoptime = (totalAvg - cpulimit) * totaltime * 2 else: punishableAvg = rollingAvg stoptime = (rollingTotalTime / frequency) * (rollingAvg - cpulimit) * 2 #print (totalcpu/totaltime), percentused, elapsedtime, totaltime, totalcpu #print totaltime, ",", (totalcpu/totaltime), "," , rollingAvg, ",", percentused #print totaltime , "," ,rollingAvg, ",", (rawcpu/totaltime) , "," ,percentused # If average CPU use is fine, then continue #if (totalcpu/totaltime) <= cpulimit: if punishableAvg <= cpulimit: time.sleep(frequency) # If we don't sleep, this process burns cpu doing nothing return # They must be punished by stopping os.kill(childpid, signal.SIGSTOP) # we'll stop them for at least long enough to even out the damage # why does this formula work? Where does *2 come from? # I checked and sleep is sleeping the full time... # I've verified the os.times() data tracks perfectly... # I've tried it will different publishing frequencies and it works... # this formula works for different cpulimits as well # for very low sleep rates, this doesn't work. The time is way over. # for high sleep rates, this works fine. # Old Stop Time #stoptime = (((percentused-cpulimit) / cpulimit)-1) * elapsedtime * 2 # New stoptime # Determine how far over the limit the average, and punish progressively # Also, unsure about the *2 but it does seem to work.... #stoptime = ((totalcpu/totaltime) - cpulimit) * totaltime * 2 #stoptime = (punishableAvg - cpulimit) * totaltime * 2 # Sanity Check # There is no reason to punish a process for more than # frequency / cpulimit # BECAUSE that means that if a process uses 100% during a sampling interval, # the resulting stop+use interval should average to the CPU limit # stoptime = min(frequency/cpulimit, stoptime) #print "Stopping: ", stoptime time.sleep(stoptime) # And now they can start back up! os.kill(childpid, signal.SIGCONT) # If stoptime < frequency, then we would over-sample if we don't sleep if (stoptime < frequency): time.sleep(frequency-stoptime)
a130b68d202c10ca030b7418740d1c46b4de4350 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7263/a130b68d202c10ca030b7418740d1c46b4de4350/nonportable.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12980, 67, 11447, 67, 23205, 12, 896, 27936, 16, 3283, 332, 1038, 16, 8670, 16, 1151, 6610, 4672, 2552, 2078, 957, 16, 2078, 11447, 225, 9613, 957, 16, 5551, 3668, 273, 336, 67, 957, 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, 12980, 67, 11447, 67, 23205, 12, 896, 27936, 16, 3283, 332, 1038, 16, 8670, 16, 1151, 6610, 4672, 2552, 2078, 957, 16, 2078, 11447, 225, 9613, 957, 16, 5551, 3668, 273, 336, 67, 957, 6...
print "Executing: ", self.host, ' ', \
print "Executing on ", self.host, ' with ', \
def run( self ): """ Run HEX job.
aec78ff89c794cc621832116bfd870db1713cd23 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/482/aec78ff89c794cc621832116bfd870db1713cd23/Docker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 365, 262, 30, 3536, 1939, 23971, 1719, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 365, 262, 30, 3536, 1939, 23971, 1719, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
tmp = value.translate(_knDigitsToLocal)
tmp = value.translate(digitsToLocal)
def dh_knYearConverter( value ): if type(value) is int: # Encode an integer value into a textual form. return unicode(value).translate(_knDigitsToLocal) else: # First make sure there are no real digits in the string tmp = value.translate(_knDigitsToLocal) # Test if tmp == value: tmp = value.translate(_knLocalToDigits) # Convert return dh_noConv( tmp, u'%d' ) else: raise ValueError("string contains regular digits")
32e5f5c1a30bc02fc3075b9c456f10fafab05a66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/32e5f5c1a30bc02fc3075b9c456f10fafab05a66/date.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11007, 67, 21112, 5593, 5072, 12, 460, 262, 30, 309, 618, 12, 1132, 13, 353, 509, 30, 468, 6240, 392, 3571, 460, 1368, 279, 25774, 646, 18, 327, 5252, 12, 1132, 2934, 13929, 24899, 211...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11007, 67, 21112, 5593, 5072, 12, 460, 262, 30, 309, 618, 12, 1132, 13, 353, 509, 30, 468, 6240, 392, 3571, 460, 1368, 279, 25774, 646, 18, 327, 5252, 12, 1132, 2934, 13929, 24899, 211...
opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:m",
opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:msC:",
def main(argv = None): import getopt if argv is None: argv = sys.argv try: opts, prog_argv = getopt.getopt(argv[1:], "tcrRf:d:m", ["help", "version", "trace", "count", "report", "no-report", "file=", "logdir=", "missing", "ignore-module=", "ignore-dir="]) except getopt.error, msg: sys.stderr.write("%s: %s\n" % (sys.argv[0], msg)) sys.stderr.write("Try `%s --help' for more information\n" % sys.argv[0]) sys.exit(1) trace = 0 count = 0 report = 0 no_report = 0 counts_file = None logdir = "." missing = 0 ignore_modules = [] ignore_dirs = [] for opt, val in opts: if opt == "--help": usage(sys.stdout) sys.exit(0) if opt == "--version": sys.stdout.write("trace 2.0\n") sys.exit(0) if opt == "-t" or opt == "--trace": trace = 1 continue if opt == "-c" or opt == "--count": count = 1 continue if opt == "-r" or opt == "--report": report = 1 continue if opt == "-R" or opt == "--no-report": no_report = 1 continue if opt == "-f" or opt == "--file": counts_file = val continue if opt == "-d" or opt == "--logdir": logdir = val continue if opt == "-m" or opt == "--missing": missing = 1 continue if opt == "--ignore-module": ignore_modules.append(val) continue if opt == "--ignore-dir": for s in string.split(val, os.pathsep): s = os.path.expandvars(s) # should I also call expanduser? (after all, could use $HOME) s = string.replace(s, "$prefix", os.path.join(sys.prefix, "lib", "python" + sys.version[:3])) s = string.replace(s, "$exec_prefix", os.path.join(sys.exec_prefix, "lib", "python" + sys.version[:3])) s = os.path.normpath(s) ignore_dirs.append(s) continue assert 0, "Should never get here" if len(prog_argv) == 0: _err_exit("missing name of file to run") if count + trace + report > 1: _err_exit("can only specify one of --trace, --count or --report") if count + trace + report == 0: _err_exit("must specify one of --trace, --count or --report") if report and counts_file is None: _err_exit("--report requires a --file") if report and no_report: _err_exit("cannot specify both --report and --no-report") if logdir is not None: # warn if the directory doesn't exist, but keep on going # (is this the correct behaviour?) if not os.path.isdir(logdir): sys.stderr.write( "trace: WARNING, --logdir directory %s is not available\n" % `logdir`) sys.argv = prog_argv progname = prog_argv[0] if eval(sys.version[:3])>1.3: sys.path[0] = os.path.split(progname)[0] # ??? # everything is ready ignore = Ignore(ignore_modules, ignore_dirs) if trace: t = Trace(ignore) try: run(t.trace, 'execfile(' + `progname` + ')') except IOError, err: _err_exit("Cannot run file %s because: %s" % \ (`sys.argv[0]`, err.strerror)) elif count: t = Coverage(ignore) try: run(t.trace, 'execfile(' + `progname` + ')') except IOError, err: _err_exit("Cannot run file %s because: %s" % \ (`sys.argv[0]`, err.strerror)) except SystemExit: pass results = t.results() # Add another lookup from the program's file name to its import name # This give the right results, but I'm not sure why ... results.modules[progname] = os.path.splitext(progname)[0] if counts_file: # add in archived data, if available try: old_counts, old_modules = marshal.load(open(counts_file, 'rb')) except IOError: pass else: results.update(CoverageResults(old_counts, old_modules)) if not no_report: create_results_log(results, logdir, missing) if counts_file: try: marshal.dump( (results.counts, results.modules), open(counts_file, 'wb')) except IOError, err: _err_exit("Cannot save counts file %s because: %s" % \ (`counts_file`, err.strerror)) elif report: old_counts, old_modules = marshal.load(open(counts_file, 'rb')) results = CoverageResults(old_counts, old_modules) create_results_log(results, logdir, missing) else: assert 0, "Should never get here"
66a7e57c7e8aab2bf187991aa5c2aa5e21b44c2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/66a7e57c7e8aab2bf187991aa5c2aa5e21b44c2c/trace.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 273, 599, 4672, 1930, 336, 3838, 225, 309, 5261, 353, 599, 30, 5261, 273, 2589, 18, 19485, 775, 30, 1500, 16, 11243, 67, 19485, 273, 336, 3838, 18, 588, 3838, 12, 1948...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 273, 599, 4672, 1930, 336, 3838, 225, 309, 5261, 353, 599, 30, 5261, 273, 2589, 18, 19485, 775, 30, 1500, 16, 11243, 67, 19485, 273, 336, 3838, 18, 588, 3838, 12, 1948...
return u"%s" % self.url_save
return force_unicode(self.url_save)
def __repr__(self): return u"%s" % self.url_save
d2883615b172064b6250e9514a91df28a46ed237 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12975/d2883615b172064b6250e9514a91df28a46ed237/base.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12715, 972, 12, 2890, 4672, 327, 2944, 67, 9124, 12, 2890, 18, 718, 67, 5688, 13, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 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, 1001, 12715, 972, 12, 2890, 4672, 327, 2944, 67, 9124, 12, 2890, 18, 718, 67, 5688, 13, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self._string_from_ip_int(self.network) + '/' + str(self.prefixlen + prefixlen_diff))
self._string_from_ip_int(self.network) + '/' + str(self._prefixlen + prefixlen_diff))
def subnet(self, prefixlen_diff=1): """The subnets which join to make the current subnet.
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, 8821, 12, 2890, 16, 1633, 1897, 67, 5413, 33, 21, 4672, 3536, 1986, 19140, 1492, 1233, 358, 1221, 326, 783, 8821, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8821, 12, 2890, 16, 1633, 1897, 67, 5413, 33, 21, 4672, 3536, 1986, 19140, 1492, 1233, 358, 1221, 326, 783, 8821, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
suite = unittest.TestLoader().loadTestsFromTestCase(TestObjectives) unittest.TextTestRunner(verbosity=2).run(suite)
def test_check_objective_player (self): print "\nTesting check mission player" world = self.world obj = self.obj pla_obj = filter (lambda o: o.type == 'player',obj) random.shuffle(pla_obj)
14dd3427f1c25a25fa68abb11ec8e37237a38268 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/14dd3427f1c25a25fa68abb11ec8e37237a38268/model_objectives.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1893, 67, 20174, 67, 14872, 261, 2890, 4672, 1172, 1548, 82, 22218, 866, 29396, 7291, 6, 9117, 273, 365, 18, 18179, 1081, 273, 365, 18, 2603, 886, 69, 67, 2603, 273, 1034, 26...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1893, 67, 20174, 67, 14872, 261, 2890, 4672, 1172, 1548, 82, 22218, 866, 29396, 7291, 6, 9117, 273, 365, 18, 18179, 1081, 273, 365, 18, 2603, 886, 69, 67, 2603, 273, 1034, 26...
- ``bits`` - integer (optional and considered only if ``cf`` is a real number) the number of bits to consider when computing the
- ``bits`` - integer (optional and considered only if ``slope`` is a real number) the number of bits to consider when computing the
def CharacteristicSturmianWord(self, cf, alphabet=(0, 1), bits=None): r""" Returns the characteristic Sturmian word of the given slope ``cf``.
b3fbc1cf28b1612f234458261a8411d34f117fd9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b3fbc1cf28b1612f234458261a8411d34f117fd9/word_generators.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6577, 5846, 510, 27430, 2779, 3944, 12, 2890, 16, 6080, 16, 10877, 28657, 20, 16, 404, 3631, 4125, 33, 7036, 4672, 436, 8395, 2860, 326, 23158, 934, 27430, 2779, 2076, 434, 326, 864, 175...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6577, 5846, 510, 27430, 2779, 3944, 12, 2890, 16, 6080, 16, 10877, 28657, 20, 16, 404, 3631, 4125, 33, 7036, 4672, 436, 8395, 2860, 326, 23158, 934, 27430, 2779, 2076, 434, 326, 864, 175...
self.mocoeffs[spin, i + symoffset + base, row + symoffset] = float(cols[i + 1])
self.mocoeffs[spin, aolist[i+base], row + symoffset] = float(cols[i + 1])
def parse(self, fupdate=0.05, cupdate=0.002): """Extract information from the logfile.""" inputfile = open(self.filename, "r") if self.progress: inputfile.seek(0, 2) #go to end of file nstep = inputfile.tell() inputfile.seek(0) self.progress.initialize(nstep) oldstep = 0 # Used to avoid extracting the final geometry twice in a GeoOpt NOTFOUND, GETLAST, NOMORE = range(3) finalgeometry = NOTFOUND # Used for calculating the scftarget (variables names taken from the ADF manual) accint = SCFconv = sconv2 = None # keep track of nosym and unrestricted case to parse Energies since it doens't have an all Irreps section nosymflag = False unrestrictedflag = False for line in inputfile: if self.progress and random.random() < cupdate: step = inputfile.tell() if step != oldstep: self.progress.update(step, "Unsupported Information") oldstep = step if line.find("INPUT FILE") >= 0:
722578f84e20e2883d2f098179d9927deafe4732 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8167/722578f84e20e2883d2f098179d9927deafe4732/adfparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 2890, 16, 284, 2725, 33, 20, 18, 6260, 16, 276, 2725, 33, 20, 18, 24908, 4672, 3536, 4976, 1779, 628, 326, 15204, 12123, 810, 768, 273, 1696, 12, 2890, 18, 3459, 16, 315, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 2890, 16, 284, 2725, 33, 20, 18, 6260, 16, 276, 2725, 33, 20, 18, 24908, 4672, 3536, 4976, 1779, 628, 326, 15204, 12123, 810, 768, 273, 1696, 12, 2890, 18, 3459, 16, 315, 8...
form = form_class(data=request.POST, files=request.FILES, **form_args)
form = self.form_class(data=request.POST, files=request.FILES, **self.form_args)
def __call__(self, request, *args, **kwargs): form_class = kwargs.get('form_class', getattr(self, 'form_class', self.get_form_class())) form_args = kwargs.get('form_args', getattr(self, 'form_args', self.get_form_args(*args, **kwargs))) template_name=kwargs.get('template_name', getattr(self, 'template_name', self.get_template_name())) pagemenu = kwargs.get('pagemenu', getattr(self, 'pagemenu', self.get_pagemenu(request, *args, **kwargs))) success_message = kwargs.get('success_message', getattr(self, 'success_message', self.get_success_message(*args, **kwargs)))
34a2e9c7044829a5a6cdb3f63c9be5a103290f99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12648/34a2e9c7044829a5a6cdb3f63c9be5a103290f99/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 590, 16, 380, 1968, 16, 2826, 4333, 4672, 646, 67, 1106, 273, 1205, 18, 588, 2668, 687, 67, 1106, 2187, 3869, 12, 2890, 16, 296, 687, 67, 1106, 2187, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 590, 16, 380, 1968, 16, 2826, 4333, 4672, 646, 67, 1106, 273, 1205, 18, 588, 2668, 687, 67, 1106, 2187, 3869, 12, 2890, 16, 296, 687, 67, 1106, 2187, 3...
def do_shell(self):
def do_shell(self, s):
def do_shell(self): pass
5089a38af2b90dfe51bbf157ff38227c85eff687 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/5089a38af2b90dfe51bbf157ff38227c85eff687/test_cmd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 10304, 12, 2890, 16, 272, 4672, 1342, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 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, 741, 67, 10304, 12, 2890, 16, 272, 4672, 1342, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if not headers.has_key('content-type') and self.status == 200: self.setStatus('nocontent')
def __str__(self, html_search=regex.compile('<html>',regex.casefold).search, ): if self._wrote: return '' # Streaming output was used.
a925db54a85961bd5dbc4796caea38cd3a2b8842 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/a925db54a85961bd5dbc4796caea38cd3a2b8842/HTTPResponse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 701, 972, 12, 2890, 16, 1729, 67, 3072, 33, 7584, 18, 11100, 2668, 32, 2620, 1870, 16, 7584, 18, 3593, 16007, 2934, 3072, 16, 262, 30, 309, 365, 6315, 91, 21436, 30, 327, 875, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1001, 701, 972, 12, 2890, 16, 1729, 67, 3072, 33, 7584, 18, 11100, 2668, 32, 2620, 1870, 16, 7584, 18, 3593, 16007, 2934, 3072, 16, 262, 30, 309, 365, 6315, 91, 21436, 30, 327, 875, ...
if not compile_dir(dir, maxlevels, ddir, force, rx):
if not compile_dir(dir, maxlevels, ddir, force, rx, quiet):
def main(): """Script main program.""" import getopt try: opts, args = getopt.getopt(sys.argv[1:], 'lfd:x:') except getopt.error, msg: print msg print "usage: python compileall.py [-l] [-f] [-d destdir] " \ "[-s regexp] [directory ...]" print "-l: don't recurse down" print "-f: force rebuild even if timestamps are up-to-date" print "-d destdir: purported directory name for error messages" print " if no directory arguments, -l sys.path is assumed" print "-x regexp: skip files matching the regular expression regexp" print " the regexp is search for in the full path of the file" sys.exit(2) maxlevels = 10 ddir = None force = 0 rx = None for o, a in opts: if o == '-l': maxlevels = 0 if o == '-d': ddir = a if o == '-f': force = 1 if o == '-x': import re rx = re.compile(a) if ddir: if len(args) != 1: print "-d destdir require exactly one directory argument" sys.exit(2) success = 1 try: if args: for dir in args: if not compile_dir(dir, maxlevels, ddir, force, rx): success = 0 else: success = compile_path() except KeyboardInterrupt: print "\n[interrupt]" success = 0 return success
6fb3494c60cbdbefb2193ec4f676a8916063457f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/6fb3494c60cbdbefb2193ec4f676a8916063457f/compileall.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3536, 3651, 2774, 5402, 12123, 1930, 336, 3838, 775, 30, 1500, 16, 833, 273, 336, 3838, 18, 588, 3838, 12, 9499, 18, 19485, 63, 21, 30, 6487, 296, 80, 8313, 30, 92, 2497, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3536, 3651, 2774, 5402, 12123, 1930, 336, 3838, 775, 30, 1500, 16, 833, 273, 336, 3838, 18, 588, 3838, 12, 9499, 18, 19485, 63, 21, 30, 6487, 296, 80, 8313, 30, 92, 2497, ...
None, lambda w,e: self.on_new_notebook(), 0,
"", lambda w,e: self.on_new_notebook(), 0,
def make_menubar(self): # menu bar folder_delete = gtk.Image() folder_delete.set_from_file(get_resource("images", "folder-delete.png")) page_delete = gtk.Image() page_delete.set_from_file(get_resource("images", "note-delete.png")) self.menu_items = ( ("/_File", None, None, 0, "<Branch>"), ("/File/_New Notebook", None, lambda w,e: self.on_new_notebook(), 0, "<StockItem>", gtk.STOCK_NEW), ("/File/New _Page", "<control>N", lambda w,e: self.on_new_page(), 0, "<ImageItem>", get_image(get_resource("images", "note-new.png")).get_pixbuf()), ("/File/New _Folder", "<control><shift>N", lambda w,e: self.on_new_dir(), 0, "<ImageItem>", get_image(get_resource("images", "folder-new.png")).get_pixbuf()), ("/File/_Open Notebook", "<control>O", lambda w,e: self.on_open_notebook(), 0, "<ImageItem>", get_image(get_resource("images", "open.png")).get_pixbuf()), ("/File/_Reload Notebook", None, lambda w,e: self.on_reload_notebook(), 0, "<StockItem>", gtk.STOCK_REVERT_TO_SAVED), ("/File/_Save Notebook", "<control>S", lambda w,e: self.on_save(), 0, "<ImageItem>", get_image(get_resource("images", "save.png")).get_pixbuf()), ("/File/_Close Notebook", "<control>W", lambda w, e: self.close_notebook(), 0, "<StockItem>", gtk.STOCK_CLOSE), ("/File/sep1", None, None, 0, "<Separator>" ), ("/File/Quit", "<control>Q", lambda w,e: self.on_close(), 0, None),
15d239b1ef23a9b5c25e57156d74ceece038ccc0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4738/15d239b1ef23a9b5c25e57156d74ceece038ccc0/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 27617, 373, 297, 12, 2890, 4672, 468, 3824, 4653, 3009, 67, 3733, 273, 22718, 18, 2040, 1435, 3009, 67, 3733, 18, 542, 67, 2080, 67, 768, 12, 588, 67, 3146, 2932, 7369, 3113,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 27617, 373, 297, 12, 2890, 4672, 468, 3824, 4653, 3009, 67, 3733, 273, 22718, 18, 2040, 1435, 3009, 67, 3733, 18, 542, 67, 2080, 67, 768, 12, 588, 67, 3146, 2932, 7369, 3113,...
def __is_displayed(self,tid):
def __is_displayed(self, tid):
def __is_displayed(self,tid): """ This is a private method that return True if the task *should* be displayed in the tree, regardless of its current status """ if tid: result = True for f in self.applied_filters: filt = self.req.get_filter(f) if filt: result = result and filt.is_displayed(tid) return result else: return False
e3bd06aa0faafd067fb9f358429e0b05d6f6f816 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/e3bd06aa0faafd067fb9f358429e0b05d6f6f816/filteredtree.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 291, 67, 5417, 329, 12, 2890, 16, 11594, 4672, 3536, 1220, 353, 279, 3238, 707, 716, 327, 1053, 309, 326, 1562, 380, 13139, 14, 506, 10453, 316, 326, 2151, 16, 15255, 434, 2097, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 291, 67, 5417, 329, 12, 2890, 16, 11594, 4672, 3536, 1220, 353, 279, 3238, 707, 716, 327, 1053, 309, 326, 1562, 380, 13139, 14, 506, 10453, 316, 326, 2151, 16, 15255, 434, 2097, ...
host = host.split(':', 1)[0]
host, port = host.split(':', 1)[0] else: if environ['wsgi.url_scheme'] == 'http': port = '80' else: port = '443'
def __call__(self, environ, start_response): host = environ.get('HTTP_HOST', environ.get('SERVER_NAME')).lower() if ':' in host: host = host.split(':', 1)[0] path_info = environ.get('PATH_INFO') path_info = self.normalize_url(path_info, False)[1] for (domain, app_url), app in self.applications: if domain and domain != host: continue if (path_info == app_url or path_info.startswith(app_url + '/')): environ['SCRIPT_NAME'] += app_url environ['PATH_INFO'] = path_info[len(app_url):] return app(environ, start_response) environ['paste.urlmap_object'] = self return self.not_found_application(environ, start_response)
e1a052c802aecd7c328af246552be494d80c174d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/e1a052c802aecd7c328af246552be494d80c174d/urlmap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 5473, 16, 787, 67, 2740, 4672, 1479, 273, 5473, 18, 588, 2668, 3693, 67, 8908, 2187, 5473, 18, 588, 2668, 4370, 67, 1985, 6134, 2934, 8167, 1435, 309, 39...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 5473, 16, 787, 67, 2740, 4672, 1479, 273, 5473, 18, 588, 2668, 3693, 67, 8908, 2187, 5473, 18, 588, 2668, 4370, 67, 1985, 6134, 2934, 8167, 1435, 309, 39...
xccl = gyp.xcodeproj_file.XCConfigurationList({'buildConfigurations': []}) for configuration_name in configuration_names: xcbc = gyp.xcodeproj_file.XCBuildConfiguration({ 'name': configuration_name}) xccl.AppendProperty('buildConfigurations', xcbc) xccl.SetProperty('defaultConfigurationName', configuration_names[0])
xccl = CreateXCConfigurationList(configuration_names)
def GenerateOutput(target_list, target_dicts, data, params): options = params['options'] generator_flags = params.get('generator_flags', {}) parallel_builds = generator_flags.get('xcode_parallel_builds', True) serialize_all_tests = \ generator_flags.get('xcode_serialize_all_test_runs', True) xcode_projects = {} for build_file, build_file_dict in data.iteritems(): (build_file_root, build_file_ext) = os.path.splitext(build_file) if build_file_ext != '.gyp': continue xcodeproj_path = build_file_root + options.suffix + '.xcodeproj' if options.generator_output: xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) xcp = XcodeProject(build_file, xcodeproj_path, build_file_dict) xcode_projects[build_file] = xcp pbxp = xcp.project if parallel_builds: pbxp.SetProperty('attributes', {'BuildIndependentTargetsInParallel': 'YES'}) main_group = pbxp.GetProperty('mainGroup') build_group = gyp.xcodeproj_file.PBXGroup({'name': 'Build'}) main_group.AppendChild(build_group) for included_file in build_file_dict['included_files']: build_group.AddOrGetFileByPath(included_file, False) xcode_targets = {} xcode_target_to_target_dict = {} for qualified_target in target_list: [build_file, target_name, toolset] = \ gyp.common.ParseQualifiedTarget(qualified_target) spec = target_dicts[qualified_target] if spec['toolset'] != 'target': raise Exception( 'Multiple toolsets not supported in xcode build (target %s)' % qualified_target) configuration_names = [spec['default_configuration']] for configuration_name in sorted(spec['configurations'].keys()): if configuration_name not in configuration_names: configuration_names.append(configuration_name) xcp = xcode_projects[build_file] pbxp = xcp.project # Set up the configurations for the target according to the list of names # supplied. xccl = gyp.xcodeproj_file.XCConfigurationList({'buildConfigurations': []}) for configuration_name in configuration_names: xcbc = gyp.xcodeproj_file.XCBuildConfiguration({ 'name': configuration_name}) xccl.AppendProperty('buildConfigurations', xcbc) xccl.SetProperty('defaultConfigurationName', configuration_names[0]) # Create an XCTarget subclass object for the target. We use the type # with "+bundle" appended if the target has "mac_bundle" set. _types = { 'executable': 'com.apple.product-type.tool', 'loadable_module': 'com.apple.product-type.library.dynamic', 'shared_library': 'com.apple.product-type.library.dynamic', 'static_library': 'com.apple.product-type.library.static', 'executable+bundle': 'com.apple.product-type.application', 'loadable_module+bundle': 'com.apple.product-type.bundle', 'shared_library+bundle': 'com.apple.product-type.framework', } target_properties = { 'buildConfigurationList': xccl, 'name': target_name, } type = spec['type'] is_bundle = int(spec.get('mac_bundle', 0)) if type != 'none': type_bundle_key = type if is_bundle: type_bundle_key += '+bundle' xctarget_type = gyp.xcodeproj_file.PBXNativeTarget try: target_properties['productType'] = _types[type_bundle_key] except KeyError, e: gyp.common.ExceptionAppend(e, "-- unknown product type while " "writing target %s" % target_name) raise else: xctarget_type = gyp.xcodeproj_file.PBXAggregateTarget if 'product_name' in spec: target_properties['productName'] = spec['product_name'] xct = xctarget_type(target_properties, parent=pbxp, force_extension=spec.get('product_extension', None)) pbxp.AppendProperty('targets', xct) xcode_targets[qualified_target] = xct xcode_target_to_target_dict[xct] = spec # Xcode does not have a distinct type for loadable_modules that are pure # BSD targets (ie-unbundled). It uses the same setup as a shared_library # but the mach-o type is explictly set in the settings. So before we do # anything else, for this one case, we stuff in that one setting. This # would allow the other data in the spec to change it if need be. if type == 'loadable_module' and not is_bundle: xccl.SetBuildSetting('MACH_O_TYPE', 'mh_bundle') prebuild_index = 0 # Add custom shell script phases for "actions" sections. for action in spec.get('actions', []): # There's no need to write anything into the script to ensure that the # output directories already exist, because Xcode will look at the # declared outputs and automatically ensure that they exist for us. # Do we have a message to print when this action runs? message = action.get('message') if message: message = 'echo note: ' + gyp.common.EncodePOSIXShellArgument(message) else: message = '' # Turn the list into a string that can be passed to a shell. action_string = gyp.common.EncodePOSIXShellList(action['action']) # Convert Xcode-type variable references to sh-compatible environment # variable references. message_sh = gyp.xcodeproj_file.ConvertVariablesToShellSyntax(message) action_string_sh = gyp.xcodeproj_file.ConvertVariablesToShellSyntax( action_string) script = '' # Include the optional message if message_sh: script += message_sh + '\n' # Be sure the script runs in exec, and that if exec fails, the script # exits signalling an error. script += 'exec ' + action_string_sh + '\nexit 1\n' ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase({ 'inputPaths': action['inputs'], 'name': 'Action "' + action['action_name'] + '"', 'outputPaths': action['outputs'], 'shellScript': script, 'showEnvVarsInLog': 0, }) # TODO(mark): this assumes too much knowledge of the internals of # xcodeproj_file; some of these smarts should move into xcodeproj_file # itself. xct._properties['buildPhases'].insert(prebuild_index, ssbp) prebuild_index = prebuild_index + 1 # TODO(mark): Should verify that at most one of these is specified. if int(action.get('process_outputs_as_sources', False)): for output in action['outputs']: AddSourceToTarget(output, pbxp, xct) if int(action.get('process_outputs_as_mac_bundle_resources', False)): for output in action['outputs']: AddResourceToTarget(output, pbxp, xct) # tgt_mac_bundle_resources holds the list of bundle resources so # the rule processing can check against it. if is_bundle: tgt_mac_bundle_resources = spec.get('mac_bundle_resources', []) else: tgt_mac_bundle_resources = [] # Add custom shell script phases driving "make" for "rules" sections. # # Xcode's built-in rule support is almost powerful enough to use directly, # but there are a few significant deficiencies that render them unusable. # There are workarounds for some of its inadequacies, but in aggregate, # the workarounds added complexity to the generator, and some workarounds # actually require input files to be crafted more carefully than I'd like. # Consequently, until Xcode rules are made more capable, "rules" input # sections will be handled in Xcode output by shell script build phases # performed prior to the compilation phase. # # The following problems with Xcode rules were found. The numbers are # Apple radar IDs. I hope that these shortcomings are addressed, I really # liked having the rules handled directly in Xcode during the period that # I was prototyping this. # # 6588600 Xcode compiles custom script rule outputs too soon, compilation # fails. This occurs when rule outputs from distinct inputs are # interdependent. The only workaround is to put rules and their # inputs in a separate target from the one that compiles the rule # outputs. This requires input file cooperation and it means that # process_outputs_as_sources is unusable. # 6584932 Need to declare that custom rule outputs should be excluded from # compilation. A possible workaround is to lie to Xcode about a # rule's output, giving it a dummy file it doesn't know how to # compile. The rule action script would need to touch the dummy. # 6584839 I need a way to declare additional inputs to a custom rule. # A possible workaround is a shell script phase prior to # compilation that touches a rule's primary input files if any # would-be additional inputs are newer than the output. Modifying # the source tree - even just modification times - feels dirty. # 6564240 Xcode "custom script" build rules always dump all environment # variables. This is a low-prioroty problem and is not a # show-stopper. rules_by_ext = {} for rule in spec.get('rules', []): rules_by_ext[rule['extension']] = rule # First, some definitions: # # A "rule source" is a file that was listed in a target's "sources" # list and will have a rule applied to it on the basis of matching the # rule's "extensions" attribute. Rule sources are direct inputs to # rules. # # Rule definitions may specify additional inputs in their "inputs" # attribute. These additional inputs are used for dependency tracking # purposes. # # A "concrete output" is a rule output with input-dependent variables # resolved. For example, given a rule with: # 'extension': 'ext', 'outputs': ['$(INPUT_FILE_BASE).cc'], # if the target's "sources" list contained "one.ext" and "two.ext", # the "concrete output" for rule input "two.ext" would be "two.cc". If # a rule specifies multiple outputs, each input file that the rule is # applied to will have the same number of concrete outputs. # # If any concrete outputs are outdated or missing relative to their # corresponding rule_source or to any specified additional input, the # rule action must be performed to generate the concrete outputs. # concrete_outputs_by_rule_source will have an item at the same index # as the rule['rule_sources'] that it corresponds to. Each item is a # list of all of the concrete outputs for the rule_source. concrete_outputs_by_rule_source = [] # concrete_outputs_all is a flat list of all concrete outputs that this # rule is able to produce, given the known set of input files # (rule_sources) that apply to it. concrete_outputs_all = [] # messages & actions are keyed by the same indices as rule['rule_sources'] # and concrete_outputs_by_rule_source. They contain the message and # action to perform after resolving input-dependent variables. The # message is optional, in which case None is stored for each rule source. messages = [] actions = [] for rule_source in rule.get('rule_sources', []): rule_source_basename = posixpath.basename(rule_source) (rule_source_root, rule_source_ext) = \ posixpath.splitext(rule_source_basename) # These are the same variable names that Xcode uses for its own native # rule support. Because Xcode's rule engine is not being used, they # need to be expanded as they are written to the makefile. rule_input_dict = { 'INPUT_FILE_BASE': rule_source_root, 'INPUT_FILE_SUFFIX': rule_source_ext, 'INPUT_FILE_NAME': rule_source_basename, 'INPUT_FILE_PATH': rule_source, } concrete_outputs_for_this_rule_source = [] for output in rule.get('outputs', []): # Fortunately, Xcode and make both use $(VAR) format for their # variables, so the expansion is the only transformation necessary. # Any remaning $(VAR)-type variables in the string can be given # directly to make, which will pick up the correct settings from # what Xcode puts into the environment. concrete_output = ExpandXcodeVariables(output, rule_input_dict) concrete_outputs_for_this_rule_source.append(concrete_output) # Add all concrete outputs to the project. pbxp.AddOrGetFileInRootGroup(concrete_output) concrete_outputs_by_rule_source.append( \ concrete_outputs_for_this_rule_source) concrete_outputs_all.extend(concrete_outputs_for_this_rule_source) # TODO(mark): Should verify that at most one of these is specified. if int(rule.get('process_outputs_as_sources', False)): for output in concrete_outputs_for_this_rule_source: AddSourceToTarget(output, pbxp, xct) # If the file came from the mac_bundle_resources list or if the rule # is marked to process outputs as bundle resource, do so. was_mac_bundle_resource = rule_source in tgt_mac_bundle_resources if was_mac_bundle_resource or \ int(rule.get('process_outputs_as_mac_bundle_resources', False)): for output in concrete_outputs_for_this_rule_source: AddResourceToTarget(output, pbxp, xct) # Do we have a message to print when this rule runs? message = rule.get('message') if message: message = gyp.common.EncodePOSIXShellArgument(message) message = '@echo note: ' + ExpandXcodeVariables(message, rule_input_dict) messages.append(message) # Turn the list into a string that can be passed to a shell. action_string = gyp.common.EncodePOSIXShellList(rule['action']) action = ExpandXcodeVariables(action_string, rule_input_dict) actions.append(action) if len(concrete_outputs_all) > 0: # TODO(mark): There's a possibilty for collision here. Consider # target "t" rule "A_r" and target "t_A" rule "r". makefile_name = '%s_%s.make' % (target_name, rule['rule_name']) makefile_path = os.path.join(xcode_projects[build_file].path, makefile_name) # TODO(mark): try/close? Write to a temporary file and swap it only # if it's got changes? makefile = open(makefile_path, 'wb') # make will build the first target in the makefile by default. By # convention, it's called "all". List all (or at least one) # concrete output for each rule source as a prerequisite of the "all" # target. makefile.write('all: \\\n') for concrete_output_index in \ xrange(0, len(concrete_outputs_by_rule_source)): # Only list the first (index [0]) concrete output of each input # in the "all" target. Otherwise, a parallel make (-j > 1) would # attempt to process each input multiple times simultaneously. # Otherwise, "all" could just contain the entire list of # concrete_outputs_all. concrete_output = \ concrete_outputs_by_rule_source[concrete_output_index][0] if concrete_output_index == len(concrete_outputs_by_rule_source) - 1: eol = '' else: eol = ' \\' makefile.write(' %s%s\n' % (concrete_output, eol)) for (rule_source, concrete_outputs, message, action) in \ zip(rule['rule_sources'], concrete_outputs_by_rule_source, messages, actions): makefile.write('\n') # Add a rule that declares it can build each concrete output of a # rule source. Collect the names of the directories that are # required. concrete_output_dirs = [] for concrete_output_index in xrange(0, len(concrete_outputs)): concrete_output = concrete_outputs[concrete_output_index] if concrete_output_index == 0: bol = '' else: bol = ' ' makefile.write('%s%s \\\n' % (bol, concrete_output)) concrete_output_dir = posixpath.dirname(concrete_output) if (concrete_output_dir and concrete_output_dir not in concrete_output_dirs): concrete_output_dirs.append(concrete_output_dir) makefile.write(' : \\\n') # The prerequisites for this rule are the rule source itself and # the set of additional rule inputs, if any. prerequisites = [rule_source] prerequisites.extend(rule.get('inputs', [])) for prerequisite_index in xrange(0, len(prerequisites)): prerequisite = prerequisites[prerequisite_index] if prerequisite_index == len(prerequisites) - 1: eol = '' else: eol = ' \\' makefile.write(' %s%s\n' % (prerequisite, eol)) # Make sure that output directories exist before executing the rule # action. # TODO(mark): quote the list of concrete_output_dirs. if len(concrete_output_dirs) > 0: makefile.write('\tmkdir -p %s\n' % ' '.join(concrete_output_dirs)) # The rule message and action have already had the necessary variable # substitutions performed. if message: makefile.write('\t%s\n' % message) makefile.write('\t%s\n' % action) makefile.close() # It might be nice to ensure that needed output directories exist # here rather than in each target in the Makefile, but that wouldn't # work if there ever was a concrete output that had an input-dependent # variable anywhere other than in the leaf position. # Don't declare any inputPaths or outputPaths. If they're present, # Xcode will provide a slight optimization by only running the script # phase if any output is missing or outdated relative to any input. # Unfortunately, it will also assume that all outputs are touched by # the script, and if the outputs serve as files in a compilation # phase, they will be unconditionally rebuilt. Since make might not # rebuild everything that could be declared here as an output, this # extra compilation activity is unnecessary. With inputPaths and # outputPaths not supplied, make will always be called, but it knows # enough to not do anything when everything is up-to-date. # To help speed things up, pass -j COUNT to make so it does some work # in parallel. Don't use ncpus because Xcode will build ncpus targets # in parallel and if each target happens to have a rules step, there # would be ncpus^2 things going. With a machine that has 2 quad-core # Xeons, a build can quickly run out of processes based on # scheduling/other tasks, and randomly failing builds are no good. script = \
9b6358ccfb062c60eee046cd65f1d7fbd396ffcc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6220/9b6358ccfb062c60eee046cd65f1d7fbd396ffcc/xcode.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 1447, 12, 3299, 67, 1098, 16, 1018, 67, 16287, 16, 501, 16, 859, 4672, 702, 273, 859, 3292, 2116, 3546, 4456, 67, 7133, 273, 859, 18, 588, 2668, 8812, 67, 7133, 2187, 2618, 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, 6654, 1447, 12, 3299, 67, 1098, 16, 1018, 67, 16287, 16, 501, 16, 859, 4672, 702, 273, 859, 3292, 2116, 3546, 4456, 67, 7133, 273, 859, 18, 588, 2668, 8812, 67, 7133, 2187, 2618, 13, ...
line+='PID: ' + os.getenv(' line+='QUEUE: ' + os.getenv('
try: line+='PID: ' + os.getenv(' line+='QUEUE: ' + os.getenv(' except: pass
def preparejob(self,jobconfig,master_input_sandbox):
637db2d472e4294b7f7425b7e2073bcab5832482 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1488/637db2d472e4294b7f7425b7e2073bcab5832482/Batch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2911, 4688, 12, 2890, 16, 4688, 1425, 16, 7525, 67, 2630, 67, 27004, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2911, 4688, 12, 2890, 16, 4688, 1425, 16, 7525, 67, 2630, 67, 27004, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
EXAMPLES:
Returns a generator object which iterates through the elements of self. The order in which the elements are generated is based on a 'weight' of a matrix which is the number of iterations on the base ring that are required to reach that matrix. The ordering is similar to a degree negative lexicographic order in monomials in a multivariate polynomial ring. EXAMPLES: Consider the case of 2 x 2 matrices over GF(5). sage: list( GF(5) ) [0, 1, 2, 3, 4] sage: MS = MatrixSpace(GF(5), 2, 2) sage: l = list(MS) Then, consider the following matrices: sage: A = MS([2,1,0,1]); A [2 1] [0 1] sage: B = MS([1,2,1,0]); B [1 2] [1 0] sage: C = MS([1,2,0,0]); C [1 2] [0 0] A appears before B since the weight of one of A's entries exceeds the weight of the corresponding entry in B earliest in the list. sage: l.index(A) 41 sage: l.index(B) 46 However, A would come after the matrix C since C has a lower weight than A. sage: l.index(A) 41 sage: l.index(C) 19 The weights of matrices over other base rings are not as obvious. For example, the weight of sage: MS = MatrixSpace(ZZ, 2, 2) sage: MS([-1,0,0,0]) [-1 0] [ 0 0] is 2 since sage: i = iter(ZZ) sage: i.next() 0 sage: i.next() 1 sage: i.next() -1 Some more examples:
def __iter__(self): """ EXAMPLES: sage: MS = MatrixSpace(GF(2),2) sage: a = list(MS) sage: len(a) 16 sage: a[0] [0 0] [0 0]
bbebd3f89fde9fdae231bd7426d05a4e2a454b81 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/bbebd3f89fde9fdae231bd7426d05a4e2a454b81/matrix_space.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2165, 972, 12, 2890, 4672, 3536, 2860, 279, 4456, 733, 1492, 16960, 3059, 326, 2186, 434, 365, 18, 225, 1021, 1353, 316, 1492, 326, 2186, 854, 4374, 353, 2511, 603, 279, 296, 4865,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2165, 972, 12, 2890, 4672, 3536, 2860, 279, 4456, 733, 1492, 16960, 3059, 326, 2186, 434, 365, 18, 225, 1021, 1353, 316, 1492, 326, 2186, 854, 4374, 353, 2511, 603, 279, 296, 4865,...
inspect.classify_class_attrs(object))
classify_class_attrs(object))
def spilldata(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: base = self.docother(getattr(object, name), name, mod) if callable(value) or inspect.isdatadescriptor(value): doc = getattr(value, "__doc__", None) else: doc = None if doc is None: push('<dl><dt>%s</dl>\n' % base) else: doc = self.markup(getdoc(value), self.preformat, funcs, classes, mdict) doc = '<dd><tt>%s</tt>' % doc push('<dl><dt>%s%s</dl>\n' % (base, doc)) push('\n') return attrs
210cc240dc7573286fe4f4380906712aae9b9a70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/210cc240dc7573286fe4f4380906712aae9b9a70/pydoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1694, 737, 892, 12, 3576, 16, 3422, 16, 5641, 4672, 1529, 16, 3422, 273, 389, 4939, 67, 1098, 12, 7039, 16, 5641, 13, 309, 1529, 30, 15407, 18, 19133, 1435, 1817, 12, 3576, 13, 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, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1694, 737, 892, 12, 3576, 16, 3422, 16, 5641, 4672, 1529, 16, 3422, 273, 389, 4939, 67, 1098, 12, 7039, 16, 5641, 13, 309, 1529, 30, 15407, 18, 19133, 1435, 1817, 12, 3576, 13, 364, ...
def time_order_rows(ligolw_segment_list, segment_table, process, segment_def_row): for seg, activity in iterutils.inorder(((seg, True) for seg in ligolw_segment_list.active), ((seg, False) for seg in ligolw_segment_list.inactive)): segment_row = segment_table.RowType() segment_row.set(seg) segment_row.process_id = process.process_id segment_row.segment_id = segment_table.get_next_id() yield segment_row, segment_def_row
def row_generator(segs, target_table, process_row, segment_def_row): id_column = target_table.next_id.column_name for seg in segs: row = target_table.RowType() row.set(seg) row.process_id = process_row.process_id setattr(row, id_column, target_table.get_next_id()) row.segment_def_id = segment_def_row.segment_def_id yield row, target_table
def time_order_rows(ligolw_segment_list, segment_table, process, segment_def_row): for seg, activity in iterutils.inorder(((seg, True) for seg in ligolw_segment_list.active), ((seg, False) for seg in ligolw_segment_list.inactive)): segment_row = segment_table.RowType() segment_row.set(seg) segment_row.process_id = process.process_id segment_row.segment_id = segment_table.get_next_id() yield segment_row, segment_def_row
bcd97bdeac084860dc395b535f5985906d79618c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3589/bcd97bdeac084860dc395b535f5985906d79618c/segments.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 813, 67, 1019, 67, 3870, 12, 80, 360, 355, 91, 67, 9273, 67, 1098, 16, 3267, 67, 2121, 16, 1207, 16, 3267, 67, 536, 67, 492, 4672, 364, 2291, 16, 5728, 316, 1400, 5471, 18, 267, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 813, 67, 1019, 67, 3870, 12, 80, 360, 355, 91, 67, 9273, 67, 1098, 16, 3267, 67, 2121, 16, 1207, 16, 3267, 67, 536, 67, 492, 4672, 364, 2291, 16, 5728, 316, 1400, 5471, 18, 267, 10...
bad_list = string.split(config.get('refer_blacklist',''),',')
bad_list = string.split(self._config.get('refer_blacklist',''),',')
def genReferrers(self): """ Generate the list of referring files """ config = self._request.getConfiguration()
bbe9b47d1117252e30350aac61eb72d8b52f5895 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11836/bbe9b47d1117252e30350aac61eb72d8b52f5895/logstats.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3157, 1957, 370, 414, 12, 2890, 4672, 3536, 6654, 326, 666, 434, 1278, 20245, 1390, 3536, 642, 273, 365, 6315, 2293, 18, 588, 1750, 1435, 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, 3157, 1957, 370, 414, 12, 2890, 4672, 3536, 6654, 326, 666, 434, 1278, 20245, 1390, 3536, 642, 273, 365, 6315, 2293, 18, 588, 1750, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -10...
attribute, accessor) columndef = {'value': accessor } defs[catalogid]['columns'].append(columndef)
attribute, accessor) defs[catalogid]['columns'].append({'value': accessor})
if ctypedef and ctypedef['index']: indexdef['meta_type'] = ctypedef['index']
333392d9b9337c7275f358060115919d0fef5d57 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11941/333392d9b9337c7275f358060115919d0fef5d57/ArchetypesGenerator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 309, 11920, 536, 471, 11920, 536, 3292, 1615, 3546, 30, 770, 536, 3292, 3901, 67, 723, 3546, 273, 11920, 536, 3292, 1615, 3546, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 309, 11920, 536, 471, 11920, 536, 3292, 1615, 3546, 30, 770, 536, 3292, 3901, 67, 723, 3546, 273, 11920, 536, 3292, 1615, 3546, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
else:
else:
def insert_into_subdivision(element, bbox): for bucket in self.all_buckets: if do_boxes_intersect((bucket.bottom_left, bucket.top_right), bbox): bucket.insert(element, bbox)
353a9bb8a040092e66fbf172198bc1e6d18df417 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12871/353a9bb8a040092e66fbf172198bc1e6d18df417/spatial_btree.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2243, 67, 18591, 67, 1717, 2892, 1951, 12, 2956, 16, 8472, 4672, 364, 2783, 316, 365, 18, 454, 67, 20700, 30, 309, 741, 67, 15918, 67, 12288, 12443, 7242, 18, 9176, 67, 4482, 16, 2783,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2243, 67, 18591, 67, 1717, 2892, 1951, 12, 2956, 16, 8472, 4672, 364, 2783, 316, 365, 18, 454, 67, 20700, 30, 309, 741, 67, 15918, 67, 12288, 12443, 7242, 18, 9176, 67, 4482, 16, 2783,...
guess = map(lambda x: sign(dot(los,x))*x, guess) self.axis=norm(sum(guess))
def f(x): s = sign(dot(los,x)) if s == 0: return -x else: return s * x guess = map(f, guess) self.axis = norm(sum(guess))
def recompute_center_axis(self, los = None): #bruce 050518 split this out of findCenter, for use in a new cmenu item oldaxis = self.axis if los is None: los = self.assy.o.lineOfSight shaft = self.atoms # remaining code is a kluge, according to the comment above findcenter; # note that it depends on order of atoms, presumably initially derived # from the selatoms dict and thus arbitrary (not even related to order # in which user selected them or created them). [bruce 050518 comment] pos=A(map((lambda a: a.posn()), shaft)) self.center=sum(pos)/len(pos) relpos=pos-self.center if len(shaft) == 1: self.axis = norm(los) elif len(shaft) == 2: self.axis = norm(cross(relpos[0],cross(relpos[1],los))) else: guess = map(cross, relpos[:-1], relpos[1:]) guess = map(lambda x: sign(dot(los,x))*x, guess) self.axis=norm(sum(guess)) if dot(oldaxis, self.axis) < 0: self.axis = - self.axis #bruce 060116 fix unreported bug analogous to bug 1330 self.assy.changed() #bruce 060116 fix unreported bug analogous to bug 1331 self._initial_posns = None #bruce 050518; needed in RotaryMotor, harmless in others return
140facc6163ba4f80ca95ca5f5df035baa438379 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/140facc6163ba4f80ca95ca5f5df035baa438379/jigs_motors.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 30067, 67, 5693, 67, 4890, 12, 2890, 16, 22148, 273, 599, 4672, 468, 2848, 3965, 374, 3361, 25, 2643, 1416, 333, 596, 434, 1104, 8449, 16, 364, 999, 316, 279, 394, 5003, 2104, 761, 159...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 30067, 67, 5693, 67, 4890, 12, 2890, 16, 22148, 273, 599, 4672, 468, 2848, 3965, 374, 3361, 25, 2643, 1416, 333, 596, 434, 1104, 8449, 16, 364, 999, 316, 279, 394, 5003, 2104, 761, 159...
AND NOT pf_protocol IS NULL AND pf_protocol != ''"""
"""
def get_graph(self, end_date, report_days, host=None, user=None, email=None): if email: return None
312a5969453f1098fae0678df91a68f627c5a2a3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/87/312a5969453f1098fae0678df91a68f627c5a2a3/untangle_node_protofilter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 4660, 12, 2890, 16, 679, 67, 712, 16, 2605, 67, 9810, 16, 1479, 33, 7036, 16, 729, 33, 7036, 16, 2699, 33, 7036, 4672, 309, 2699, 30, 327, 599, 2, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 4660, 12, 2890, 16, 679, 67, 712, 16, 2605, 67, 9810, 16, 1479, 33, 7036, 16, 729, 33, 7036, 16, 2699, 33, 7036, 4672, 309, 2699, 30, 327, 599, 2, -100, -100, -100, -100, ...
self.write_dependent_schema(self._wa.getSchemaDict().get(ns), fd)
self.write_dependent_schema(self._wa.\ getSchemaDict().get(ns), fd)
def write_dependent_schema(self, schema, fd): """Write schema instance contents w/respect to dependency requirements. First write any schema that is imported directly into current schema, then check current schema's xmlns and see if any of these represent currently held schema instances.
a2422a4ff104ae248ad594b02d159d0d4a1b9d0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/a2422a4ff104ae248ad594b02d159d0d4a1b9d0e/wsdl2python.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 10891, 67, 4821, 12, 2890, 16, 1963, 16, 5194, 4672, 3536, 3067, 1963, 791, 2939, 341, 19, 455, 1181, 358, 4904, 8433, 18, 5783, 1045, 1281, 1963, 716, 353, 9101, 5122, 1368, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 10891, 67, 4821, 12, 2890, 16, 1963, 16, 5194, 4672, 3536, 3067, 1963, 791, 2939, 341, 19, 455, 1181, 358, 4904, 8433, 18, 5783, 1045, 1281, 1963, 716, 353, 9101, 5122, 1368, ...
merged = []
def doPreview(self, depth, renew, timePoint = 0): """ Makes a two-dimensional preview using the class-specific combination function Parameters: depth The preview depth renew Flag indicating, whether the preview should be regenerated or if a stored image can be reused timePoint The timepoint from which to generate the preview Defaults to 0 """ Logging.info("Creating preview",kw="dataunit") preview = None if timePoint > self.getNumberOfTimepoints(): timepoint = self.getNumberOfTimepoints() - 1 self.oldAlphaStatus = scripting.wantAlphaChannel if depth == scripting.WHOLE_DATASET_NO_ALPHA: scripting.wantAlphaChannel = 0 # If the previously requested preview was a "show original" preview # then we can just restore the preview before that without any # processing showOrig = self.settings.get("ShowOriginal")
5ab84ae3fb47cec3dc170caeca2d9d6b294cc39c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2877/5ab84ae3fb47cec3dc170caeca2d9d6b294cc39c/CombinedDataUnit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 11124, 12, 2890, 16, 3598, 16, 15723, 16, 813, 2148, 273, 374, 4672, 3536, 490, 3223, 279, 2795, 17, 31236, 10143, 1450, 326, 667, 17, 12524, 10702, 445, 7012, 30, 3598, 202, 202, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 11124, 12, 2890, 16, 3598, 16, 15723, 16, 813, 2148, 273, 374, 4672, 3536, 490, 3223, 279, 2795, 17, 31236, 10143, 1450, 326, 667, 17, 12524, 10702, 445, 7012, 30, 3598, 202, 202, ...
self.start_times = {}
self.start_times = {}
def __init__(self, c, selmgr): # Call constructor of superclass PathBuilder.__init__(self, c, selmgr, GeoIPRouter) # Additional stuff self.ping_circs = Queue.Queue() # (circ_id, hop)-pairs self.start_times = {} # dict mapping circ_id:start_time TODO: cleanup self.circs_sorted = [] # sorted list of circs, generated regularly # Set up the CircuitManager self.circ_manager = CircuitManager(selmgr, c, self) self.circ_manager.setDaemon(True) self.circ_manager.start()
5c07e1b6d34f16556018f8177a0bd4db44e9e733 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3762/5c07e1b6d34f16556018f8177a0bd4db44e9e733/op-addon.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 276, 16, 357, 13552, 4672, 468, 3049, 3885, 434, 12098, 2666, 1263, 16186, 2738, 972, 12, 2890, 16, 276, 16, 357, 13552, 16, 9385, 2579, 8259, 13, 468, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 276, 16, 357, 13552, 4672, 468, 3049, 3885, 434, 12098, 2666, 1263, 16186, 2738, 972, 12, 2890, 16, 276, 16, 357, 13552, 16, 9385, 2579, 8259, 13, 468, 1...
for id in ids: userdeleter.doDeleteUser(id) PluggableAuthService._doDelUsers = _doDelUsers
userdeleter.doDeleteUser(id) PluggableAuthService._doDelUser = _doDelUser
def _doDelUsers(self, ids): """ Given a list of user ids, hand off to a deleter plugin if available; has no return value, like the original """ plugins = self._getOb('plugins') userdeleters = plugins.listPlugins(IUserManagement) if not userdeleters: raise NotImplementedError("There is no plugin that can " " delete users.") for userdeleter_id, userdeleter in userdeleters: for id in ids: userdeleter.doDeleteUser(id)
d4ed704a8299446a409a45d056f3b50d97a5a658 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12230/d4ed704a8299446a409a45d056f3b50d97a5a658/pas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2896, 2837, 6588, 12, 2890, 16, 3258, 4672, 3536, 16803, 279, 666, 434, 729, 3258, 16, 948, 3397, 358, 279, 6578, 264, 1909, 309, 2319, 31, 711, 1158, 327, 460, 16, 3007, 326, 228...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2896, 2837, 6588, 12, 2890, 16, 3258, 4672, 3536, 16803, 279, 666, 434, 729, 3258, 16, 948, 3397, 358, 279, 6578, 264, 1909, 309, 2319, 31, 711, 1158, 327, 460, 16, 3007, 326, 228...
sourcefiles = []
_context = self._ctx if _context is None: _context = self._ctx = self._make_context(self.autocommit)
def main(global_config, **settings): config = Configurator() config.include('myapp.myconfig.configure')
4a5f9df2c6ecfaea37c231f5c5aa48b92e1b59ad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14321/4a5f9df2c6ecfaea37c231f5c5aa48b92e1b59ad/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 6347, 67, 1425, 16, 2826, 4272, 4672, 642, 273, 1903, 10662, 1435, 642, 18, 6702, 2668, 4811, 2910, 18, 4811, 1425, 18, 14895, 6134, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 6347, 67, 1425, 16, 2826, 4272, 4672, 642, 273, 1903, 10662, 1435, 642, 18, 6702, 2668, 4811, 2910, 18, 4811, 1425, 18, 14895, 6134, 2, -100, -100, -100, -100, -100, -100, -100...
if node.get('class', '') == '': node['class'] = 'toc'
if _node_class( node ) is None: _set_node_class( node, 'toc' )
def _auto_toc_filter(node,root=node): return node != root \ and isinstance(node, docutils.nodes.bullet_list)
594566144131a9ea678d1f59e8605fef59589a0f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5620/594566144131a9ea678d1f59e8605fef59589a0f/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6079, 67, 1391, 67, 2188, 12, 2159, 16, 3085, 33, 2159, 4672, 327, 225, 756, 480, 1365, 521, 471, 1549, 12, 2159, 16, 997, 5471, 18, 4690, 18, 70, 19994, 67, 1098, 13, 2, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6079, 67, 1391, 67, 2188, 12, 2159, 16, 3085, 33, 2159, 4672, 327, 225, 756, 480, 1365, 521, 471, 1549, 12, 2159, 16, 997, 5471, 18, 4690, 18, 70, 19994, 67, 1098, 13, 2, -100, ...
replacement repl"""
replacement repl. repl can be either a string or a callable; if a callable, it's passed the match object and must return a replacement string to be used."""
def sub(pattern, repl, string, count=0): """Return the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in string by the replacement repl""" return _compile(pattern, 0).sub(repl, string, count)
8901987dc5265c407c474061672b77c237f3400a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8901987dc5265c407c474061672b77c237f3400a/sre.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 720, 12, 4951, 16, 6831, 16, 533, 16, 1056, 33, 20, 4672, 3536, 990, 326, 533, 12700, 635, 13993, 326, 2002, 10329, 1661, 17, 17946, 1382, 15698, 434, 326, 1936, 316, 533, 635, 326, 60...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 720, 12, 4951, 16, 6831, 16, 533, 16, 1056, 33, 20, 4672, 3536, 990, 326, 533, 12700, 635, 13993, 326, 2002, 10329, 1661, 17, 17946, 1382, 15698, 434, 326, 1936, 316, 533, 635, 326, 60...
'EXECUTION': ('ref/execframes', ''), 'NAMESPACES': ('ref/execframes', 'global ASSIGNMENT DELETION'),
'EXECUTION': ('ref/naming', ''), 'NAMESPACES': ('ref/naming', 'global ASSIGNMENT DELETION'),
'METHODS': ('lib/typesmethods', 'class def CLASSES TYPES'),
9fbf287241e4561acb33255cfb71cba124e273ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9fbf287241e4561acb33255cfb71cba124e273ee/pydoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 296, 25750, 4278, 7707, 2941, 19, 2352, 5163, 2187, 296, 1106, 1652, 29859, 20230, 3463, 55, 19899, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 296, 25750, 4278, 7707, 2941, 19, 2352, 5163, 2187, 296, 1106, 1652, 29859, 20230, 3463, 55, 19899, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
self.assertEqual( ('\ud800\udc02'*1000).encode('utf-8', 'surrogatepass'), b'\xf0\x90\x80\x82'*1000 )
if sys.maxunicode == 65535: self.assertEqual( ('\ud800\udc02'*1000).encode('utf-8'), b'\xf0\x90\x80\x82'*1000)
def test_codecs_utf8(self): self.assertEqual(''.encode('utf-8'), b'') self.assertEqual('\u20ac'.encode('utf-8'), b'\xe2\x82\xac') self.assertEqual('\ud800\udc02'.encode('utf-8'), b'\xf0\x90\x80\x82') self.assertEqual('\ud84d\udc56'.encode('utf-8'), b'\xf0\xa3\x91\x96') self.assertEqual('\ud800'.encode('utf-8', 'surrogatepass'), b'\xed\xa0\x80') self.assertEqual('\udc00'.encode('utf-8', 'surrogatepass'), b'\xed\xb0\x80') self.assertEqual( ('\ud800\udc02'*1000).encode('utf-8', 'surrogatepass'), b'\xf0\x90\x80\x82'*1000 ) self.assertEqual( '\u6b63\u78ba\u306b\u8a00\u3046\u3068\u7ffb\u8a33\u306f' '\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u4e00' '\u90e8\u306f\u30c9\u30a4\u30c4\u8a9e\u3067\u3059\u304c' '\u3001\u3042\u3068\u306f\u3067\u305f\u3089\u3081\u3067' '\u3059\u3002\u5b9f\u969b\u306b\u306f\u300cWenn ist das' ' Nunstuck git und'.encode('utf-8'), b'\xe6\xad\xa3\xe7\xa2\xba\xe3\x81\xab\xe8\xa8\x80\xe3\x81' b'\x86\xe3\x81\xa8\xe7\xbf\xbb\xe8\xa8\xb3\xe3\x81\xaf\xe3' b'\x81\x95\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe' b'\xe3\x81\x9b\xe3\x82\x93\xe3\x80\x82\xe4\xb8\x80\xe9\x83' b'\xa8\xe3\x81\xaf\xe3\x83\x89\xe3\x82\xa4\xe3\x83\x84\xe8' b'\xaa\x9e\xe3\x81\xa7\xe3\x81\x99\xe3\x81\x8c\xe3\x80\x81' b'\xe3\x81\x82\xe3\x81\xa8\xe3\x81\xaf\xe3\x81\xa7\xe3\x81' b'\x9f\xe3\x82\x89\xe3\x82\x81\xe3\x81\xa7\xe3\x81\x99\xe3' b'\x80\x82\xe5\xae\x9f\xe9\x9a\x9b\xe3\x81\xab\xe3\x81\xaf' b'\xe3\x80\x8cWenn ist das Nunstuck git und' )
6e85511651f5d91f9b7ca72740d65689de538f5e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/6e85511651f5d91f9b7ca72740d65689de538f5e/test_unicode.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 710, 2143, 67, 3158, 28, 12, 2890, 4672, 365, 18, 11231, 5812, 2668, 10332, 3015, 2668, 3158, 17, 28, 19899, 324, 11, 6134, 365, 18, 11231, 5812, 2668, 64, 89, 3462, 1077, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 710, 2143, 67, 3158, 28, 12, 2890, 4672, 365, 18, 11231, 5812, 2668, 10332, 3015, 2668, 3158, 17, 28, 19899, 324, 11, 6134, 365, 18, 11231, 5812, 2668, 64, 89, 3462, 1077, 10...
if template in list_licenses: seems_ok = True break
def checkbot(): """ Main function """ # Command line configurable parameters repeat = True # Restart after having check all the images? limit = 80 # How many images check? time_sleep = 30 # How many time sleep after the check? skip_number = 0 # How many images to skip before checking? wait_number = 0 # How many time sleep before the check? commonsActive = False # Check if on commons there's an image with the same name? normal = False # Check the new images or use another generator? urlUsed = False # Use the url-related function instead of the new-pages generator regexGen = False # Use the regex generator untagged = False # Use the untagged generator skip_list = list() # Inizialize the skip list used below duplicatesActive = False # Use the duplicate option duplicatesReport = False # Use the duplicate-report option sendemailActive = False # Use the send-email smartdetection = False # Enable the smart detection # Here below there are the parameters. for arg in wikipedia.handleArgs(): if arg.startswith('-limit'): if len(arg) == 7: limit = int(wikipedia.input(u'How many images do you want to check?')) else: limit = int(arg[7:]) if arg.startswith('-time'): if len(arg) == 5: time_sleep = int(wikipedia.input(u'How many seconds do you want runs to be apart?')) else: time_sleep = int(arg[6:]) elif arg == '-break': repeat = False elif arg == '-commons': commonsActive = True elif arg == '-duplicates': duplicatesActive = True elif arg == '-duplicatereport': duplicatesReport = True elif arg == '-sendemail': sendemailActive = True elif arg == '-smartdetection': smartdetection = True elif arg.startswith('-skip'): if len(arg) == 5: skip = True skip_number = int(wikipedia.input(u'How many images do you want to skip?')) elif len(arg) > 5: skip = True skip_number = int(arg[6:]) elif arg.startswith('-wait'): if len(arg) == 5: wait = True wait_number = int(wikipedia.input(u'How many time do you want to wait before checking the images?')) elif len(arg) > 5: wait = True wait_number = int(arg[6:]) elif arg.startswith('-start'): if len(arg) == 6: firstPageTitle = str(wikipedia.input(u'From witch page do you want to start?')) elif len(arg) > 6: firstPageTitle = str(arg[7:]) generator = wikipedia.getSite().allpages(start='Image:%s' % firstPageTitle) repeat = False elif arg.startswith('-page'): if len(arg) == 5: regexPageName = str(wikipedia.input(u'Which page do you want to use for the regex?')) elif len(arg) > 5: regexPageName = str(arg[6:]) repeat = False regexGen = True elif arg.startswith('-url'): if len(arg) == 4: regexPageUrl = str(wikipedia.input(u'Which url do you want to use for the regex?')) elif len(arg) > 4: regexPageUrl = str(arg[5:]) urlUsed = True repeat = False regexGen = True elif arg.startswith('-regex'): if len(arg) == 6: regexpToUse = str(wikipedia.input(u'Which regex do you want to use?')) elif len(arg) > 6: regexpToUse = str(arg[7:]) generator = 'regex' repeat = False elif arg.startswith('-cat'): if len(arg) == 4: catName = str(wikipedia.input(u'In which category do I work?')) elif len(arg) > 4: catName = str(arg[5:]) catSelected = catlib.Category(wikipedia.getSite(), 'Category:%s' % catName) generator = pagegenerators.CategorizedPageGenerator(catSelected) repeat = False elif arg.startswith('-ref'): if len(arg) == 4: refName = str(wikipedia.input(u'The references of what page should I parse?')) elif len(arg) > 4: refName = str(arg[5:]) generator = pagegenerators.ReferringPageGenerator(wikipedia.Page(wikipedia.getSite(), refName)) repeat = False elif arg.startswith('-untagged'): untagged = True if len(arg) == 9: projectUntagged = str(wikipedia.input(u'In which project should I work?')) elif len(arg) > 9: projectUntagged = str(arg[10:]) # Understand if the generator it's the default or not. try: generator except NameError: normal = True # Define the site. site = wikipedia.getSite() # Block of text to translate the parameters set above. image_n = site.image_namespace() image_namespace = "%s:" % image_n # Example: "User_talk:" unvertext = wikipedia.translate(site, n_txt) di = wikipedia.translate(site, delete_immediately) dih = wikipedia.translate(site, delete_immediately_head) din = wikipedia.translate(site, delete_immediately_notification) nh = wikipedia.translate(site, nothing_head) nn = wikipedia.translate(site, nothing_notification) dels = wikipedia.translate(site, del_comm) smwl = wikipedia.translate(site, second_message_without_license) TextFind = wikipedia.translate(site, txt_find) hiddentemplate = wikipedia.translate(site, HiddenTemplate) # If there's an hidden template, change the used HiddenTN = wikipedia.translate(site, HiddenTemplateNotification) # A template as {{en is not a license! Adding also them in the whitelist template... for langK in wikipedia.Family('wikipedia').langs.keys(): hiddentemplate.append('%s' % langK) # The template #if: isn't something to care about hiddentemplate.append('#if:') # If the images to skip are 0, set the skip variable to False (the same for the wait time) if skip_number == 0: skip = False if wait_number == 0: wait = False # nothing = Defining an empty image description nothing = ['', ' ', ' ', ' ', '\n', '\n ', '\n ', '\n\n', '\n \n', ' \n', ' \n ', ' \n \n'] # something = Minimal requirements for an image description. # If this fits, no tagging will take place (if there aren't other issues) # MIT license is ok on italian wikipedia, let also this here something = ['{{', "'''MIT&nbsp;license'''"] # Don't put "}}" here, please. Useless and can give problems. # Unused file extensions. Does not contain PDF. notallowed = ("xcf", "xls", "sxw", "sxi", "sxc", "sxd") # A little block-statement to ensure that the bot will not start with en-parameters if site.lang not in project_inserted: wikipedia.output(u"Your project is not supported by this script. You have to edit the script and add it!") wikipedia.stopme() # Some formatting for delete immediately template di = '\n%s' % di dels = dels % di # Reading the log of the new images if another generator is not given. if normal == True: if limit == 1: wikipedia.output(u"Retrieving the latest file for checking...") else: wikipedia.output(u"Retrieving the latest %d files for checking..." % limit) # Main Loop while 1: # Defing the Main Class. mainClass = main(site, sendemailActive = sendemailActive, duplicatesReport = duplicatesReport) # Untagged is True? Let's take that generator if untagged == True: generator = mainClass.untaggedGenerator(projectUntagged, limit) normal = False # Ensure that normal is False # Normal True? Take the default generator if normal == True: generator = pagegenerators.NewimagesPageGenerator(number = limit, site = site) # if urlUsed and regexGen, get the source for the generator if urlUsed == True and regexGen == True: textRegex = site.getUrl(regexPageUrl, no_hostname = True) # Not an url but a wiki page as "source" for the regex elif regexGen == True: pageRegex = wikipedia.Page(site, regexPageName) try: textRegex = pageRegex.get() except wikipedia.NoPage: wikipedia.output(u"%s doesn't exist!" % page.title()) textRegex = '' # No source, so the bot will quit later. # If generator is the regex' one, use your own Generator using an url or page and a regex. if generator == 'regex' and regexGen == True: generator = mainClass.regexGenerator(regexpToUse, textRegex) # Ok, We (should) have a generator, so let's go on. try: # Take the additional settings for the Project tupla_written = mainClass.takesettings() except wikipedia.Error: # Error? Settings = None wikipedia.output(u'Problems with loading the settigs, run without them.') tupla_written = None some_problem = False # Load the list of licenses allowed for our project list_licenses = mainClass.load_licenses() # Ensure that if the list given is empty it will be converted to "None" # (but it should be already done in the takesettings() function) if tupla_written == []: tupla_written = None # Real-Time page loaded if tupla_written != None: wikipedia.output(u'\t >> Loaded the real-time page... <<') # No settings found, No problem, continue. else: wikipedia.output(u'\t >> No additional settings found! <<') # Not the main, but the most important loop. #parsed = False for image in generator: # When you've a lot of image to skip before working use this workaround, otherwise # let this commented, thanks. [ decoment also parsed = False if you want to use it # #if image.title() != u'Immagine:Nytlogo379x64.gif' and not parsed: # wikipedia.output(u"%s already parsed." % image.title()) # continue #else: # parsed = True # If I don't inizialize the generator, wait part and skip part are useless if wait: printWithTimeZone(u'Waiting %s seconds before checking the images,' % wait_number) # Let's sleep... time.sleep(wait_number) # Never sleep again (we are in a loop) wait = False # If the generator returns something that is not an image, simply skip it. if normal == False and regexGen == False: if image_namespace.lower() not in image.title().lower() and \ 'image:' not in image.title().lower(): wikipedia.output(u'%s seems not an image, skip it...' % image.title()) continue try: imageName = image.title().split(image_namespace)[1] # Deleting the namespace (useless here) except IndexError:# Namespace image not found, that's not an image! Let's skip... wikipedia.output(u"%s is not an image, skipping..." % image.title()) continue mainClass.setParameters(imageName) # Setting the image for the main class # Skip block if skip == True: # If the images to skip are more the images to check, make them the same number if skip_number > limit: skip_number = limit # Print a starting message only if no images has been skipped if skip_list == []: if skip_number == 1: wikipedia.output(u'Skipping the first image:\n') else: wikipedia.output(u'Skipping the first %s images:\n' % skip_number) # If we still have pages to skip: if len(skip_list) < skip_number: wikipedia.output(u'Skipping %s...' % imageName) skip_list.append(imageName) if skip_number == 1: wikipedia.output('') skip = False continue else: wikipedia.output('') # Print a blank line. skip = False elif skip_list == []: # Skip must be false if we are here but # the user has set 0 as images to skip wikipedia.output(u'\t\t>> No images to skip...<<') skip_list.append('skip = Off') # Only to print it once parentesi = False # parentesi are these in italian: { ( ) } [] delete = False tagged = False extension = imageName.split('.')[-1] # get the extension from the image's name # Page => ImagePage p = wikipedia.ImagePage(site, image.title()) # Get the text in the image (called g) try: g = p.get() except wikipedia.NoPage: wikipedia.output(u"Skipping %s because it has been deleted." % imageName) continue except wikipedia.IsRedirectPage: wikipedia.output(u"The file description for %s is a redirect?!" % imageName) continue # Check on commons if there's already an image with the same name if commonsActive == True: response = mainClass.checkImageOnCommons() if response == False: continue # Check if there are duplicates of the image on the project selected if duplicatesActive == True: response2 = mainClass.checkImageDuplicated() if response2 == False: continue # Is the image already tagged? If yes, no need to double-check, skip for i in TextFind: # If there are {{ use regex, otherwise no (if there's not the {{ may not be a template # and the regex will be wrong) if '{{' in i: regexP = re.compile('\{\{(?:template|)%s ?(?:\||\n|\}) ?' % i.split('{{')[1].replace(' ', '[ _]'), re.I) result = regexP.findall(g) if result != []: tagged = True elif i.lower() in g: tagged = True # Deleting the useless template from the description (before adding something # in the image the original text will be reloaded, don't worry). hiddenTemplateFound = False white_template_found = 0 for l in hiddentemplate: if tagged == False: res = re.findall(r'\{\{(?:[Tt]emplate:|)%s(?: \n|\||\n|\})' % l.lower(), g.lower()) if res != []: white_template_found += 1 if l != '' and l != ' ': # Check that l is not nothing or a space # Deleting! (replace the template with nothing) regex_white_template = re.compile(r'\{\{(?:template:|)%s' % l, re.IGNORECASE) g = regex_white_template.sub(r'', g) hiddenTemplateFound = True if white_template_found == 1: wikipedia.output(u'A white template found, skipping the template...') elif white_template_found == 0: pass # if nothing found, print nothing else: wikipedia.output(u'White templates found: %s; skipping those templates...' % white_template_found) for a_word in something: # something is the array with {{, MIT License and so on. if a_word in g: # There's a template, probably a license (or I hope so) parentesi = True # Is the extension allowed? (is it an image or f.e. a .xls file?) for parl in notallowed: if parl.lower() in extension.lower(): delete = True some_problem = False # If it has "some_problem" it must check # the additional settings. # if tupla_writte, use addictional settings if tupla_written != None: # In every tupla there's a setting configuration for tupla in tupla_written: name = tupla[1] find_tipe = tupla[2] find = tupla[3] find_list = mainClass.load(find) imagechanges = tupla[4] if imagechanges.lower() == 'false': imagestatus = False elif imagechanges.lower() == 'true': imagestatus = True else: wikipedia.output(u"Error! Imagechanges set wrongly!") tupla_written = None break summary = tupla[5] head_2 = tupla[6] text = tupla[7] text = text % imageName mexCatched = tupla[8] wikipedia.setAction(summary) for k in find_list: if find_tipe.lower() == 'findonly': if k.lower() == g.lower(): some_problem = True text_used = text head_used = head_2 imagestatus_used = imagestatus name_used = name summary_used = summary mex_used = mexCatched break elif find_tipe.lower() == 'find': if k.lower() in g.lower(): some_problem = True text_used = text head_used = head_2 imagestatus_used = imagestatus name_used = name summary_used = summary mex_used = mexCatched continue # If the image exists (maybe it has been deleting during the oder # checking parts or something, who knows? ;-)) if p.exists(): # Here begins the check block. if tagged == True: # Tagged? Yes, skip. printWithTimeZone(u'%s is already tagged...' % imageName) continue if some_problem == True: if mex_used in g: wikipedia.output(u'Image already fixed. Skip.') continue wikipedia.output(u"The image description for %s contains %s..." % (imageName, name_used)) if mex_used.lower() == 'default': mex_used = unvertext if imagestatus_used == False: reported = mainClass.report_image(imageName) else: reported = True if reported == True: #if imagestatus_used == True: mainClass.report(mex_used, imageName, text_used, "\n%s\n" % head_used, None, imagestatus_used, summary_used) else: wikipedia.output(u"Skipping the image...") some_problem = False continue elif parentesi == True: seems_ok = False license_found = None if smartdetection: regex_find_licenses = re.compile(r'\{\{(?:[Tt]emplate:|)(.*?)(?:[|\n].*?|)\}\}', re.DOTALL) licenses_found = regex_find_licenses.findall(g) if licenses_found != []: for license_selected in licenses_found: #print template.exists() template = wikipedia.Page(site, 'Template:%s' % license_selected) if template.isRedirectPage(): template = template.getRedirectTarget() license_found = license_selected if template in list_licenses: seems_ok = True break if not seems_ok: rep_text_license_fake = "\n*[[:Image:%s]] seems to have a ''fake license'', license detected: {{tl|%s}}." % (imageName, license_found) regexFakeLicense = r"\* ?\[\[:Image:%s\]\] seems to have a ''fake license'', license detected: \{\{tl\|%s\}\}\.$" % (imageName, license_found) printWithTimeZone(u"%s seems to have a fake license: %s, reporting..." % (imageName, license_found)) mainClass.report_image(imageName, rep_text = rep_text_license_fake, addings = False, regex = regexFakeLicense) else: seems_ok = True if seems_ok: if license_found != None: printWithTimeZone(u"%s seems ok, license found: %s..." % (imageName, license_found)) else: printWithTimeZone(u"%s seems ok..." % imageName) # It works also without this... but i want only to be sure ^^ parentesi = False continue elif delete == True: wikipedia.output(u"%s is not a file!" % imageName) # Modify summary text wikipedia.setAction(dels) canctext = di % extension notification = din % imageName head = dih mainClass.report(canctext, imageName, notification, head) delete = False continue elif g in nothing: wikipedia.output(u"The image description for %s does not contain a license template!" % imageName) if hiddenTemplateFound and HiddenTN != None and HiddenTN != '' and HiddenTN != ' ': notification = HiddenTN % imageName else: notification = nn % imageName head = nh mainClass.report(unvertext, imageName, notification, head, smwl) continue else: wikipedia.output(u"%s has only text and not the specific license..." % imageName) if hiddenTemplateFound and HiddenTN != None and HiddenTN != '' and HiddenTN != ' ': notification = HiddenTN % imageName else: notification = nn % imageName head = nh mainClass.report(unvertext, imageName, notification, head, smwl) continue # A little block to perform the repeat or to break. if repeat == True: printWithTimeZone(u"Waiting for %s seconds," % time_sleep) time.sleep(time_sleep) elif repeat == False: wikipedia.output(u"\t\t\t>> STOP! <<") return True # Exit
2165209677d483eb7ff231fba7e819490a2c8291 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/2165209677d483eb7ff231fba7e819490a2c8291/checkimages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 4819, 13332, 3536, 12740, 445, 3536, 468, 3498, 980, 14593, 1472, 7666, 273, 1053, 468, 20709, 1839, 7999, 866, 777, 326, 4602, 35, 1800, 273, 8958, 468, 9017, 4906, 4602, 866, 35, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 4819, 13332, 3536, 12740, 445, 3536, 468, 3498, 980, 14593, 1472, 7666, 273, 1053, 468, 20709, 1839, 7999, 866, 777, 326, 4602, 35, 1800, 273, 8958, 468, 9017, 4906, 4602, 866, 35, ...
print feeds
def handle_subscription_link_clicked(self, message): url = message.url subscriptions = subscription.find_subscribe_links(url) added, ignored = subscription.Subscriber().add_subscriptions( subscriptions) feeds = added.get('feed') # send a notification to the user if feeds: print feeds if len(feeds) == 1: title = _("Subscribed to new feed:") body = feeds[0].get('title', feeds[0]['url']) elif len(feeds) > 1: title = _('Subscribed to new feeds:') body = '\n'.join( [' - %s' % feed.get('title', feed['url']) for feed in feeds]) messages.NotifyUser( title, body, 'feed-subscribe').send_to_frontend() if 'download' in added or 'download' in ignored: messages.FeedlessDownloadStarted().send_to_frontend()
f407a2dc743249d53077f225b09cdd5f79c24cff /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/f407a2dc743249d53077f225b09cdd5f79c24cff/messagehandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 11185, 67, 1232, 67, 7475, 329, 12, 2890, 16, 883, 4672, 880, 273, 883, 18, 718, 11912, 273, 4915, 18, 4720, 67, 9174, 67, 7135, 12, 718, 13, 3096, 16, 5455, 273, 4915, 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, 1640, 67, 11185, 67, 1232, 67, 7475, 329, 12, 2890, 16, 883, 4672, 880, 273, 883, 18, 718, 11912, 273, 4915, 18, 4720, 67, 9174, 67, 7135, 12, 718, 13, 3096, 16, 5455, 273, 4915, 18,...
command = OSDCommand().get_member_attributes(pid, cid)
command = OSDCommand().set_get_member_attributes(pid, cid)
def create_any_object(pid): command = OSDCommand().set_create(pid) command.attr_build(OSDAttr(ATTR_GET, CUR_CMD_ATTR_PG, CCAP_OID, \ CCAP_OID_LEN)) attr = run(command) return ntohll(attr.val)
1a657e8a0d40e2f52afb4de22d8d54d26392a8c1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11094/1a657e8a0d40e2f52afb4de22d8d54d26392a8c1/test-collection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 2273, 67, 1612, 12, 6610, 4672, 1296, 273, 5932, 40, 2189, 7675, 542, 67, 2640, 12, 6610, 13, 1296, 18, 1747, 67, 3510, 12, 4618, 40, 3843, 12, 12043, 67, 3264, 16, 4706, 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, 752, 67, 2273, 67, 1612, 12, 6610, 4672, 1296, 273, 5932, 40, 2189, 7675, 542, 67, 2640, 12, 6610, 13, 1296, 18, 1747, 67, 3510, 12, 4618, 40, 3843, 12, 12043, 67, 3264, 16, 4706, 67...
0x866: 'IMAGE_FILE_MACHINE_AMD64',
0x8664: 'IMAGE_FILE_MACHINE_AMD64',
def symname(value): parts = struct.unpack("<2L", value) if parts [0] == 0: return string_table_entry (parts [1]) else: return '%s'
b001d9753c11709b1bec11bbf13d3488d72d49b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6277/b001d9753c11709b1bec11bbf13d3488d72d49b4/coff-dump.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5382, 529, 12, 1132, 4672, 2140, 273, 1958, 18, 17309, 2932, 32, 22, 48, 3113, 460, 13, 309, 2140, 306, 20, 65, 422, 374, 30, 327, 533, 67, 2121, 67, 4099, 261, 6019, 306, 21, 5717, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5382, 529, 12, 1132, 4672, 2140, 273, 1958, 18, 17309, 2932, 32, 22, 48, 3113, 460, 13, 309, 2140, 306, 20, 65, 422, 374, 30, 327, 533, 67, 2121, 67, 4099, 261, 6019, 306, 21, 5717, ...
factor = 1.0
factor = .8
def user_point(self, x, y): # Return the point described by the SVG coordinates x and y as # an SKPoint object in user coordinates. x and y are expected to # be strings. x = strip(x) y = strip(y)
4176e9424d509c8e23f7b45346e57b94fed80180 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3127/4176e9424d509c8e23f7b45346e57b94fed80180/svgloader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 729, 67, 1153, 12, 2890, 16, 619, 16, 677, 4672, 468, 2000, 326, 1634, 11893, 635, 326, 11281, 5513, 619, 471, 677, 487, 468, 392, 12038, 2148, 733, 316, 729, 5513, 18, 619, 471, 677, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 729, 67, 1153, 12, 2890, 16, 619, 16, 677, 4672, 468, 2000, 326, 1634, 11893, 635, 326, 11281, 5513, 619, 471, 677, 487, 468, 392, 12038, 2148, 733, 316, 729, 5513, 18, 619, 471, 677, ...
[wc.filter.rules.RewriteRule.ENDTAG, "script"])
[wc.filter.rules.RewriteRule.ENDTAG, u"script"])
def jsScriptData (self, data, url, ver): """Callback for loading <script src=""> data in the background If downloading is finished, data is None""" assert self.htmlparser.state[0] == 'wait', "non-wait state" wc.log.debug(wc.LOG_JS, "%s jsScriptData %r", self, data) if data is None: if not self.js_script: wc.log.warn(wc.LOG_JS, "empty JavaScript src %s", url) self.js_script = u"// "+\ _("error fetching script from %r") % url self.htmlparser.tagbuf.append( [wc.filter.rules.RewriteRule.STARTTAG, "script", {'type': 'text/javascript'}]) # norm html comments script = wc.js.remove_html_comments(self.js_script) script = u"\n<!--\n%s\n//-->\n" % wc.js.escape_js(script) self.htmlparser.tagbuf.append( [wc.filter.rules.RewriteRule.DATA, script]) # Note: <script src=""> could be missing an end tag, # but now we need one. Look later for a duplicate </script>. self.htmlparser.tagbuf.append( [wc.filter.rules.RewriteRule.ENDTAG, "script"]) self.js_script = u'' self.htmlparser.state = ('parse',) wc.log.debug(wc.LOG_JS, "%s switching back to parse with", self) self.htmlparser.debugbuf(wc.LOG_JS) else: wc.log.debug(wc.LOG_JS, "JS read %d <= %s", len(data), url) self.js_script += data
b1dda6c5bb0d6477a864e1272a9bb9f4dbc578bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/b1dda6c5bb0d6477a864e1272a9bb9f4dbc578bd/JSFilter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3828, 3651, 751, 261, 2890, 16, 501, 16, 880, 16, 1924, 4672, 3536, 2428, 364, 7153, 411, 4263, 1705, 1546, 6441, 501, 316, 326, 5412, 971, 23742, 353, 6708, 16, 501, 353, 599, 8395, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3828, 3651, 751, 261, 2890, 16, 501, 16, 880, 16, 1924, 4672, 3536, 2428, 364, 7153, 411, 4263, 1705, 1546, 6441, 501, 316, 326, 5412, 971, 23742, 353, 6708, 16, 501, 353, 599, 8395, 1...
programs = map(lambda t: TVProgram({'title': t, 'category_type':'movie'}, translator=Mock()), self.movies) provider = TheMovieDbFanartProvider(nextProvider=None) @run_async def work(p): posters = provider.getPosters(p) if not posters: self.fail = True for poster in posters: log.debug('%s - %s' % (p.title(), poster)) self.fail = False threads = [] for p in programs: threads.append(work(p)) for t in threads: t.join() self.assertFalse(self.fail)
def test_getRandomPoster_When_program_is_not_movie_Then_returns_poster(self): # Setup program = TVProgram({'title':'Seinfeld', 'category_type':'series'}, translator=Mock()) provider = TvdbFanartProvider(self.platform, nextProvider=None) # Test def test_getPosters_When_pounded_by_many_threads_Then_doesnt_fail_miserably(self): programs = map(lambda t: TVProgram({'title': t, 'category_type':'movie'}, translator=Mock()), self.movies) provider = TheMovieDbFanartProvider(nextProvider=None) @run_async def work(p): posters = provider.getPosters(p) if not posters: self.fail = True for poster in posters: log.debug('%s - %s' % (p.title(), poster))
16a27dc9c028607cb88cd31c86b47e5d25397565 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12279/16a27dc9c028607cb88cd31c86b47e5d25397565/test_fanart.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 588, 8529, 3349, 264, 67, 9434, 67, 12890, 67, 291, 67, 902, 67, 8683, 13120, 67, 20112, 67, 6154, 67, 2767, 264, 12, 2890, 4672, 468, 10939, 5402, 273, 399, 58, 9459, 12590,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 588, 8529, 3349, 264, 67, 9434, 67, 12890, 67, 291, 67, 902, 67, 8683, 13120, 67, 20112, 67, 6154, 67, 2767, 264, 12, 2890, 4672, 468, 10939, 5402, 273, 399, 58, 9459, 12590,...
return {'type':'ir.actions.act_window_close' }
return {'type': 'ir.actions.act_window_close'}
def action_move(self,cr,uid,ids,context=None): move_obj=self.pool.get('stock.move') picking_obj=self.pool.get('stock.picking') for act in self.read(cr,uid,ids): move_lines=move_obj.browse(cr,uid,act['move_ids']) for line in move_lines: if line.picking_id: picking_obj.write(cr,uid,[line.picking_id.id],{'move_lines':[(1,line.id,{'picking_id':act['picking_id']})]}) picking_obj.write(cr,uid,[act['picking_id']],{'move_lines':[(1,line.id,{'picking_id':act['picking_id']})]}) cr.commit() old_picking=picking_obj.read(cr,uid,[line.picking_id.id])[0] if not len(old_picking['move_lines']): picking_obj.write(cr,uid,[old_picking['id']],{'state':'done'}) else: raise osv.except_osv(_('UserError'), _('You can not create new moves.')) return {'type':'ir.actions.act_window_close' }
369221b47101072e094ad2d02fe2edd2b47690aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/369221b47101072e094ad2d02fe2edd2b47690aa/stock.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 67, 8501, 12, 2890, 16, 3353, 16, 1911, 16, 2232, 16, 2472, 33, 7036, 4672, 3635, 67, 2603, 33, 2890, 18, 6011, 18, 588, 2668, 15381, 18, 8501, 6134, 6002, 310, 67, 2603, 33, 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, 1301, 67, 8501, 12, 2890, 16, 3353, 16, 1911, 16, 2232, 16, 2472, 33, 7036, 4672, 3635, 67, 2603, 33, 2890, 18, 6011, 18, 588, 2668, 15381, 18, 8501, 6134, 6002, 310, 67, 2603, 33, 2...
temp_dict[key] = self._copy(obj[key])
temp_dict[key] = self._copy(obj[key], objectmap) objectmap[_saved_id(obj)] = temp_dict
def _copy(self, obj): """ <Purpose> Create a deep copy of an object without using the python 'copy' module. Using copy.deepcopy() doesn't work because builtins like id and hasattr aren't available when this is called. <Arguments> self obj The object to make a deep copy of. <Exceptions> TypeError If an object is encountered that we don't know how to make a copy of. NamespaceViolationError If an unexpected error occurs while copying. This isn't the greatest solution, but in general the idea is we just need to abort the wrapped function call. <Side Effects> A new reference is created to every non-simple type of object. That is, everything except objects of type str, unicode, int, etc. <Returns> The deep copy of obj. """ try: # types.InstanceType is included because the user can provide an instance # of a class of their own in the list of callback args to settimer. if _is_in(type(obj), [str, unicode, int, long, float, complex, bool, types.NoneType, types.FunctionType, types.LambdaType, types.MethodType, types.InstanceType]): return obj elif _is_in(type(obj), [tuple, list, set, frozenset]): temp_list = [] for item in obj: temp_list.append(self._copy(item)) if type(obj) is tuple: return tuple(temp_list) elif type(obj) is set: return set(temp_list) elif type(obj) is frozenset: return frozenset(temp_list) else: return temp_list elif type(obj) is dict: temp_dict = {} for key in obj: temp_dict[key] = self._copy(obj[key]) return temp_dict # We don't copy certain objects. This is because copying an emulated file # object, for example, will cause the destructor of the original one to # be invoked, which will close the actual underlying file. As the object # is wrapped and the client does not have access to it, it's safe to not # wrap it. elif isinstance(obj, (NamespaceObjectWrapper, emulfile.emulated_file, emulcomm.emulated_socket, thread.LockType, virtual_namespace.VirtualNamespace)): return obj else: raise TypeError("_copy is not implemented for objects of type " + str(type(obj))) except Exception, e: self._handle_violation("_copy failed on " + str(obj) + " with message " + str(e))
269dec09cf5f6cd26664269cfea5fe441cc84fa4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/269dec09cf5f6cd26664269cfea5fe441cc84fa4/namespace.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3530, 12, 2890, 16, 1081, 4672, 3536, 411, 10262, 4150, 34, 1788, 279, 4608, 1610, 434, 392, 733, 2887, 1450, 326, 5790, 296, 3530, 11, 1605, 18, 11637, 1610, 18, 16589, 3530, 1435,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3530, 12, 2890, 16, 1081, 4672, 3536, 411, 10262, 4150, 34, 1788, 279, 4608, 1610, 434, 392, 733, 2887, 1450, 326, 5790, 296, 3530, 11, 1605, 18, 11637, 1610, 18, 16589, 3530, 1435,...
return rt.sage_poly(self.parent())
r = rt.sage_poly(self.parent()) if self.parent().ngens() <= 1 and r.degree() <= 0: return self.parent().base_ring()(r[0]) else: return r
def resultant(self, other, variable=None): """ computes the resultant of self and the first argument with respect to the variable given as the second argument.
4bdea39bd10a1269a205eb65cd78180066651f77 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/4bdea39bd10a1269a205eb65cd78180066651f77/polynomial_singular_interface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 563, 970, 12, 2890, 16, 1308, 16, 2190, 33, 7036, 4672, 3536, 15881, 326, 563, 970, 434, 365, 471, 326, 1122, 1237, 598, 8762, 358, 326, 2190, 864, 487, 326, 2205, 1237, 18, 2, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 563, 970, 12, 2890, 16, 1308, 16, 2190, 33, 7036, 4672, 3536, 15881, 326, 563, 970, 434, 365, 471, 326, 1122, 1237, 598, 8762, 358, 326, 2190, 864, 487, 326, 2205, 1237, 18, 2, -100, ...
target_list = target_list[len(pp):]
def add_data_dir(self,data_path): """ Recursively add files under data_path to data_files list. Argument can be either - 2-sequence (<datadir suffix>,<path to data directory>) - path to data directory where python datadir suffix defaults to package dir.
7ac6e2005976d03e25e723bacd59f27ad87e86dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/7ac6e2005976d03e25e723bacd59f27ad87e86dc/misc_util.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 892, 67, 1214, 12, 2890, 16, 892, 67, 803, 4672, 3536, 31362, 527, 1390, 3613, 501, 67, 803, 358, 501, 67, 2354, 666, 18, 5067, 848, 506, 3344, 300, 576, 17, 6178, 261, 32, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 892, 67, 1214, 12, 2890, 16, 892, 67, 803, 4672, 3536, 31362, 527, 1390, 3613, 501, 67, 803, 358, 501, 67, 2354, 666, 18, 5067, 848, 506, 3344, 300, 576, 17, 6178, 261, 32, ...
if authProtocol is None: usmNoAuthProtocol, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-USER-BASED-SM-MIB', 'usmNoAuthProtocol')
if authProtocol is usmNoAuthProtocol:
def addV3User(snmpEngine, securityName, authKey=None, authProtocol=None, privKey=None, privProtocol=None, hashedAuthKey=None, hashedPrivKey=None): # v3 setup snmpEngineID, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'snmpEngineID') # Build entry index usmUserEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-USER-BASED-SM-MIB', 'usmUserEntry') tblIdx = usmUserEntry.getInstIdFromIndices( snmpEngineID.syntax, securityName ) # Load augmenting table before creating new row in base one pysnmpUsmKeyEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('PYSNMP-USM-MIB', 'pysnmpUsmKeyEntry') # Create new row snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((usmUserEntry.name + (13,) + tblIdx, 4),) ) # Commit username (may not be needed) usmUserSecurityName = usmUserEntry.getNode( usmUserEntry.name + (3,) + tblIdx ) usmUserSecurityName.syntax = usmUserSecurityName.syntax.clone(securityName) # Commit clone-from (may not be needed) zeroDotZero, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMPv2-SMI', 'zeroDotZero') usmUserCloneFrom = usmUserEntry.getNode( usmUserEntry.name + (4,) + tblIdx ) usmUserCloneFrom.syntax = usmUserCloneFrom.syntax.clone(zeroDotZero.name) # Commit auth protocol usmUserAuthProtocol = usmUserEntry.getNode( usmUserEntry.name + (5,) + tblIdx ) if authProtocol is None: usmNoAuthProtocol, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-USER-BASED-SM-MIB', 'usmNoAuthProtocol') usmUserAuthProtocol.syntax = usmUserAuthProtocol.syntax.clone( usmNoAuthProtocol.name ) elif string.find('MD5', string.upper(authProtocol)) != -1: usmHMACMD5AuthProtocol, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-USER-BASED-SM-MIB', 'usmHMACMD5AuthProtocol') usmUserAuthProtocol.syntax = usmUserAuthProtocol.syntax.clone( usmHMACMD5AuthProtocol.name ) elif string.find('SHA', string.upper(authProtocol)) != -1: usmHMACSHAAuthProtocol, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-USER-BASED-SM-MIB', 'usmHMACSHAAuthProtocol') usmUserAuthProtocol.syntax = usmUserAuthProtocol.syntax.clone( usmHMACSHAAuthProtocol.name ) else: raise error.PySnmpError('Unknown auth protocol %s' % authProtocol) # Commit priv protocol usmUserPrivProtocol = usmUserEntry.getNode( usmUserEntry.name + (8,) + tblIdx ) if privProtocol is None: usmNoPrivProtocol, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-USER-BASED-SM-MIB', 'usmNoPrivProtocol') usmUserPrivProtocol.syntax = usmUserPrivProtocol.syntax.clone( usmNoPrivProtocol.name ) elif string.find('DES', string.upper(privProtocol)) != -1: usmDESPrivProtocol, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('SNMP-USER-BASED-SM-MIB', 'usmDESPrivProtocol') usmUserPrivProtocol.syntax = usmUserPrivProtocol.syntax.clone( usmDESPrivProtocol.name ) else: raise error.PySnmpError('Unknown priv protocol %s' % privProtocol) # Localize and commit localized keys if authKey is not None or hashedAuthKey is not None: pysnmpUsmKeyAuth = pysnmpUsmKeyEntry.getNode( pysnmpUsmKeyEntry.name + (3,) + tblIdx ) if hashedAuthKey is not None: pysnmpUsmKeyAuth.syntax = pysnmpUsmKeyAuth.syntax.clone( hashedAuthKey ) else: pysnmpUsmKeyAuth.syntax = pysnmpUsmKeyAuth.syntax.clone( localkey.hashPassphrase(authKey) ) pysnmpUsmKeyAuthLocalized = pysnmpUsmKeyEntry.getNode( pysnmpUsmKeyEntry.name + (1,) + tblIdx ) pysnmpUsmKeyAuthLocalized.syntax = pysnmpUsmKeyAuthLocalized.syntax.clone(localkey.localizeKey(pysnmpUsmKeyAuth.syntax, snmpEngineID.syntax)) if privKey is not None or hashedPrivKey is not None: pysnmpUsmKeyPriv = pysnmpUsmKeyEntry.getNode( pysnmpUsmKeyEntry.name + (4,) + tblIdx ) if hashedPrivKey is not None: pysnmpUsmKeyPriv.syntax = pysnmpUsmKeyPriv.syntax.clone( hashedPrivKey ) else: pysnmpUsmKeyPriv.syntax = pysnmpUsmKeyPriv.syntax.clone( localkey.hashPassphrase(privKey) ) pysnmpUsmKeyPrivLocalized = pysnmpUsmKeyEntry.getNode( pysnmpUsmKeyEntry.name + (2,) + tblIdx ) pysnmpUsmKeyPrivLocalized.syntax = pysnmpUsmKeyPrivLocalized.syntax.clone(localkey.localizeKey(pysnmpUsmKeyPriv.syntax, snmpEngineID.syntax)) # Commit passphrases pysnmpUsmSecretEntry, = snmpEngine.msgAndPduDsp.mibInstrumController.mibBuilder.importSymbols('PYSNMP-USM-MIB', 'pysnmpUsmSecretEntry') tblIdx = pysnmpUsmSecretEntry.getInstIdFromIndices( usmUserSecurityName.syntax ) # Create new row snmpEngine.msgAndPduDsp.mibInstrumController.writeVars( ((pysnmpUsmSecretEntry.name + (4,) + tblIdx, 4),) ) if authKey is not None: pysnmpUsmSecretAuthKey = pysnmpUsmSecretEntry.getNode( pysnmpUsmSecretEntry.name + (2,) + tblIdx ) pysnmpUsmSecretAuthKey.syntax = pysnmpUsmSecretAuthKey.syntax.clone( authKey ) if privKey is not None: pysnmpUsmSecretPrivKey = pysnmpUsmSecretEntry.getNode( pysnmpUsmSecretEntry.name + (3,) + tblIdx ) pysnmpUsmSecretPrivKey.syntax = pysnmpUsmSecretPrivKey.syntax.clone( privKey )
798dbb057dd82e34376d111b9d3e6bd0d5f57239 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/587/798dbb057dd82e34376d111b9d3e6bd0d5f57239/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 58, 23, 1299, 12, 26527, 4410, 16, 4373, 461, 16, 1357, 653, 33, 7036, 16, 1357, 5752, 33, 7036, 16, 22849, 33, 7036, 16, 6015, 5752, 33, 7036, 16, 14242, 1730, 653, 33, 7036, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 58, 23, 1299, 12, 26527, 4410, 16, 4373, 461, 16, 1357, 653, 33, 7036, 16, 1357, 5752, 33, 7036, 16, 22849, 33, 7036, 16, 6015, 5752, 33, 7036, 16, 14242, 1730, 653, 33, 7036, 1...
author_email='zope3-dev@zope.org',
author_email='zope-dev@zope.org',
def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
9b426a5a9ad9fcee24ac48dc97b5820d558e710b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9628/9b426a5a9ad9fcee24ac48dc97b5820d558e710b/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 30857, 86, 1973, 4672, 327, 1696, 12, 538, 18, 803, 18, 5701, 12, 538, 18, 803, 18, 12287, 12, 972, 768, 972, 3631, 380, 86, 1973, 13, 2934, 896, 1435, 225, 2, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 30857, 86, 1973, 4672, 327, 1696, 12, 538, 18, 803, 18, 5701, 12, 538, 18, 803, 18, 12287, 12, 972, 768, 972, 3631, 380, 86, 1973, 13, 2934, 896, 1435, 225, 2, -100, -100, -100,...
self.buttonUpload.setIcon(QtGui.QIcon("../../../.designer/backup"))
self.buttonUpload.setIcon(QtGui.QIcon(" "))
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(QtCore.QSize(QtCore.QRect(0,0,776,593).size()).expandedTo(MainWindow.minimumSizeHint())) MainWindow.setWindowIcon(QtGui.QIcon("../../../.designer/backup"))
79b42f390e6f53f319f4cccbce3f6018d111c729 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1108/79b42f390e6f53f319f4cccbce3f6018d111c729/main_ui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 13943, 12, 2890, 16, 12740, 3829, 4672, 12740, 3829, 18, 542, 16707, 2932, 6376, 3829, 7923, 12740, 3829, 18, 15169, 12, 23310, 4670, 18, 53, 1225, 12, 23310, 4670, 18, 53, 6120, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 13943, 12, 2890, 16, 12740, 3829, 4672, 12740, 3829, 18, 542, 16707, 2932, 6376, 3829, 7923, 12740, 3829, 18, 15169, 12, 23310, 4670, 18, 53, 1225, 12, 23310, 4670, 18, 53, 6120, 1...
'value'))
'value'), is_method=True)
def annotate(obj, d): self._logger.insert_annotation_DB(locator, currentVersion, obj.id, d)
80df9da371f9270b1373f11f10818be64d95ec8f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6341/80df9da371f9270b1373f11f10818be64d95ec8f/noncached.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13795, 12, 2603, 16, 302, 4672, 365, 6315, 4901, 18, 6387, 67, 11495, 67, 2290, 12, 20048, 16, 23344, 16, 1081, 18, 350, 16, 302, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13795, 12, 2603, 16, 302, 4672, 365, 6315, 4901, 18, 6387, 67, 11495, 67, 2290, 12, 20048, 16, 23344, 16, 1081, 18, 350, 16, 302, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100,...
raise OperationError(BufferTooShort)
raise BufferTooShort(space)
def recv_bytes_into(self, space, w_buffer, offset=0): rwbuffer = space.rwbuffer_w(w_buffer) length = rwbuffer.getlength()
c8a395526acc384b8abc9423dba4c5bcf6d8e363 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/c8a395526acc384b8abc9423dba4c5bcf6d8e363/interp_connection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10665, 67, 3890, 67, 18591, 12, 2890, 16, 3476, 16, 341, 67, 4106, 16, 1384, 33, 20, 4672, 7985, 4106, 273, 3476, 18, 21878, 4106, 67, 91, 12, 91, 67, 4106, 13, 769, 273, 7985, 4106,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10665, 67, 3890, 67, 18591, 12, 2890, 16, 3476, 16, 341, 67, 4106, 16, 1384, 33, 20, 4672, 7985, 4106, 273, 3476, 18, 21878, 4106, 67, 91, 12, 91, 67, 4106, 13, 769, 273, 7985, 4106,...
src_dir = '$MAIN_DIR/..'
src_dir = '$SCONSBUILD_DIR/..'
def GenerateSConscript(output_filename, spec, build_file): """ Generates a SConscript file for a specific target. This generates a SConscript file suitable for building any or all of the target's configurations. A SConscript file may be called multiple times to generate targets for multiple configurations. Consequently, it needs to be ready to build the target for any requested configuration, and therefore contains information about the settings for all configurations (generated into the SConscript file at gyp configuration time) as well as logic for selecting (at SCons build time) the specific configuration being built. The general outline of a generated SConscript file is: -- Header -- Import 'env'. This contains a $CONFIG_NAME construction variable that specifies what configuration to build (e.g. Debug, Release). -- Configurations. This is a dictionary with settings for the different configurations (Debug, Release) under which this target can be built. The values in the dictionary are themselves dictionaries specifying what construction variables should added to the local copy of the imported construction environment (Append), should be removed (FilterOut), and should outright replace the imported values (Replace). -- Clone the imported construction environment and update with the proper configuration settings. -- Initialize the lists of the targets' input files and prerequisites. -- Target-specific actions and rules. These come after the input file and prerequisite initializations because the outputs of the actions and rules may affect the input file list (process_outputs_as_sources) and get added to the list of prerequisites (so that they're guaranteed to be executed before building the target). -- Call the Builder for the target itself. -- Arrange for any copies to be made into installation directories. -- Set up the gyp_target_{name} Alias (phony Node) for the target as the primary handle for building all of the target's pieces. -- Use env.Require() to make sure the prerequisites (explicitly specified, but also including the actions and rules) are built before the target itself. -- Return the gyp_target_{name} Alias to the calling SConstruct file so it can be added to the list of default targets. """ gyp_dir = os.path.split(output_filename)[0] if not gyp_dir: gyp_dir = '.' gyp_dir = os.path.abspath(gyp_dir) component_name = os.path.splitext(os.path.basename(build_file))[0] target_name = spec['target_name'] fp = open(output_filename, 'w') fp.write(header) fp.write('\nimport os\n') fp.write('\nImport("env")\n') # fp.write('\n') fp.write('configurations = {\n') for config_name, config in spec['configurations'].iteritems(): fp.write(' \'%s\' : {\n' % config_name) fp.write(' \'Append\' : dict(\n') GenerateConfig(fp, spec, config, ' '*12) fp.write(' ),\n') fp.write(' \'FilterOut\' : dict(\n' ) for key, var in config.get('scons_remove', {}).iteritems(): fp.write(' %s = %s,\n' % (key, repr(var))) fp.write(' ),\n') fp.write(' \'Replace\' : dict(\n' ) scons_settings = config.get('scons_variable_settings', {}) for key in sorted(scons_settings.keys()): val = pprint.pformat(scons_settings[key]) fp.write(' %s = %s,\n' % (key, val)) if 'c++' in spec.get('link_languages', []): fp.write(' %s = %s,\n' % ('LINK', repr('$CXX'))) fp.write(' ),\n') fp.write(' \'ImportExternal\' : [\n' ) for var in config.get('scons_import_variables', []): fp.write(' %s\n' % repr(var)) fp.write(' ],\n') fp.write(' \'PropagateExternal\' : [\n' ) for var in config.get('scons_propagate_variables', []): fp.write(' %s\n' % repr(var)) fp.write(' ],\n') fp.write(' },\n') fp.write('}\n') # fp.write('\n') fp.write('env = env.Clone(COMPONENT_NAME=%s,\n' % repr(component_name)) fp.write(' TARGET_NAME=%s)\n' % repr(target_name)) fp.write('\n') fp.write('config = configurations[env[\'CONFIG_NAME\']]\n') fp.write('env.Append(**config[\'Append\'])\n') fp.write('env.FilterOut(**config[\'FilterOut\'])\n') fp.write('env.Replace(**config[\'Replace\'])\n') fp.write('for _var in config[\'ImportExternal\']:\n') fp.write(' if _var in ARGUMENTS:\n') fp.write(' env[_var] = ARGUMENTS[_var]\n') fp.write(' elif _var in os.environ:\n') fp.write(' env[_var] = os.environ[_var]\n') fp.write('for _var in config[\'PropagateExternal\']:\n') fp.write(' if _var in ARGUMENTS:\n') fp.write(' env[_var] = ARGUMENTS[_var]\n') fp.write(' elif _var in os.environ:\n') fp.write(' env[\'ENV\'][_var] = os.environ[_var]\n') # sources = spec.get('sources') if sources: pre = '\ninput_files = ChromeFileList([\n ' WriteList(fp, map(repr, sources), preamble=pre, postamble=',\n])\n') else: fp.write('\ninput_files = []\n') fp.write('\n') fp.write('target_files = []\n') prerequisites = spec.get('scons_prerequisites', []) fp.write('prerequisites = %s\n' % pprint.pformat(prerequisites)) actions = spec.get('actions', []) for action in actions: a = ['cd', gyp_dir, '&&'] + action['action'] message = action.get('message') if message: message = repr(message) fp.write(_command_template % { 'inputs' : pprint.pformat(action.get('inputs', [])), 'outputs' : pprint.pformat(action.get('outputs', [])), 'action' : pprint.pformat(a), 'message' : message, }) if action.get('process_outputs_as_sources'): fp.write('input_files.extend(_outputs)\n') fp.write('prerequisites.extend(_outputs)\n') rules = spec.get('rules', []) for rule in rules: name = rule['rule_name'] a = ['cd', gyp_dir, '&&'] + rule['action'] message = rule.get('message') if message: message = repr(message) fp.write(_rule_template % { 'inputs' : pprint.pformat(rule.get('inputs', [])), 'outputs' : pprint.pformat(rule.get('outputs', [])), 'action' : pprint.pformat(a), 'extension' : rule['extension'], 'name' : name, 'message' : message, }) if rule.get('process_outputs_as_sources'): fp.write(' input_files.Replace(%s_file, _outputs)\n' % name) fp.write('prerequisites.extend(_outputs)\n') SConsTypeWriter[spec.get('type')](fp, spec) copies = spec.get('copies', []) for copy in copies: destdir = copy['destination'] files = copy['files'] fmt = '\n_outputs = env.Install(%s,\n %s\n)\n' fp.write(fmt % (repr(destdir), pprint.pformat(files))) fp.write('prerequisites.extend(_outputs)\n') fmt = "\ngyp_target = env.Alias('gyp_target_%s', target_files)\n" fp.write(fmt % target_name) dependencies = spec.get('scons_dependencies', []) if dependencies: WriteList(fp, dependencies, preamble='env.Requires(gyp_target, [\n ', postamble='\n])\n') fp.write('env.Requires(gyp_target, prerequisites)\n') fp.write('Return("gyp_target")\n') fp.close()
9aede4f9faaa362bdd9b7beef7797e547894741d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6220/9aede4f9faaa362bdd9b7beef7797e547894741d/scons.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 55, 442, 4263, 12, 2844, 67, 3459, 16, 857, 16, 1361, 67, 768, 4672, 3536, 31902, 279, 348, 442, 4263, 585, 364, 279, 2923, 1018, 18, 225, 1220, 6026, 279, 348, 442, 4263, 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, 6654, 55, 442, 4263, 12, 2844, 67, 3459, 16, 857, 16, 1361, 67, 768, 4672, 3536, 31902, 279, 348, 442, 4263, 585, 364, 279, 2923, 1018, 18, 225, 1220, 6026, 279, 348, 442, 4263, 585, ...
'/opt/kde3/lib'))
'/opt/kde3/lib', '/opt/kde3/lib64'))
def check(self, pkg): global _policy_legacy_exceptions
0cbe50ccaeadfb12134b9e1b3e950b862eb62fb7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10341/0cbe50ccaeadfb12134b9e1b3e950b862eb62fb7/LibraryPolicyCheck.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 12, 2890, 16, 3475, 4672, 2552, 389, 5086, 67, 17386, 67, 11855, 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, 866, 12, 2890, 16, 3475, 4672, 2552, 389, 5086, 67, 17386, 67, 11855, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
new_price = float(price) * from_uom.factor
new_price = float(price) * from_uom.rate
def _compute_price(self, cursor, user, from_uom, price, to_uom=False): """ Convert price for given uom's. from_uom and to_uom should be browse records. """ if not from_uom or not price or not to_uom: return price if from_uom.category.id <> to_uom.category.id: return price if from_uom.factor_data: new_price = float(price) / from_uom.factor_data else: new_price = float(price) * from_uom.factor
1c3eb8968b62e8d0dd32434c2ed5ad19c170cb2e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9285/1c3eb8968b62e8d0dd32434c2ed5ad19c170cb2e/uom.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9200, 67, 8694, 12, 2890, 16, 3347, 16, 729, 16, 628, 67, 89, 362, 16, 6205, 16, 358, 67, 89, 362, 33, 8381, 4672, 3536, 4037, 6205, 364, 864, 582, 362, 1807, 18, 628, 67, 89,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9200, 67, 8694, 12, 2890, 16, 3347, 16, 729, 16, 628, 67, 89, 362, 16, 6205, 16, 358, 67, 89, 362, 33, 8381, 4672, 3536, 4037, 6205, 364, 864, 582, 362, 1807, 18, 628, 67, 89,...
assert_arrays_equal(actual, desired)
self.assertRavelEqual(actual, desired)
def test_add_path(self): path1 = agg.CompiledPath() path1.move_to(1.0,1.0) path1.translate_ctm(1.0,1.0) path1.line_to(2.0,2.0) #actually (3.0,3.0) path1.scale_ctm(2.0,2.0) path1.line_to(2.0,2.0) # actually (5.0,5.0) path2 = agg.CompiledPath() path2.move_to(1.0,1.0) path2.translate_ctm(1.0,1.0) path2.line_to(2.0,2.0) #actually (3.0,3.0) sub_path = agg.CompiledPath() sub_path.scale_ctm(2.0,2.0) sub_path.line_to(2.0,2.0) path2.add_path(sub_path) desired = path1._vertices() actual = path2._vertices() assert_arrays_equal(actual, desired) desired = path1.get_ctm() actual = path2.get_ctm() assert_arrays_equal(actual, desired)
3d92c0ab4a3a1dfa3f396a7b42d8cc8314558496 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13166/3d92c0ab4a3a1dfa3f396a7b42d8cc8314558496/compiled_path_test_case.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1289, 67, 803, 12, 2890, 4672, 589, 21, 273, 10421, 18, 20733, 743, 1435, 589, 21, 18, 8501, 67, 869, 12, 21, 18, 20, 16, 21, 18, 20, 13, 589, 21, 18, 13929, 67, 299, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1289, 67, 803, 12, 2890, 4672, 589, 21, 273, 10421, 18, 20733, 743, 1435, 589, 21, 18, 8501, 67, 869, 12, 21, 18, 20, 16, 21, 18, 20, 13, 589, 21, 18, 13929, 67, 299, 8...
warn("building table '" + builder.PROVIDES \
warn("Building table '" + builder.PROVIDES \
def build(self, tables): """ Builds the given tables.
e8e9b1566ed97c2e61c03da42d88ea3809b5a0f1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11128/e8e9b1566ed97c2e61c03da42d88ea3809b5a0f1/build.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 12, 2890, 16, 4606, 4672, 3536, 3998, 87, 326, 864, 4606, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1361, 12, 2890, 16, 4606, 4672, 3536, 3998, 87, 326, 864, 4606, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
else
else:
def __init__(data = None) if data == None: quickfix.CharField.__init__(self, 695) else quickfix.CharField.__init__(self, 695, 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, 2156, 974, 16186, 2738, 972, 12, 2890, 16, 1666, 8778, 13, 469, 30, 9549, 904, 18, 2156, 974, 16186, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2156, 974, 16186, 2738, 972, 12, 2890, 16, 1666, 8778, 13, 469, 30, 9549, 904, 18, 2156, 974, 16186, 27...
self.mode.buffer.revert(text)
self.mode.buffer.revert(encoding=text)
def processMinibuffer(self, minibuffer, mode, text): #dprint("Revert to encoding %s" % text) # see if it's a known encoding try: 'test'.encode(text) # if we get here, it's valid self.mode.buffer.revert(text) if text != self.mode.buffer.stc.encoding: self.mode.setStatusText("Failed converting to %s; loaded as binary (probably not what you want)" % text) except LookupError: self.mode.setStatusText("Unknown encoding %s" % text)
cf56d234d99c79a038cfc2338a94d9a6f7416785 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/cf56d234d99c79a038cfc2338a94d9a6f7416785/fundamental_menu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 2930, 495, 962, 12, 2890, 16, 1131, 495, 962, 16, 1965, 16, 977, 4672, 468, 72, 1188, 2932, 426, 1097, 358, 2688, 738, 87, 6, 738, 977, 13, 468, 2621, 309, 518, 1807, 279, 4846...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 2930, 495, 962, 12, 2890, 16, 1131, 495, 962, 16, 1965, 16, 977, 4672, 468, 72, 1188, 2932, 426, 1097, 358, 2688, 738, 87, 6, 738, 977, 13, 468, 2621, 309, 518, 1807, 279, 4846...
if pzEndStamp < int(time.time()):
if not doing_still_pzlocked_rows:
def pz_locked(doc, pageContext): world = pageContext.get_selected_world() curtime = int(time.time()) limits = (0, 30) #limits = (0, 200) doc.write("Players sorted by descending protection zone lock time remaining. Also shown is their level, vocation, guild, and most recent victim.") with stattab_table_tag(doc.open_tag): with doc.open_tag("tr", inline=False): if not world: doc.add_tag("th", "World") doc.add_tag("th", "PZ Lock End") doc.add_tag("th", "Killer") doc.add_tag("th", "Level") doc.add_tag("th", "Vocation") doc.add_tag("th", "Guild") doc.add_tag("th", "Last Victim") rowColor = stattab_row_class() for pzlock in dbiface.get_last_pzlocks(world, limits): killerInfo = dbiface.get_char(pzlock["killer"]) #pdb.set_trace() pzEndStamp = dbiface.pz_end(pzlock) if world is None or killerInfo["world"] == world: rowAttrs = {"class": rowColor.next()} if pzEndStamp < int(time.time()): rowAttrs["class"] += " greyed" with doc.open_tag("tr", attrs=rowAttrs, inline=False): assert killerInfo["name"] == pzlock["killer"] if not world: doc.add_tag("td", killerInfo["world"]) doc.add_tag("td", human_time_diff(pzEndStamp)) doc.add_tag("td", char_link(pzlock["killer"])) for field in ("level", "vocation"): doc.add_tag("td", killerInfo[field]) doc.add_tag("td", pageContext.guild_link(killerInfo["guild"])) doc.add_tag("td", char_link(pzlock["victim"]))
e8c01a7a2c0aee291735f4d3cf0f1bf1195fef6d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4811/e8c01a7a2c0aee291735f4d3cf0f1bf1195fef6d/pages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 293, 94, 67, 15091, 12, 2434, 16, 21442, 4672, 9117, 273, 21442, 18, 588, 67, 8109, 67, 18179, 1435, 662, 957, 273, 509, 12, 957, 18, 957, 10756, 8181, 273, 261, 20, 16, 5196, 13, 46...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 293, 94, 67, 15091, 12, 2434, 16, 21442, 4672, 9117, 273, 21442, 18, 588, 67, 8109, 67, 18179, 1435, 662, 957, 273, 509, 12, 957, 18, 957, 10756, 8181, 273, 261, 20, 16, 5196, 13, 46...
print "client is kopete"
if DEBUG: print "client is kopete"
def logout(self): self.imapObject.close() self.imapObject.logout()
65e3917b5bf16d473b6d7144e95cbec4674e8433 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2167/65e3917b5bf16d473b6d7144e95cbec4674e8433/im2imap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12735, 12, 2890, 4672, 365, 18, 12161, 921, 18, 4412, 1435, 365, 18, 12161, 921, 18, 21229, 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, ...
[ 1, 1, 1, 1, 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, 12735, 12, 2890, 4672, 365, 18, 12161, 921, 18, 4412, 1435, 365, 18, 12161, 921, 18, 21229, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
TESTS::
A curve of rank 0 and prime conductor:: sage: E = EllipticCurve('19a') sage: E.prove_BSD(verbosity=2) p = 2: true by 2-descent True for p not in {2, 3} by Kolyvagin. True for p=3 by Mazur []
def prove_BSD(self, verbosity=0, simon=False, proof=None): """ Attempts to prove the Birch and Swinnerton-Dyer conjectural formula for `E`, returning a list of primes `p` for which this function fails to prove BSD(E,p). Here, BSD(E,p) is the statement: "the Birch and Swinnerton-Dyer formula holds up to a rational number coprime to `p`." INPUT: - ``verbosity`` - int, how much information about the proof to print. - 0 - print nothing - 1 - print sketch of proof - 2 - print information about remaining primes - ``simon`` - bool (default False), whether to use two_descent or simon_two_descent at p=2. - ``proof`` - bool or None (default: None, see proof.elliptic_curve or sage.structure.proof). If False, this function just immediately returns the empty list. EXAMPLE:: sage: for E in cremona_optimal_curves(range(15)): ....: print E.label() ....: E.prove_BSD(verbosity=2) ....: 11a1 p = 2: true by 2-descent True for p not in {2, 5} by Kolyvagin. True for p=5 by Mazur [] 14a1 p = 2: true by 2-descent True for p not in {2, 3} by Kolyvagin. Remaining primes: p = 3: reducible, surjective, good ordinary [3]
7e12d1cab8922a4b992851b4d1773b845c6c9b38 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/7e12d1cab8922a4b992851b4d1773b845c6c9b38/ell_rational_field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 450, 537, 67, 30780, 12, 2890, 16, 11561, 33, 20, 16, 3142, 265, 33, 8381, 16, 14601, 33, 7036, 4672, 3536, 6020, 9585, 358, 450, 537, 326, 605, 481, 343, 471, 5434, 267, 82, 1051, 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, 450, 537, 67, 30780, 12, 2890, 16, 11561, 33, 20, 16, 3142, 265, 33, 8381, 16, 14601, 33, 7036, 4672, 3536, 6020, 9585, 358, 450, 537, 326, 605, 481, 343, 471, 5434, 267, 82, 1051, 2...
return code
return (code,msg)
def ehlo(self, name=''): """ SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host. """ name=string.strip(name) if len(name)==0: name=socket.gethostbyaddr(socket.gethostname())[0] self.putcmd("ehlo",name) (code,msg)=self.getreply() # According to RFC1869 some (badly written) # MTA's will disconnect on an ehlo. Toss an exception if # that happens -ddm if code == -1 and len(msg) == 0: raise SMTPServerDisconnected("Server not connected") self.ehlo_resp=msg if code<>250: return code self.does_esmtp=1 #parse the ehlo responce -ddm resp=string.split(self.ehlo_resp,'\n') del resp[0] for each in resp: m=re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*)',each) if m: feature=string.lower(m.group("feature")) params=string.strip(m.string[m.end("feature"):]) self.esmtp_features[feature]=params return code
053a07b597f875016b8bc478c8a905c8baf4efe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/053a07b597f875016b8bc478c8a905c8baf4efe4/smtplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20124, 383, 12, 2890, 16, 508, 2218, 11, 4672, 3536, 18102, 296, 73, 76, 383, 11, 1296, 18, 17423, 358, 1366, 364, 333, 1296, 3467, 358, 326, 23127, 8609, 434, 326, 1191, 1479, 18, 353...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20124, 383, 12, 2890, 16, 508, 2218, 11, 4672, 3536, 18102, 296, 73, 76, 383, 11, 1296, 18, 17423, 358, 1366, 364, 333, 1296, 3467, 358, 326, 23127, 8609, 434, 326, 1191, 1479, 18, 353...
tokens appears anywhere in the sequqnce of returned tokens.
tokens appears anywhere in the sequence of returned tokens.
def tokensMatch(expectedTokens, recievedTokens): """Test whether the test has passed or failed For brevity in the tests, the test has passed if the sequence of expected tokens appears anywhere in the sequqnce of returned tokens. """ return expectedTokens == recievedTokens for i, token in enumerate(recievedTokens): if expectedTokens[0] == token: if (len(expectedTokens) <= len(recievedTokens[i:]) and recievedTokens[i:i+len(expectedTokens)]): return True return False
b71ce9ba4dcd259d5d334c2f0b5ef8d97f1860fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10463/b71ce9ba4dcd259d5d334c2f0b5ef8d97f1860fe/test_tokenizer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2430, 2060, 12, 3825, 5157, 16, 1950, 1385, 2155, 5157, 4672, 3536, 4709, 2856, 326, 1842, 711, 2275, 578, 2535, 225, 2457, 324, 9083, 560, 316, 326, 7434, 16, 326, 1842, 711, 2275, 309,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2430, 2060, 12, 3825, 5157, 16, 1950, 1385, 2155, 5157, 4672, 3536, 4709, 2856, 326, 1842, 711, 2275, 578, 2535, 225, 2457, 324, 9083, 560, 316, 326, 7434, 16, 326, 1842, 711, 2275, 309,...
Using 'str(bug)' and 'print bug' is not recommended because of potential encoding issues. Please use unicode(bug) where possible. ''' return unicode(self)
This is available only for compatibility. Using 'str(bug)' and 'print bug' is not recommended because of potential encoding issues. Please use unicode(bug) where possible. ''' return unicode(self).encode(locale.getpreferredencoding(), 'replace')
def __str__(self): '''Return a simple string representation of this bug
0c06e3225bf33fbfe59be3e01f75d50e7de778a2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5050/0c06e3225bf33fbfe59be3e01f75d50e7de778a2/base.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 701, 972, 12, 2890, 4672, 9163, 990, 279, 4143, 533, 4335, 434, 333, 7934, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 701, 972, 12, 2890, 4672, 9163, 990, 279, 4143, 533, 4335, 434, 333, 7934, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if itera.begins_line() :
if itera.starts_line() :
def inserttag_clicked(self,widget) : itera = self.textview.get_insert() if itera.begins_line() : self.textview.insert_text("@",itera) else : self.textview.insert_text(" @",itera)
b20233cbbb113ee4fe055aecf3371281eed1b3bd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/b20233cbbb113ee4fe055aecf3371281eed1b3bd/editor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 316, 550, 748, 346, 67, 7475, 329, 12, 2890, 16, 6587, 13, 294, 1400, 69, 273, 365, 18, 955, 1945, 18, 588, 67, 6387, 1435, 309, 1400, 69, 18, 17514, 67, 1369, 1435, 294, 365, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 316, 550, 748, 346, 67, 7475, 329, 12, 2890, 16, 6587, 13, 294, 1400, 69, 273, 365, 18, 955, 1945, 18, 588, 67, 6387, 1435, 309, 1400, 69, 18, 17514, 67, 1369, 1435, 294, 365, 18, ...
sage: sr = mq.SR(3,1,1,8) sage: sr.field_polynomials('x',2)
sage: sr = mq.SR(3, 1, 1, 8) sage: sr.field_polynomials('x', 2)
def field_polynomials(self, name, i, l=None): """ Return list of field polynomials for a given round -- given by its number $i$ -- and name.
e506ccc2459e6e3948659b0d1b28d9d6b70342e4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/e506ccc2459e6e3948659b0d1b28d9d6b70342e4/sr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 652, 67, 3915, 13602, 87, 12, 2890, 16, 508, 16, 277, 16, 328, 33, 7036, 4672, 3536, 2000, 666, 434, 652, 16991, 87, 364, 279, 864, 3643, 1493, 864, 635, 2097, 1300, 271, 77, 8, 1493...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 652, 67, 3915, 13602, 87, 12, 2890, 16, 508, 16, 277, 16, 328, 33, 7036, 4672, 3536, 2000, 666, 434, 652, 16991, 87, 364, 279, 864, 3643, 1493, 864, 635, 2097, 1300, 271, 77, 8, 1493...
traceback.format_ext())
traceback.format_exc())
def open_url(self, url): # It looks like the maximum URL length is about 2k. I can't # seem to find the exact value if len(url) > 2047: url = url[:2047] try: webbrowser.get("windows-default").open_new(url) except: logging.warn("Error opening URL: %r\n%s", url, traceback.format_ext()) recommendURL = config.get(prefs.RECOMMEND_URL)
9a7c1245a51fbcea127214a775d13ad8fa35f9a9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/9a7c1245a51fbcea127214a775d13ad8fa35f9a9/application.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 718, 12, 2890, 16, 880, 4672, 468, 2597, 10192, 3007, 326, 4207, 1976, 769, 353, 2973, 576, 79, 18, 467, 848, 1404, 468, 19264, 358, 1104, 326, 5565, 460, 309, 562, 12, 718, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 718, 12, 2890, 16, 880, 4672, 468, 2597, 10192, 3007, 326, 4207, 1976, 769, 353, 2973, 576, 79, 18, 467, 848, 1404, 468, 19264, 358, 1104, 326, 5565, 460, 309, 562, 12, 718, ...
smtp.sendmail("mom@ubuntu.com", addr , message.as_string())
smtp.sendmail("mom@ubuntu.com", env_addr , message.as_string())
def send_message(message, recipients): """Send out a message to everyone subscribed to it.""" smtp = SMTP("localhost") for addr in recipients: logging.debug("Sending to %s", addr) message.replace_header("To", addr) smtp.sendmail("mom@ubuntu.com", addr , message.as_string()) smtp.quit()
79f0991ee4561814c91aecfb7b523e979971c812 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1955/79f0991ee4561814c91aecfb7b523e979971c812/mail-diffs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 2150, 12, 2150, 16, 12045, 4672, 3536, 3826, 596, 279, 883, 358, 3614, 476, 16445, 358, 518, 12123, 17660, 273, 18102, 2932, 13014, 7923, 225, 364, 3091, 316, 12045, 30, 2907, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 2150, 12, 2150, 16, 12045, 4672, 3536, 3826, 596, 279, 883, 358, 3614, 476, 16445, 358, 518, 12123, 17660, 273, 18102, 2932, 13014, 7923, 225, 364, 3091, 316, 12045, 30, 2907, ...
if xmid-x >= 0: d = tol1 else: d = -tol1
if xmid-x >= 0: rat = tol1 else: rat = -tol1
def brent(func, args=(), brack=None, tol=1.48e-8, full_output=0, maxiter=500): """ Given a function of one-variable and a possible bracketing interval, return the minimum of the function isolated to a fractional precision of tol. A bracketing interval is a triple (a,b,c) where (a<b<c) and func(b) < func(a),func(c). If bracket is two numbers then they are assumed to be a starting interval for a downhill bracket search (see bracket) Uses inverse interpolation when possible to speed up convergence. """ _mintol = 1.0e-11 _cg = 0.3819660 if brack is None: xa,xb,xc,fa,fb,fc,funcalls = bracket(func, args=args) elif len(brack) == 2: xa,xb,xc,fa,fb,fc,funcalls = bracket(func, xa=brack[0], xb=brack[1], args=args) elif len(brack) == 3: xa,xb,xc = brack if (xa > xc): # swap so xa < xc can be assumed dum = xa; xa=xc; xc=dum assert ((xa < xb) and (xb < xc)), "Not a bracketing interval." fa = apply(func, (xa,)+args) fb = apply(func, (xb,)+args) fc = apply(func, (xc,)+args) assert ((fb<fa) and (fb < fc)), "Not a bracketing interval." funcalls = 3 else: raise ValuError, "Bracketing interval must be length 2 or 3 sequence." x=w=v=xb fw=fv=fx=apply(func, (x,)+args) if (xa < xc): a = xa; b = xc else: a = xc; b = xa e = 0.0 funcalls = 1 iter = 0 while (iter < maxiter): tol1 = tol*abs(x) + _mintol tol2 = 2.0*tol1 xmid = 0.5*(a+b) if abs(x-xmid) < (tol2-0.5*(b-a)): # check for convergence xmin=x; fval=fx break if (abs(e) <= tol1): # do a parabolic fit if (x>=xmid): e=a-x else: e=b-x d = _cg*e else: tmp1 = (x-w)*(fx-fv) tmp2 = (x-v)*(fx-fw) p = (x-v)*tmp2 - (x-w)*tmp1; tmp2 = 2.0*(tmp2-tmp1) if (tmp2 > 0.0): p = -p tmp2 = abs(tmp2) etemp = e e = d # check parabolic fit if ((p > tmp2*(a-x)) and (p < tmp2*(b-x)) and (abs(p) < abs(0.5*tmp2*etemp))): d = p*1.0/tmp2 # if it's good use it. u = x + d if ((u-a) < tol2 or (b-u) < tol2): if xmid-x >= 0: d = tol1 else: d = -tol1 else: if (x>=xmid): e=a-x # if it's bad do a golden section step else: e=b-x d = _cg*e if (abs(d) < tol1): if d >= 0: u = x + tol1 else: u = x - tol1 else: u = x + d fu = apply(func, (u,)+args) funcalls += 1 if (fu > fx): if (u<x): a=u else: b=u if (fu<=fw) or (w==x): v=w; w=u; fv=fw; fw=fu elif (fu<=fv) or (v==x) or (v==w): v=u; fv=fu else: if (u >= x): a = x else: b = x v=w; w=x; x=u fv=fw; fw=fx; fx=fu xmin = x fval = fx if full_output: return xmin, fval, iter, funcalls else: return xmin
151bc0cf429941b974cff683950f0c18642f7da4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/151bc0cf429941b974cff683950f0c18642f7da4/optimize.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 324, 547, 12, 644, 16, 833, 33, 9334, 16430, 363, 33, 7036, 16, 6085, 33, 21, 18, 8875, 73, 17, 28, 16, 1983, 67, 2844, 33, 20, 16, 25743, 33, 12483, 4672, 3536, 16803, 279, 445, 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, 324, 547, 12, 644, 16, 833, 33, 9334, 16430, 363, 33, 7036, 16, 6085, 33, 21, 18, 8875, 73, 17, 28, 16, 1983, 67, 2844, 33, 20, 16, 25743, 33, 12483, 4672, 3536, 16803, 279, 445, 4...
if map is None: map=asyncore.socket_map
if map is None: map = asyncore.socket_map
def loop (timeout=30.0, use_poll=0, map=None): if use_poll: poll_fun = asyncore.poll2 else: poll_fun = asyncore.poll if map is None: map=asyncore.socket_map _start_loop(map) while map: poll_fun (timeout, map) _stop_loop()
5415dbe3669c0431316ed3f82bda29b29aa844b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/5415dbe3669c0431316ed3f82bda29b29aa844b9/ThreadedAsync.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2798, 261, 4538, 33, 5082, 18, 20, 16, 999, 67, 13835, 33, 20, 16, 852, 33, 7036, 4672, 225, 309, 999, 67, 13835, 30, 7672, 67, 12125, 273, 4326, 479, 18, 13835, 22, 469, 30, 3639, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2798, 261, 4538, 33, 5082, 18, 20, 16, 999, 67, 13835, 33, 20, 16, 852, 33, 7036, 4672, 225, 309, 999, 67, 13835, 30, 7672, 67, 12125, 273, 4326, 479, 18, 13835, 22, 469, 30, 3639, ...
flash(u"We recorded you as Maybe Attending. When you know better, could you select Yes or No?", 'info')
flash(u"We recorded you as Maybe Attending, %s. When you know better, could you select Yes or No?" % user.fullname, 'info')
def rsvp(): key = request.args.get('key') choice = request.args.get('rsvp') if key is None: flash(u"You need an access key to RSVP.", 'error') return redirect(url_for('index'), code=303) if choice not in ['Y', 'N', 'M']: flash(u"You need to RSVP with Yes, No or Maybe: Y, N or M.", 'error') return redirect(url_for('index'), code=303) user = User.query.filter_by(privatekey=key).first() if user is None: flash(u"Sorry, that access key is not in our records.", 'error') return redirect(url_for('index'), code=303) user.participant.rsvp = choice if choice == 'Y': flash(u"Yay! So glad you will be joining us.", 'info') elif choice == 'N': flash(u"Sorry you can't make it. Hope you’ll join us next time.", 'error') # Fake 'error' for frowny icon elif choice == 'M': flash(u"We recorded you as Maybe Attending. When you know better, could you select Yes or No?", 'info') db.session.commit() return redirect(url_for('index'), code=303)
f7cc649d162305e0ce6ef8008f6f776172e0d077 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12083/f7cc649d162305e0ce6ef8008f6f776172e0d077/website.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3597, 20106, 13332, 498, 273, 590, 18, 1968, 18, 588, 2668, 856, 6134, 6023, 273, 590, 18, 1968, 18, 588, 2668, 5453, 20106, 6134, 309, 498, 353, 599, 30, 9563, 12, 89, 6, 6225, 1608, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3597, 20106, 13332, 498, 273, 590, 18, 1968, 18, 588, 2668, 856, 6134, 6023, 273, 590, 18, 1968, 18, 588, 2668, 5453, 20106, 6134, 309, 498, 353, 599, 30, 9563, 12, 89, 6, 6225, 1608, ...
return idaapi.get_numbered_type_name(idaapi.cvar.idati, ordinal)
return idaapi.idc_get_local_type_name(ordinal)
def GetLocalTypeName(ordinal): """ Retrieve a local type name @param ordinal: slot number (1...NumberOfLocalTypes) returns: local type name or None """ return idaapi.get_numbered_type_name(idaapi.cvar.idati, ordinal)
8b2650eebaf80bde2146ed36982b6253636dd286 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3410/8b2650eebaf80bde2146ed36982b6253636dd286/idc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 2042, 7947, 12, 517, 1490, 4672, 3536, 10708, 279, 1191, 618, 508, 225, 632, 891, 12675, 30, 225, 4694, 1300, 261, 21, 2777, 9226, 2042, 2016, 13, 225, 1135, 30, 1191, 618, 508, 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, 968, 2042, 7947, 12, 517, 1490, 4672, 3536, 10708, 279, 1191, 618, 508, 225, 632, 891, 12675, 30, 225, 4694, 1300, 261, 21, 2777, 9226, 2042, 2016, 13, 225, 1135, 30, 1191, 618, 508, 5...
primes up to bound.
primes up to ``bound``.
def saturate(self, bound=-1): """ Compute the saturation of the Mordell-Weil group at all primes up to bound.
8b53e056cc765e689493ec9632c441ee03a3206a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8b53e056cc765e689493ec9632c441ee03a3206a/interface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5942, 295, 340, 12, 2890, 16, 2489, 29711, 21, 4672, 3536, 8155, 326, 22824, 434, 326, 490, 517, 1165, 17, 3218, 330, 1041, 622, 777, 846, 4485, 731, 358, 2489, 18, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5942, 295, 340, 12, 2890, 16, 2489, 29711, 21, 4672, 3536, 8155, 326, 22824, 434, 326, 490, 517, 1165, 17, 3218, 330, 1041, 622, 777, 846, 4485, 731, 358, 2489, 18, 2, -100, -100, -100...
(root_drive, root_path) = os.path.splitdrive (new_root)
def change_root (new_root, pathname): """Return 'pathname' with 'new_root' prepended. If 'pathname' is relative, this is equivalent to "os.path.join(new_root,pathname)". Otherwise, it requires making 'pathname' relative and then joining the two, which is tricky on DOS/Windows and Mac OS.""" if not abspath (pathname): return os.path.join (new_root, pathname) elif os.name == 'posix': return os.path.join (new_root, pathname[1:]) elif os.name == 'nt': (root_drive, root_path) = os.path.splitdrive (new_root) (drive, path) = os.path.splitdrive (pathname) raise RuntimeError, "I give up -- not sure how to do this on Windows" elif os.name == 'mac': raise RuntimeError, "no clue how to do this on Mac OS" else: raise DistutilsPlatformError, \ "nothing known about platform '%s'" % os.name
4b46ef9a4f35c50eed2e0993058be0cfe71e0b3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4b46ef9a4f35c50eed2e0993058be0cfe71e0b3b/util.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2549, 67, 3085, 261, 2704, 67, 3085, 16, 9806, 4672, 225, 3536, 990, 296, 28336, 11, 598, 296, 2704, 67, 3085, 11, 26989, 18, 225, 971, 296, 28336, 11, 353, 3632, 16, 333, 353, 7680, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2549, 67, 3085, 261, 2704, 67, 3085, 16, 9806, 4672, 225, 3536, 990, 296, 28336, 11, 598, 296, 2704, 67, 3085, 11, 26989, 18, 225, 971, 296, 28336, 11, 353, 3632, 16, 333, 353, 7680, ...
'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theorical Margin',
'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theoretical Margin',
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
3415b14d6137c1321c302ddbfce5d3abfacd8e15 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3415b14d6137c1321c302ddbfce5d3abfacd8e15/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, ...
except Exception, e:
except DOMGenerationError, e:
def extendDOMFromContent (self, document, element, ctd_instance): assert isinstance(ctd_instance, PyWXSB_complexTypeDefinition) if self.C_SEQUENCE == self.compositor(): for particle in self.particles(): particle.extendDOMFromContent(document, element, ctd_instance) elif self.C_ALL == self.compositor(): mutable_particles = self.particles().copy() while 0 < len(mutable_particles): try: choice = self.__extendDOMFromChoice(document, element, ctd_instance, mutable_particles) mutable_particles.remove(choice) except Exception, e: #print 'ALL failed: %s' % (e,) break for particle in mutable_particles: if 0 < particle.minOccurs(): raise DOMGenerationError('ALL: Could not generate instance of required %s' % (particle.term(),)) elif self.C_CHOICE == self.compositor(): choice = self.__extendDOMFromChoice(document, element, ctd_instance, self.particles()) if choice is None: raise DOMGenerationError('CHOICE: No candidates found') else: assert False
bd2c5c290cba6195c7988af7f54c294b36490ade /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7171/bd2c5c290cba6195c7988af7f54c294b36490ade/bindings.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2133, 8168, 1265, 1350, 261, 2890, 16, 1668, 16, 930, 16, 276, 4465, 67, 1336, 4672, 1815, 1549, 12, 299, 72, 67, 1336, 16, 4707, 59, 60, 14541, 67, 14259, 559, 1852, 13, 309, 365, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2133, 8168, 1265, 1350, 261, 2890, 16, 1668, 16, 930, 16, 276, 4465, 67, 1336, 4672, 1815, 1549, 12, 299, 72, 67, 1336, 16, 4707, 59, 60, 14541, 67, 14259, 559, 1852, 13, 309, 365, 1...
escape_newlines=self._get_preserve_newlines())
escape_newlines=self.must_preserve_newlines)
def category(m): return m.is_completed and 1 or m.due and 2 or 3
76404ab70779d75689c7caa0a8c2b2405923c55a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2831/76404ab70779d75689c7caa0a8c2b2405923c55a/web_ui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3150, 12, 81, 4672, 327, 312, 18, 291, 67, 13615, 471, 404, 578, 312, 18, 24334, 471, 576, 578, 890, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3150, 12, 81, 4672, 327, 312, 18, 291, 67, 13615, 471, 404, 578, 312, 18, 24334, 471, 576, 578, 890, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
win.addstr(my - 2, x, self.help_title, curses.A_BOLD) win.addstr(my - 2, x + len(self.help_title), self.help, curses.A_DIM)
self.safe_add_str(my - 2, x, self.help_title, curses.A_BOLD) self.safe_add_str(my - 2, x + len(self.help_title), self.help, curses.A_DIM)
def draw(self): win = self.win self.handle_keypress() x = LEFT_BORDER_OFFSET y = blank_line = count(2).next my, mx = win.getmaxyx() win.erase() win.bkgd(" ", curses.color_pair(1)) win.border() win.addstr(1, x, self.greet, curses.A_DIM | curses.color_pair(5)) blank_line() win.addstr(y(), x, self.format_row("UUID", "TASK", "WORKER", "TIME", "STATE"), curses.A_BOLD | curses.A_UNDERLINE) tasks = self.tasks if tasks: for row, (uuid, task) in enumerate(tasks): if row > self.display_height: break
3781edb034e455f00bc49bc3dfa71d146102d27d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2024/3781edb034e455f00bc49bc3dfa71d146102d27d/cursesmon.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 12, 2890, 4672, 5657, 273, 365, 18, 8082, 365, 18, 4110, 67, 856, 1028, 1435, 619, 273, 9686, 67, 38, 7954, 67, 11271, 677, 273, 7052, 67, 1369, 273, 1056, 12, 22, 2934, 4285, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2890, 4672, 5657, 273, 365, 18, 8082, 365, 18, 4110, 67, 856, 1028, 1435, 619, 273, 9686, 67, 38, 7954, 67, 11271, 677, 273, 7052, 67, 1369, 273, 1056, 12, 22, 2934, 4285, ...
import matplotlib matplotlib.use("Agg")
if not opts.show_plots: import matplotlib matplotlib.use("Agg")
help="path to the config file (def = mvsc_config)")
0704cea2649a288bce696ecf79ec4f35cdeb0d32 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/0704cea2649a288bce696ecf79ec4f35cdeb0d32/pylal_mvsc_player.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 2809, 1546, 803, 358, 326, 642, 585, 261, 536, 273, 7701, 1017, 67, 1425, 2225, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 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, 2809, 1546, 803, 358, 326, 642, 585, 261, 536, 273, 7701, 1017, 67, 1425, 2225, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
return run_sql('insert into basket_record (id_basket, id_record) values %s;' % vals)
owner_uid = get_basket_owner_id(basket_id) add_to_basket(owner_uid, record_ids, [basket_id])
def add_records_to_basket(record_ids, basket_id): nrec = len(record_ids) if nrec > 0: vals = '(%s,%s)' % (basket_id, record_ids[0]) if nrec > 1: for i in record_ids[1:]: vals += ',(%s, %s)' % (basket_id, i) if CFG_WEBALERT_DEBUG_LEVEL > 0: print "-> adding %s records into basket %s: %s" % (nrec, basket_id, vals) try: if CFG_WEBALERT_DEBUG_LEVEL < 4: return run_sql('insert into basket_record (id_basket, id_record) values %s;' % vals) # Cannot use the run_sql(<query>, (<arg>,)) form for some reason else: print ' NOT ADDED, DEBUG LEVEL == 4' return 0 except Exception: register_exception() return 0 else: return 0
7fd38a342394a9733a4995f21b115dc0ee9a9425 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/7fd38a342394a9733a4995f21b115dc0ee9a9425/alert_engine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 7094, 67, 869, 67, 26219, 12, 3366, 67, 2232, 16, 12886, 67, 350, 4672, 225, 290, 3927, 273, 562, 12, 3366, 67, 2232, 13, 309, 290, 3927, 405, 374, 30, 5773, 273, 7747, 9, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 7094, 67, 869, 67, 26219, 12, 3366, 67, 2232, 16, 12886, 67, 350, 4672, 225, 290, 3927, 273, 562, 12, 3366, 67, 2232, 13, 309, 290, 3927, 405, 374, 30, 5773, 273, 7747, 9, ...
pManager.manager.DebugStr('cOwlManager '+ __version__ +': Distributing to: '+str(distri)+'.')
pManager.manager.DebugStr('cOwlManager '+ __version__ +': Distributing to '+str(len(distri))+' owls.')
def Distribute(self, cNetPackage): """Pass cNetPackage to all Neighbourowls.
d6a08bcedb67323d8f55162c82e03e2d1169ba6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2853/d6a08bcedb67323d8f55162c82e03e2d1169ba6e/cOwlManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3035, 887, 12, 2890, 16, 276, 7308, 2261, 4672, 3536, 6433, 276, 7308, 2261, 358, 777, 30663, 477, 543, 3251, 18, 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, 3035, 887, 12, 2890, 16, 276, 7308, 2261, 4672, 3536, 6433, 276, 7308, 2261, 358, 777, 30663, 477, 543, 3251, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
result = '"%s"' % tool_path( bjam )
result = '%s "-sBOOST_BUILD_PATH=%s:%s" "-sBOOST_ROOT=%s"'\ % ( tool_path( bjam ) , regression_root , os.path.join( boost_root, 'tools/build/v1' ) , boost_root )
def bjam_command( toolsets ): result = '"%s"' % tool_path( bjam ) if not toolsets is None: result += ' "-sTOOLS=%s"' % string.join( string.split( toolsets, ',' ), ' ' ) result += ' "-sBOOST_ROOT=%s"' % boost_root return result
cb3bf0e2aaf71156423e0967a9e6571cb015a2e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7959/cb3bf0e2aaf71156423e0967a9e6571cb015a2e5/regression.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 324, 78, 301, 67, 3076, 12, 5226, 4424, 262, 30, 563, 273, 1995, 87, 3701, 87, 5315, 4005, 67, 20215, 67, 4211, 5095, 87, 5319, 87, 6, 3701, 87, 5315, 4005, 67, 9185, 5095, 87, 5187,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 324, 78, 301, 67, 3076, 12, 5226, 4424, 262, 30, 563, 273, 1995, 87, 3701, 87, 5315, 4005, 67, 20215, 67, 4211, 5095, 87, 5319, 87, 6, 3701, 87, 5315, 4005, 67, 9185, 5095, 87, 5187,...
error ("Expected to find 3 but found: " + value);
error ("Expected to find 3 but found: " + str(value)) return False queue.unref () queue = vortex.AsyncQueue () iterator = 0 while iterator < 1000: queue.push (iterator) iterator += 1 iterator = 0 while iterator < 1000: value = queue.pop () if value != iterator: error ("Expected to find: " + str(value) + ", but found: " + str(iterator)) return False iterator += 1 queue.unref () queue = vortex.AsyncQueue () queue.push ((2, 3)) queue.push ("This is an string") queue.push ([1, 2, 3, 4]) if not test_00_a_check (queue):
def test_00_a(): ########## # create a queue queue = vortex.AsyncQueue (); # call to terminate queue del queue; ######### # create a queue queue = vortex.AsyncQueue (); # call to unref iterator = 0 while iterator < 100: # unref queue.unref (); # next operation iterator += 1; # and now finish del queue; ######### now check data storage queue = vortex.AsyncQueue (); # push items queue.push (1); queue.push (2); queue.push (3); # get items value = queue.pop (); if value != 3: error ("Expected to find 3 but found: " + value); return False; if value != 2: error ("Expected to find 2 but found: " + value); return False; if value != 1: error ("Expected to find 1 but found: " + value); return False; # call to unref queue.unref (); return True;
44bc361f3b497230e1d601079e2df89085d4b1cd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1306/44bc361f3b497230e1d601079e2df89085d4b1cd/vortex-regression-client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 713, 67, 69, 13332, 468, 3228, 7, 468, 752, 279, 2389, 2389, 273, 331, 20873, 18, 2771, 3183, 261, 1769, 225, 468, 745, 358, 10850, 2389, 1464, 2389, 31, 225, 468, 3228, 225,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 713, 67, 69, 13332, 468, 3228, 7, 468, 752, 279, 2389, 2389, 273, 331, 20873, 18, 2771, 3183, 261, 1769, 225, 468, 745, 358, 10850, 2389, 1464, 2389, 31, 225, 468, 3228, 225,...
self.__node.x = self.__startDragPos[0]+event.x-event.lastdownpos[0] self.__node.y = self.__startDragPos[1]+event.y-event.lastdownpos[1]
self.__node.pos = (self.__startDragPos[0]+event.x-event.lastdownpos[0],self.__startDragPos[1]+event.y-event.lastdownpos[1])
def __onMove(self, event): if event.cursorid == self.__cursorID: self.__node.x = self.__startDragPos[0]+event.x-event.lastdownpos[0] self.__node.y = self.__startDragPos[1]+event.y-event.lastdownpos[1] stopBubble = False if self.__onDragMove: stopBubble = self.__onDragMove(event) if stopBubble == None: stopBubble = False return stopBubble
08d03676380c0236e98994118de1718693c0dd36 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7300/08d03676380c0236e98994118de1718693c0dd36/draggable.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 265, 7607, 12, 2890, 16, 871, 4672, 309, 871, 18, 9216, 350, 422, 365, 16186, 9216, 734, 30, 365, 16186, 2159, 18, 917, 273, 261, 2890, 16186, 1937, 11728, 1616, 63, 20, 3737, 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, 1001, 265, 7607, 12, 2890, 16, 871, 4672, 309, 871, 18, 9216, 350, 422, 365, 16186, 9216, 734, 30, 365, 16186, 2159, 18, 917, 273, 261, 2890, 16186, 1937, 11728, 1616, 63, 20, 3737, 25...
self.doSaveConfig() def doSaveConfig (self, reallySave="dunno"): if reallySave == "No": return
def saveConfig (self, widget): self.doSaveConfig()
44ba4a387d4167dedba8d083a763a0b3d1a1236b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4580/44ba4a387d4167dedba8d083a763a0b3d1a1236b/driconf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 809, 261, 2890, 16, 3604, 4672, 365, 18, 2896, 4755, 809, 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, 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, 1923, 809, 261, 2890, 16, 3604, 4672, 365, 18, 2896, 4755, 809, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
' journal-page ' : ' 773__c:', ' jp ' : ' 773__c:',
'journal-page' : '773__c:', 'jp' : '773__c:',
def __init__(self, message): """Initialization.""" self.message = message
9ac6f199aca80bde5350b014ceb25041ee84876b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2139/9ac6f199aca80bde5350b014ceb25041ee84876b/search_engine_query_parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 883, 4672, 3536, 17701, 12123, 365, 18, 2150, 273, 883, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 883, 4672, 3536, 17701, 12123, 365, 18, 2150, 273, 883, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
flags = fcntl.fcntl (fd, fcntl.F_GETFL, 0)
flags = fcntl.fcntl(fd, fcntl.F_GETFL, 0)
def __init__ (self, fd): dispatcher.__init__ (self) self.connected = 1 # set it to non-blocking mode flags = fcntl.fcntl (fd, fcntl.F_GETFL, 0) flags = flags | os.O_NONBLOCK fcntl.fcntl (fd, fcntl.F_SETFL, flags) self.set_file (fd)
d560ace3a76d1fa162fa40ec90a158d4d3540036 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d560ace3a76d1fa162fa40ec90a158d4d3540036/asyncore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 5194, 4672, 7393, 16186, 2738, 972, 261, 2890, 13, 365, 18, 8537, 273, 404, 468, 444, 518, 358, 1661, 17, 18926, 1965, 2943, 273, 30894, 18, 7142, 16681, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 261, 2890, 16, 5194, 4672, 7393, 16186, 2738, 972, 261, 2890, 13, 365, 18, 8537, 273, 404, 468, 444, 518, 358, 1661, 17, 18926, 1965, 2943, 273, 30894, 18, 7142, 16681, ...
arguments in each of any two columns, i. e.
arguments in each of any two columns, i.e.
def wigner_6j(j_1, j_2, j_3, j_4, j_5, j_6, prec=None): r""" Calculate the Wigner 6j symbol `Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6)`. INPUT: - ``j_1``, ..., ``j_6`` - integer or half integer - ``prec`` - precision, default: None. Providing a precision can drastically speed up the calculation. OUTPUT: rational number times the square root of a rational number (if prec=None), or real number if a precision is given EXAMPLES:: sage: wigner_6j(3,3,3,3,3,3) -1/14 sage: wigner_6j(5,5,5,5,5,5) 1/52 sage: wigner_6j(6,6,6,6,6,6) 309/10868 sage: wigner_6j(8,8,8,8,8,8) -12219/965770 sage: wigner_6j(30,30,30,30,30,30) 36082186869033479581/87954851694828981714124 sage: wigner_6j(0.5,0.5,1,0.5,0.5,1) 1/6 sage: wigner_6j(200,200,200,200,200,200, prec=1000)*1.0 0.000155903212413242 It is an error to have arguments that are not integer or half integer values or do not fulfil the triangle relation:: sage: wigner_6j(2.5,2.5,2.5,2.5,2.5,2.5) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfil the triangle relation sage: wigner_6j(0.5,0.5,1.1,0.5,0.5,1.1) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfil the triangle relation NOTES: The Wigner 6j symbol is related to the Racah symbol but exhibits more symmetries as detailed below. .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =(-1)^{j_1+j_2+j_4+j_5} W(j_1,j_2,j_5,j_4,j_3,j_6) The Wigner 6j symbol obeys the following symmetry rules: - Wigner $6j$ symbols are left invariant under any permutation of the columns: .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =Wigner6j(j_3,j_1,j_2,j_6,j_4,j_5) =Wigner6j(j_2,j_3,j_1,j_5,j_6,j_4) =Wigner6j(j_3,j_2,j_1,j_6,j_5,j_4) =Wigner6j(j_1,j_3,j_2,j_4,j_6,j_5) =Wigner6j(j_2,j_1,j_3,j_5,j_4,j_6) - They are invariant under the exchange of the upper and lower arguments in each of any two columns, i. e. .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =Wigner6j(j_1,j_5,j_6,j_4,j_2,j_3) =Wigner6j(j_4,j_2,j_6,j_1,j_5,j_3) =Wigner6j(j_4,j_5,j_3,j_1,j_2,j_6) - additional 6 symmetries [Regge59] giving rise to 144 symmetries in total - only non-zero if any triple of `j`'s fulfil a triangle relation ALGORITHM: This function uses the algorithm of [Edmonds74] to calculate the value of the 6j symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [Rasch03]. REFERENCES: - [Regge59] 'Symmetry Properties of Racah Coefficients', T. Regge, Nuovo Cimento, Volume 11, pp. 116 (1959) - [Edmonds74] 'Angular Momentum in Quantum Mechanics', A. R. Edmonds, Princeton University Press (1974) - [Rasch03] 'Efficient Storage Scheme for Pre-calculated Wigner 3j, 6j and Gaunt Coefficients', J. Rasch and A. C. H. Yu, SIAM J. Sci. Comput. Volume 25, Issue 4, pp. 1416-1428 (2003) """ res = (-1) ** (int(j_1 + j_2 + j_4 + j_5)) * \ racah(j_1, j_2, j_5, j_4, j_3, j_6, prec) return res
88e8ded3e4e8fadbc380d719dcf3bdc6eab9d557 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/88e8ded3e4e8fadbc380d719dcf3bdc6eab9d557/wigner.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 341, 724, 264, 67, 26, 78, 12, 78, 67, 21, 16, 525, 67, 22, 16, 525, 67, 23, 16, 525, 67, 24, 16, 525, 67, 25, 16, 525, 67, 26, 16, 13382, 33, 7036, 4672, 436, 8395, 9029, 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, 341, 724, 264, 67, 26, 78, 12, 78, 67, 21, 16, 525, 67, 22, 16, 525, 67, 23, 16, 525, 67, 24, 16, 525, 67, 25, 16, 525, 67, 26, 16, 13382, 33, 7036, 4672, 436, 8395, 9029, 326,...
marshal.load(file(test_support.TESTFN, "rb"))
new = marshal.load(file(test_support.TESTFN, "rb"))
def test_sets(self): for constructor in (set, frozenset): t = constructor(self.d.keys()) new = marshal.loads(marshal.dumps(t)) self.assertEqual(t, new) self.assert_(isinstance(new, constructor)) self.assertNotEqual(id(t), id(new)) marshal.dump(t, file(test_support.TESTFN, "wb")) marshal.load(file(test_support.TESTFN, "rb")) self.assertEqual(t, new) os.unlink(test_support.TESTFN)
605586a925121ac8d40dc68dcb21bf374fc9e92b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/605586a925121ac8d40dc68dcb21bf374fc9e92b/test_marshal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4424, 12, 2890, 4672, 364, 3885, 316, 261, 542, 16, 23462, 4672, 268, 273, 3885, 12, 2890, 18, 72, 18, 2452, 10756, 394, 273, 10893, 18, 17135, 12, 3108, 18, 13302, 1121, 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, 1842, 67, 4424, 12, 2890, 4672, 364, 3885, 316, 261, 542, 16, 23462, 4672, 268, 273, 3885, 12, 2890, 18, 72, 18, 2452, 10756, 394, 273, 10893, 18, 17135, 12, 3108, 18, 13302, 1121, 12,...
def setUp(self):
def setUp(self):
def _test_currency(self, value, out, **format_opts): self.assertEqual(locale.currency(value, **format_opts), out)
728388af075aafcab93ed25c4da71bb6877a5e55 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/728388af075aafcab93ed25c4da71bb6877a5e55/test_locale.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3813, 67, 7095, 12, 2890, 16, 460, 16, 596, 16, 2826, 2139, 67, 4952, 4672, 365, 18, 11231, 5812, 12, 6339, 18, 7095, 12, 1132, 16, 2826, 2139, 67, 4952, 3631, 596, 13, 2, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3813, 67, 7095, 12, 2890, 16, 460, 16, 596, 16, 2826, 2139, 67, 4952, 4672, 365, 18, 11231, 5812, 12, 6339, 18, 7095, 12, 1132, 16, 2826, 2139, 67, 4952, 3631, 596, 13, 2, -100,...