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
ret = _check_empty_program(context, 'SHCXX', text, 'C++')
ret = _check_empty_program(context, 'SHCXX', text, 'C++', use_shared = True)
def CheckSHCXX(context): """ Configure check for a working shared CXX compiler. This checks whether the CXX compiler, as defined in the $SHCXX construction variable, can compile a CXX source file. It uses the current $SHCXXCOM value too, so that it can test against non working flags. """ context.Display("Checking whether the (shared) C++ compiler works") text = """
d7f19d0adcb540ba9db107a53714bc50856c4772 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12817/d7f19d0adcb540ba9db107a53714bc50856c4772/Conftest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2073, 2664, 39, 5619, 12, 2472, 4672, 3536, 11758, 866, 364, 279, 5960, 5116, 385, 5619, 5274, 18, 225, 1220, 4271, 2856, 326, 385, 5619, 5274, 16, 487, 2553, 316, 326, 271, 2664, 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, 2073, 2664, 39, 5619, 12, 2472, 4672, 3536, 11758, 866, 364, 279, 5960, 5116, 385, 5619, 5274, 18, 225, 1220, 4271, 2856, 326, 385, 5619, 5274, 16, 487, 2553, 316, 326, 271, 2664, 39, ...
if gungamelib.getGlobal('gungame_currentmap_prefix') == 'de' and gungamelib.getVariableValue('gg_player_defuser') > 0:
if len(es.createentitylist('func_bomb_target')) and gungamelib.getVariableValue('gg_player_defuser') > 0:
def player_spawn(event_var): userid = int(event_var['userid']) gungamePlayer = gungamelib.getPlayer(userid) if gungamelib.isSpectator(userid): return if gungamelib.isDead(userid): return # Reset AFK status if not es.isbot(userid): gamethread.delayed(0.6, gungamePlayer.resetPlayerLocation, ()) # Check to see if the WarmUp Round is Active if not gungamelib.getGlobal('isWarmup'): # Since the WarmUp Round is not Active, give the player the weapon relevant to their level gungamePlayer.giveWeapon() levelInfoHint(userid) if gungamelib.getVariableValue('gg_map_obj') > 1: # Check to see if this player is a CT if int(event_var['es_userteam']) == 3: # Are we in a de_ map and want to give defuser? if gungamelib.getGlobal('gungame_currentmap_prefix') == 'de' and gungamelib.getVariableValue('gg_player_defuser') > 0: # Get player object playerlibPlayer = playerlib.getPlayer(userid) # Make sure the player doesn't already have a defuser if not playerlibPlayer.get('defuser'): es.delayed(0, 'es_xgive %d item_defuser' % userid)
7e69bb95a56d48637acdc3e83635e6a7231045a3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4575/7e69bb95a56d48637acdc3e83635e6a7231045a3/gungame.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7291, 67, 1752, 9533, 12, 2575, 67, 1401, 4672, 6709, 273, 509, 12, 2575, 67, 1401, 3292, 8339, 19486, 31475, 13957, 12148, 273, 314, 20651, 9925, 495, 18, 588, 12148, 12, 8339, 13, 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, 7291, 67, 1752, 9533, 12, 2575, 67, 1401, 4672, 6709, 273, 509, 12, 2575, 67, 1401, 3292, 8339, 19486, 31475, 13957, 12148, 273, 314, 20651, 9925, 495, 18, 588, 12148, 12, 8339, 13, 225,...
duel = [duel for duel in self.duels if shooter in duel]
duel = [duel for duel in self.duels if shooter.lower() in duel]
def fire(self, event, weapon): shooter = event.sender['nick'] duel = [duel for duel in self.duels if shooter in duel]
aa1ed27d2fb49c3312b8631fd7d267394e04ddf2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12048/aa1ed27d2fb49c3312b8631fd7d267394e04ddf2/games.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4452, 12, 2890, 16, 871, 16, 732, 28629, 4672, 699, 7253, 273, 871, 18, 15330, 3292, 17091, 3546, 9978, 292, 273, 306, 2544, 292, 364, 9978, 292, 316, 365, 18, 2544, 10558, 309, 699, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4452, 12, 2890, 16, 871, 16, 732, 28629, 4672, 699, 7253, 273, 871, 18, 15330, 3292, 17091, 3546, 9978, 292, 273, 306, 2544, 292, 364, 9978, 292, 316, 365, 18, 2544, 10558, 309, 699, 7...
return self.__wids.keys()
return self._wids.keys()
def words(self): return self.__wids.keys()
b3cb1b87a5d4acd119615e3a4c2e367913509ec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/b3cb1b87a5d4acd119615e3a4c2e367913509ec1/Lexicon.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4511, 12, 2890, 4672, 327, 365, 16186, 91, 2232, 18, 2452, 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, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4511, 12, 2890, 4672, 327, 365, 16186, 91, 2232, 18, 2452, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
""" Recomputes the next unused timestep from scratch """
""" invalidateCurrentTime() -> None Recomputes the next unused timestep from scratch """
def invalidateCurrentTime(self): """ Recomputes the next unused timestep from scratch """ self.latestTime = 1 for time in self.actionMap.keys(): if time >= self.latestTime: self.latestTime = time + 1
0d08a982cb8d26e26f2e6ab32b89ef18e54df8fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6341/0d08a982cb8d26e26f2e6ab32b89ef18e54df8fb/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11587, 3935, 950, 12, 2890, 4672, 3536, 11587, 3935, 950, 1435, 317, 599, 868, 13406, 281, 326, 1024, 10197, 27072, 628, 15289, 3536, 365, 18, 13550, 950, 273, 404, 364, 813, 316, 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, 11587, 3935, 950, 12, 2890, 4672, 3536, 11587, 3935, 950, 1435, 317, 599, 868, 13406, 281, 326, 1024, 10197, 27072, 628, 15289, 3536, 365, 18, 13550, 950, 273, 404, 364, 813, 316, 365, 1...
lInitialListOfServers = [ sGateway ]
lInitialListOfServers = sGateway
def __refresh( self ): self.iLastUpdateTime = time.time() gLogger.debug( "Refreshing configuration..." ) sGateway = getGatewayURL() updatingErrorsList = [] if sGateway: lInitialListOfServers = [ sGateway ] gLogger.debug( "Using configuration gateway", str( lInitialListOfServers[0] ) ) else: lInitialListOfServers = gConfigurationData.getServers() gLogger.debug( "Refreshing from list %s" % str( lInitialListOfServers ) ) lRandomListOfServers = List.randomize( lInitialListOfServers ) gLogger.debug( "Randomized server list is %s" % ", ".join( lRandomListOfServers ) )
7f89efa67d91360bdb75ddf53bab5a964b97a593 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/7f89efa67d91360bdb75ddf53bab5a964b97a593/Refresher.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9144, 12, 365, 262, 30, 365, 18, 77, 3024, 1891, 950, 273, 813, 18, 957, 1435, 314, 3328, 18, 4148, 12, 315, 8323, 310, 1664, 7070, 262, 272, 5197, 273, 336, 5197, 1785, 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, 1001, 9144, 12, 365, 262, 30, 365, 18, 77, 3024, 1891, 950, 273, 813, 18, 957, 1435, 314, 3328, 18, 4148, 12, 315, 8323, 310, 1664, 7070, 262, 272, 5197, 273, 336, 5197, 1785, 1435, ...
sage: print L
sage: L
def next_conjugate(L): """ Permute L[r, c] = e to the conjugate L[c, e] = r We assume that L is an n by n matrix and has values in the range 0, 1, ..., n-1. EXAMPLES: sage: from sage.combinat.matrices.latin import * sage: L = back_circulant(6) sage: print L [0 1 2 3 4 5] [1 2 3 4 5 0] [2 3 4 5 0 1] [3 4 5 0 1 2] [4 5 0 1 2 3] [5 0 1 2 3 4] sage: print next_conjugate(L) [0 1 2 3 4 5] [5 0 1 2 3 4] [4 5 0 1 2 3] [3 4 5 0 1 2] [2 3 4 5 0 1] [1 2 3 4 5 0] sage: L == next_conjugate(next_conjugate(next_conjugate(L))) True """ assert L.nrows() == L.ncols() n = L.nrows() C = LatinSquare(n, n) for r in range(n): for c in range(n): e = L[r, c] assert e >= 0 and e < n C[c, e] = r return C
0d333d6beb48cce2a6cb9f6c18b5d14e9b0765b2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/0d333d6beb48cce2a6cb9f6c18b5d14e9b0765b2/latin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1024, 67, 591, 78, 31529, 12, 48, 4672, 3536, 13813, 624, 511, 63, 86, 16, 276, 65, 273, 425, 358, 326, 10550, 31529, 511, 63, 71, 16, 425, 65, 273, 436, 225, 1660, 6750, 716, 511, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1024, 67, 591, 78, 31529, 12, 48, 4672, 3536, 13813, 624, 511, 63, 86, 16, 276, 65, 273, 425, 358, 326, 10550, 31529, 511, 63, 71, 16, 425, 65, 273, 436, 225, 1660, 6750, 716, 511, ...
sym = "Grid Plane"
sym = "GridPlane"
def _copy_fixup_at_end(self): # warning [bruce 050704]: some of this code is copied in jig_Gamess.py's Gamess.cm_duplicate method. """[Private method] This runs at the end of a copy operation to copy attributes from the old jig (which could have been done at the start but might as well be done now for most of them) and copy atom refs (which has to be done now in case some atoms were not copied when the jig itself was). Self is the copy, self._orig is the original. """ orig = self._orig del self._orig mapping = self._mapping del self._mapping copy = self orig.copy_copyable_attrs_to(copy) # replaces .name set by __init__ self.own_mutable_copyable_attrs() # eliminate unwanted sharing of mutable copyable_attrs if orig.picked: # clean up weird color attribute situation (since copy is not picked) # by modifying color attrs as if we unpicked the copy self.color = self.normcolor #nuats = [] #for atom in orig.atoms: #nuat = mapping.mapper(atom) #if nuat is not None: #nuats.append(nuat) #if len(nuats) < len(orig.atoms) and not self.name.endswith('-frag'): # similar code is in chunk, both need improving #self.name += '-frag' #if nuats or not self.needs_atoms_to_survive(): #self.setAtoms(nuats) #else: ##bruce 050704 to fix bug 743 #self.kill() #e jig classes with atom-specific info would have to do more now... we could call a 2nd method here... # or use list of classnames to search for more and more specific methods to call... # or just let subclasses extend this method in the usual way (maybe not doing those dels above). return
c2e8824f3efdabedf3bda39b6e6a92c68261d6d1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/c2e8824f3efdabedf3bda39b6e6a92c68261d6d1/jigs_planes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3530, 67, 904, 416, 67, 270, 67, 409, 12, 2890, 4672, 468, 3436, 306, 2848, 3965, 374, 3361, 27, 3028, 14542, 2690, 434, 333, 981, 353, 9268, 316, 525, 360, 67, 43, 301, 403, 18...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3530, 67, 904, 416, 67, 270, 67, 409, 12, 2890, 4672, 468, 3436, 306, 2848, 3965, 374, 3361, 27, 3028, 14542, 2690, 434, 333, 981, 353, 9268, 316, 525, 360, 67, 43, 301, 403, 18...
while self._peek('LITERAL_DOLLAR_SIGN', 'START_DIRECTIVE', 'SPACE', 'NEWLINE', 'START_PLACEHOLDER', 'TEXT', "'
while self._peek('LITERAL_DOLLAR_SIGN', 'LITERAL_FOWARD_SLASH', 'START_DIRECTIVE', 'SPACE', 'NEWLINE', 'START_PLACEHOLDER', 'TEXT', "'
_def = DefNode(ID)
9deb9fa6d2d20c20af52d535e3f6984d94eca8ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4381/9deb9fa6d2d20c20af52d535e3f6984d94eca8ac/parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 389, 536, 273, 10922, 907, 12, 734, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 389, 536, 273, 10922, 907, 12, 734, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
msgnode += self.reporter.severe('Duplicate ID: "%s".' % id)
msg = self.reporter.severe('Duplicate ID: "%s".' % id) if msgnode != None: msgnode += msg
def set_id(self, node, msgnode=None): if node.has_key('id'): id = node['id'] if self.ids.has_key(id) and self.ids[id] is not node: msgnode += self.reporter.severe('Duplicate ID: "%s".' % id) else: if node.has_key('name'): id = make_id(node['name']) else: id = '' while not id or self.ids.has_key(id): id = 'id%s' % self.id_start self.id_start += 1 node['id'] = id self.ids[id] = node return id
07f64dd440ff9fc085cd61ecbe5cc0af45cd6007 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/07f64dd440ff9fc085cd61ecbe5cc0af45cd6007/nodes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 350, 12, 2890, 16, 756, 16, 1234, 2159, 33, 7036, 4672, 309, 756, 18, 5332, 67, 856, 2668, 350, 11, 4672, 612, 273, 756, 3292, 350, 3546, 309, 365, 18, 2232, 18, 5332, 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, 444, 67, 350, 12, 2890, 16, 756, 16, 1234, 2159, 33, 7036, 4672, 309, 756, 18, 5332, 67, 856, 2668, 350, 11, 4672, 612, 273, 756, 3292, 350, 3546, 309, 365, 18, 2232, 18, 5332, 67, ...
settimer(0, self._socketReader, ())
settimer(2, self._socketReader, ())
def __init__(self, socket, info={}): """ <Purpose> Initializes the Multiplexer object. <Arguments> socket: Socket like object that is used for multiplexing """ # If we are given a socket, assume it is setup if socket != None: # Is everything setup? self.connectionInit = True
1112595c57cf306108462e6b856c4f207cb86c99 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/1112595c57cf306108462e6b856c4f207cb86c99/Multiplexer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2987, 16, 1123, 12938, 4672, 3536, 411, 10262, 4150, 34, 10188, 3128, 326, 13531, 92, 264, 733, 18, 225, 411, 4628, 34, 2987, 30, 8758, 3007, 733, 716, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2987, 16, 1123, 12938, 4672, 3536, 411, 10262, 4150, 34, 10188, 3128, 326, 13531, 92, 264, 733, 18, 225, 411, 4628, 34, 2987, 30, 8758, 3007, 733, 716, 3...
'to' : "%s@%s/%s" % (channel, self.muc, self.username + '-' + self.resource) })
'to' : to })
def handle_io_in(self, data): print(data) data = data self.parser.feed(data)
aafda75ca94ff8f2803d1d92990754394881af8a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8801/aafda75ca94ff8f2803d1d92990754394881af8a/logxmpp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 1594, 67, 267, 12, 2890, 16, 501, 4672, 1172, 12, 892, 13, 501, 273, 501, 365, 18, 4288, 18, 7848, 12, 892, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 1594, 67, 267, 12, 2890, 16, 501, 4672, 1172, 12, 892, 13, 501, 273, 501, 365, 18, 4288, 18, 7848, 12, 892, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
"""Throttles bandwidth and number of connections.
""" Throttles bandwidth and number of connections.
def unthrottleWrites(self): # Write some data if self._tempDataBuffer: assert self.factory.registerWritten(len(self._tempDataBuffer[0])) self._tempDataLength -= len(self._tempDataBuffer[0]) ProtocolWrapper.write(self, self._tempDataBuffer.pop(0)) assert self._tempDataLength >= 0
58eccda74a195382b889cef4bef5351d7ade115f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/665/58eccda74a195382b889cef4bef5351d7ade115f/policies.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 640, 27971, 298, 8368, 12, 2890, 4672, 468, 2598, 2690, 501, 309, 365, 6315, 5814, 751, 1892, 30, 1815, 365, 18, 6848, 18, 4861, 12643, 12, 1897, 12, 2890, 6315, 5814, 751, 1892, 63, 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, 640, 27971, 298, 8368, 12, 2890, 4672, 468, 2598, 2690, 501, 309, 365, 6315, 5814, 751, 1892, 30, 1815, 365, 18, 6848, 18, 4861, 12643, 12, 1897, 12, 2890, 6315, 5814, 751, 1892, 63, 2...
possible_display_types = [ ]
possible = [ ]
def eventhandler(self, event, menuw=None): if event == DIRECTORY_CHANGE_DISPLAY_TYPE and self.item_menu.visible: possible_display_types = [ ]
e29d880d94d54392035abf993d3ebc58250e2320 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/e29d880d94d54392035abf993d3ebc58250e2320/directory.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 871, 4176, 12, 2890, 16, 871, 16, 3824, 91, 33, 7036, 4672, 309, 871, 422, 5707, 67, 14473, 67, 17463, 67, 2399, 471, 365, 18, 1726, 67, 5414, 18, 8613, 30, 3323, 67, 5417, 67, 2352,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 871, 4176, 12, 2890, 16, 871, 16, 3824, 91, 33, 7036, 4672, 309, 871, 422, 5707, 67, 14473, 67, 17463, 67, 2399, 471, 365, 18, 1726, 67, 5414, 18, 8613, 30, 3323, 67, 5417, 67, 2352,...
self.inc_dir = n+self.lib+'.framework/Versions/Current/Headers' self.cflags = '-Ddarwin -Xlinker "-F'+n+self.lib+'.framework" -Xlinker "-framework" -Xlinker "'+self.lib+'"'
self.inc_dir = framework_root+self.lib+'.framework/Versions/Current/Headers' self.cflags = '-Ddarwin -Xlinker "-F'+framework_root+self.lib+'.framework" -Xlinker "-framework" -Xlinker "'+self.lib+'"'
def configure(self, incdirs, libdirs): for n in '/Library/Frameworks/','~/Library/Frameworks/','/System/Library/Frameworks/': if os.path.isfile(n+self.lib+'.framework/Versions/Current/'+self.lib): print 'Framework '+self.lib+' found' self.found = 1 self.inc_dir = n+self.lib+'.framework/Versions/Current/Headers' self.cflags = '-Ddarwin -Xlinker "-F'+n+self.lib+'.framework" -Xlinker "-framework" -Xlinker "'+self.lib+'"' self.origlib = self.lib self.lib = '' return print 'Framework '+self.lib+' not found'
3a3c0653360d63e7ac10f254afdab7a96885c003 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1298/3a3c0653360d63e7ac10f254afdab7a96885c003/config_darwin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5068, 12, 2890, 16, 7290, 8291, 16, 2561, 8291, 4672, 364, 290, 316, 1173, 9313, 19, 13701, 87, 19, 17023, 98, 19, 9313, 19, 13701, 87, 19, 17023, 19, 3163, 19, 9313, 19, 13701, 87, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5068, 12, 2890, 16, 7290, 8291, 16, 2561, 8291, 4672, 364, 290, 316, 1173, 9313, 19, 13701, 87, 19, 17023, 98, 19, 9313, 19, 13701, 87, 19, 17023, 19, 3163, 19, 9313, 19, 13701, 87, ...
return False
return False
def move(self, newtitle, reason=None, movetalkpage=True, sysop=False, throttle=True): """Move this page to new title given by newtitle.""" if throttle: put_throttle() if reason == None: reason = input(u'Please enter a reason for the move:') if self.isTalkPage(): movetalkpage = False host = self.site().hostname() address = self.site().move_address() self.site().forceLogin(sysop = sysop) token = self.site().getToken(self, sysop = sysop) predata = { 'wpOldTitle': self.title().encode(self.site().encoding()), 'wpNewTitle': newtitle.encode(self.site().encoding()), 'wpReason': reason.encode(self.site().encoding()), } if movetalkpage: predata['wpMovetalk'] = '1' else: predata['wpMovetalk'] = '0' if token: predata['wpEditToken'] = token if self.site().hostname() in config.authenticate.keys(): predata['Content-type'] = 'application/x-www-form-urlencoded' predata['User-agent'] = useragent data = self.site().urlEncode(predata) response = urllib2.urlopen(urllib2.Request(self.site().protocol() + '://' + self.site().hostname() + address, data)) data = '' else: response, data = self.site().postForm(address, predata, sysop = sysop) if data == u'': output(u'Page %s moved to %s' % (self.title(), newtitle)) return True else: if self.site().mediawiki_message('articleexists') in data: output(u'Page moved failed: Target page [[%s]] already exists.' % newtitle) else: output(u'Page move failed for unknown reason.') try: ibegin = data.index('<!-- start content -->') + 22 iend = data.index('<!-- end content -->') except ValueError: # if begin/end markers weren't found, show entire HTML file output(data) else: # otherwise, remove the irrelevant sections data = data[ibegin:iend] output(data) return False
0f12fda07ed68344bb75cde28e607e646bc2461b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/0f12fda07ed68344bb75cde28e607e646bc2461b/wikipedia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3635, 12, 2890, 16, 394, 2649, 16, 3971, 33, 7036, 16, 5730, 278, 2960, 2433, 33, 5510, 16, 2589, 556, 33, 8381, 16, 18304, 33, 5510, 4672, 3536, 7607, 333, 1363, 358, 394, 2077, 864, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3635, 12, 2890, 16, 394, 2649, 16, 3971, 33, 7036, 16, 5730, 278, 2960, 2433, 33, 5510, 16, 2589, 556, 33, 8381, 16, 18304, 33, 5510, 4672, 3536, 7607, 333, 1363, 358, 394, 2077, 864, ...
print f.filename,
print f.basename,
def AjouteZero(n): N = str(n) a = [] for i in range(len(N),4): a.append("0") a.append(N) return "".join(a)
fa387e11472a25e2e3457e7b4d51b0c30256b243 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5108/fa387e11472a25e2e3457e7b4d51b0c30256b243/liste_exo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 432, 78, 2571, 7170, 12, 82, 4672, 423, 273, 609, 12, 82, 13, 279, 273, 5378, 364, 277, 316, 1048, 12, 1897, 12, 50, 3631, 24, 4672, 279, 18, 6923, 2932, 20, 7923, 279, 18, 6923, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 432, 78, 2571, 7170, 12, 82, 4672, 423, 273, 609, 12, 82, 13, 279, 273, 5378, 364, 277, 316, 1048, 12, 1897, 12, 50, 3631, 24, 4672, 279, 18, 6923, 2932, 20, 7923, 279, 18, 6923, 1...
return page_not_authorized(req, "../", text="You are not authorized to view this collection.", navmenuid='search')
cookie = mail_cookie_create_authorize_action(VIEWRESTRCOLL, {'collection' : coll}) target = CFG_SITE_SECURE_URL + '/youraccount/login' + \ make_canonical_urlargd({'action' : cookie, 'ln' : argd['ln'], 'referer' : req.unparsed_uri}, {}) return redirect_to_url(req, target)
def authenticate(self, req, form): """Restricted search results pages."""
a647562785273f2640d1f0b15ea97a96f2bf3519 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2139/a647562785273f2640d1f0b15ea97a96f2bf3519/websearch_webinterface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8929, 12, 2890, 16, 1111, 16, 646, 4672, 3536, 18784, 1623, 1686, 4689, 12123, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 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, 8929, 12, 2890, 16, 1111, 16, 646, 4672, 3536, 18784, 1623, 1686, 4689, 12123, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
haveBouquets = csel.bouquet_root.getPath().find('FROM BOUQUET "bouquets.') != -1
haveBouquets = config.usage.multibouquet.value
def __init__(self, session, csel): Screen.__init__(self, session) self.csel = csel self.bsel = None
aa9f2235e7298a65c143678a8b75eaf6ed842462 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/aa9f2235e7298a65c143678a8b75eaf6ed842462/ChannelSelection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1339, 16, 276, 1786, 4672, 10146, 16186, 2738, 972, 12, 2890, 16, 1339, 13, 365, 18, 71, 1786, 273, 276, 1786, 365, 18, 70, 1786, 273, 599, 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, 1001, 2738, 972, 12, 2890, 16, 1339, 16, 276, 1786, 4672, 10146, 16186, 2738, 972, 12, 2890, 16, 1339, 13, 365, 18, 71, 1786, 273, 276, 1786, 365, 18, 70, 1786, 273, 599, 2, -100, -1...
.todict() @returns({1:2, 2:4, 3:6, 4:8}) def todict_2(self):
.to_dict() @returns({2:1, 4:2, 6:3, 8:4}) def to_dict_2(self):
def todict_1(self): return Query(self.L) \ .where(lambda n: n <= 4) \ .select(lambda n: (n, 2*n)) \ .todict()
f134b825431ac82f3dbba76e7a945a0e195d27cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14315/f134b825431ac82f3dbba76e7a945a0e195d27cf/pyquery.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 1576, 67, 21, 12, 2890, 4672, 327, 2770, 12, 2890, 18, 48, 13, 521, 263, 6051, 12, 14661, 290, 30, 290, 1648, 1059, 13, 521, 263, 4025, 12, 14661, 290, 30, 261, 82, 16, 576, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 358, 1576, 67, 21, 12, 2890, 4672, 327, 2770, 12, 2890, 18, 48, 13, 521, 263, 6051, 12, 14661, 290, 30, 290, 1648, 1059, 13, 521, 263, 4025, 12, 14661, 290, 30, 261, 82, 16, 576, 1...
if f.endswith('.xpi') CopyFileToDir(f, upload_dir, latestPath)
if f.endswith('.xpi'): CopyFileToDir(f, upload_dir, latestPath)
def ReleaseToLatest(options, upload_dir, files): latestDir = LATEST_DIR % {'branch': options.branch} latestPath = os.path.join(NIGHTLY_PATH, latestDir) for f in files: if f.endswith('.xpi') CopyFileToDir(f, upload_dir, latestPath)
de3ede9e12d0e21e3522c409e6821dd1a378973f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6206/de3ede9e12d0e21e3522c409e6821dd1a378973f/post_upload.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10819, 774, 18650, 12, 2116, 16, 3617, 67, 1214, 16, 1390, 4672, 4891, 1621, 273, 511, 1777, 882, 67, 4537, 738, 13666, 7500, 4278, 702, 18, 7500, 97, 4891, 743, 273, 1140, 18, 803, 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, 10819, 774, 18650, 12, 2116, 16, 3617, 67, 1214, 16, 1390, 4672, 4891, 1621, 273, 511, 1777, 882, 67, 4537, 738, 13666, 7500, 4278, 702, 18, 7500, 97, 4891, 743, 273, 1140, 18, 803, 18...
if name[0] == '(' and name[-1] == ')' and not show_hidden: continue
def getbrowserdata(self, show_hidden=1): self.packages = self.pimpdb.list() rv = [] for pkg in self.packages: name = pkg.fullname() if name[0] == '(' and name[-1] == ')' and not show_hidden: continue status, _ = pkg.installed() description = pkg.description() rv.append((status, name, description)) return rv
f776dee6dd3d11f084071f52200838aeed0f4613 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f776dee6dd3d11f084071f52200838aeed0f4613/PackageManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 11213, 892, 12, 2890, 16, 2405, 67, 6345, 33, 21, 4672, 365, 18, 10308, 273, 365, 18, 84, 14532, 1966, 18, 1098, 1435, 5633, 273, 5378, 364, 3475, 316, 365, 18, 10308, 30, 508, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 11213, 892, 12, 2890, 16, 2405, 67, 6345, 33, 21, 4672, 365, 18, 10308, 273, 365, 18, 84, 14532, 1966, 18, 1098, 1435, 5633, 273, 5378, 364, 3475, 316, 365, 18, 10308, 30, 508, ...
def start (self, flag=None):
def start(self, flag=None):
def start (self, flag=None): self.flag = flag threading.Thread.start(self)
f08683542eada763321715f558eac5b2baec28e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/f08683542eada763321715f558eac5b2baec28e9/test_ssl.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 12, 2890, 16, 2982, 33, 7036, 4672, 365, 18, 6420, 273, 2982, 17254, 18, 3830, 18, 1937, 12, 2890, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 12, 2890, 16, 2982, 33, 7036, 4672, 365, 18, 6420, 273, 2982, 17254, 18, 3830, 18, 1937, 12, 2890, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
job_model = parser_mod0.job.expect_new(results)
job_model = self.god.create_mock_class_obj(parser_mod0.job, "pjob")
def test_init_parser(self): self.construct_server_job()
3fbf5de3716612299fc4cd4fc97c170486dccae9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/3fbf5de3716612299fc4cd4fc97c170486dccae9/base_server_job_unittest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2738, 67, 4288, 12, 2890, 4672, 365, 18, 10062, 67, 3567, 67, 4688, 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...
[ 1, 1, 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, 1842, 67, 2738, 67, 4288, 12, 2890, 4672, 365, 18, 10062, 67, 3567, 67, 4688, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
root.update_idletasks() root.after_idle(update, root, statusbar, listbox)
root.update_idletasks() root.after_idle(update, root, statusbar, listbox)
def __init__(self, root): self.tkref = root self.tkref.title("Prolepsis 0.2.0")
a297d3735c8e07d10e9f1f8937e0131696e57ce3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4811/a297d3735c8e07d10e9f1f8937e0131696e57ce3/prolepsis.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1365, 4672, 365, 18, 16099, 1734, 273, 1365, 365, 18, 16099, 1734, 18, 2649, 2932, 626, 298, 1121, 291, 374, 18, 22, 18, 20, 7923, 2, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1365, 4672, 365, 18, 16099, 1734, 273, 1365, 365, 18, 16099, 1734, 18, 2649, 2932, 626, 298, 1121, 291, 374, 18, 22, 18, 20, 7923, 2, -100, -100, -100, ...
if self.objifacedefs.has_key(obj):
if obj in self.objifacedefs:
def _write_method(self, obj, name, ret, args): regex = ''.join([c+'_?' for c in obj.lower()]) mname, count = re.subn(regex, '', name, 1) if not count and self.prefix: mname = re.sub('^'+self.prefix+'_', '', mname) self.fp.write('(define-method ' + mname + '\n') self.fp.write(' (of-object "' + obj + '")\n') self.fp.write(' (c-name "' + name + '")\n') m = getset_pat.match(mname) if self.genpropgetsets and m and len(args[1:]) <= 1: prop = m.group(1) if self.objifacedefs.has_key(obj): oidef = self.objifacedefs[obj] if prop.replace('_', '-') in oidef.props: self.fp.write(' (prop-getset "' + prop + '")\n') self._write_return(ret) self._write_arguments(args[1:]) return
e857558ac6c8557b27e204d09917eff7eecdbddb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8659/e857558ac6c8557b27e204d09917eff7eecdbddb/defsgen.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 67, 2039, 12, 2890, 16, 1081, 16, 508, 16, 325, 16, 833, 4672, 3936, 273, 875, 18, 5701, 3816, 71, 6797, 67, 4899, 364, 276, 316, 1081, 18, 8167, 1435, 5717, 312, 529, 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, 389, 2626, 67, 2039, 12, 2890, 16, 1081, 16, 508, 16, 325, 16, 833, 4672, 3936, 273, 875, 18, 5701, 3816, 71, 6797, 67, 4899, 364, 276, 316, 1081, 18, 8167, 1435, 5717, 312, 529, 16,...
NonLinProblem.__prepare__(self)
def __prepare__(self): self.X = atleast_2d(self.X) self.Y = array(self.Y, float) #if self.Y.ndim NonLinProblem.__prepare__(self) if self.userProvided.df: assert len(self.user.df) == 1 self.dfff = self.user.df[0] def dff(x): r = zeros(self.n) for i in xrange(self.Y.shape[0]): #print asfarray(self.fff(x, self.X[i])-self.Y[i]), asfarray(self.dfff(x, self.X[i])) r += dot(2.0 * asfarray(self.fff(x, self.X[i])-self.Y[i]), asfarray(self.dfff(x, self.X[i]))) return r self.df = dff
bd79459bbdbec6cf52480d051ee152b56a727852 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6196/bd79459bbdbec6cf52480d051ee152b56a727852/DFP.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9366, 972, 12, 2890, 4672, 365, 18, 60, 273, 20098, 67, 22, 72, 12, 2890, 18, 60, 13, 365, 18, 61, 273, 526, 12, 2890, 18, 61, 16, 1431, 13, 468, 430, 365, 18, 61, 18, 82, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 9366, 972, 12, 2890, 4672, 365, 18, 60, 273, 20098, 67, 22, 72, 12, 2890, 18, 60, 13, 365, 18, 61, 273, 526, 12, 2890, 18, 61, 16, 1431, 13, 468, 430, 365, 18, 61, 18, 82, ...
outlets={}
def get_outlets_status(conn, options): outlets={} if (vmware_internal_type==VMWARE_TYPE_ESX): all_machines=vmware_run_command(options,True,"--operation list",0) all_machines_array=all_machines.splitlines() for machine in all_machines_array: machine_array=dsv_split(machine) if (len(machine_array)==4): if (machine_array[0] in outlets): fail_usage("Failed. More machines with same name %s found!"%(machine_array[0])) if (vmware_disconnected_hack): outlets[machine_array[0]]=("",( ((machine_array[2].lower() in ["poweredon"]) and (machine_array[3].lower()=="connected")) and "on" or "off")) else: outlets[machine_array[0]]=("",((machine_array[2].lower() in ["poweredon"]) and "on" or "off")) if ((vmware_internal_type==VMWARE_TYPE_SERVER1) or (vmware_internal_type==VMWARE_TYPE_SERVER2)): running_machines=vmware_run_command(options,True,"list",0) running_machines_array=running_machines.splitlines()[1:] if (vmware_internal_type==VMWARE_TYPE_SERVER2): all_machines=vmware_run_command(options,True,"listRegisteredVM",0) all_machines_array=all_machines.splitlines()[1:] elif (vmware_internal_type==VMWARE_TYPE_SERVER1): all_machines_array=running_machines_array for machine in all_machines_array: if (machine!=""): outlets[machine]=("",((machine in running_machines_array) and "on" or "off")) return outlets
1ab3e3473e5538d6c410332b62b796c7544f1e03 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6868/1ab3e3473e5538d6c410332b62b796c7544f1e03/fence_vmware.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 659, 17307, 67, 2327, 12, 4646, 16, 702, 4672, 309, 261, 3489, 2726, 67, 7236, 67, 723, 631, 7397, 28499, 67, 2399, 67, 3991, 60, 4672, 777, 67, 81, 10635, 33, 3489, 2726, 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, 336, 67, 659, 17307, 67, 2327, 12, 4646, 16, 702, 4672, 309, 261, 3489, 2726, 67, 7236, 67, 723, 631, 7397, 28499, 67, 2399, 67, 3991, 60, 4672, 777, 67, 81, 10635, 33, 3489, 2726, 6...
result['ParameterNames'] = copy.copy(self.TRANSPARAMS)
result['ParameterNames'] = copy.copy( self.TRANSPARAMS )
def getTransformations(self,condDict={},older=None, newer=None, timeStamp='CreationDate', orderAttribute=None, limit=None, extraParams=False,connection=False): """ Get parameters of all the Transformations with support for the web standard structure """ connection = self.__getConnection(connection) req = "SELECT %s FROM Transformations %s" % (intListToString(self.TRANSPARAMS),self.buildCondition(condDict, older, newer, timeStamp,orderAttribute,limit)) res = self._query(req,connection) if not res['OK']: return res webList = [] resultList = [] for row in res['Value']: # Prepare the structure for the web rList = [] transDict = {} count = 0 for item in row: transDict[self.TRANSPARAMS[count]] = item count += 1 if type(item) not in [IntType,LongType]: rList.append(str(item)) else: rList.append(item) webList.append(rList) if extraParams: res = self.__getAdditionalParameters(transDict['TransformationID'],connection=connection) if not res['OK']: return res transDict.update(res['Value']) resultList.append(transDict) result = S_OK(resultList) result['Records'] = webList result['ParameterNames'] = copy.copy(self.TRANSPARAMS) return result
9ad007ea503b29694fc081c1646b7c5ecd07b1f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9ad007ea503b29694fc081c1646b7c5ecd07b1f2/TransformationDB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 4059, 1012, 12, 2890, 16, 10013, 5014, 28793, 1498, 33, 7036, 16, 16069, 33, 7036, 16, 18198, 2218, 9906, 1626, 2187, 1353, 1499, 33, 7036, 16, 1800, 33, 7036, 16, 2870, 1370, 33, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 4059, 1012, 12, 2890, 16, 10013, 5014, 28793, 1498, 33, 7036, 16, 16069, 33, 7036, 16, 18198, 2218, 9906, 1626, 2187, 1353, 1499, 33, 7036, 16, 1800, 33, 7036, 16, 2870, 1370, 33, ...
install='make install PREFIX=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%(
install='make install CC=%s PREFIX=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%( CC,
def library_recipes(): result = [] if DEPTARGET < '10.5': result.extend([ dict( name="Bzip2 1.0.5", url="http://www.bzip.org/1.0.5/bzip2-1.0.5.tar.gz", checksum='3c15a0c8d1d3ee1c46a1634d00617b1a', configure=None, install='make install PREFIX=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%( shellQuote(os.path.join(WORKDIR, 'libraries')), ' -arch '.join(ARCHLIST), SDKPATH, ), ), dict( name="ZLib 1.2.3", url="http://www.gzip.org/zlib/zlib-1.2.3.tar.gz", checksum='debc62758716a169df9f62e6ab2bc634', configure=None, install='make install prefix=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%( shellQuote(os.path.join(WORKDIR, 'libraries')), ' -arch '.join(ARCHLIST), SDKPATH, ), ), dict( # Note that GNU readline is GPL'd software name="GNU Readline 5.1.4", url="http://ftp.gnu.org/pub/gnu/readline/readline-5.1.tar.gz" , checksum='7ee5a692db88b30ca48927a13fd60e46', patchlevel='0', patches=[ # The readline maintainers don't do actual micro releases, but # just ship a set of patches. 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-001', 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-002', 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-003', 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-004', ] ), dict( name="SQLite 3.6.11", url="http://www.sqlite.org/sqlite-3.6.11.tar.gz", checksum='7ebb099696ab76cc6ff65dd496d17858', configure_pre=[ '--enable-threadsafe', '--enable-tempstore', '--enable-shared=no', '--enable-static=yes', '--disable-tcl', ] ), dict( name="NCurses 5.5", url="http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.5.tar.gz", checksum='e73c1ac10b4bfc46db43b2ddfd6244ef', configure_pre=[ "--without-cxx", "--without-ada", "--without-progs", "--without-curses-h", "--enable-shared", "--with-shared", "--datadir=/usr/share", "--sysconfdir=/etc", "--sharedstatedir=/usr/com", "--with-terminfo-dirs=/usr/share/terminfo", "--with-default-terminfo-dir=/usr/share/terminfo", "--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib"%(getVersion(),), "--enable-termcap", ], patches=[ "ncurses-5.5.patch", ], useLDFlags=False, install='make && make install DESTDIR=%s && cd %s/usr/local/lib && ln -fs ../../../Library/Frameworks/Python.framework/Versions/%s/lib/lib* .'%( shellQuote(os.path.join(WORKDIR, 'libraries')), shellQuote(os.path.join(WORKDIR, 'libraries')), getVersion(), ), ), ]) result.extend([ dict( name="Sleepycat DB 4.7.25", url="http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz", checksum='ec2b87e833779681a0c3a814aa71359e', buildDir="build_unix", configure="../dist/configure", configure_pre=[ '--includedir=/usr/local/include/db4', ] ), ]) return result
fe74a6d0b4bf0e8a2a6c68b977a022a722fe66d7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/fe74a6d0b4bf0e8a2a6c68b977a022a722fe66d7/build-installer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5313, 67, 266, 3449, 281, 13332, 563, 273, 5378, 225, 309, 2030, 1856, 10987, 411, 296, 2163, 18, 25, 4278, 563, 18, 14313, 3816, 2065, 12, 508, 1546, 38, 4450, 22, 404, 18, 20, 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, 5313, 67, 266, 3449, 281, 13332, 563, 273, 5378, 225, 309, 2030, 1856, 10987, 411, 296, 2163, 18, 25, 4278, 563, 18, 14313, 3816, 2065, 12, 508, 1546, 38, 4450, 22, 404, 18, 20, 18, ...
images[stripNS(name)] = dict(url=item["thumburl"] or item['url'], descriptionurl=item['descriptionurl'], templates=item['templates'], contributors=item['contributors'])
images[name] = dict(url=item["thumburl"] or item['url'], descriptionurl=item['descriptionurl'], templates=item['templates'], contributors=item['contributors'])
def istemplate(name, item): nsmap = None src = item.get('source') if src: try: lang = src['language'] nsmap = namespace.namespace_maps['%s+en_mw' % lang] except KeyError: pass ns, partial, full = namespace.splitname(name, nsmap=nsmap) return ns == namespace.NS_TEMPLATE
6f31e619d0ab1ae87e77c19888def7bffa648037 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/6f31e619d0ab1ae87e77c19888def7bffa648037/fzipcreator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19165, 29761, 12, 529, 16, 761, 4672, 3153, 1458, 273, 599, 1705, 273, 761, 18, 588, 2668, 3168, 6134, 309, 1705, 30, 775, 30, 3303, 273, 1705, 3292, 4923, 3546, 3153, 1458, 273, 1981, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19165, 29761, 12, 529, 16, 761, 4672, 3153, 1458, 273, 599, 1705, 273, 761, 18, 588, 2668, 3168, 6134, 309, 1705, 30, 775, 30, 3303, 273, 1705, 3292, 4923, 3546, 3153, 1458, 273, 1981, ...
shiftString=shift
shiftString=shiftLabel[shift]
def getFOMLinks(gpsTime=int(0),ifo=("default")): """ Simple method returns a list of links to FOMs ordered by FOM # The list is 2D ie: [['ifo,shift',LINKtoImage,LinktoThumb],['ifo,shift',LinktoImage,LinkToThumb]...] images marked [Eve,Owl,Day] via [p3,p2,p1] in filenames this methd only for S6 and later IFO naming start dates: There were three naming conventions mixed, then p1,p2,p3 and lastly Day,Eve,Owl LHO: 20090724 :: 932428815 LLO: 20090708 :: 931046415 """ urls={ "DEFAULT":"http://www.ligo.caltech.edu/~pshawhan/scilinks.html", "V1":"http://wwwcascina.virgo.infn.it/DetectorOperations/index.htm", "L1":"https://llocds.ligo-la.caltech.edu/scirun/S6/robofom/%s/%s%s_FOM%i%s.gif", "H1":"http://lhocds.ligo-wa.caltech.edu/scirun/S6/robofom/%s/%s%s_FOM%i%s.gif", "H2":"http://lhocds.ligo-wa.caltech.edu/scirun/S6/robofom/%s/%s%s_FOM%i%s.gif" } ifoTag=ifo.upper() shiftDuration=8; #Give the IFO and shift start hour as integer shiftStandardTime={'L1':{'day':14,'eve':22,'owl':6}, 'H1':{'day':16,'eve':0,'owl':8}, 'H2':{'day':16,'eve':0,'owl':8}, 'V1':{'day':6,'eve':14,'owl':22}} shiftOrder=['day','eve','owl'] shiftLabel={'day':'p1','eve':'p3','owl':'p2'} outputURLs=list() if ((ifo==None) or (gpsTime==None)): sys.stdout.write("getFOMLinks called incorrectly \
6cd44b04b081138f0ba71fef8fcfaf1fc7a38e27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/6cd44b04b081138f0ba71fef8fcfaf1fc7a38e27/stfu_pipe.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2812, 51, 1495, 754, 87, 12, 75, 1121, 950, 33, 474, 12, 20, 3631, 20299, 33, 2932, 1886, 6, 3719, 30, 3536, 4477, 707, 1135, 279, 666, 434, 4716, 358, 478, 1872, 87, 5901, 635, 478,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2812, 51, 1495, 754, 87, 12, 75, 1121, 950, 33, 474, 12, 20, 3631, 20299, 33, 2932, 1886, 6, 3719, 30, 3536, 4477, 707, 1135, 279, 666, 434, 4716, 358, 478, 1872, 87, 5901, 635, 478,...
eq_(datetime.datetime.now(), now) patched.restore()
try: eq_(datetime.datetime.now(), now) finally: patched.restore() eq_(datetime.datetime.now, orig_datetime.now) def test_patch_builtin_as_string(): import datetime orig_datetime = datetime.datetime now = datetime.datetime(2006, 11, 4, 8, 19, 11, 28778) fake_dt = fudge.Fake('datetime').provides('now').returns(now) patched = fudge.patch_object('datetime', 'datetime', fake_dt) try: eq_(datetime.datetime.now().timetuple(), now.timetuple()) finally: patched.restore()
def test_patch_builtin(): import datetime orig_datetime = datetime.datetime now = datetime.datetime(2010, 11, 4, 8, 19, 11, 28778) fake = fudge.Fake('now', callable=True).returns(now) patched = fudge.patch_object(datetime.datetime, 'now', fake) eq_(datetime.datetime.now(), now) patched.restore() eq_(datetime.datetime.now, orig_datetime.now)
a93ca303de3659460ff54d7744d0ccf5ac6c5609 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3602/a93ca303de3659460ff54d7744d0ccf5ac6c5609/test_patcher.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2272, 67, 24553, 13332, 1930, 3314, 1647, 67, 6585, 273, 3314, 18, 6585, 2037, 273, 3314, 18, 6585, 12, 6734, 20, 16, 4648, 16, 1059, 16, 1725, 16, 5342, 16, 4648, 16, 9131, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2272, 67, 24553, 13332, 1930, 3314, 1647, 67, 6585, 273, 3314, 18, 6585, 2037, 273, 3314, 18, 6585, 12, 6734, 20, 16, 4648, 16, 1059, 16, 1725, 16, 5342, 16, 4648, 16, 9131, ...
self.assert_(self.done.get(True, 1))
self._waitThreads() self.failUnlessEqual(self.done.get_nowait(), 'EXC') @_Repeat
def testExclusiveBlocksExclusive(self): _decoratorlock.acquire() Thread(target=self._doItExclusive).start() # give it a bit of time to check that it's not actually doing anything self.assertRaises(Queue.Empty, self.done.get, True, 0.2) _decoratorlock.release() self.assert_(self.done.get(True, 1))
4607c978b8f973b63c49547f1b8d6061fdbd78d3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/4607c978b8f973b63c49547f1b8d6061fdbd78d3/ganeti.locking_unittest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 17075, 6450, 17075, 12, 2890, 4672, 389, 19142, 739, 18, 1077, 1039, 1435, 4884, 12, 3299, 33, 2890, 6315, 2896, 7193, 17075, 2934, 1937, 1435, 468, 8492, 518, 279, 2831, 434, 813, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 17075, 6450, 17075, 12, 2890, 4672, 389, 19142, 739, 18, 1077, 1039, 1435, 4884, 12, 3299, 33, 2890, 6315, 2896, 7193, 17075, 2934, 1937, 1435, 468, 8492, 518, 279, 2831, 434, 813, ...
self.div(id="div_"+secnum , style='display:none;') def add_section(self, tag, title=""):
if open_by_default: style = 'display:block;' else: style = 'display:none;' self.div(id="div_"+secnum , style=style) def add_section(self, tag, title="", open_by_default=False):
def __init__(self, tag, title="", secnum="1", pagenum="1", level=2): markup.page.__init__(self, mode="strict_html") self.pagenum = pagenum self.secnum = secnum self._title = title self.sections = {} self.section_ids = [] self.level = level self.tag = tag self.id = tag + self.secnum self.tables = 0 self.add('<div class="contenu"><h%d id="toggle_%s" onclick="javascript:toggle2(\'div_%s\', \'toggle_%s\');"> %s.%s %s </h%d>' % (level, self.id, secnum, self.id, pagenum, secnum, title, level) ) self.div(id="div_"+secnum , style='display:none;')
4a1883f5d99ab45340837694512c34f07e262d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/4a1883f5d99ab45340837694512c34f07e262d9d/cbcwebpage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1047, 16, 2077, 1546, 3113, 1428, 2107, 1546, 21, 3113, 4262, 7924, 1546, 21, 3113, 1801, 33, 22, 4672, 9813, 18, 2433, 16186, 2738, 972, 12, 2890, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1047, 16, 2077, 1546, 3113, 1428, 2107, 1546, 21, 3113, 4262, 7924, 1546, 21, 3113, 1801, 33, 22, 4672, 9813, 18, 2433, 16186, 2738, 972, 12, 2890, 16, 1...
('prep', 'prep_script', "%setup"),
('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"),
def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version().replace('-','_'), '%define release ' + self.release.replace('-','_'), '', 'Summary: ' + self.distribution.get_description(), ]
c8d525acd88ca122ba90a3c0f660267e5259e286 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/c8d525acd88ca122ba90a3c0f660267e5259e286/bdist_rpm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6540, 67, 2793, 67, 768, 12, 2890, 4672, 3536, 4625, 326, 977, 434, 392, 534, 12728, 857, 585, 471, 327, 518, 487, 279, 666, 434, 2064, 261, 476, 1534, 980, 2934, 3536, 468, 6377,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6540, 67, 2793, 67, 768, 12, 2890, 4672, 3536, 4625, 326, 977, 434, 392, 534, 12728, 857, 585, 471, 327, 518, 487, 279, 666, 434, 2064, 261, 476, 1534, 980, 2934, 3536, 468, 6377,...
sage: A = monsky_washnitzer.matrix_of_frobenius( ... x^3 - x + R(1/4), p, M)
sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), p, M)
def matrix_of_frobenius(Q, p, M, trace=None, compute_exact_forms=False): """ Computes the matrix of Frobenius on Monsky-Washnitzer cohomology, with respect to the basis $(dx/y, x dx/y)$. INPUT: Q -- cubic polynomial $Q(x) = x^3 + ax + b$ defining an elliptic curve E by $y^2 = Q(x)$. The coefficient ring of Q should be a $\Z/(p^M)\Z$-algebra in which the matrix of frobenius will be constructed. p -- prime >= 5 for which E has good reduction M -- integer >= 2; $p$-adic precision of the coefficient ring trace -- (optional) the trace of the matrix, if known in advance. This is easy to compute because it's just the $a_p$ of the curve. If the trace is supplied, matrix_of_frobenius will use it to speed the computation (i.e. we know the determinant is $p$, so we have two conditions, so really only column of the matrix needs to be computed. It's actually a little more complicated than that, but that's the basic idea.) If trace=None, then both columns will be computed independently, and you can get a strong indication of correctness by verifying the trace afterwards. WARNING: -- THE RESULT WILL NOT NECESSARILY BE CORRECT TO M p-ADIC DIGITS. If you want prec digits of precision, you need to use the function adjusted_prec(), and then you need to reduce the answer mod p^prec at the end. OUTPUT: 2x2 matrix of frobenius on Monsky-Washnitzer cohomology, with entries in the coefficient ring of Q. EXAMPLES: A simple example: sage: p = 5 sage: prec = 3 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: M 5 sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), p, M) sage: A [3090 187] [2945 408] But the result is only accurate to prec digits: sage: B = A.change_ring(Integers(p**prec)) sage: B [90 62] [70 33] Check trace (123 = -2 mod 125) and determinant: sage: B.det() 5 sage: B.trace() 123 sage: EllipticCurve([-1, 1/4]).ap(5) -2 Try using the trace to speed up the calculation: sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), ... p, M, -2) sage: A [2715 187] [1445 408] Hmmm... it looks different, but that's because the trace of our first answer was only -2 modulo $5^3$, not -2 modulo $5^5$. So the right answer is: sage: A.change_ring(Integers(p**prec)) [90 62] [70 33] Check it works with only one digit of precision: sage: p = 5 sage: prec = 1 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), p, M) sage: A.change_ring(Integers(p)) [0 2] [0 3] Here's an example that's particularly badly conditioned for using the trace trick: sage: p = 11 sage: prec = 3 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 + 7*x + 8, p, M) sage: A.change_ring(Integers(p**prec)) [1144 176] [ 847 185] The problem here is that the top-right entry is divisible by 11, and the bottom-left entry is divisible by $11^2$. So when you apply the trace trick, neither $F(dx/y)$ nor $F(x dx/y)$ is enough to compute the whole matrix to the desired precision, even if you try increasing the target precision by one. Nevertheless, \code{matrix_of_frobenius} knows how to get the right answer by evaluating $F((x+1) dx/y)$ instead: sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 + 7*x + 8, p, M, -2) sage: A.change_ring(Integers(p**prec)) [1144 176] [ 847 185] The running time is about \code{O(p * prec**2)} (times some logarithmic factors), so it's feasible to run on fairly large primes, or precision (or both?!?!): sage: p = 10007 sage: prec = 2 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( # long time ... x^3 - x + R(1/4), p, M) # long time sage: B = A.change_ring(Integers(p**prec)); B # long time [74311982 57996908] [95877067 25828133] sage: B.det() # long time 10007 sage: B.trace() # long time 66 sage: EllipticCurve([-1, 1/4]).ap(10007) # long time 66 sage: p = 5 sage: prec = 300 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( # long time ... x^3 - x + R(1/4), p, M) # long time sage: B = A.change_ring(Integers(p**prec)) # long time sage: B.det() # long time 5 sage: -B.trace() # long time 2 sage: EllipticCurve([-1, 1/4]).ap(5) # long time -2 Let's check consistency of the results for a range of precisions: sage: p = 5 sage: max_prec = 60 sage: M = monsky_washnitzer.adjusted_prec(p, max_prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( # long time ... x^3 - x + R(1/4), p, M) # long time sage: A = A.change_ring(Integers(p**max_prec)) # long time sage: result = [] # long time sage: for prec in range(1, max_prec): # long time ... M = monsky_washnitzer.adjusted_prec(p, prec) # long time ... R.<x> = PolynomialRing(Integers(p^M),'x') # long time ... B = monsky_washnitzer.matrix_of_frobenius( # long time ... x^3 - x + R(1/4), p, M) # long time ... B = B.change_ring(Integers(p**prec)) # long time ... result.append(B == A.change_ring( # long time ... Integers(p**prec))) # long time sage: result == [True] * (max_prec - 1) # long time True The remaining examples discuss what happens when you take the coefficient ring to be a power series ring; i.e. in effect you're looking at a family of curves. The code does in fact work... sage: p = 11 sage: prec = 3 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: S.<t> = PowerSeriesRing(Integers(p**M), default_prec=4) sage: a = 7 + t + 3*t^2 sage: b = 8 - 6*t + 17*t^2 sage: R.<x> = PolynomialRing(S) sage: Q = x**3 + a*x + b sage: A = monsky_washnitzer.matrix_of_frobenius(Q, p, M) # long time sage: B = A.change_ring(PowerSeriesRing( # long time ... Integers(p**prec), 't', default_prec=4)) # long time sage: B # long time [1144 + 264*t + 841*t^2 + 1025*t^3 + O(t^4) 176 + 1052*t + 216*t^2 + 523*t^3 + O(t^4)] [ 847 + 668*t + 81*t^2 + 424*t^3 + O(t^4) 185 + 341*t + 171*t^2 + 642*t^3 + O(t^4)] The trace trick should work for power series rings too, even in the badly- conditioned case. Unfortunately I don't know how to compute the trace in advance, so I'm not sure exactly how this would help. Also, I suspect the running time will be dominated by the expansion, so the trace trick won't really speed things up anyway. Another problem is that the determinant is not always p: sage: B.det() # long time 11 + 484*t^2 + 451*t^3 + O(t^4) However, it appears that the determinant always has the property that if you substitute t -> 11t, you do get the constant series p (mod p**prec). Similarly for the trace. And since the parameter only really makes sense when it's divisible by p anyway, perhaps this isn't a problem after all. """ M = int(M) if M < 2: raise ValueError, "M (=%s) must be at least 2" % M base_ring = Q.base_ring() # Expand out frobenius of dx/y and x dx/y. # (You can substitute frobenius_expansion_by_series here, that will work # as well. See its docstring for some performance notes.) F0, F1, offset = frobenius_expansion_by_newton(Q, p, M) #F0, F1, offset = frobenius_expansion_by_series(Q, p, M) if compute_exact_forms: # we need to do all the work to get the exact expressions f such that F(x^i dx/y) = df + \sum a_i x^i dx/y F0_coeffs = transpose_list(F0.coeffs()) F0_reduced, f_0 = reduce_all(Q, p, F0_coeffs, offset, True) F1_coeffs = transpose_list(F1.coeffs()) F1_reduced, f_1 = reduce_all(Q, p, F1_coeffs, offset, True) elif M == 2: # This implies that only one digit of precision is valid, so we only need # to reduce the second column. Also, the trace doesn't help at all. F0_reduced = [ base_ring(0), base_ring(0) ] F1_coeffs = transpose_list(F1.coeffs()) F1_reduced = reduce_all(Q, p, F1_coeffs, offset) elif trace is None: # No trace provided, just reduce F(dx/y) and F(x dx/y) separately. F0_coeffs = transpose_list(F0.coeffs()) F0_reduced = reduce_all(Q, p, F0_coeffs, offset) F1_coeffs = transpose_list(F1.coeffs()) F1_reduced = reduce_all(Q, p, F1_coeffs, offset) else: # Trace has been provided. # In most cases this can be used to quickly compute F(dx/y) from # F(x dx/y). However, if we're unlucky, the (dx/y)-component of # F(x dx/y) (i.e. the top-right corner of the matrix) may be divisible # by p, in which case there isn't enough information to get the # (x dx/y)-component of F(dx/y) to the desired precision. When this # happens, it turns out that F((x+1) dx/y) always *does* give enough # information (together with the trace) to get both columns to the # desired precision. # First however we need a quick way of telling whether the top-right # corner is divisible by p, i.e. we want to compute the second column # of the matrix mod p. We could do this by just running the entire # algorithm with M = 2 (which assures precision 1). Luckily, we've # already done most of the work by computing F1 to high precision; so # all we need to do is extract the coefficients that would correspond # to the first term of the series, and run the reduction on them. # todo: actually we only need to do this reduction step mod p^2, not # mod p^M, which is what the code currently does. If the base ring # is Integers(p^M), then it's easy. Otherwise it's tricky to construct # the right ring, I don't know how to do it. F1_coeffs = transpose_list(F1.coeffs()) F1_modp_coeffs = F1_coeffs[int((M-2)*p):] # make a copy, because reduce_all will destroy the coefficients: F1_modp_coeffs = [[cell for cell in row] for row in F1_modp_coeffs] F1_modp_offset = offset - (M-2)*p F1_modp_reduced = reduce_all(Q, p, F1_modp_coeffs, F1_modp_offset) if F1_modp_reduced[0].is_unit(): # If the first entry is invertible mod p, then F(x dx/y) is sufficient # to get the whole matrix. F1_reduced = reduce_all(Q, p, F1_coeffs, offset) F0_reduced = [ base_ring(trace) - F1_reduced[1], None ] # using that the determinant is p: F0_reduced[1] = (F0_reduced[0] * F1_reduced[1] - base_ring(p)) \ / F1_reduced[0] else: # If the first entry is zero mod p, then F((x+1) dx/y) will be sufficient # to get the whole matrix. (Here we are using the fact that the second # entry *cannot* be zero mod p. This is guaranteed by some results in # section 3.2 of ``Computation of p-adic Heights and Log Convergence'' # by Mazur, Stein, Tate. But let's quickly check it anyway :-)) assert F1_modp_reduced[1].is_unit(), \ "Hey that's impossible! The second entry in the second column " \ "should be invertible mod p!" G0_coeffs = transpose_list( (F0 + F1).coeffs()) G0_reduced = reduce_all(Q, p, G0_coeffs, offset) # Now G0_reduced expresses F((x+1) dx/y) in terms of dx/y and x dx/y. # Re-express this in terms of (x+1) dx/y and x dx/y. H0_reduced = [ G0_reduced[0], G0_reduced[1] - G0_reduced[0] ] # The thing we're about to divide by better be a unit. assert H0_reduced[1].is_unit(), \ "Hey that's impossible! The second entry in this column " \ "should be invertible mod p!" # Figure out the second column using the trace... H1_reduced = [ None, base_ring(trace) - H0_reduced[0] ] # ... and using that the determinant is p: H1_reduced[0] = (H0_reduced[0] * H1_reduced[1] - base_ring(p)) \ / H0_reduced[1] # Finally, change back to the usual basis (dx/y, x dx/y) F1_reduced = [ H1_reduced[0], \ H1_reduced[0] + H1_reduced[1] ] F0_reduced = [ H0_reduced[0] - F1_reduced[0], H0_reduced[0] + H0_reduced[1] - F1_reduced[1] ] # One more sanity check: our final result should be congruent mod p # to the approximation we used earlier. assert not ( (F1_reduced[0] - F1_modp_reduced[0]).is_unit() or \ (F1_reduced[1] - F1_modp_reduced[1]).is_unit() or \ F0_reduced[0].is_unit() or F0_reduced[1].is_unit()), \ "Hey that's impossible! The output matrix is not congruent mod p " \ "to the approximation found earlier!" if compute_exact_forms: return matrix(base_ring, 2, 2, [F0_reduced[0], F1_reduced[0], F0_reduced[1], F1_reduced[1]]), f_0, f_1 else: return matrix(base_ring, 2, 2, [F0_reduced[0], F1_reduced[0], F0_reduced[1], F1_reduced[1]])
9a7b8159077f0bbbeff411909718819acacd249c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/9a7b8159077f0bbbeff411909718819acacd249c/monsky_washnitzer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3148, 67, 792, 67, 74, 303, 19425, 8384, 12, 53, 16, 293, 16, 490, 16, 2606, 33, 7036, 16, 3671, 67, 17165, 67, 9741, 33, 8381, 4672, 3536, 14169, 281, 326, 3148, 434, 478, 303, 1942...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3148, 67, 792, 67, 74, 303, 19425, 8384, 12, 53, 16, 293, 16, 490, 16, 2606, 33, 7036, 16, 3671, 67, 17165, 67, 9741, 33, 8381, 4672, 3536, 14169, 281, 326, 3148, 434, 478, 303, 1942...
class CurrentColumn(gtk.TreeViewColumn): _render = gtk.CellRendererPixbuf() _render.set_property('xalign', 0.5) header_name = "~current" def _cdf(self, column, cell, model, iter, pixbuf=(gtk.STOCK_MEDIA_PLAY, gtk.STOCK_MEDIA_PAUSE)): try: if model[iter][0] is not widgets.watcher.song: stock = '' else: stock = pixbuf[player.playlist.paused] cell.set_property('stock-id', stock) except AttributeError: pass def __init__(self): gtk.TreeViewColumn.__init__(self, "", self._render) self.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED) self.set_fixed_width(24) self.set_cell_data_func(self._render, self._cdf) self.header_name = "~current"
CurrentColumn = None
def __visible(self, model, prop, cb, menu): value = self.get_property('visible') config.set("memory", "playqueue", str(value)) menu.set_active(value) self.set_expanded(not model.is_empty()) cb.set_property('visible', self.get_expanded())
28f91731d935463549760bcd2aefd1a36da7c30b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/28f91731d935463549760bcd2aefd1a36da7c30b/widgets.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 8613, 12, 2890, 16, 938, 16, 2270, 16, 2875, 16, 3824, 4672, 460, 273, 365, 18, 588, 67, 4468, 2668, 8613, 6134, 642, 18, 542, 2932, 7858, 3113, 315, 1601, 4000, 3113, 609, 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, 1001, 8613, 12, 2890, 16, 938, 16, 2270, 16, 2875, 16, 3824, 4672, 460, 273, 365, 18, 588, 67, 4468, 2668, 8613, 6134, 642, 18, 542, 2932, 7858, 3113, 315, 1601, 4000, 3113, 609, 12, ...
raise RuntimeError, "You must intall the optional gap_packages package."
raise RuntimeError, "You must install the optional gap_packages package."
def homology_part(self, n, p = 0): r""" Computes the `p`-part of the group homology `H_n(G, F)`, where `F = \ZZ` if `p=0` and `F = \ZZ / p \ZZ` if `p > 0` is a prime. Wraps HAP's ``Homology`` function, written by Graham Ellis, applied to the `p`-Sylow subgroup of `G`.
593625e5b2c74edf16e4eea9814458105c9a779d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/593625e5b2c74edf16e4eea9814458105c9a779d/permgroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13995, 4676, 67, 2680, 12, 2890, 16, 290, 16, 293, 273, 374, 4672, 436, 8395, 14169, 281, 326, 1375, 84, 68, 17, 2680, 434, 326, 1041, 13995, 4676, 1375, 44, 67, 82, 12, 43, 16, 478,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13995, 4676, 67, 2680, 12, 2890, 16, 290, 16, 293, 273, 374, 4672, 436, 8395, 14169, 281, 326, 1375, 84, 68, 17, 2680, 434, 326, 1041, 13995, 4676, 1375, 44, 67, 82, 12, 43, 16, 478,...
mychain = self.sequence
app.mainCamera.setCenter( x, y, z ) viewer.emitModelChanged()
def setSequenceSelection(self, newSelection=None, removeOne=None, addOne=None, addRange=None): selectionToClear = self.sequence.getSelection() for i in selectionToClear: try: self.sequence[i] except KeyError: continue atom = self.sequence[i].getAtom('CA') if not atom: continue atom.setSelected(False) self.sequence.setSelection(newSelection,removeOne,addOne,addRange) dock = self.parentWidget().parentWidget().parentWidget().parentWidget() #self.parentWidget() => QWidget, self.parentWidget().parentWidget() => ScrollableSequenceView #self.parentWidget().parentWidget().parentWidget() => SequenceDock viewer = dock.viewer renderer = viewer.renderer app = dock.app try: selectedAtom = self.sequence[ self.sequence.getSelection()[-1] ].getAtom('CA') except KeyError: return if not selectedAtom: return selectedAtom.setSelected(True) pos = selectedAtom.getPosition() x, y, z = pos.x()*viewer.scale[0], pos.y()*viewer.scale[1], pos.z()*viewer.scale[2] mychain = self.sequence #TODO: change BaseViewer.modelLoaded() to redraw PDBAtoms if their attributes have changed #Current: Here we completely unload and re-load the model, which isn't really the best way to do things, #but it's the only way I can get selected atoms to display viewer.unloadData() mychain.addCalphaBonds() app.mainCamera.setCenter( x, y, z ) for i in mychain.residueRange(): atom = mychain[i].getAtom('CA') if atom: renderer.addAtom(atom)
ca17ad546b24f59586930c5b4dcc74c6920bc51a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4399/ca17ad546b24f59586930c5b4dcc74c6920bc51a/SequenceView.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 4021, 6233, 12, 2890, 16, 394, 6233, 33, 7036, 16, 1206, 3335, 33, 7036, 16, 527, 3335, 33, 7036, 16, 527, 2655, 33, 7036, 4672, 4421, 774, 9094, 273, 365, 18, 6178, 18, 588, 62...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 4021, 6233, 12, 2890, 16, 394, 6233, 33, 7036, 16, 1206, 3335, 33, 7036, 16, 527, 3335, 33, 7036, 16, 527, 2655, 33, 7036, 4672, 4421, 774, 9094, 273, 365, 18, 6178, 18, 588, 62...
import sys
def debug(*args): for i in args: sys.stderr.write(str(i)) sys.stderr.write("\n")
9f4e3e3588cb49ba3faa7dfadc55ba9ea51ffed7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/9f4e3e3588cb49ba3faa7dfadc55ba9ea51ffed7/toIcal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1198, 30857, 1968, 4672, 364, 277, 316, 833, 30, 2589, 18, 11241, 18, 2626, 12, 701, 12, 77, 3719, 2589, 18, 11241, 18, 2626, 31458, 82, 7923, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1198, 30857, 1968, 4672, 364, 277, 316, 833, 30, 2589, 18, 11241, 18, 2626, 12, 701, 12, 77, 3719, 2589, 18, 11241, 18, 2626, 31458, 82, 7923, 225, 2, -100, -100, -100, -100, -100, -10...
return proxy.handle_command("test", ["nothing", "happens"]) proxy = _make_proxy() proxy.engine.add_command("xyzzy", handle_xyzzy) check_engine(tc, proxy.engine, 'xyzzy', [], "args: nothing happens") check_engine(tc, proxy.engine, 'xyzzy', ['error'], "normal error", expect_failure=True)
return fx.proxy.handle_command("test", ["nothing", "happens"]) fx = Proxy_fixture(tc) fx.engine.add_command("xyzzy", handle_xyzzy) fx.check_command('xyzzy', [], "args: nothing happens") fx.check_command('xyzzy', ['error'], "normal error", expect_failure=True)
def handle_xyzzy(args): if args and args[0] == "error": return proxy.handle_command("error", []) else: return proxy.handle_command("test", ["nothing", "happens"])
d3c1810c39f74e2ab0ab81debc544cc7ea34da4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6121/d3c1810c39f74e2ab0ab81debc544cc7ea34da4d/gtp_proxy_tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 1698, 6378, 93, 12, 1968, 4672, 309, 833, 471, 833, 63, 20, 65, 422, 315, 1636, 6877, 327, 2889, 18, 4110, 67, 3076, 2932, 1636, 3113, 5378, 13, 469, 30, 327, 2889, 18, 411...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 1698, 6378, 93, 12, 1968, 4672, 309, 833, 471, 833, 63, 20, 65, 422, 315, 1636, 6877, 327, 2889, 18, 4110, 67, 3076, 2932, 1636, 3113, 5378, 13, 469, 30, 327, 2889, 18, 411...
ids = self.pool.get('ir.actions.act_window').search(cr, uid, [('usage','=','menu')], context=context) return ids and ids[0] or False
dataobj = self.pool.get('ir.model.data') try: model, res_id = dataobj.get_object_reference(cr, uid, 'base', 'action_menu_admin') if model != 'ir.actions.act_window': return False return res_id except ValueError: return False
def _get_menu(self,cr, uid, context=None): ids = self.pool.get('ir.actions.act_window').search(cr, uid, [('usage','=','menu')], context=context) return ids and ids[0] or False
28fd01553908b899450a693036276f755c3f43fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/28fd01553908b899450a693036276f755c3f43fd/res_user.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 5414, 12, 2890, 16, 3353, 16, 4555, 16, 819, 33, 7036, 4672, 3258, 273, 365, 18, 6011, 18, 588, 2668, 481, 18, 4905, 18, 621, 67, 5668, 16063, 3072, 12, 3353, 16, 4555,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 5414, 12, 2890, 16, 3353, 16, 4555, 16, 819, 33, 7036, 4672, 3258, 273, 365, 18, 6011, 18, 588, 2668, 481, 18, 4905, 18, 621, 67, 5668, 16063, 3072, 12, 3353, 16, 4555,...
raise TestFailed, 'zip(None) - expected TypeError, got', e
raise TestFailed, 'zip(None) - expected TypeError, got %s' % e
def __getitem__(self, i): if i < 0 or i > 2: raise IndexError return i + 4
205b98d73507f9524785c43fda7b256370bee4dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/205b98d73507f9524785c43fda7b256370bee4dd/test_b2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 31571, 972, 12, 2890, 16, 277, 4672, 309, 277, 411, 374, 578, 277, 405, 576, 30, 1002, 10195, 327, 277, 397, 1059, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 31571, 972, 12, 2890, 16, 277, 4672, 309, 277, 411, 374, 578, 277, 405, 576, 30, 1002, 10195, 327, 277, 397, 1059, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
nosmp = os.environ['NPY_NOSMP'] nosmp = 1 except KeyError: nosmp = 0 return nosmp == 1 def win32_checks(deflist): from numpy.distutils.misc_util import get_build_architecture a = get_build_architecture() print('BUILD_ARCHITECTURE: %r, os.name=%r, sys.platform=%r' % \ (a, os.name, sys.platform)) if a == 'AMD64': deflist.append('DISTUTILS_USE_SDK') if a == "Intel" or a == "AMD64": deflist.append('FORCE_NO_LONG_DOUBLE_FORMATTING') def check_math_capabilities(config, moredefs, mathlibs): def check_func(func_name): return config.check_func(func_name, libraries=mathlibs, decl=True, call=True) def check_funcs_once(funcs_name): decl = dict([(f, True) for f in funcs_name]) st = config.check_funcs_once(funcs_name, libraries=mathlibs, decl=decl, call=decl) if st: moredefs.extend([fname2def(f) for f in funcs_name]) return st def check_funcs(funcs_name): if not check_funcs_once(funcs_name): for f in funcs_name: if check_func(f): moredefs.append(fname2def(f)) return 0 else: return 1 if not check_funcs_once(MANDATORY_FUNCS): raise SystemError("One of the required function to build numpy is not" " available (the list is %s)." % str(MANDATORY_FUNCS)) if sys.version_info[:2] >= (2, 5): for f in OPTIONAL_STDFUNCS_MAYBE: if config.check_decl(fname2def(f), headers=["Python.h", "math.h"]): OPTIONAL_STDFUNCS.remove(f) check_funcs(OPTIONAL_STDFUNCS) check_funcs(C99_FUNCS_SINGLE) check_funcs(C99_FUNCS_EXTENDED) def check_complex(config, mathlibs): priv = [] pub = [] st = config.check_header('complex.h') if st: priv.append('HAVE_COMPLEX_H') pub.append('NPY_USE_C99_COMPLEX') for t in C99_COMPLEX_TYPES: st = config.check_type(t, headers=["complex.h"]) if st: pub.append(('NPY_HAVE_%s' % type2def(t), 1)) def check_prec(prec): flist = [f + prec for f in C99_COMPLEX_FUNCS] decl = dict([(f, True) for f in flist]) if not config.check_funcs_once(flist, call=decl, decl=decl, libraries=mathlibs): for f in flist: if config.check_func(f, call=True, decl=True, libraries=mathlibs): priv.append(fname2def(f))
src, obj, exe = self._link(body, headers, include_dirs, libraries, library_dirs, lang) exe = os.path.join('.', exe) exitstatus, output = exec_command(exe, execute_in='.') if hasattr(os, 'WEXITSTATUS'): exitcode = os.WEXITSTATUS(exitstatus) if os.WIFSIGNALED(exitstatus): sig = os.WTERMSIG(exitstatus) log.error('subprocess exited with signal %d' % (sig,)) if sig == signal.SIGINT: raise KeyboardInterrupt
def is_npy_no_smp(): """Return True if the NPY_NO_SMP symbol must be defined in public header (when SMP support cannot be reliably enabled).""" # Python 2.3 causes a segfault when # trying to re-acquire the thread-state # which is done in error-handling # ufunc code. NPY_ALLOW_C_API and friends # cause the segfault. So, we disable threading # for now. if sys.version[:5] < '2.4.2': nosmp = 1 else: # Perhaps a fancier check is in order here. # so that threads are only enabled if there # are actually multiple CPUS? -- but # threaded code can be nice even on a single # CPU so that long-calculating code doesn't # block. try: nosmp = os.environ['NPY_NOSMP'] nosmp = 1 except KeyError: nosmp = 0 return nosmp == 1
37a71c453b67f06646e51013b2c929ce8b65459c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/37a71c453b67f06646e51013b2c929ce8b65459c/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 82, 2074, 67, 2135, 67, 87, 1291, 13332, 3536, 990, 1053, 309, 326, 423, 16235, 67, 3417, 67, 55, 4566, 3273, 1297, 506, 2553, 316, 1071, 1446, 261, 13723, 348, 4566, 2865, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 82, 2074, 67, 2135, 67, 87, 1291, 13332, 3536, 990, 1053, 309, 326, 423, 16235, 67, 3417, 67, 55, 4566, 3273, 1297, 506, 2553, 316, 1071, 1446, 261, 13723, 348, 4566, 2865, 27...
self.spawn (["zip", "-r", base_dir, base_dir])
self.spawn (["zip", "-r", base_dir + ".zip", base_dir])
def make_zipfile (self, base_dir):
479ca439616165c1a71a0ff280607a555acc2dd3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/479ca439616165c1a71a0ff280607a555acc2dd3/dist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 4450, 768, 261, 2890, 16, 1026, 67, 1214, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 4450, 768, 261, 2890, 16, 1026, 67, 1214, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if re.search('pack_lun\)\(', fo): buf += "u64 " + fabric_mod_name + "_pack_lun(unsigned int lun)\n" buf += "{\n" buf += " WARN_ON(lun >= 256);\n" buf += " /* Caller wants this byte-swapped */\n" buf += " return cpu_to_le64((lun & 0xff) << 8);\n" buf += "}\n\n" bufi += "u64 " + fabric_mod_name + "_pack_lun(unsigned int);\n"
def tcm_mod_dump_fabric_ops(proto_ident, fabric_mod_dir_var, fabric_mod_name): buf = "" bufi = "" f = fabric_mod_dir_var + "/" + fabric_mod_name + "_fabric.c" print "Writing file: " + f p = open(f, 'w') if not p: tcm_mod_err("Unable to open file: " + f) fi = fabric_mod_dir_var + "/" + fabric_mod_name + "_fabric.h" print "Writing file: " + fi pi = open(fi, 'w') if not pi: tcm_mod_err("Unable to open file: " + fi) buf = "#include <linux/slab.h>\n" buf += "#include <linux/kthread.h>\n" buf += "#include <linux/types.h>\n" buf += "#include <linux/list.h>\n" buf += "#include <linux/types.h>\n" buf += "#include <linux/string.h>\n" buf += "#include <linux/ctype.h>\n" buf += "#include <asm/unaligned.h>\n" buf += "#include <scsi/scsi.h>\n" buf += "#include <scsi/scsi_host.h>\n" buf += "#include <scsi/scsi_device.h>\n" buf += "#include <scsi/scsi_cmnd.h>\n" buf += "#include <scsi/libfc.h>\n\n" buf += "#include <target/target_core_base.h>\n" buf += "#include <target/target_core_fabric.h>\n" buf += "#include <target/target_core_configfs.h>\n\n" buf += "#include \"" + fabric_mod_name + "_base.h\"\n" buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n" buf += "int " + fabric_mod_name + "_check_true(struct se_portal_group *se_tpg)\n" buf += "{\n" buf += " return 1;\n" buf += "}\n\n" bufi += "int " + fabric_mod_name + "_check_true(struct se_portal_group *);\n" buf += "int " + fabric_mod_name + "_check_false(struct se_portal_group *se_tpg)\n" buf += "{\n" buf += " return 0;\n" buf += "}\n\n" bufi += "int " + fabric_mod_name + "_check_false(struct se_portal_group *);\n" total_fabric_ops = len(fabric_ops) i = 0 while i < total_fabric_ops: fo = fabric_ops[i] i += 1
02e057919061cfa8b484b9c8e27f19fa28a33705 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5327/02e057919061cfa8b484b9c8e27f19fa28a33705/tcm_mod_builder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1715, 81, 67, 1711, 67, 8481, 67, 23710, 67, 4473, 12, 9393, 67, 6392, 16, 21127, 67, 1711, 67, 1214, 67, 1401, 16, 21127, 67, 1711, 67, 529, 4672, 1681, 273, 1408, 1681, 77, 273, 14...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1715, 81, 67, 1711, 67, 8481, 67, 23710, 67, 4473, 12, 9393, 67, 6392, 16, 21127, 67, 1711, 67, 1214, 67, 1401, 16, 21127, 67, 1711, 67, 529, 4672, 1681, 273, 1408, 1681, 77, 273, 14...
ans = ans._fixexponents(prec, rounding, folddown=folddown, context=context)
ans = ans._fixexponents(prec, rounding, folddown=folddown, context=context)
def _fix(self, prec=None, rounding=None, folddown=None, context=None): """Round if it is necessary to keep self within prec precision.
323d0b30a64964b89a85e1b02e8fcc4017ce9fa7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/323d0b30a64964b89a85e1b02e8fcc4017ce9fa7/decimal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 904, 12, 2890, 16, 13382, 33, 7036, 16, 13885, 33, 7036, 16, 28420, 449, 995, 33, 7036, 16, 819, 33, 7036, 4672, 3536, 11066, 309, 518, 353, 4573, 358, 3455, 365, 3470, 13382, 603...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 904, 12, 2890, 16, 13382, 33, 7036, 16, 13885, 33, 7036, 16, 28420, 449, 995, 33, 7036, 16, 819, 33, 7036, 4672, 3536, 11066, 309, 518, 353, 4573, 358, 3455, 365, 3470, 13382, 603...
f = self.get_time()
f = get_time()
def calibrate(self, m): # Modified by Tim Peters n = m s = self.get_time() while n: self.simple() n = n - 1 f = self.get_time() my_simple = f - s #print "Simple =", my_simple,
edb5ffb2c145fc52df2195c22688db51034b08d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/edb5ffb2c145fc52df2195c22688db51034b08d5/profile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26139, 5141, 12, 2890, 16, 312, 4672, 468, 21154, 635, 12652, 453, 1032, 290, 273, 312, 272, 273, 365, 18, 588, 67, 957, 1435, 1323, 290, 30, 365, 18, 9647, 1435, 290, 273, 290, 300, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26139, 5141, 12, 2890, 16, 312, 4672, 468, 21154, 635, 12652, 453, 1032, 290, 273, 312, 272, 273, 365, 18, 588, 67, 957, 1435, 1323, 290, 30, 365, 18, 9647, 1435, 290, 273, 290, 300, ...
if len (errorStrings) == 1: str = _("error") else: str = _("errors") errorMessage = _("The following %s occurred. %s") % (str, ', '.join(errorStrings)) errorMessage = errorMessage.encode ('utf-8') self.setStatusMessage (errorMessage, alert=True)
errorMessage = constants.UPLOAD_ERROR % (', '.join(errorStrings)) """Clear the status message""" self.setStatusMessage('') self.displayMailError (errorMessage, mailMessage.parentAccount)
def displaySMTPSendError (self, mailMessage): """ Called when the SMTP Send generated an error. """ if mailMessage is not None and mailMessage.isOutbound: """ Maybe we should select the message in CPIA? """ errorStrings = [] for error in mailMessage.deliveryExtension.deliveryErrors: errorStrings.append(error.errorString)
b73de39521bee8ef4874e4a550496256db00a381 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/b73de39521bee8ef4874e4a550496256db00a381/Main.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 55, 14636, 3826, 668, 261, 2890, 16, 4791, 1079, 4672, 3536, 11782, 1347, 326, 18102, 2479, 4374, 392, 555, 18, 3536, 309, 4791, 1079, 353, 486, 599, 471, 4791, 1079, 18, 291, 1787...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 55, 14636, 3826, 668, 261, 2890, 16, 4791, 1079, 4672, 3536, 11782, 1347, 326, 18102, 2479, 4374, 392, 555, 18, 3536, 309, 4791, 1079, 353, 486, 599, 471, 4791, 1079, 18, 291, 1787...
minOccurs = element.getAttribute('minOccurs') maxOccurs = element.getAttribute('maxOccurs')
minOccurs = int(element.getAttribute('minOccurs')) maxOccurs = int(element.getAttribute('maxOccurs'))
def _getElement(self, element, literal=False, local=False, namespaceURI=None): """Returns a typecode instance representing the passed in element. element -- XMLSchema.ElementDeclaration instance literal -- literal encoding? local -- is locally defined? namespaceURI -- namespace """ if not element.isElement(): raise TypeError, 'Expecting an ElementDeclaration'
c728f4f75dac1c8244f531bae8604a57bbfa35d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/c728f4f75dac1c8244f531bae8604a57bbfa35d4/ServiceProxy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 21336, 12, 2890, 16, 930, 16, 7158, 33, 8381, 16, 1191, 33, 8381, 16, 19421, 33, 7036, 4672, 3536, 1356, 279, 618, 710, 791, 5123, 326, 2275, 316, 930, 18, 930, 1493, 3167, 3078, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 21336, 12, 2890, 16, 930, 16, 7158, 33, 8381, 16, 1191, 33, 8381, 16, 19421, 33, 7036, 4672, 3536, 1356, 279, 618, 710, 791, 5123, 326, 2275, 316, 930, 18, 930, 1493, 3167, 3078, ...
death_year = None
if ydeath: death_year = ydeath assume("We're assuming author (%s) died in %d."% (aname, ydeath)) elif ybirth: death_year = ybirth + OLDEST_PERSON_EVER_IN_CANADA assume("We're assuming author (%s) was born in %d."% (aname, ybirth)) elif pubyear: death_year = pubyear + OLDEST_PERSON_EVER_IN_CANADA assume("We're assuming author (%s) was born at the time of publication, since we don't have a known birthdate."% (aname,))
def y(author, attr): """Extract attribute (i.e. a string-valued date field) from author and convert it to integer. If field is absent or no valid conversion, return None.""" r = author.get(attr, None) try: return int(r) except (ValueError, AttributeError, TypeError): return None
104be50a5a77cb902fc054f57f71705decb88063 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3913/104be50a5a77cb902fc054f57f71705decb88063/ca.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 677, 12, 4161, 16, 1604, 4672, 3536, 4976, 1566, 261, 77, 18, 73, 18, 279, 533, 17, 4531, 329, 1509, 652, 13, 628, 2869, 471, 1765, 518, 358, 3571, 18, 225, 971, 652, 353, 17245, 578...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 677, 12, 4161, 16, 1604, 4672, 3536, 4976, 1566, 261, 77, 18, 73, 18, 279, 533, 17, 4531, 329, 1509, 652, 13, 628, 2869, 471, 1765, 518, 358, 3571, 18, 225, 971, 652, 353, 17245, 578...
if not existing_type.isTypeEquivalent(pending_type): raise pyxb.SchemaValidationError('Conflicting element declarations for %s: %s versus %s' % (decl.expandedName(), existing_type, pending_type))
if not pending_type.isDerivationConsistent(existing_type): raise pyxb.SchemaValidationError('Conflicting element declarations for %s: existing %s versus new %s' % (decl.expandedName(), existing_type, pending_type))
def _recordLocalDeclaration (self, decl): """Record the given declaration as being locally scoped in this type.""" assert isinstance(decl, _ScopedDeclaration_mixin) if isinstance(decl, ElementDeclaration): scope_map = self.__scopedElementDeclarations elif isinstance(decl, AttributeDeclaration): scope_map = self.__scopedAttributeDeclarations else: raise pyxb.LogicError('Unexpected instance of %s recording as local declaration' % (type(decl),)) decl_en = decl.expandedName() existing_decl = scope_map.setdefault(decl_en, decl) if decl != existing_decl: if isinstance(decl, ElementDeclaration): # Test cos-element-consistent existing_type = existing_decl.typeDefinition() pending_type = decl.typeDefinition() if not existing_type.isTypeEquivalent(pending_type): raise pyxb.SchemaValidationError('Conflicting element declarations for %s: %s versus %s' % (decl.expandedName(), existing_type, pending_type)) elif isinstance(decl, AttributeDeclaration): raise pyxb.SchemaValidationError('Multiple attribute declarations for %s' % (decl.expandedName(),)) else: assert False, 'Unrecognized type %s' % (type(decl),) decl._baseDeclaration(existing_decl) return self
b7ed924e856dc13554a1c493a47b47b1caeb5ff4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7171/b7ed924e856dc13554a1c493a47b47b1caeb5ff4/structures.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3366, 2042, 6094, 261, 2890, 16, 3496, 4672, 3536, 2115, 326, 864, 8266, 487, 3832, 13760, 12523, 316, 333, 618, 12123, 1815, 1549, 12, 8840, 16, 389, 25470, 6094, 67, 81, 10131, 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, 389, 3366, 2042, 6094, 261, 2890, 16, 3496, 4672, 3536, 2115, 326, 864, 8266, 487, 3832, 13760, 12523, 316, 333, 618, 12123, 1815, 1549, 12, 8840, 16, 389, 25470, 6094, 67, 81, 10131, 13...
print urllib2.urlopen(request).read()
result = urllib2.urlopen(request).read() if len(result) > 3: print result else: print "stackwalkCGI returned nothing."
def checkForCrashes(dumpDir, symbolsPath, testName=None): stackwalkPath = os.environ.get('MINIDUMP_STACKWALK', None) stackwalkCGI = os.environ.get('MINIDUMP_STACKWALK_CGI', None) # try to get the caller's filename if no test name is given if testName is None: try: testName = os.path.basename(sys._getframe(1).f_code.co_filename) except: testName = "unknown" foundCrash = False dumps = glob.glob(os.path.join(dumpDir, '*.dmp')) for d in dumps: log.info("PROCESS-CRASH | %s | application crashed (minidump found)", testName) if symbolsPath and stackwalkPath and os.path.exists(stackwalkPath): nullfd = open(os.devnull, 'w') # eat minidump_stackwalk errors subprocess.call([stackwalkPath, d, symbolsPath], stderr=nullfd) nullfd.close() elif stackwalkCGI and symbolsPath and isURL(symbolsPath): f = None try: f = open(d, "rb") sys.path.append(os.path.join(os.path.dirname(__file__), "poster.zip")) from poster.encode import multipart_encode from poster.streaminghttp import register_openers import urllib2 register_openers() datagen, headers = multipart_encode({"minidump": f, "symbols": symbolsPath}) request = urllib2.Request(stackwalkCGI, datagen, headers) print urllib2.urlopen(request).read() finally: if f: f.close() else: if not symbolsPath: print "No symbols path given, can't process dump." if not stackwalkPath and not stackwalkCGI: print "Neither MINIDUMP_STACKWALK nor MINIDUMP_STACKWALK_CGI is set, can't process dump." else: if stackwalkPath and not os.path.exists(stackwalkPath): print "MINIDUMP_STACKWALK binary not found: %s" % stackwalkPath elif stackwalkCGI and not isURL(stackwalkCGI): print "MINIDUMP_STACKWALK_CGI is not a URL: %s" % stackwalkCGI elif symbolsPath and not isURL(symbolsPath): print "symbolsPath is not a URL: %s" % symbolsPath dumpSavePath = os.environ.get('MINIDUMP_SAVE_PATH', None) if dumpSavePath: shutil.move(d, dumpSavePath) print "Saved dump as %s" % os.path.join(dumpSavePath, os.path.basename(d)) else: os.remove(d) extra = os.path.splitext(d)[0] + ".extra" if os.path.exists(extra): os.remove(extra) foundCrash = True return foundCrash
2847c6f0934eef32956e63283b0d48155a894326 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11102/2847c6f0934eef32956e63283b0d48155a894326/automationutils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13855, 12893, 7690, 12, 8481, 1621, 16, 7963, 743, 16, 1842, 461, 33, 7036, 4672, 2110, 11348, 743, 273, 1140, 18, 28684, 18, 588, 2668, 6236, 734, 23942, 67, 21971, 59, 1013, 47, 2187, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13855, 12893, 7690, 12, 8481, 1621, 16, 7963, 743, 16, 1842, 461, 33, 7036, 4672, 2110, 11348, 743, 273, 1140, 18, 28684, 18, 588, 2668, 6236, 734, 23942, 67, 21971, 59, 1013, 47, 2187, ...
fontinfo = {} def cm_guess_font_info (filename): """this function fills in sensible values for fontinfo. This should be tailored for each metafont font set. """ fontinfo = {"FontName": filename}
def derive_font_name (family, fullname): fullname = re.sub (family, '', fullname) fullname = re.sub ('Oldstyle Figures', 'OsF', fullname) fullname = re.sub ('Small Caps', 'SC', fullname) fullname = re.sub ('[Mm]edium', '', fullname) fullname = re.sub ('[^A-Za-z0-9]', '', fullname) return '%s-%s' % (family, fullname) def cm_guess_font_info (filename, fontinfo):
def abs_path (path, dir): # Python's ABSPATH means ABSDIR dir = os.path.abspath (dir) return string.join (map (lambda x: abs_dir (x, dir), string.split (path, os.pathsep)), os.pathsep)
dfdd47ac4957b0e437c434b79c7589ca35658d7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11856/dfdd47ac4957b0e437c434b79c7589ca35658d7b/mftrace.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2417, 67, 803, 261, 803, 16, 1577, 4672, 468, 6600, 1807, 10336, 3118, 3275, 4696, 10336, 55, 4537, 1577, 273, 1140, 18, 803, 18, 5113, 803, 261, 1214, 13, 327, 533, 18, 5701, 261, 145...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2417, 67, 803, 261, 803, 16, 1577, 4672, 468, 6600, 1807, 10336, 3118, 3275, 4696, 10336, 55, 4537, 1577, 273, 1140, 18, 803, 18, 5113, 803, 261, 1214, 13, 327, 533, 18, 5701, 261, 145...
qu1[-1] = '(' + qu1[-1] + ' OR ' + \
qu1[-1] = '(' + qu1[-1] + add_null + \
def _rec_get(ids, table, parent): if not ids: return [] ids2 = table.search(cursor, user, [(parent, 'in', ids), (parent, '!=', False)], context=context) return ids + _rec_get(ids2, table, parent)
68ca60ecd96e7b09f38d0fe5c78adf0e5327ceda /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9266/68ca60ecd96e7b09f38d0fe5c78adf0e5327ceda/modelsql.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3927, 67, 588, 12, 2232, 16, 1014, 16, 982, 4672, 309, 486, 3258, 30, 327, 5378, 3258, 22, 273, 1014, 18, 3072, 12, 9216, 16, 729, 16, 306, 12, 2938, 16, 296, 267, 2187, 3258, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3927, 67, 588, 12, 2232, 16, 1014, 16, 982, 4672, 309, 486, 3258, 30, 327, 5378, 3258, 22, 273, 1014, 18, 3072, 12, 9216, 16, 729, 16, 306, 12, 2938, 16, 296, 267, 2187, 3258, ...
z = self.gp().eval('Lseries(%s,,%s)'%(a,k-1)) if 'pole' in z: raise ArithmeticError, z elif 'Warning' in z: i = z.rfind('\n') msg = z[:i].replace('digits','decimal digits')
try: z = self.gp()('Vec(Lseries(%s,,%s))'%(a,k-1)) except TypeError, msg: raise RuntimeError, "%s\nUnable to compute Taylor expansion (try lowering the number of terms)"%msg r = repr(z) if 'pole' in r: raise ArithmeticError, r elif 'Warning' in r: i = r.rfind('\n') msg = r[:i].replace('digits','decimal digits')
def taylor_series(self, a=0, k=6, var='z'): """ Return the first k terms of the Taylor series expansion of the $L$-series about $a$.
7648085f93b9378e3dab4a4434be5ed0389e7fc4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/7648085f93b9378e3dab4a4434be5ed0389e7fc4/dokchitser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 268, 528, 80, 280, 67, 10222, 12, 2890, 16, 279, 33, 20, 16, 417, 33, 26, 16, 569, 2218, 94, 11, 4672, 3536, 2000, 326, 1122, 417, 6548, 434, 326, 399, 528, 80, 280, 4166, 17965, 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, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 268, 528, 80, 280, 67, 10222, 12, 2890, 16, 279, 33, 20, 16, 417, 33, 26, 16, 569, 2218, 94, 11, 4672, 3536, 2000, 326, 1122, 417, 6548, 434, 326, 399, 528, 80, 280, 4166, 17965, 4...
list, tuple, or vector
list, tuple, or vector.
def frame_labels(lower_left, upper_right, label_lower_left, label_upper_right, eps = 1, **kwds): """ Draw correct labels for a given frame in 3D. Primarily used as a helper function for creating frames for 3D graphics viewing - do not use directly unless you know what you are doing! INPUT: - ``lower_left`` - the lower left corner of the frame, as a list, tuple, or vector - ``upper_right`` - the upper right corner of the frame, as a list, tuple, or vector - ``label_lower_left`` - the label for the lower left corner of the frame, as a list, tuple, or vector. This label must actually have all coordinates less than the coordinates of the other label. - ``label_upper_right`` - the label for the upper right corner of the frame, as a list, tuple, or vector. This label must actually have all coordinates greater than the coordinates of the other label. - ``eps`` - (default: 1) a parameter for how far away from the frame to put the labels. Type ``line3d.options`` for a dictionary of the default options for lines, which are also available. EXAMPLES: We can use it directly:: sage: from sage.plot.plot3d.shapes2 import frame_labels sage: frame_labels([1,2,3],[4,5,6],[1,2,3],[4,5,6]) This is usually used for making an actual plot:: sage: y = var('y') sage: P = plot3d(sin(x^2+y^2),(x,0,pi),(y,0,pi)) sage: a,b = P._rescale_for_frame_aspect_ratio_and_zoom(1.0,[1,1,1],1) sage: F = frame_labels(a,b,*P._box_for_aspect_ratio("automatic",a,b)) sage: F.jmol_repr(F.default_render_params())[0] [['select atomno = 1', 'color atom [76,76,76]', 'label "0.0"']] TESTS:: sage: frame_labels([1,2,3],[4,5,6],[1,2,3],[1,3,4]) Traceback (most recent call last): ... ValueError: Ensure the upper right labels are above and to the right of the lower left labels. """ x0,y0,z0 = lower_left x1,y1,z1 = upper_right lx0,ly0,lz0 = label_lower_left lx1,ly1,lz1 = label_upper_right if (lx1 - lx0) <= 0 or (ly1 - ly0) <= 0 or (lz1 - lz0) <= 0: raise ValueError, "Ensure the upper right labels are above and to the right of the lower left labels." # Helper function for formatting the frame labels from math import log log10 = log(10) nd = lambda a: int(log(a)/log10) def fmt_string(a): b = a/2.0 if b >= 1: return "%.1f" n = max(0, 2 - nd(a/2.0)) return "%%.%sf"%n # Slightly faster than mean for this situation def avg(a,b): return (a+b)/2.0 color = (0.3,0.3,0.3) fmt = fmt_string(lx1 - lx0) T = Text(fmt%lx0, color=color).translate((x0,y0-eps,z0)) T += Text(fmt%avg(lx0,lx1), color=color).translate((avg(x0,x1),y0-eps,z0)) T += Text(fmt%lx1, color=color).translate((x1,y0-eps,z0)) fmt = fmt_string(ly1 - ly0) T += Text(fmt%ly0, color=color).translate((x1+eps,y0,z0)) T += Text(fmt%avg(ly0,ly1), color=color).translate((x1+eps,avg(y0,y1),z0)) T += Text(fmt%ly1, color=color).translate((x1+eps,y1,z0)) fmt = fmt_string(lz1 - lz0) T += Text(fmt%lz0, color=color).translate((x0-eps,y0,z0)) T += Text(fmt%avg(lz0,lz1), color=color).translate((x0-eps,y0,avg(z0,z1))) T += Text(fmt%lz1, color=color).translate((x0-eps,y0,z1)) return T
25144c93b092a09ccf947d595af3b9e9d463ccf2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/25144c93b092a09ccf947d595af3b9e9d463ccf2/shapes2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2623, 67, 5336, 12, 8167, 67, 4482, 16, 3854, 67, 4083, 16, 1433, 67, 8167, 67, 4482, 16, 1433, 67, 5797, 67, 4083, 16, 7785, 273, 404, 16, 2826, 25577, 4672, 3536, 10184, 3434, 3249, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2623, 67, 5336, 12, 8167, 67, 4482, 16, 3854, 67, 4083, 16, 1433, 67, 8167, 67, 4482, 16, 1433, 67, 5797, 67, 4083, 16, 7785, 273, 404, 16, 2826, 25577, 4672, 3536, 10184, 3434, 3249, ...
self.get_contents_to_file(fp, headers)
self.get_contents_to_file(fp, headers, cb)
def get_contents_to_filename(self, filename, headers=None): fp = open(filename, 'wb') self.get_contents_to_file(fp, headers) fp.close() # if last_modified date was sent from s3, try to set file's timestamp if self.last_modified != None: try: modified_tuple = rfc822.parsedate_tz(self.last_modified) modified_stamp = int(rfc822.mktime_tz(modified_tuple)) os.utime(fp.name, (modified_stamp, modified_stamp)) except Exception, e: pass
8815b75e1e9a04196177bd43eae30028f576ab63 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1098/8815b75e1e9a04196177bd43eae30028f576ab63/key.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3980, 67, 869, 67, 3459, 12, 2890, 16, 1544, 16, 1607, 33, 7036, 4672, 4253, 273, 1696, 12, 3459, 16, 296, 9464, 6134, 365, 18, 588, 67, 3980, 67, 869, 67, 768, 12, 7944, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3980, 67, 869, 67, 3459, 12, 2890, 16, 1544, 16, 1607, 33, 7036, 4672, 4253, 273, 1696, 12, 3459, 16, 296, 9464, 6134, 365, 18, 588, 67, 3980, 67, 869, 67, 768, 12, 7944, ...
return self.make_table(lambda x: x[0].sprintf("%IP.dst%:{TCP:tcp%TCP.dport%}{UDP:udp%UDP.dport%}{ICMP:ICMP}"), lambda x: x[0].ttl, lambda x: x[1].sprintf("%-15s,IP.src% {TCP:%TCP.flags%}{ICMP:%ir,ICMP.type%}"))
return self.make_table(lambda (s,r): (s.sprintf("%IP.dst%:{TCP:tcp%TCP.dport%}{UDP:udp%UDP.dport%}{ICMP:ICMP}"), s.ttl, r.sprintf("%-15s,IP.src% {TCP:%TCP.flags%}{ICMP:%ir,ICMP.type%}")))
def show(self):
e331990b0d8485c2b144b8e75bc86ef78d647e42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/e331990b0d8485c2b144b8e75bc86ef78d647e42/scapy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
fmid0=fmid ftx0=ftx.get() f10=f1.get()
def update(): global root_geom,isec0,im,pim,ndbm0,nsec0,a,ftx0,f10,nin0,nout0, \ receiving,transmitting,newdat,nscroll,newspec,scale0,offset0, \ modpixmap0,tw,s0,c0,fmid,fmid0,idsec,loopall,ntr0,txmsg,iband0, \ bandmap,bm tsec=time.time() + 0.1*idsec utc=time.gmtime(tsec) nsec=int(tsec) nsec0=nsec ns120=nsec % 120 try: f0.set(float(sf0.get())) ftx.set(float(sftx.get())) except: pass isec=utc[5] f1.set(f0.get()*options.calfactor.get()) t="%.6f" % (f1.get(),) sf1.set(t) if fmid!=fmid0 or ftx.get()!=ftx0 or f1.get()!=f10 or iband.get()!=iband0: draw_axis() lftx.configure(validate={'validator':'real', 'min':f0.get()+0.001500-0.000100,'minstrict':1, 'max':f0.get()+0.001500+0.000100,'maxstrict':1}) f0.set(freq0[iband.get()]) t="%.6f" % (f0.get(),) sf0.set(t) ftx.set(freqtx[iband.get()]) t="%.6f" % (ftx.get(),) sftx.set(t) if options.cat_enable.get(): nHz=int(1000000.0*f0.get()*options.calfactor.get()+0.5) cmd="rigctl -m %d -s %d -C serial_handshake=%s F %d" % \ (options.rignum.get(), options.serial_rate.get(), \ options.serial_handshake.get(), nHz) ierr=os.system(cmd) bandmap=[] bm={} text1.configure(state=NORMAL) text1.delete('1.0',END) text1.configure(state=DISABLED) iband0=iband.get() fmid0=fmid ftx0=ftx.get() f10=f1.get() freq0[iband.get()]=f0.get() freqtx[iband.get()]=ftx.get() if isec != isec0: #Do once per second isec0=isec t=time.strftime('%Y %b %d\n%H:%M:%S',utc) ldate.configure(text=t) root_geom=root.geometry() utchours=utc[3]+utc[4]/60.0 + utc[5]/3600.0 try: if options.dBm.get()!=ndbm0: ndbm0=options.dBm.get() options.dbm_balloon() except: pass put_params() nndf=int(1000000.0*(ftx.get()-f0.get()) + 0.5) - 1500 ndb=int(w.acom1.xdb1-57.0) if ndb<-30: ndb=-30 t='Rx Noise: '+str(ndb)+' dB' bg='gray85' r=SUNKEN if w.acom1.receiving: if ndb<-10 or ndb>10: bg='red' else: t='' if t=='': r=FLAT msg1.configure(text=t,bg=bg,relief=r)
4d9a6ff53775ce5a4ec720651f567b42bec1f1c8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2394/4d9a6ff53775ce5a4ec720651f567b42bec1f1c8/wspr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 13332, 2552, 1365, 67, 10049, 16, 291, 557, 20, 16, 381, 16, 84, 381, 16, 82, 1966, 81, 20, 16, 82, 3321, 20, 16, 69, 16, 74, 978, 20, 16, 74, 2163, 16, 82, 267, 20, 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, 1089, 13332, 2552, 1365, 67, 10049, 16, 291, 557, 20, 16, 381, 16, 84, 381, 16, 82, 1966, 81, 20, 16, 82, 3321, 20, 16, 69, 16, 74, 978, 20, 16, 74, 2163, 16, 82, 267, 20, 16, ...
quickEntryWidget.SetValue(text + ' ?')
quickEntryWidget.SetValue(text + error_string)
def onQuickEntryEvent (self, event): sidebar = self.findBlockByName("Sidebar") quickEntryBlock = self.findBlockByName("ApplicationBarQuickEntry") quickEntryWidget = quickEntryBlock.widget.GetControl()
ad9ac1a1be6663a33c6e34cd1854c4b4f7952cb6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/ad9ac1a1be6663a33c6e34cd1854c4b4f7952cb6/Main.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 13663, 1622, 1133, 261, 2890, 16, 871, 4672, 23364, 273, 365, 18, 4720, 1768, 5911, 2932, 8895, 3215, 7923, 9549, 1622, 1768, 273, 365, 18, 4720, 1768, 5911, 2932, 3208, 5190, 13663, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 13663, 1622, 1133, 261, 2890, 16, 871, 4672, 23364, 273, 365, 18, 4720, 1768, 5911, 2932, 8895, 3215, 7923, 9549, 1622, 1768, 273, 365, 18, 4720, 1768, 5911, 2932, 3208, 5190, 13663, ...
whole filed; for that it is better to use
whole field; for that it is better to use
def subfield(self, alpha, name=None): r""" Return an absolute number field K isomorphic to QQ(alpha) and a map from K to self that sends the generator of K to alpha.
b0aec2555dcb62b25affd1fa108cbb6e7fc30880 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/b0aec2555dcb62b25affd1fa108cbb6e7fc30880/number_field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29616, 12, 2890, 16, 4190, 16, 508, 33, 7036, 4672, 436, 8395, 2000, 392, 4967, 1300, 652, 1475, 353, 362, 18435, 358, 2238, 53, 12, 5429, 13, 471, 279, 852, 628, 1475, 358, 365, 716, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 29616, 12, 2890, 16, 4190, 16, 508, 33, 7036, 4672, 436, 8395, 2000, 392, 4967, 1300, 652, 1475, 353, 362, 18435, 358, 2238, 53, 12, 5429, 13, 471, 279, 852, 628, 1475, 358, 365, 716, ...
if type != "" and checksum == "?":
if typestr != "" and checksum == "?":
def _check_process(self, headers, filesize, checksums = {}): size = "?" checksum = "?" sizeheader = self._get_header(headers, "Content-Length") # digest code, untested since no servers seem to support this digest = self._get_header(headers, "Content-MD5") if digest != None: try: if binascii.hexlify(binascii.a2b_base64(digest)).lower() == checksums['md5'].lower(): checksum = _("OK") else: checksum = _("FAIL") except KeyError: pass
cedf2d3fa50ba7140bc823ffa4ba7db6a4c37228 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6425/cedf2d3fa50ba7140bc823ffa4ba7db6a4c37228/metalinkc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1893, 67, 2567, 12, 2890, 16, 1607, 16, 14104, 16, 26829, 273, 2618, 4672, 963, 273, 13574, 6697, 273, 13574, 225, 963, 3374, 273, 365, 6315, 588, 67, 3374, 12, 2485, 16, 315, 135...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1893, 67, 2567, 12, 2890, 16, 1607, 16, 14104, 16, 26829, 273, 2618, 4672, 963, 273, 13574, 6697, 273, 13574, 225, 963, 3374, 273, 365, 6315, 588, 67, 3374, 12, 2485, 16, 315, 135...
def __init__(self, design, weights=1, **keywords): LikelihoodModel.__init__(self, **keywords)
def __init__(self, design, weights=1):
def __init__(self, design, weights=1, **keywords): LikelihoodModel.__init__(self, **keywords) self.weights = weights self.initialize(design)
9ddff40881d697c0b8f7657aabf6bd401fbfe489 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/9ddff40881d697c0b8f7657aabf6bd401fbfe489/regression.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 8281, 16, 5376, 33, 21, 4672, 365, 18, 9727, 273, 5376, 365, 18, 11160, 12, 16934, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 8281, 16, 5376, 33, 21, 4672, 365, 18, 9727, 273, 5376, 365, 18, 11160, 12, 16934, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
assert base.controlForce.getLocalVector() == newVector assert base.controlForce.getPhysicsObject() assert base.controlForce.getPhysicsObject() == physObject
assert base.controlForce.getLocalVector() == newVector,'1' assert base.controlForce.getPhysicsObject(),'2' assert base.controlForce.getPhysicsObject() == physObject,'3'
def handleAvatarControls(self, task): """ Check on the arrow keys and update the "avatar" (ship). """ if __debug__: if self.wantDebugIndicator: onScreenDebug.append("localAvatar pos = %s\n"%( base.localAvatar.getPos().pPrintValues(),)) onScreenDebug.append("localAvatar hpr = %s\n"%( base.localAvatar.getHpr().pPrintValues(),)) assert self.debugPrint("handleAvatarControls(task=%s)"%(task,)) physObject = self.actorNode.getPhysicsObject() contact = self.actorNode.getContactVector() # get the button states: forward = inputState.isSet("forward") reverse = inputState.isSet("reverse") turnLeft = inputState.isSet("slideLeft") or inputState.isSet("turnLeft") turnRight = inputState.isSet("slideRight") or inputState.isSet("turnRight") slide = inputState.isSet("slide") slideLeft = 0 slideRight = 0 jump = inputState.isSet("jump") # Determine what the speeds are based on the buttons:
649ff0db6e516c16462fde7ac98f7d373fdf8b06 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7242/649ff0db6e516c16462fde7ac98f7d373fdf8b06/ShipPilot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 23999, 16795, 12, 2890, 16, 1562, 4672, 3536, 2073, 603, 326, 12274, 1311, 471, 1089, 326, 315, 19660, 6, 261, 3261, 2934, 3536, 309, 1001, 4148, 972, 30, 309, 365, 18, 17369, 2829...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 23999, 16795, 12, 2890, 16, 1562, 4672, 3536, 2073, 603, 326, 12274, 1311, 471, 1089, 326, 315, 19660, 6, 261, 3261, 2934, 3536, 309, 1001, 4148, 972, 30, 309, 365, 18, 17369, 2829...
print "\nFATAL ERROR on package %s" % (package.name())
print "\nFATAL ERROR on package %s\n" % (package.name())
def postProcessPackage(package): pkgutil.debug("Post process package " + package.name()) pkgutil.debug(" - uncompressing...") package.packageDir = options.packageRoot + "/" + package.name() pkgutil.uncompress(package.dataFile, package.packageDir); os.chdir(package.packageDir) if os.path.isfile("FATAL.ERROR"): print "\nFATAL ERROR on package %s" % (package.name()) return; shutil.copy(package.packageDir + "/.task.log", options.packageRoot + "/." + package.name() + ".tasklog"); pkgutil.debug(" - creating directories...") for mkdir in package.mkdirs: os.makedirs(mkdir) pkgutil.debug(" - copying files around...") copyFiles(package) pkgutil.debug(" - deleting files and directories...") removeFiles(package) # unjar docs into doc directory... pkgutil.debug(" - doing docs...") os.makedirs("doc/html") os.chdir("doc/html") os.system("jar -xf %s/qtjambi-javadoc-%s.jar" % (options.startDir, options.qtJambiVersion) ) os.chdir(package.packageDir) expandMacroes(package) # unpack the platform .jar to get the correct binary content into # the package... os.system("jar -xf %s" % package.platformJarName) shutil.rmtree("%s/META-INF" % package.packageDir) bundle(package)
9ac47f9ecf789734865da2c0706a0c3dc2eb6813 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4229/9ac47f9ecf789734865da2c0706a0c3dc2eb6813/package_builder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1603, 2227, 2261, 12, 5610, 4672, 3475, 1367, 18, 4148, 2932, 3349, 1207, 2181, 315, 397, 2181, 18, 529, 10756, 225, 3475, 1367, 18, 4148, 2932, 300, 12704, 1028, 310, 7070, 13, 2181, 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, 1603, 2227, 2261, 12, 5610, 4672, 3475, 1367, 18, 4148, 2932, 3349, 1207, 2181, 315, 397, 2181, 18, 529, 10756, 225, 3475, 1367, 18, 4148, 2932, 300, 12704, 1028, 310, 7070, 13, 2181, 18...
def __init__(self, master=None):
def __init__(self, master=None, value=None, name=None):
def __init__(self, master=None): """Construct a string variable.
337487e3b87f887abdb3b47781508c6437cd7e94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/337487e3b87f887abdb3b47781508c6437cd7e94/Tkinter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4171, 33, 7036, 16, 460, 33, 7036, 16, 508, 33, 7036, 4672, 3536, 7249, 279, 533, 2190, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4171, 33, 7036, 16, 460, 33, 7036, 16, 508, 33, 7036, 4672, 3536, 7249, 279, 533, 2190, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
self.changed()
def addmol(self, mol): #bruce 050228 revised this for Part (was on assy) and for inval/update of part-summary attrs. """(Public method:) Add a chunk to this Part (usually the "current Part"). Invalidate part attributes which summarize part content (e.g. bbox, drawLevel).
0abde4f5ce347d2e9de87cb0501caffd0127e8c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/0abde4f5ce347d2e9de87cb0501caffd0127e8c2/part.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 21260, 12, 2890, 16, 12629, 4672, 468, 2848, 3965, 15331, 3103, 6030, 283, 26779, 333, 364, 6393, 261, 17416, 603, 1551, 93, 13, 471, 364, 316, 1125, 19, 2725, 434, 1087, 17, 7687, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 21260, 12, 2890, 16, 12629, 4672, 468, 2848, 3965, 15331, 3103, 6030, 283, 26779, 333, 364, 6393, 261, 17416, 603, 1551, 93, 13, 471, 364, 316, 1125, 19, 2725, 434, 1087, 17, 7687, ...
if inst.errno != errno.ENOENT: raise
if nonexistent:
def changes(self, files=None, match=util.always): lookup, modified, added, unknown = [], [], [], [] removed, deleted = [], []
96032505f683e49a6628cd8635161914c169b238 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/96032505f683e49a6628cd8635161914c169b238/dirstate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3478, 12, 2890, 16, 1390, 33, 7036, 16, 845, 33, 1367, 18, 17737, 4672, 3689, 16, 4358, 16, 3096, 16, 5917, 273, 5378, 16, 5378, 16, 5378, 16, 5378, 3723, 16, 4282, 273, 5378, 16, 53...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3478, 12, 2890, 16, 1390, 33, 7036, 16, 845, 33, 1367, 18, 17737, 4672, 3689, 16, 4358, 16, 3096, 16, 5917, 273, 5378, 16, 5378, 16, 5378, 16, 5378, 3723, 16, 4282, 273, 5378, 16, 53...
skw = SetKeyword(SetKeywordData(['${var}','KW','RETURN','value']))
self._verify_scalar('value') def test_set_object_to_scalar(self): self._verify_scalar(self) def test_set_empty_list_to_scalar(self): self._verify_scalar([]) def test_set_list_with_one_element_to_scalar(self): self._verify_scalar(['hi']) def test_set_strings_to_multiple_scalars(self): self._verify_three_scalars('x', 'y', 'z') def test_set_objects_to_multiple_scalars(self): self._verify_three_scalars(['x', 'y'], {}, None) def test_set_list_of_strings_to_list(self): self._verify_list(['x','y','z']) def test_set_empty_list_to_list(self): self._verify_list([]) def test_set_objects_to_list(self): self._verify_list([{True: False}, None, self]) def test_set_objects_to_two_scalars_and_list(self): variables = self._run_kw(['${v1}','${v2}','@{v3}'], ['a',None,'x','y',{}]) assert_equal(variables['${v1}'], 'a') assert_equal(variables['${v2}'], None) assert_equal(variables['@{v3}'], ['x','y',{}]) def test_set_scalars_and_list_so_that_list_is_empty(self): variables = self._run_kw(['${scal}','@{list}'], ['a']) assert_equal(variables['${scal}'], 'a') assert_equal(variables['@{list}'], []) def test_set_more_values_than_variables(self): variables = self._run_kw(['${v1}','${v2}'], ['x','y','z']) assert_equal(variables['${v1}'], 'x') assert_equal(variables['${v2}'], ['y','z']) def test_set_too_few_scalars_raises(self): assert_raises(ExecutionFailed, self._run_kw, ['${v1}','${v2}'], ['x']) def test_set_list_but_no_list_raises(self): assert_raises(ExecutionFailed, self._run_kw, ['@{list}'], 'not a list') def test_set_too_few_scalars_with_list_raises(self): assert_raises(ExecutionFailed, self._run_kw, ['${v1}','${v2}','@{list}'], ['x']) def _verify_scalar(self, return_value): variables = self._run_kw(['${var}'], return_value) assert_equal(variables['${var}'], return_value) def _verify_list(self, return_value): variables = self._run_kw(['@{var}'], return_value) assert_equal(variables['@{var}'], return_value) def _verify_three_scalars(self, ret1, ret2, ret3): variables = self._run_kw(['${v1}','${v2}','${v3}'], [ret1, ret2, ret3]) assert_equal(variables['${v1}'], ret1) assert_equal(variables['${v2}'], ret2) assert_equal(variables['${v3}'], ret3) def _run_kw(self, assign, return_value): kw = Keyword('Name', ['Return', return_value], assign)
def test_set_string_to_scalar(self): skw = SetKeyword(SetKeywordData(['${var}','KW','RETURN','value'])) context = _FakeContext() skw.run(context) assert_equal(context.variables['${var}'], 'value')
db947bb573ca3f7482e3c6dd93e6347db242691f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7408/db947bb573ca3f7482e3c6dd93e6347db242691f/test_keywords.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 542, 67, 1080, 67, 869, 67, 8748, 12, 2890, 4672, 365, 6315, 8705, 67, 8748, 2668, 1132, 6134, 225, 1652, 1842, 67, 542, 67, 1612, 67, 869, 67, 8748, 12, 2890, 4672, 365, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 542, 67, 1080, 67, 869, 67, 8748, 12, 2890, 4672, 365, 6315, 8705, 67, 8748, 2668, 1132, 6134, 225, 1652, 1842, 67, 542, 67, 1612, 67, 869, 67, 8748, 12, 2890, 4672, 365, 6...
package_dir={ '' : 'lib' }, packages=['thandy', 'thandy.packagesys'],
package_dir=pkg_dir, packages=pkgs,
def run(self): script_path = None sys_path = map(os.path.normpath, sys.path) sys_path = map(os.path.normcase, sys_path) install_lib = os.path.normcase(os.path.normpath(self.install_lib))
6ebc7d6103098e695c33f55f84e6f64f5d795e84 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9410/6ebc7d6103098e695c33f55f84e6f64f5d795e84/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 2728, 67, 803, 273, 599, 2589, 67, 803, 273, 852, 12, 538, 18, 803, 18, 7959, 803, 16, 2589, 18, 803, 13, 2589, 67, 803, 273, 852, 12, 538, 18, 803, 18, 7959,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 2728, 67, 803, 273, 599, 2589, 67, 803, 273, 852, 12, 538, 18, 803, 18, 7959, 803, 16, 2589, 18, 803, 13, 2589, 67, 803, 273, 852, 12, 538, 18, 803, 18, 7959,...
if self.cur_event-1 >= 0:
if valid_event and self.cur_event-1 >= 0:
def selEntry(self, dir, visible=True): cur_service = self.cur_service #(service, service_name, events) if not self.event_rect: self.recalcEntrySize() if cur_service and self.cur_event is not None: update = True entries = cur_service[2] if dir == 0: #current update = False elif dir == +1: #next if self.cur_event+1 < len(entries): self.cur_event+=1 else: self.offs += 1 self.fillMultiEPG(None) # refill return True elif dir == -1: #prev if self.cur_event-1 >= 0: self.cur_event-=1 elif self.offs > 0: self.offs -= 1 self.fillMultiEPG(None) # refill return True entry = entries[self.cur_event] #(event_id, event_title, begin_time, duration) time_base = self.time_base+self.offs*self.time_epoch*60 xpos, width = self.calcEntryPosAndWidth(self.event_rect, time_base, self.time_epoch, entry[2], entry[3]) self.l.setSelectionClip(eRect(xpos, 0, width, self.event_rect.height()), visible and update) else: self.l.setSelectionClip(eRect(self.event_rect.left(), self.event_rect.top(), self.event_rect.width(), self.event_rect.height()), False) self.selectionChanged() return False
b942bab40252e20a5cbefb0cca47ea1ab42688c6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6652/b942bab40252e20a5cbefb0cca47ea1ab42688c6/GraphMultiEpg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 357, 1622, 12, 2890, 16, 1577, 16, 6021, 33, 5510, 4672, 662, 67, 3278, 273, 365, 18, 1397, 67, 3278, 468, 12, 3278, 16, 1156, 67, 529, 16, 2641, 13, 309, 486, 365, 18, 2575, 67, 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, 357, 1622, 12, 2890, 16, 1577, 16, 6021, 33, 5510, 4672, 662, 67, 3278, 273, 365, 18, 1397, 67, 3278, 468, 12, 3278, 16, 1156, 67, 529, 16, 2641, 13, 309, 486, 365, 18, 2575, 67, 2...
print "from win32com.client import CoClassBaseClass"
print >> self.file, "from win32com.client import CoClassBaseClass"
def checkWriteCoClassBaseClass(self): if not self.bHaveWrittenCoClassBaseClass: print "from win32com.client import CoClassBaseClass" self.bHaveWrittenCoClassBaseClass = 1
d465d55b4c2e9a03e3b613dd6344bf0290ff0ff6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/d465d55b4c2e9a03e3b613dd6344bf0290ff0ff6/genpy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 3067, 4249, 797, 2171, 797, 12, 2890, 4672, 309, 486, 365, 18, 70, 17944, 12643, 4249, 797, 2171, 797, 30, 1172, 1671, 365, 18, 768, 16, 315, 2080, 5657, 1578, 832, 18, 2625, 1930...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 3067, 4249, 797, 2171, 797, 12, 2890, 4672, 309, 486, 365, 18, 70, 17944, 12643, 4249, 797, 2171, 797, 30, 1172, 1671, 365, 18, 768, 16, 315, 2080, 5657, 1578, 832, 18, 2625, 1930...
if self.resize_callback: self.resize_callback(self.height())
self.resize_to_minimum() self.rearrange_callback()
def showEvent(self, event): self.timer = QtCore.QTimer(self) self.connect(self.timer, QtCore.SIGNAL("timeout()"), self.opacity_timer) self.timer.start(1) if self.resize_callback: self.resize_callback(self.height())
6da3a49668769c8248fc6884f3a4fb927515ce5a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1208/6da3a49668769c8248fc6884f3a4fb927515ce5a/gui_pyqt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 1133, 12, 2890, 16, 871, 4672, 365, 18, 12542, 273, 20193, 18, 53, 6777, 12, 2890, 13, 365, 18, 3612, 12, 2890, 18, 12542, 16, 20193, 18, 11260, 1013, 2932, 4538, 10031, 3631, 36...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 1133, 12, 2890, 16, 871, 4672, 365, 18, 12542, 273, 20193, 18, 53, 6777, 12, 2890, 13, 365, 18, 3612, 12, 2890, 18, 12542, 16, 20193, 18, 11260, 1013, 2932, 4538, 10031, 3631, 36...
print 'Skip', path,'- Up-to-date'
print 'Skip', dstfile,'- Up-to-date'
def hexbincwprojects(creator): """Compact and hexbin all files remembered with a given creator""" print 'Please start project mgr with signature', creator,'-' sys.stdin.readline() try: mgr = MwShell(creator) except 'foo': print 'Not handled:', creator return for fss in project_files[creator]: srcfile = fss.as_pathname() dstfile = srcfile + '.hqx' if os.path.exists(dstfile) and \ os.stat(dstfile)[8] > os.stat(srcfile)[8]: print 'Skip', path,'- Up-to-date' continue print 'Compacting', dstfile mgr.open(fss) mgr.Reset_File_Paths() mgr.Remove_Binaries() mgr.Close_Project() print 'Binhexing', dstfile binhex.binhex(srcfile, dstfile) mgr.quit()
54500bb79fb744d9725168f5acaaf3612c221aa8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/54500bb79fb744d9725168f5acaaf3612c221aa8/binhextree.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3827, 4757, 71, 91, 13582, 12, 20394, 4672, 3536, 16863, 471, 3827, 4757, 777, 1390, 11586, 329, 598, 279, 864, 11784, 8395, 1172, 296, 8496, 787, 1984, 13333, 598, 3372, 2187, 11784, 1118...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3827, 4757, 71, 91, 13582, 12, 20394, 4672, 3536, 16863, 471, 3827, 4757, 777, 1390, 11586, 329, 598, 279, 864, 11784, 8395, 1172, 296, 8496, 787, 1984, 13333, 598, 3372, 2187, 11784, 1118...
intermidiate steps ``scan`` should use for a given output. Use
intermediate steps ``scan`` should use for a given output. Use
def scan( fn , sequences = None , outputs_info = None , non_sequences = None , n_steps = None , truncate_gradient = -1 , go_backwards = False , mode = None , name = None ): """ This function constructs and applies a Scan op to the provided arguments. :param fn: ``fn`` is a function that describes the operations involved in one step of ``scan``. ``fn`` should construct variables describing the output of one iteration step. It should expect as input theano variables representing all the time slices of the input sequences and outputs, and all other arguments given to scan as ``non_sequences``. The order in which scan passes this variables to ``fn`` is the following : * all time slices of the first sequence * all time slices of the second sequence * ... * all time slices of the last sequence * all time slices of the first output * all time slices of the second otuput * ... * all time slices of the last output * all other arguments (the list given as `non_sequences` to scan) The order of the sequences is the same as the one in the list `sequences` given to scan. The order of the outputs is the sane as the order of ``output_info``. For any sequence or output the order of the time slices is the same as the order of the time taps provided. For example if one writes the following : .. code-block:: python scan(fn, sequences = [ dict( Sequence1, taps = [-3,2,-1]) , Sequence2 , dict( Sequence3, taps = 3) ] , outputs_info = [ dict( Output1, taps = [-3,-5]) , dict( Output2, taps = None) , Output3 ] , non_sequences = [ Argument1, Argument 2]) ``fn`` should expect the following arguments in this given order: #. ``Sequence1[t-3]`` #. ``Sequence1[t+2]`` #. ``Sequence1[t-1]`` #. ``Sequence2[t]`` #. ``Sequence3[t+3]`` #. ``Output1[t-3]`` #. ``Output1[t-5]`` #. ``Output3[t-1]`` #. ``Argument1`` #. ``Argument2`` The list of ``non_sequences`` can also contain shared variables used in the function, though ``scan`` is able to figure those out on its own so they can be skipped. For the clarity of the code we recommand though to provide them to scan. The function is expected to return two things. One is a list of outputs ordered in the same order as ``outputs_info``, with the difference that there should be only one output variable per output initial state (even if no tap value is used). Secondly `fn` should return an update dictionary ( that tells how to update any shared variable after each iteration ste). The dictionary can optionally be given as a list of tuples. There is no constraint on the order of these two list, ``fn`` can return either ``(outputs_list, update_dictionary)`` or ``(update_dictionary, outputs_list)`` or just one of the two (in case the other is empty). :param sequences: ``sequences`` is the list of Theano variables or dictionaries describing the sequences ``scan`` has to iterate over. If a sequence is given as wrapped in a dictionary a set of optional information can be provided about the sequence. The dictionary should have the following keys: * ``input`` (*mandatory*) -- Theano variable representing the sequence. * ``taps`` -- Temporal taps of the sequence required by ``fn``. They are provided as a list of integers, where a value ``k`` impiles that at iteration step ``t`` scan will pass to ``fn`` the slice ``t+k``. Default value is ``[0]`` Any Theano variable in the list ``sequences`` is automatically wrapped into a dictionary where ``taps`` is set to ``[0]`` :param outputs_info: ``outputs_info`` is the list of Theano variables or dictionaries describing the initial state of the outputs computed recurrently. When this initial states are given as dictionary optional information can be provided about the output corresponding to these initial states. The dictionary should have the following keys: * ``initial`` -- Theano variable that represents the initial state of a given output. In case the output is not computed recursively (think of a map) and does not require a initial state this field can be skiped. Given that only the previous time step of the output is used by ``fn`` the initial state should have the same shape as the output. If multiple time taps are used, the initial state should have one extra dimension that should cover all the possible taps. For example if we use ``-5``, ``-2`` and ``-1`` as past taps, at step 0, ``fn`` will require (by an abuse of notation) ``output[-5]``, ``output[-2]`` and ``output[-1]``. This will be given by the initial state, which in this case should have the shape (5,)+output.shape. If this variable containing the initial state is called ``init_y`` then ``init_y[0]`` *corresponds to* ``output[-5]``. ``init_y[1]`` *correponds to* ``output[-4]``, ``init_y[2]`` corresponds to ``output[-3]``, ``init_y[3]`` coresponds to ``output[-2]``, ``init_y[4]`` corresponds to ``output[-1]``. While this order might seem strange, it comes natural from splitting an array at a given point. Assume that we have a array ``x``, and we choose ``k`` to be time step ``0``. Then our initial state would be ``x[:k]``, while the output will be ``x[k:]``. Looking at this split, elements in ``x[:k]`` are ordered exactly like those in ``init_y``. * ``taps`` -- Temporal taps of the output that will be pass to ``fn``. They are provided as a list of *negative* integers, where a value ``k`` implies that at iteration step ``t`` scan will pass to ``fn`` the slice ``t+k``. * ``inplace`` -- One of the Theano variables provided as ``sequences``. ``scan`` will try to compute this output *in place* of the provided input *iff* it respects the following constraints: * There is no other output that is denied to be computed in place for whatever reason. * ``fn`` is not using past taps of the input sequence that will get overwritten by the output * ``return_steps`` -- Integer representing the number of steps to return for the current steps. For example, if ``k`` is provided, ``scan`` will return ``output[-k:]``. This is meant as a hint, based on ``k`` and the past taps of the outputs used, scan can be smart about the amount of memory it requires to store intermidiate results. If not given, or ``0``, ``scan`` will return all computed steps. * ``store_steps`` -- Integer representing the number of intermidiate steps ``scan`` should use for a given output. Use this key only if you really know what you are doing. In general is recommendat to let scan decide for you the ammount of memory it should use. ``scan`` will follow this logic if partial information is given: * If an output is not wrapped in a dictionary, ``scan`` will wrap it in one assuming that you use only the last step of the output (i.e. it makes your tap value list equal to [-1]) and that it is not computed inplace. * If you wrap an output in a dictionary and you do not provide any taps but you provide an initial state it will assume that you are using only a tap value of -1. * If you wrap an output in a dictionary but you do not provide any initial state, it assumes that you are not using any form of taps. * If you provide a ``None`` instead of a variable or a dictionary ``scan`` assumes that you will not use any taps for this output (like for example in case of a map) If ``outputs_info`` is an empty list or None, ``scan`` assumes that no tap is used for any of the otuputs. If information is provided just for a subset of the outputs an exception is raised (because there is no convention on how scan should map the provided information to the outputs of ``fn``) :param non_sequences: ``non_sequences`` is the list of arguments that are passed to ``fn`` at each steps. Once can opt to exclude shared variables used in ``fn`` from this list. :param n_steps: ``n_steps`` is the number of steps to iterate given as an int or Theano scalar. If any of the input sequences do not have enough elements, scan will produce a warning and run only for the maximal amount of steps it can. If the *value is 0* the outputs will have *0 rows*. If the value is negative, ``scan`` run backwards in time. If the ``go_backwards`` flag is already set and also ``n_steps`` is negative, ``scan`` will run forward in time. If n stpes is not provided, or evaluates to ``None``, ``inf`` or ``NaN``, ``scan`` will figure out the amount of steps it should run given its input sequences. :param truncate_gradient: ``truncate_gradient`` is the number of steps to use in truncated BPTT. If you compute gradients through a scan op, they are computed using backpropagation through time. By providing a different value then -1, you choose to use truncated BPTT instead of classical BPTT, where you go for only ``truncate_gradient`` number of steps back in time. :param go_backwards: ``go_backwards`` is a flag indicating if ``scan`` should go backwards through the sequences. If you think of each sequence as indexed by time, making this flag True would mean that ``scan`` goes back in time, namely that for any sequence it starts from the end and goes towards 0. :param name: When profiling ``scan`` it is crucial to provide a name for any instance of ``scan``. The profiler will produce an overall profile of your code as well as profiles for doing one iteration step for each instance of ``scan``. The ``name`` of the instance is how you differentiate between all these profiles. :param mode: It is recommended to leave this argument to None, especially when profiling ``scan`` (otherwise the results are not going to be accurate). If you prefer the computations of one step os ``scan`` to be done differently then the entire function set this parameters (see ``theano.function`` for details about possible values and their meaning). :rtype: tuple :return: tuple of the form (outputs, updates); ``outputs`` is either a Theano variable or a list of Theano variables representing the outputs of ``scan`` (in the same order as in ``outputs_info``). ``updates`` is a dictionary specifying the update rules for all shared variables used in the scan operation. This dictionary should be passed to ``theano.function`` when you compile your function. """ # General observation : this code is executed only once, at creation # of the computational graph, so we don't yet need to be smart about # anything ( to speed things up) # check if inputs are just single variables instead of lists if not (type(sequences) in (list, tuple)) and sequences != None: seqs = [sequences] elif sequences == None: seqs = [] else: seqs = sequences if not (type(outputs_info) in (list,tuple)) and outputs_info != None: outs_info = [outputs_info] elif outputs_info == None: outs_info = [] else: outs_info = outputs_info if ( not (type(non_sequences) in (list,tuple)) and non_sequences != None): non_seqs = [non_sequences] elif non_sequences == None: non_seqs = [] else: non_seqs = non_sequences # If we provided a known number of steps ( before compilation) # and if that number is 1 or -1, then we can skip the Scan Op, # and just apply the inner function once # To do that we check here to see the nature of n_steps if type(n_steps) in (float,int): n_fixed_steps = int(n_steps) else: # also check if this value happens to be a constant, # then we could do the same try : n_fixed_steps = opt.get_constant_value(n_steps) except: n_fixed_steps = None # compute number of sequences and number of outputs n_seqs = len(seqs) n_outs = len(outs_info) # initialize the inplace map, sequences map and # outputs map ''' Details: The scan op identifies different properties attached to input tensors by their order in the input list. These maps ( inplace, sequence_taps, output_taps, store_steps, return_steps) go from the index of an input to its properties. Note that inputs are always first, followed by outputs. Since we always know the number of inputs we index the outputs from 0 ( so sometimes you will need to do something like outputs_taps[i-n_ins] ''' inplace_map = {} sequences_taps = {} outputs_taps = {} # Assume that for any output we want to store everythin that it produces store_steps = [] return_steps = {} # wrap sequences in a dictionary if they are not already dictionaries # in the same pass create a sequences_taps dictionary for i in xrange(n_seqs): if not type(seqs[i]) == dict : # if it is not a dictionary make it into one seqs[i] = dict(input=seqs[i], taps=[0]) # see if taps values are provided as a list elif seqs[i].get('taps',None): # users can optionally provide the past value (if is just # one) as a number instead of a list. Wrap it in a list # to have a uniform way of dealing with inputs later on if not type(seqs[i]['taps']) in (tuple,list): seqs[i]['taps'] = [seqs[i]['taps']] else: # See if the user actually provided the None value to taps, # which would indicate that the sequence was provided but # not used by the internal function; Only if the user has # not provided anything add the defaul [0] # Possible reason to provide a squence and not use it is # if you want to compute the output # inplace of this input; it is a very unlikely behaviour but # we do want to cover it for completeness if not seqs[i].has_key('taps'): seqs[i][taps] = [0] # Now that our input is well behaved, collect the taps in the # sequences_taps map that we will use later in the body of scan # since inputs will be just tensors there if seqs[i].get('taps',None): sequences_taps[i] = seqs[i]['taps'] # wrap outputs info in a dictionary if they are not already # in one and in the same pass create a init_outs_taps dictionary and a inplace map for i in xrange(n_outs): if outs_info[i]: # If output is a dictionary, collect the number of steps the # user would like scan to return if type(outs_info[i]) == dict: if outs_info[i].get('return_steps', None): return_steps[i] = outs_info[i]['return_steps'] # If you provide the number of steps to store internally, # (not advocated in the user documentation), then also # make sure you are returning only those number of steps if outs_info[i].get('store_steps', None): store_steps += [outs_info[i].get('store_steps',None)] return_steps[i] = outs_info[i].get('store_steps',None) else: store_steps += [0] else: store_steps += [0] # trying to collect taps of the output if not type(outs_info[i]) == dict: # by default any output has a tap value of -1 outs_info[i] = dict(initial=outs_info[i], taps = [-1]) # if there is no initial state but there are taps # then return an error because it makes no sense elif (not outs_info[i].get('initial',None)) and \ (outs_info[i].get('taps',None)): raise ValueError('If you are using slices of an output you need to '\ 'provide a initial state for it', outs_info[i]) # if there is an intial state but no tap, we will add the default value # for taps, namely [-1] ( previous value); not that this will happen # even though you have provided for taps the value None, which is a bit # strange (why would one provide an initial state but tell scan not to # use it ? ), just that in that case we will throw in a warning message # pointing out this inconsistency elif outs_info[i].get('initial',None) and \ ( not outs_info[i].get('taps',None)): if outs_info[i].has_key('taps'): warning('You are providing a initial state for an output and then ' 'tell scan not to use it. Why? Scan will overwrite this setting' ' and use the previous value of the provided initial state. If' ' this is not what you wanted, check your code and do not ' 'provide the initial state') outs_info[i]['taps'] = [-1] else: # if the output is a None then replace it with an empty dictionary for # easing up dealing with this case later one ( we can directly call .has_key # and things like this outs_info[i] = dict() store_steps += [0] if outs_info[i].get('taps', None): # Create a separate outputs_taps dictionary with all the outputs taps; This # is how the Scan Op expects this information, separeted from the variables outputs_taps[i] = outs_info[i]['taps'] if outs_info[i].get('inplace', None): # The same is true for the inplace info; it has to go into a separate # dictionary based on index; Note that the input we're replacing should also # come as an index, therefore we have to look for it at this point found = None for k in xrange(n_seqs): if seqs[k].get('input', None) == outs_info[i].get('inplace',None): found = k if found != None: # NOTE : inplace_map is identical to destroy_map, i.e. it tells what # output is computed inplace of what input !! inplace_map[i] = found else: raise ValueError('Asked to compute in place of a non-input variable',\ outs_info[i].get('inplace', None)) # create theano inputs for the recursive function # note : this is a first batch of possible inputs that will # be compiled in a dummy function; we used this dummy # function to detect shared variables and their updates # and to construct a new and complete list of inputs and outputs args = [] # list of arguments dummy_notshared_ins = 0 # number of arguments corresponding to input seqs dummy_notshared_init_outs = 0 # number of arguments corresponding to output seqs slice_to_seqs = [] # for each slice index of the corresponding input # go through sequences picking up time slices as needed for i,seq in enumerate(seqs): # Note that you can have something like no taps for # a sequence, though is highly unlikely in practice if seq.get('taps', None): # go through the indicated slice mintap = numpy.min(seq['taps']) for k in seq['taps']: # create one slice of the input ''' Later on, if we decide not to use scan because we are going for just one step, it makes things easier if we compute the correct outputs here. This way we can use the output of the lambda expression directly to replace the output of scan. If not we need to use copies, that will be replaced at each frame by the corresponding slice ''' if n_fixed_steps not in [1,-1]: nw_slice = seq['input'][0].type() elif n_fixed_steps == 1: nw_slice = seq['input'][k-mintap] else: nw_slice = seq['input'][-1+mintap-k] # Add names to slices for debugging and pretty printing .. # that is if the input already has a name if seq['input'].name: if seq['taps'][k] > 0: nw_slice.name = seq['input'].name + '[t+%d]'%seq['taps'][k] elif seq['taps'][k] == 0: nw_slice.name = seq['input'].name + '[t]' else: nw_slice.name = seq['input'].name + '[t%d]'%seq['taps'][k] args.append(nw_slice) # Specify to whom this slice belongs slice_to_seqs.append(i) # Any slice is not a shared variable, even though the sequence # from where we pick the slices is shared, therefore we should # increase the number of notshared inputs to the dummy function # by the number of slices dummy_notshared_ins += len(seq['taps']) # go through outputs picking up time slices as needed for i,init_out in enumerate(outs_info): # Note that our convention dictates that if an output uses # just the previous time step, as a initial state we will only provide # a tensor of the same dimension as one time step; This makes code # much cleaner for those who do not use taps. Otherwise they would # always had to shape_pad_left the initial state .. which is ugly if init_out.get('taps', None) == [-1]: if n_fixed_steps in [-1,1]: args += [init_out['initial']] else: args += [init_out['initial'].type()] # Added name to slices for debugging and pretty printing if init_out['initial'].name: args[-1].name = init_out['initial'].name+'[t-1]' # we need to specify in slice_seqs to which output this # slice belongs; Because we might get confused afterwards # if a number is an index of a sequence or an output, and # because we do not want to create yet another list, we will # add the number of sequences + the current output. This makes # decoding easy and spares us from writing a lot of lines slice_to_seqs += [ i+n_seqs ] dummy_notshared_init_outs += 1 elif init_out.get('taps',None): if numpy.any(numpy.array(init_out.get('taps',[])) > 0): # Make sure we do not have requests for future values of a sequence # we can not provide such values raise ValueError('Can not use future taps of outputs', init_out) # go through the taps minstep = abs(numpy.min(init_out['taps'])) for k in init_out['taps']: # create a new slice if n_fixed_steps in [1,-1]: nw_slice = init_out['initial'][k+minstep] else: nw_slice = init_out['initial'][0].type() # give it a name or debugging and pretty printing if init_out['initial'].name: if k > 0: nw_slice.name = init_out['initial'].name + '[t+%d]'%k elif k == 0: nw_slice.name = init_out['initial'].name + '[t]' else: nw_slice.name = init_out['initial'].name + '[t%d]'%k args.append(nw_slice) # indicate the output index + n_seqs ( see above why) slice_to_seqs.append(i + n_seqs) # add as many slices as there are taps dummy_notshared_init_outs += len(init_out['taps']) #NOTE: there is another case, in which we do not want to provide any previous # value of the output to the inner case; in this case we do not have to do # anything .. # remove shared variables from the non sequences list # such that we can compile the function ( the user has the option to add them when # writing scan, because in some situations this might make the code more readable) notshared_other_args = [] for non_seq in non_seqs: if not isinstance(non_seq, SharedVariable): notshared_other_args += [non_seq] # add only the not shared variables to the arguments of the dummy # function [ a function should not get shared variables as input ] dummy_args = [] for arg in args: if not isinstance(arg, SharedVariable): dummy_args += [arg] dummy_args += notshared_other_args # arguments for the lambda expression that gives us the output # of the inner function args += non_seqs # when we apply the lambda expression we get a mixture of update rules # and outputs that needs to be separated outputs_updates = fn(*args) # The code that follows tries to be as flexible as possible allowing the # user to return the output and updates in any order, and giving the updates # however he wants ( as a dictionary or a list o pairs ..) # Is there a way to compress all this by writing it in a more python/functional way? outputs = [] updates = {} # we will try now to separate the outputs from the updates if not type(outputs_updates) in (list,tuple): if type(outputs_updates) == dict : # we have just an update dictionary updates = outputs_updates else: outputs = [outputs_updates] else: elem0 = outputs_updates[0] elem1 = outputs_updates[1] t_el0 = type(elem0) t_el1 = type(elem1) if t_el0 == dict or ( t_el0 in (list,tuple) and type(elem0[0]) in (list,tuple)): # elem0 is the updates dictionary / list updates = elem0 outputs = elem1 if not type(outputs) in (list,tuple): outputs = [outputs] elif ( type(elem1) == dict) or \ ( type(elem1) in (list,tuple) and type(elem1[0]) in (list,tuple)): # elem1 is the updates dictionary / list updates = elem1 outputs = elem0 if not type(outputs) in (list,tuple): outputs = [outputs] else : if type(outputs_updates) in (list,tuple) and \ (type(outputs_updates[0]) in (list,tuple)): outputs = [] updates = outputs_updates else: outputs = outputs_updates updates = {} # in case you return a tuple .. convert it to a list (there are certain # operation that are not permited on tuples, like element assignment) outputs = list(outputs) # If you return numbers (highly unlikely) this will not go well for theano # We need to convert them to Theano constants for i,out in enumerate(outputs): outputs[i] = tensor.as_tensor(out) # We can now compile a dummy function just to see what shared variable # we have and what are their update rules (note that the user has # the option not to pass the shared variable to scan, so we need to # pick them manually and add them to scan) # make the compilation as fast as possible by not applying any optimization # or conversion to C [ note this region is not important for performance # so we can do stuff as unoptimal as we wish ] if n_fixed_steps in [-1,1]: ''' We do have a special case here, namely is so might happen that whatever we have in dummy_args is not sufficient to compile the function( i.e. missing inputs). Furthermore we might not even need to compile the function here for this special case. But due to the way I wrote the code is easier to have a compiled function here that I can ignore later. Plus it is easier this way to take care of shared variables with non-default updates. Therefore only for this case I need to use gof.graph.inputs to look for the real inputs so that I can compile the function. RP ''' dummy_f = function(filter(lambda x: isinstance(x, gof.Variable) and \ not isinstance(x,SharedVariable) and not isinstance(x,gof.Constant), \ gof.graph.inputs(dummy_args)), outputs, updates = updates, mode = compile.mode.Mode(linker='py',optimizer=None)) else: dummy_f = function(filter(lambda x: isinstance(x, gof.Variable) and \ not isinstance(x,SharedVariable) and not isinstance(x,gof.Constant), \ dummy_args), outputs, updates = updates, mode = compile.mode.Mode(linker='py',optimizer=None)) # We now look at what outputs our function returns inner_fn_outs = [ out.variable for out in dummy_f.maker.outputs] update_map = {} shared_outs = [] shared_non_seqs = [] givens = {} # if the number of outputs to the function does not match the number of # assumed outputs until now (provided by the initial case) there can be # only one explanation that we now how to deal with. Namely no information # is provided for any outputs which will indicate that we deal with a map, # i.e. we never use previous values of outputs if len(inner_fn_outs) != n_outs: if outs_info == []: # We know how to deal with this case, assume that none of the outputs # are required to have any sort of time taps # we just need to update the number of actual outputs n_outs = len(inner_fn_outs) # other updates : for i in xrange(n_outs): outs_info += [ dict() ] # we also need to re-initialize the store_steps list to match the # number of outputs store_steps = [ 0 for i in xrange(n_outs)] else: # Otherwise there is a bit of confusion, since Scan works on the index of # a sequence /output. There are maybe corner cases that could be added here # or defult behaviour ( like always add the extra outputs at the end !?) # But I did not bother implementing this, I leave it to the user to clearly # express what he/she wants to do raise ValueError('Scan is totally lost. Make sure that you indicate for each' ' output what taps you want to use, or None, if you do not want to' ' use any !') inner_fn_inputs=[input.variable for input in \ dummy_f.maker.expanded_inputs[:dummy_notshared_ins+dummy_notshared_init_outs]] # Keep track of the range (place) where you insert shared variables with updates # Because we will not be able to compute the gradient with respect to those variables # inner_fn_notshared_ins_idx is from where these shared variables with updates start inner_fn_notshared_ins_idx = dummy_notshared_ins + dummy_notshared_init_outs # Because scan is particularly sensitive at the order in which it gets its # arguments, we need to separete the shared variables that act as outputs # from those that are not outputs of the network as well n_extended_outs = n_outs # Skip the slices that we've added to the inner_fn which will be the first elements # of f.maker.epanded_inputs and which we know that are not shared fromIdx = dummy_notshared_ins + dummy_notshared_init_outs copy_map = {} for input in dummy_f.maker.expanded_inputs[fromIdx:] : # If input is a shared variable that gets updated, then # this shared variable will be an output of our inner function if isinstance(input.variable, SharedVariable) and input.update: # Create a copy of it new_var = input.variable.type() if input.variable.name: new_var.name = input.variable.name + '_copy' copy_map[new_var] = input.variable inner_fn_inputs.append(new_var) # add it to the slices at the end slice_to_seqs += [ n_extended_outs ] inner_fn_outs += [input.update] update_map[ input.variable ] = n_extended_outs # We know that we only have access to the last step outputs_taps[ n_extended_outs ] = [-1] n_extended_outs += 1 # we shouldn't try to store more then the last step # this might not even be a tensor ! ( RandomState ) store_steps += [1] return_steps[n_extended_outs -1] = 1 shared_outs += [input.variable] givens[input.variable] = inner_fn_inputs[-1] # inner_fn_shared_ins_idx stores where we stop having shared variables with updates inner_fn_shared_ins_idx = len(inner_fn_inputs) - inner_fn_notshared_ins_idx # Now that we took out the shared variables that have an update rule # we need to take care of all the other shared variables for input in dummy_f.maker.expanded_inputs[fromIdx:] : # make sure that we do not add the same shared variable twice if isinstance(input.variable, SharedVariable) and not input.update: shared_non_seqs += [input.variable] new_var = input.variable.type() if input.variable.name: new_var.name = input.variable.name + '_copy' inner_fn_inputs += [new_var] slice_to_seqs += [ n_extended_outs] givens[input.variable] = inner_fn_inputs[-1] copy_map[inner_fn_inputs[-1]] = input.variable elif not isinstance(input.variable, SharedVariable): # also add the normal tensor that are non sequences at the # end of the inputs intertwingled with the shared variables inner_fn_inputs.append(input.variable) # If we haven't provided a number of steps nor did we provide a sequence # scan will not know how long to iterate if (n_steps == None or n_steps == numpy.inf or n_steps == numpy.nan) and n_seqs == 0 : raise ValueError('Scan does not know for how many steps to iterate. ' 'You need to provide the number of steps through the ' ' ``n_steps`` argument if you do not iterate over any sequence') # We can now create the Scan Op Object if n_fixed_steps not in [1,-1]: if n_steps != None: n_steps = tensor.as_tensor(n_steps) else: n_steps = gof.Constant(gof.generic, 'unknown', '?_steps') local_op = Scan( (inner_fn_inputs,inner_fn_outs, givens, slice_to_seqs ), n_seqs, n_extended_outs, inplace_map, sequences_taps, outputs_taps, n_steps,truncate_gradient, # n_outs, inner_fn_notshared_ins_idx and inner_fn_shared_ins_idx are used by the gradient # to figure out where in the input are shared variables with updates, for whom I can't compute # a gradient n_outs, inner_fn_notshared_ins_idx, inner_fn_shared_ins_idx, go_backwards, store_steps, return_steps, mode, name = name ) # Shortcut for attaching this property to the Scan op local_op.copy_map = copy_map # Call the object on the input sequences, initial values for outs, # and non sequences for seq in seqs : if not seq.get('input', None): raiseValue('All input sequences should provide') unwrapped_seqs = [ seq.get('input',tensor.as_tensor(0.)) for seq in seqs ] unwrapped_outs = [ out.get('initial',tensor.as_tensor(0.)) for out in outs_info ] values = local_op( *( [n_steps] + unwrapped_seqs + unwrapped_outs + shared_outs + notshared_other_args + shared_non_seqs)) else: # If we do not actually need scan for pos, inner_out in enumerate(inner_fn_outs): if isinstance(inner_out.type, tensor.TensorType) and store_steps[pos] != 1: inner_fn_outs[pos] = tensor.unbroadcast( tensor.shape_padleft(inner_out),0) values = inner_fn_outs if not type(values) in (tuple, list): values = [values] # take out the updates of shared variable and build the dictionary # that tells what to update and with what value for val in update_map.keys(): update_map[val] = values [ update_map[val] ] # Now we need to check the values returned # if it just one strip the list around it if n_outs == 1: # if we need to return just one step or several steps # note that when we return one step we have two cases, in # the first one store_steps is set to 1, case in which we don't # need to take a slice of the output (is already of the right # dimension) and case 2 when we store more then one step, # and we actually need to take a slice if return_steps.has_key(0): if return_steps[0] > 1: values = values[0][-return_steps[0]:] else: if store_steps[0] == 1: values = values[0] else: values = values[0][-1] else: values = values[0] else: values = values[:n_outs] for idx,val in enumerate(values): if return_steps.has_key(idx): if return_steps[idx] > 1: values[idx] = val[-return_steps[idx]:] else: if store_steps[idx] == 1: values[idx] = val else: values[idx] = val[-1] return (values, update_map)
f2d65b5f1543549d0ee82f56a5380a255723c639 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/f2d65b5f1543549d0ee82f56a5380a255723c639/scan.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4135, 12, 2295, 269, 8463, 540, 273, 599, 269, 6729, 67, 1376, 1377, 273, 599, 269, 1661, 67, 17190, 377, 273, 599, 269, 290, 67, 8986, 6647, 273, 599, 269, 10310, 67, 20219, 273, 300,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4135, 12, 2295, 269, 8463, 540, 273, 599, 269, 6729, 67, 1376, 1377, 273, 599, 269, 1661, 67, 17190, 377, 273, 599, 269, 290, 67, 8986, 6647, 273, 599, 269, 10310, 67, 20219, 273, 300,...
if list.short_name_width and list.account_width:
if list.short_name_width > 0 and list.account_width > 0:
def pdf(request, group, list, is_admin=False): """PDF version of list""" # Get accounts to show if list.accounts.all().count(): accounts = list.accounts.all() else: accounts = group.user_account_set.filter(active=True) # Create response filename = '%s-%s-%s' % (date.today(), group, list) response = HttpResponse(mimetype='application/pdf') response['Content-Disposition'] = 'attachment; filename=%s.pdf' % slugify(filename) margin = 0.5*cm font_name = 'Times-Roman' font_name_bold = 'Times-Bold' font_size = 14 font_size_name = font_size - 2 font_size_short_name = font_size - 2 font_size_balance = font_size_name - 2 font_size_min = 5 head_height = 30 # pt foot_height = 15 # pt logo_height = 25 # pt blacklisted_color = Color(0,0,0) blacklisted_text_color = Color(0.63,0,0) even_color = Color(1,1,1) odd_color = Color(0.97,0.97,0.97) faint_color = Color(0.70, 0.70, 0.70) alternate_colors = [even_color, odd_color] if list.orientation == list.LANDSCAPE: height, width = A4 else: width, height = A4 # Create canvas for page and set fonts p = canvas.Canvas(response, (width,height)) if group.logo: # Find scaling ratio ratio = group.logo.width / group.logo.height # Load logo with correct scaling logo = Image(group.logo.path, width=logo_height*ratio, height=logo_height) # Draw on first page logo.drawOn(p, width - margin - logo_height*ratio, height - margin - logo_height) # Setup rest of header p.setFont(font_name, font_size) p.drawString(margin, height - margin - font_size, u'%s: %s' % (group, list.name)) p.setFont(font_name, font_size - 4) p.drawString(margin, height - margin - font_size - font_size + 2, u'%s: %s' % (_('Printed'), str(date.today()))) footer = [] if group.email: footer.append(group.email) if list.comment.strip(): footer.append(list.comment.replace('\n', ' ').replace('\r', ' ')) p.drawString(margin, margin, u' - '.join(footer)) blacklisted_note = _(u'Blacklisted accounts are marked with: ') p.drawString(width - margin - 10 - p.stringWidth(blacklisted_note, font_name, font_size - 4), margin, blacklisted_note) p.rect(width - margin - 10, margin, 8, 8, fill=1, stroke=0) p.setFont(font_name, font_size) if not accounts: no_accounts_message = _(u"Sorry, this list is empty.") p.drawString(margin, height - font_size - margin - head_height, no_accounts_message) p.save() return response # Store col widths col_width = [] header = [] if list.account_width: col_width.append(list.account_width) header.append(_(u'Name')) if list.short_name_width: col_width.append(list.short_name_width) header.append('') if list.balance_width: header.append(_(u'Balance')) col_width.append(list.balance_width) if list.short_name_width and list.account_width: GRID_STYLE.add('SPAN', (0,0), (1,0)) base_x = len(header) for c in list.column_set.all(): header.append(c.name) col_width.append(c.width) # Calculate relative col widths over to absolute points for i,w in enumerate(col_width): col_width[i] = float(w) / float((list.listcolumn_width or 0) + list.balance_width + (list.account_width or 0) + (list.short_name_width or 0)) * (width-2*margin) # Intialise table with header data = [header] for i,a in enumerate(accounts): color = alternate_colors[(i+1)%2] if list.double: i *= 2 extra_row_height = 1 else: extra_row_height = 0 i += 1 GRID_STYLE.add('BACKGROUND', (0,i), (-1,i+extra_row_height), color) if a.is_blocked(): if list.balance_width: GRID_STYLE.add('TEXTCOLOR', (base_x-1,i), (base_x-1,i), blacklisted_text_color) GRID_STYLE.add('BACKGROUND', (base_x,i), (-1,i+extra_row_height), blacklisted_color) row = [] if list.account_width: row.append(a.name) # Check if we need to reduce col font size while col_width[len(row)-1] < p.stringWidth(row[-1], font_name, font_size_name) + 12 and font_size_name > font_size_min: font_size_name -= 1 if list.short_name_width: row.append(a.short_name or u'') # Check if we need to reduce col font size while col_width[len(row)-1] < p.stringWidth(row[-1], font_name, font_size_name) + 12 and font_size_short_name > font_size_min: font_size_short_name -= 1 if list.balance_width: row.append('%d' % a.user_balance()) if a.needs_warning(): GRID_STYLE.add('FONTNAME', (0,i), (base_x-1,i), font_name_bold) # Check if we need to reduce col font size while col_width[len(row)-1] < p.stringWidth(str(row[-1]), font_name, font_size_balance) + 12 and font_size_balance > font_size_min: font_size_balance -= 1 if not a.is_blocked(): row.extend(header[base_x:]) else: row.extend([''] * len(header[base_x:])) data.append(row) if list.double: data.append([''] * len(row)) GRID_STYLE.add('SPAN', (0,i), (0,i+extra_row_height)) if list.balance_width: GRID_STYLE.add('SPAN', (1,i), (1,i+extra_row_height)) # Set font size for names GRID_STYLE.add('FONTSIZE', (0,1), (0,-1), font_size_name) GRID_STYLE.add('ALIGN', (0,0), (-1,-1), 'LEFT') GRID_STYLE.add('FONTNAME', (0,0), (-1,0), font_name_bold) # Set font size for balance if list.balance_width: GRID_STYLE.add('FONTSIZE', (base_x-1,1), (base_x-1,-1), font_size_balance) GRID_STYLE.add('ALIGN', (base_x-1,1), (base_x-1,-1), 'RIGHT') GRID_STYLE.add('TEXTCOLOR', (base_x,1), (-1,-1), faint_color) if list.double: if list.balance_width: GRID_STYLE.add('TOPPADDING', (2,1), (-1,-1), 0) GRID_STYLE.add('BOTTOMPADDING', (2,1), (-1,-1), 0) else: GRID_STYLE.add('TOPPADDING', (1,1), (-1,-1), 0) GRID_STYLE.add('BOTTOMPADDING', (1,1), (-1,-1), 0) GRID_STYLE.add('VALIGN', (0,1), (-1,-1), 'TOP') # Create table t = Table(data, colWidths=col_width, style=GRID_STYLE, repeatRows=1) rest = None while t: # Figure out how big table will be t_width, t_height = t.wrapOn(p, width-2*margin,height-margin-head_height-foot_height) if not rest and t_height > height - 2*margin - head_height: t,rest = t.split(width-2*margin, height - margin - head_height-foot_height) continue # Draw on canvas t.drawOn(p, margin, height - t_height - margin - head_height) if rest: # FIXME indicate print time etc on second page (also page count) # set t to the second table and reset rest t, rest= (rest, None) # Show new page p.showPage() # Remove header spacing head_height = 0 else: # Leave loop break p.save() return response
10ce50ad30b1afd74d338227a772f57acaac00f0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12178/10ce50ad30b1afd74d338227a772f57acaac00f0/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8169, 12, 2293, 16, 1041, 16, 666, 16, 353, 67, 3666, 33, 8381, 4672, 3536, 17508, 1177, 434, 666, 8395, 225, 468, 968, 9484, 358, 2405, 309, 666, 18, 13739, 18, 454, 7675, 1883, 13332...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8169, 12, 2293, 16, 1041, 16, 666, 16, 353, 67, 3666, 33, 8381, 4672, 3536, 17508, 1177, 434, 666, 8395, 225, 468, 968, 9484, 358, 2405, 309, 666, 18, 13739, 18, 454, 7675, 1883, 13332...
assert x.__class__ == a.__class__ assert sorteditems(x.__dict__) == sorteditems(a.__dict__) assert y.__class__ == b.__class__ assert sorteditems(y.__dict__) == sorteditems(b.__dict__) assert `x` == `a` assert `y` == `b`
vereq(x.__class__, a.__class__) vereq(sorteditems(x.__dict__), sorteditems(a.__dict__)) vereq(y.__class__, b.__class__) vereq(sorteditems(y.__dict__), sorteditems(b.__dict__)) vereq(`x`, `a`) vereq(`y`, `b`)
def __repr__(self): return "C2(%r, %r)<%r>" % (self.a, self.b, int(self))
d8a148bce782802d6229894948b8f2312b800eb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d8a148bce782802d6229894948b8f2312b800eb3/test_descr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12715, 972, 12, 2890, 4672, 327, 315, 39, 22, 9275, 86, 16, 738, 86, 13, 32, 9, 86, 2984, 738, 261, 2890, 18, 69, 16, 365, 18, 70, 16, 509, 12, 2890, 3719, 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, 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, 1001, 12715, 972, 12, 2890, 4672, 327, 315, 39, 22, 9275, 86, 16, 738, 86, 13, 32, 9, 86, 2984, 738, 261, 2890, 18, 69, 16, 365, 18, 70, 16, 509, 12, 2890, 3719, 2, -100, -100, -...
lines = [" " + x for x in stdout[4096:].split("\n")]
lines = [" " + x for x in stdout[-4096:].split("\n")]
def system(args, timeout=None): stime=time.time() retcode, stdout = proc.run_cmd(args, timeout=timeout) d = time.time()-stime pub_args = garble_password(args) msg = [] a = msg.append a("%s %s %r\n" % (retcode, d, pub_args)) writemsg = lambda: sys.stderr.write("".join(msg)) if retcode != 0: a(stdout) a("\n====================\n") writemsg() lines = [" " + x for x in stdout[4096:].split("\n")] raise RuntimeError("command failed with returncode %s: %r\nLast Output:\n%s" % (retcode, pub_args, "\n".join(lines))) writemsg()
0d4de1faecc62828122d6028b2f010173bf68db1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12391/0d4de1faecc62828122d6028b2f010173bf68db1/nslave.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2619, 12, 1968, 16, 2021, 33, 7036, 4672, 384, 494, 33, 957, 18, 957, 1435, 225, 22115, 16, 3909, 273, 5418, 18, 2681, 67, 4172, 12, 1968, 16, 2021, 33, 4538, 13, 225, 302, 273, 813,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2619, 12, 1968, 16, 2021, 33, 7036, 4672, 384, 494, 33, 957, 18, 957, 1435, 225, 22115, 16, 3909, 273, 5418, 18, 2681, 67, 4172, 12, 1968, 16, 2021, 33, 4538, 13, 225, 302, 273, 813,...
activate = True self.setActivated(True) self.preventedForQL = True
self.setActivated(True) self.preventedForQL = True
def _check_for_QL(self): dsp = None try: dsp = Xlib.display.Display() screen = dsp.screen() root_win = screen.root activate = False ## iterate through all of the X windows for window in root_win.query_tree()._data['children']: window_name = window.get_wm_name()
8e0827c1c0dc74abc8a32208e187d78522e65f2c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1563/8e0827c1c0dc74abc8a32208e187d78522e65f2c/core.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1893, 67, 1884, 67, 2024, 12, 2890, 4672, 225, 302, 1752, 273, 599, 775, 30, 302, 1752, 273, 1139, 2941, 18, 5417, 18, 4236, 1435, 5518, 273, 302, 1752, 18, 9252, 1435, 1365, 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, 389, 1893, 67, 1884, 67, 2024, 12, 2890, 4672, 225, 302, 1752, 273, 599, 775, 30, 302, 1752, 273, 1139, 2941, 18, 5417, 18, 4236, 1435, 5518, 273, 302, 1752, 18, 9252, 1435, 1365, 67, ...
getattr(trig,col)
getattr(trigcopy,col)
def generateCohbankXMLfile(ckey,triggerTime,ifoTag,ifolist_in_coinc,search,outputPath=None,type='plot',use_col_from_installation=None): if outputPath: try: os.mkdir(outputPath) except: pass xmldoc = ligolw.Document() xmldoc.appendChild(ligolw.LIGO_LW()) # Cohbank files use the loudest single-ifo template for all ifos in a coinc maxSNR = 0; maxIFO = "" for t in ckey: snr = t.snr if snr > maxSNR: maxSNR = snr maxIFO = t.ifo trig = getattr(ckey,maxIFO) #This is a hack since data channel can differ among ifos #properChannelTrig = getattr(ckey,maxIFO) #trig.channel = properChannelTrig.channel # BEFORE WE MAKE A NEW TABLE FIGURE OUT WHAT COLUMNS ARE VALID !!! valid_columns = trig.__slots__ columns = [] notcolumns = [] for col in valid_columns: try: getattr(trig,col) columns.append(col) except: notcolumns.append(col) # IF "use_col_from_installation" IS TRUE, ADD NEW COLUMNS TO THE SNGL_INSPIRAL TABLE if use_col_from_installation: for col in notcolumns: print "\n adding column " + col columns.append(col) setattr(trig,col,0) process_table = lsctables.New(lsctables.ProcessTable) xmldoc.childNodes[-1].appendChild(process_table) process_params_table = lsctables.New(lsctables.ProcessParamsTable) xmldoc.childNodes[-1].appendChild(process_params_table) search_summary_table = lsctables.New(lsctables.SearchSummaryTable) xmldoc.childNodes[-1].appendChild(search_summary_table) for chunk in search: out_start_time = float(chunk.out_start_time) out_start_time_ns = float(chunk.out_start_time_ns)/1000000000 out_end_time = float(chunk.out_end_time) out_end_time_ns = float(chunk.out_end_time_ns)/1000000000 if ( (triggerTime >= (out_start_time+out_start_time_ns)) and (triggerTime <= (out_end_time+out_end_time_ns)) ): search_summary_table.append(chunk) break sngl_inspiral_table = lsctables.New(lsctables.SnglInspiralTable,columns) xmldoc.childNodes[-1].appendChild(sngl_inspiral_table) # Each coherent bank file should have trig rows for all ifos in a coinc #for ifo in ifolist_in_coinc: # Each coherent bank file should have trig rows for all ifos in science mode for j in range(0,len(ifoTag)-1,2): itf = ifoTag[j:j+2] trigger = copy.deepcopy(trig) trigger.ifo = itf sngl_inspiral_table.append(trigger) fileName = ifoTag + '-COHBANK_FOLLOWUP_' + str(int(ckey.event_id)) + '-' + str(int(triggerTime)) + "-2048.xml.gz" if outputPath: fileName = outputPath + '/' + fileName utils.write_filename(xmldoc, fileName, verbose = False, gz = True) return maxIFO
31dadc7792c90c977087db3d8dc75126cf66ed71 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/31dadc7792c90c977087db3d8dc75126cf66ed71/fu_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 4249, 76, 10546, 4201, 768, 12, 363, 402, 16, 10668, 950, 16, 20299, 1805, 16, 430, 355, 376, 67, 267, 67, 12645, 71, 16, 3072, 16, 2844, 743, 33, 7036, 16, 723, 2218, 4032, 21...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 4249, 76, 10546, 4201, 768, 12, 363, 402, 16, 10668, 950, 16, 20299, 1805, 16, 430, 355, 376, 67, 267, 67, 12645, 71, 16, 3072, 16, 2844, 743, 33, 7036, 16, 723, 2218, 4032, 21...
def get_index_text(self, modname, name):
def get_index_text(self, name):
def get_index_text(self, modname, name): if self.desctype == 'cfunction': return _('%s (C function)') % name elif self.desctype == 'cmember': return _('%s (C member)') % name elif self.desctype == 'cmacro': return _('%s (C macro)') % name elif self.desctype == 'ctype': return _('%s (C type)') % name elif self.desctype == 'cvar': return _('%s (C variable)') % name else: return ''
71c85cf8876bd2bce4e59f01fce043c04f8c3723 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7032/71c85cf8876bd2bce4e59f01fce043c04f8c3723/desc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1615, 67, 955, 12, 2890, 16, 508, 4672, 309, 365, 18, 5489, 12387, 422, 296, 71, 915, 4278, 327, 389, 29909, 87, 261, 39, 445, 2506, 13, 738, 508, 1327, 365, 18, 5489, 12387...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1615, 67, 955, 12, 2890, 16, 508, 4672, 309, 365, 18, 5489, 12387, 422, 296, 71, 915, 4278, 327, 389, 29909, 87, 261, 39, 445, 2506, 13, 738, 508, 1327, 365, 18, 5489, 12387...
return date <= self.ebdate
result = date <= self.ebdate return result
def is_earlybird(self, date): return date <= self.ebdate
bc7091026e3bc4f0a6f0c48228e7bcacf991f906 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12856/bc7091026e3bc4f0a6f0c48228e7bcacf991f906/registration.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 2091, 715, 31245, 12, 2890, 16, 1509, 4672, 327, 1509, 1648, 365, 18, 24008, 712, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 2091, 715, 31245, 12, 2890, 16, 1509, 4672, 327, 1509, 1648, 365, 18, 24008, 712, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
obj2 = netsvc._service[service_name]
obj2 = netsvc.SERVICES[service_name]
def encode(s): if isinstance(s, unicode): return s.encode('utf8') return s
844fc464b20b3f14ab1caaa37060b285c5308c2c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/844fc464b20b3f14ab1caaa37060b285c5308c2c/translate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 12, 87, 4672, 309, 1549, 12, 87, 16, 5252, 4672, 327, 272, 18, 3015, 2668, 3158, 28, 6134, 327, 272, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 12, 87, 4672, 309, 1549, 12, 87, 16, 5252, 4672, 327, 272, 18, 3015, 2668, 3158, 28, 6134, 327, 272, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
self.warning(10)
def setSubsetData(self, data): # if we haven't yet received the main data we just remember this data and return if not self.data: self.unprocessedSubsetData = data self.warning(10) return
1637fded461ab523362c616c4de9fd0ecbfd8e90 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/1637fded461ab523362c616c4de9fd0ecbfd8e90/OWScatterPlot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19942, 542, 751, 12, 2890, 16, 501, 4672, 468, 309, 732, 15032, 1404, 4671, 5079, 326, 2774, 501, 732, 2537, 11586, 333, 501, 471, 327, 309, 486, 365, 18, 892, 30, 365, 18, 318, 11005,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 19942, 542, 751, 12, 2890, 16, 501, 4672, 468, 309, 732, 15032, 1404, 4671, 5079, 326, 2774, 501, 732, 2537, 11586, 333, 501, 471, 327, 309, 486, 365, 18, 892, 30, 365, 18, 318, 11005,...
self.widths=[3,15,58];
self.widths=[3,15,58]
def command_databases(self, cmd): """databases: Lists names and files of attached databases
e137397029314212ddc4b3b0c929249017ecae86 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/993/e137397029314212ddc4b3b0c929249017ecae86/shell.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1296, 67, 3404, 19684, 12, 2890, 16, 1797, 4672, 3536, 3404, 19684, 30, 11592, 1257, 471, 1390, 434, 7495, 16358, 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, 1296, 67, 3404, 19684, 12, 2890, 16, 1797, 4672, 3536, 3404, 19684, 30, 11592, 1257, 471, 1390, 434, 7495, 16358, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
self.y_spin = wx.SpinButton(self, -1, (220, 20), (h*2, h), wx.SP_VERTICAL)
self.y_spin = wx.SpinButton(self, -1, (225, 20), (h*1.5, h), wx.SP_VERTICAL)
def __init__(self, parent, month=None, day = None, year=None): wx.Dialog.__init__(self, parent, -1, "Event Calendar", wx.DefaultPosition, (280, 360))
dba0885d8c52d3a9a3e3f3887b525db57ba759f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/dba0885d8c52d3a9a3e3f3887b525db57ba759f7/calendar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 16, 3138, 33, 7036, 16, 2548, 273, 599, 16, 3286, 33, 7036, 4672, 7075, 18, 6353, 16186, 2738, 972, 12, 2890, 16, 982, 16, 300, 21, 16, 315, 1133,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 16, 3138, 33, 7036, 16, 2548, 273, 599, 16, 3286, 33, 7036, 4672, 7075, 18, 6353, 16186, 2738, 972, 12, 2890, 16, 982, 16, 300, 21, 16, 315, 1133,...
if type(conversion) is type(""): line = "&%s;%s" % (conversion, line[m.end(1):]) continue
def subconvert(line, ofp, table, discards, autoclosing, knownempty, endchar=None): stack = [] while line: if line[0] == endchar and not stack: return line[1:] m = _comment_rx.match(line) if m: text = m.group(1) if text: ofp.write("(COMMENT\n") ofp.write("-%s\n" % encode(text)) ofp.write(")COMMENT\n") ofp.write("-\\n\n") else: ofp.write("-\\n\n") line = line[m.end():] continue m = _begin_env_rx.match(line) if m: # re-write to use the macro handler line = r"\%s%s" % (m.group(1), line[m.end():]) continue m =_end_env_rx.match(line) if m: # end of environment envname = m.group(1) if envname == "document": # special magic for n in stack[1:]: if n not in autoclosing: raise LaTeXFormatError("open element on stack: " + `n`) # should be more careful, but this is easier to code: stack = [] ofp.write(")document\n") elif envname == stack[-1]: ofp.write(")%s\n" % envname) del stack[-1] else:
96b07a9453cea31e40ee00a69838d4fc29ad3d66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96b07a9453cea31e40ee00a69838d4fc29ad3d66/latex2esis.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 720, 6283, 12, 1369, 16, 434, 84, 16, 1014, 16, 10388, 87, 16, 23173, 10910, 16, 4846, 5531, 16, 679, 3001, 33, 7036, 4672, 2110, 273, 5378, 1323, 980, 30, 309, 980, 63, 20, 65, 422,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 720, 6283, 12, 1369, 16, 434, 84, 16, 1014, 16, 10388, 87, 16, 23173, 10910, 16, 4846, 5531, 16, 679, 3001, 33, 7036, 4672, 2110, 273, 5378, 1323, 980, 30, 309, 980, 63, 20, 65, 422,...
def __init__(data = None)
def __init__(data = None):
def __init__(data = None) if data == None: quickfix.DoubleField.__init__(self, 886) else quickfix.DoubleField.__init__(self, 886, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 5265, 974, 16186, 2738, 972, 12, 2890, 16, 1725, 5292, 13, 469, 9549, 904, 18, 5265, 974, 16186, 2738, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 5265, 974, 16186, 2738, 972, 12, 2890, 16, 1725, 5292, 13, 469, 9549, 904, 18, 5265, 974, 16186, 2738, ...
return result
return result
def makeDirectory_andrei(self,path,credDict,status=0): """Create a new directory. The return value is the dictionary containing all the parameters of the newly created directory """ if path[0] != '/': return S_ERROR('Not an absolute path') # Strip off the trailing slash if necessary if len(path) > 1 and path[-1] == '/': path = path[:-1] if path == '/': # Create the root directory l_uid = 0 l_gid = 0 else: result = self.db.ugManager.getUserAndGroupID(credDict) if not result['OK']: return result ( l_uid, l_gid ) = result['Value']
af74338ba0e906fbce8cf42711b8855ef326ddcd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/af74338ba0e906fbce8cf42711b8855ef326ddcd/DirectoryTreeBase.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 2853, 67, 464, 266, 77, 12, 2890, 16, 803, 16, 20610, 5014, 16, 2327, 33, 20, 4672, 3536, 1684, 279, 394, 1867, 18, 1021, 327, 460, 353, 326, 3880, 4191, 777, 326, 1472, 434, 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, 1221, 2853, 67, 464, 266, 77, 12, 2890, 16, 803, 16, 20610, 5014, 16, 2327, 33, 20, 4672, 3536, 1684, 279, 394, 1867, 18, 1021, 327, 460, 353, 326, 3880, 4191, 777, 326, 1472, 434, 3...
for j in range(maxQPshoutouts):
for j in range(maxQPshoutouts if bestFeasiblePoint is not None else 1):
def __solver__(self, p): h0 = self.h0
0034fc2438405fabb74c74b111b9b3cfa5ac8601 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6196/0034fc2438405fabb74c74b111b9b3cfa5ac8601/gsubg_oo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 27198, 972, 12, 2890, 16, 293, 4672, 225, 366, 20, 273, 365, 18, 76, 20, 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, 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, 27198, 972, 12, 2890, 16, 293, 4672, 225, 366, 20, 273, 365, 18, 76, 20, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
elif rcmd == u'O': for count in xrange(repeat): self.AddLine(before=True)
elif rcmd == u'G': if repeat == 1 and '1' not in cmd: repeat = self.GetLineCount() self.GotoLine(repeat - 1)
def NewLineAfter(): """Insert newline after current line""" line = self.LineFromPosition(self.GetCurrentPos()) self.GotoPos(self.GetLineEndPosition(line)) self.AutoIndent()
be43c077f19ad88c63e5e2f8aa6305f97b701c5e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3530/be43c077f19ad88c63e5e2f8aa6305f97b701c5e/ed_stc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1166, 1670, 4436, 13332, 3536, 4600, 9472, 1839, 783, 980, 8395, 980, 273, 365, 18, 1670, 1265, 2555, 12, 2890, 18, 967, 3935, 1616, 10756, 365, 18, 43, 6302, 1616, 12, 2890, 18, 967, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1166, 1670, 4436, 13332, 3536, 4600, 9472, 1839, 783, 980, 8395, 980, 273, 365, 18, 1670, 1265, 2555, 12, 2890, 18, 967, 3935, 1616, 10756, 365, 18, 43, 6302, 1616, 12, 2890, 18, 967, ...
"""Estimate exposure's background using parameters in backgroundPolicy. If subtract is true, make a copy of the exposure and subtract the background. Return background, backgroundSubtractedExposure"""
""" Estimate exposure's background using parameters in backgroundPolicy. If subtract is true, make a copy of the exposure and subtract the background. Return background, backgroundSubtractedExposure """
def estimateBackground(exposure, backgroundPolicy, subtract=True): """Estimate exposure's background using parameters in backgroundPolicy. If subtract is true, make a copy of the exposure and subtract the background. Return background, backgroundSubtractedExposure""" maskedImage = exposure.getMaskedImage() bbox = afwImg.BBox(maskedImage.getXY0(), maskedImage.getWidth(), maskedImage.getHeight()) backgroundSubtractedExposure = exposure.Factory(exposure, bbox, true) image = maskedImage.getImage() background = getBackground(image, backgroundPolicy) del maskedImage del image if not background: raise RuntimeError, "Unable to estimate background for exposure" if not subtract: return background, None copyImage = backgroundSubtractedExposure.getMaskedImage().getImage() copyImage -= background.getImageF() del copyImage return background, backgroundSubtractedExposure
2868db0dc0ba271f645d5a1b398fa213f2049a4c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6523/2868db0dc0ba271f645d5a1b398fa213f2049a4c/sourceDetection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11108, 8199, 12, 22739, 16, 5412, 2582, 16, 10418, 33, 5510, 4672, 3536, 17787, 4988, 14620, 1807, 5412, 1450, 1472, 316, 5412, 2582, 18, 971, 10418, 353, 638, 16, 1221, 279, 1610, 434, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11108, 8199, 12, 22739, 16, 5412, 2582, 16, 10418, 33, 5510, 4672, 3536, 17787, 4988, 14620, 1807, 5412, 1450, 1472, 316, 5412, 2582, 18, 971, 10418, 353, 638, 16, 1221, 279, 1610, 434, ...
assert ((not isinstance(k, slice) and (k >= 0))
if not ((not isinstance(k, slice) and (k >= 0))
def __getitem__(self, k): if not isinstance(k, (slice, int, long)): raise TypeError assert ((not isinstance(k, slice) and (k >= 0)) or (isinstance(k, slice) and (k.start is None or k.start >= 0) and (k.stop is None or k.stop >= 0))), \ "Negative indexing is not supported."
0f48044d7bad3173b4a0c5a422226c913a123ae1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4645/0f48044d7bad3173b4a0c5a422226c913a123ae1/resultset.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 31571, 972, 12, 2890, 16, 417, 4672, 309, 486, 1549, 12, 79, 16, 261, 6665, 16, 509, 16, 1525, 3719, 30, 1002, 3580, 309, 486, 14015, 902, 1549, 12, 79, 16, 2788, 13, 471, 261,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 31571, 972, 12, 2890, 16, 417, 4672, 309, 486, 1549, 12, 79, 16, 261, 6665, 16, 509, 16, 1525, 3719, 30, 1002, 3580, 309, 486, 14015, 902, 1549, 12, 79, 16, 2788, 13, 471, 261,...
return self._win32_check_running_pid()
return self._win32_check_running_pid(pid)
def check_running_pid(self, pid): """Return True if pid is alive, otherwise return False.""" if sys.platform in ('darwin', 'linux2', 'cygwin'): try: os.kill(pid, 0) return True except OSError: return False elif sys.platform == 'win32': return self._win32_check_running_pid()
80229b78d570b40debd93f5932d4ae7e600ea2cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/80229b78d570b40debd93f5932d4ae7e600ea2cb/executive.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 8704, 67, 6610, 12, 2890, 16, 4231, 4672, 3536, 990, 1053, 309, 4231, 353, 13714, 16, 3541, 327, 1083, 12123, 309, 2589, 18, 9898, 316, 7707, 28076, 2187, 296, 20132, 22, 2187, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 8704, 67, 6610, 12, 2890, 16, 4231, 4672, 3536, 990, 1053, 309, 4231, 353, 13714, 16, 3541, 327, 1083, 12123, 309, 2589, 18, 9898, 316, 7707, 28076, 2187, 296, 20132, 22, 2187, ...
contextMibInstrumCtl = self.snmpContext.getMibInstrum(contextName)
def processPdu( self, snmpEngine, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, maxSizeResponseScopedPDU, stateReference ):
ca511d4861e2766119d6d61ee2703c35e34f7451 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/ca511d4861e2766119d6d61ee2703c35e34f7451/cmdrsp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 52, 2544, 12, 365, 16, 15366, 4410, 16, 883, 7798, 1488, 16, 4373, 1488, 16, 4373, 461, 16, 4373, 2355, 16, 819, 4410, 548, 16, 819, 461, 16, 21160, 1444, 16, 453, 16214, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 52, 2544, 12, 365, 16, 15366, 4410, 16, 883, 7798, 1488, 16, 4373, 1488, 16, 4373, 461, 16, 4373, 2355, 16, 819, 4410, 548, 16, 819, 461, 16, 21160, 1444, 16, 453, 16214, 16, 1...
old_y, old_x = self.window.win.getyx()
def display(self, i, insert=0): self.lock.acquire() try: if not self.window: return self.window.screen.lock.acquire() try: if not self.window.screen.active: return if i < self.pos: return if i >= self.pos+self.window.ih: return self.window.win.scrollok(0) self.__logger.debug("Updating item #%i" % (i,)) if i >= len(self.items): self.window.win.move(0, i - self.pos) self.window.clrtoeol() return view = self.items[i] attr, s = view[0] self.__logger.debug("Item: %r" % (view,)) old_y, old_x = self.window.win.getyx() if insert: self.window.insert_line(i - self.pos) self.window.write_at(0, i - self.pos, s, attr) for attr, s in view[1:]: self.window.write(s, attr) y, x = self.window.win.getyx() if y == old_y: self.window.clrtoeol() finally: self.window.screen.lock.release() self.window.win.scrollok(1) finally: self.lock.release()
a54d494b3abf41f8dc299cdff897d08f530aa389 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12768/a54d494b3abf41f8dc299cdff897d08f530aa389/list_buffer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 12, 2890, 16, 277, 16, 2243, 33, 20, 4672, 365, 18, 739, 18, 1077, 1039, 1435, 775, 30, 309, 486, 365, 18, 5668, 30, 327, 365, 18, 5668, 18, 9252, 18, 739, 18, 1077, 1039, 14...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2562, 12, 2890, 16, 277, 16, 2243, 33, 20, 4672, 365, 18, 739, 18, 1077, 1039, 1435, 775, 30, 309, 486, 365, 18, 5668, 30, 327, 365, 18, 5668, 18, 9252, 18, 739, 18, 1077, 1039, 14...
None, [cty.POINTER(FL_OBJECT), FL_VAL_FILTER],
None, [cty.POINTER(FL_OBJECT), FL_VAL_FILTER],
def fl_set_slider_precision(ob, prec): """ fl_set_slider_precision(ob, prec) """ _fl_set_slider_precision(ob, prec)
9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 542, 67, 28372, 67, 14548, 12, 947, 16, 13382, 4672, 3536, 1183, 67, 542, 67, 28372, 67, 14548, 12, 947, 16, 13382, 13, 3536, 225, 389, 2242, 67, 542, 67, 28372, 67, 14548, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 542, 67, 28372, 67, 14548, 12, 947, 16, 13382, 4672, 3536, 1183, 67, 542, 67, 28372, 67, 14548, 12, 947, 16, 13382, 13, 3536, 225, 389, 2242, 67, 542, 67, 28372, 67, 14548, ...
if not self.parser: return []
if not self.parser: return []
def getlinkinfos(self):
f97eecccb714a71cf5a1ca9399cd9c579014a5b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f97eecccb714a71cf5a1ca9399cd9c579014a5b9/wcnew.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 1232, 18227, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 1232, 18227, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...