rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
def get_absolute_url(self): return ("grid", [self.slug]) | fe15034b819b49f5aa6073544363a0b86293cff4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12315/fe15034b819b49f5aa6073544363a0b86293cff4/models.py | ||
Plus just '+' or '-' signs can be used but cap at 3 multiples to protect layout<br/ | Plus just '+' or '-' signs can be used but cap at 3 multiples to protect layout<br/> | def __unicode__(self): return '%s : %s' % (self.grid.slug, self.title) | fe15034b819b49f5aa6073544363a0b86293cff4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12315/fe15034b819b49f5aa6073544363a0b86293cff4/models.py |
django_dash = 'django-%s' % letter django_space = 'django %s' % letter packages = Package.objects.filter( Q(title__istartswith=letter) | Q(title__istartswith=django_dash) | Q(title__istartswith=django_space)) | letter = letter.lower() if letter == 'd': packages = Package.objects.filter(title__istartswith=letter).exclude(title__istartswith='django-').exclude(title__istartswith='django ') else: django_dash = 'django-%s' % letter django_space = 'django %s' % letter packages = Package.objects.filter( Q(title__istartswith=letter) ... | def handle(self, *args, **options): | eaf76400665a47538248c3e3c27e8e8ca5c01f5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12315/eaf76400665a47538248c3e3c27e8e8ca5c01f5d/update_packages.py |
for package in Package.objects.filter(title__startswith=letter): | for package in packages: | def handle(self, *args, **options): | eaf76400665a47538248c3e3c27e8e8ca5c01f5d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12315/eaf76400665a47538248c3e3c27e8e8ca5c01f5d/update_packages.py |
print >> stdout, "%s packages updated" % index +1 | print >> stdout, "%s packages updated" % int(index) + 1 | def handle(self, *args, **options): print >> stdout, "Commencing package updating now" github = Github() | 35f1b2b68485e1a94c14ec8ed9041c73e83f6102 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12315/35f1b2b68485e1a94c14ec8ed9041c73e83f6102/package_updater.py |
match = downloads_re.search(page).group() | match = downloads_re.search(page) | def save(self, *args, **kwargs): # Get the downloads from pypi if self.pypi_url: page = urlopen(self.pypi_url).read() # If the target page is an Index of packages if 'Index of Packages' in page: if self.pypi_url.endswith('/'): project_name = self.pypi_url[:-1] else: project_name = self.pypi_url project_name = os.path.... | c39c5ed693adad9271cfbf96aff579c98499a1c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12315/c39c5ed693adad9271cfbf96aff579c98499a1c9/models.py |
logging.error('No serial port is available.') logging.error('Are the game buttons connected?') | print 'No serial port is available.' print 'Are the game buttons connected?' | def __init__(self): """ Setup the serial system. """ super(GameButtons, self).__init__() | 4bee63ad85cfd934a74f6373cc8eda9a1887b8c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/4bee63ad85cfd934a74f6373cc8eda9a1887b8c5/game_buttons.py |
self.get_height()) | self.get_height()) | def __init__(self): super(GUI, self).__init__() | 14cb32bd482d7c6d869016291f66851b9e46f8b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/14cb32bd482d7c6d869016291f66851b9e46f8b7/gui.py |
self.daily_double_overlay(self.get_width(), self.get_height()) | self.daily_double_overlay.set_size(self.get_width(), self.get_height()) | def on_allocation_changed(self, stage, box, flags): """ """ logging.debug("self size %d x %d and stage size %d x %d" % (self.get_width(), self.get_height(), stage.get_width(), stage.get_height())) self.clue_overlay.set_size(self.get_width(), self.get_height()) self.daily_double_overlay(self.get_width(), self.get_heigh... | 11acc3996060bc89c9bdef60ec7b237905d295a6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/11acc3996060bc89c9bdef60ec7b237905d295a6/gui.py |
logging.debug('called set text.') | def set_text(self, font, text): """ """ logging.debug('called set text.') self.remove(self.text) self.text = Text(font, text) self.text.set_size(self.get_width(), self.get_height()) scale_x, scale_y = self.get_scale() print scale_x self.text.set_scale(scale_x, scale_y) self.add(self.text) | 78d35b6eabb456ab59c6c32414df879edc75e4c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/78d35b6eabb456ab59c6c32414df879edc75e4c8/game_board.py | |
logging.debug("Entered clue square on_paint.") | def on_paint(self, actor): logging.debug("Entered clue square on_paint.") if self.clue.state == 'unanswered': self.set_text(config.clue_value_font, self.clue.get_value()) self.set_color(config.clue_value_color) elif self.clue.state == 'selected': self.set_text(config.clue_font, self.clue.answer) elif self.clue.state ==... | 78d35b6eabb456ab59c6c32414df879edc75e4c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/78d35b6eabb456ab59c6c32414df879edc75e4c8/game_board.py | |
absolute_path = path | absolute_path = location | def _find_config_file(self): absolute_path = None for location in CONFIG_LOCATIONS: if os.path.isfile(location): absolute_path = path return absolute_path | 111179c3f0ec3d6441df7eb1471e30322160f638 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/111179c3f0ec3d6441df7eb1471e30322160f638/config.py |
self.set_text('') | self.set_text('', '') | def on_click(self, actor, event): """ """ logging.debug("Clue square click! state = %s" % self.clue.state) if self.clue.state == 'unanswered': self.clue.state = 'selected' logging.debug("Clue answer = %s" % self.clue.get_answer()) self.set_text('') | 82ccb0ac9028a2be655d641a6bab153dec092e90 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/82ccb0ac9028a2be655d641a6bab153dec092e90/game_board.py |
self.game_board = GameBoard() self.game_board.set_scale(0.6, 0.6) self.add(self.game_board) | def __init__(self): super(IdleBox, self).__init__(clutter.FlowLayout(clutter.FLOW_VERTICAL)) | 3c35f89ed5d8e62b2a7e2ef8bd8b2f75c739dfd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/3c35f89ed5d8e62b2a7e2ef8bd8b2f75c739dfd7/admin.py | |
self.game_board.set_size(width, height) self.game_board.set_scale(0.6, 0.6) | def set_size(self, width, height): super(IdleBox, self).set_size(width, height) self.game_board.set_size(width, height) self.game_board.set_scale(0.6, 0.6) | 3c35f89ed5d8e62b2a7e2ef8bd8b2f75c739dfd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/3c35f89ed5d8e62b2a7e2ef8bd8b2f75c739dfd7/admin.py | |
self.add(self.text) class DailyDoubleOverlay(clutter.Box): """ """ def __init__(self): """ """ super(DailyDoubleOverlay, self).__init__(clutter.BinLayout( clutter.BIN_ALIGNMENT_CENTER, clutter.BIN_ALIGNMENT_CENTER)) self.set_color(config.square_background_color) self.text = Text(config.player_overlay_font, 'Daily\nDo... | def set_text(self, text): """ """ self.remove(self.text) self.text = Text(config.player_overlay_font, text) self.add(self.text) | 8ee11e0cc92310df1931380e880ca1b02cf41ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/8ee11e0cc92310df1931380e880ca1b02cf41ee9/gui.py | |
self.board_box.add(self.game_board) | board_box_layout.pack(self.game_board, True, True, True, clutter.BOX_ALIGNMENT_CENTER, clutter.BOX_ALIGNMENT_CENTER) | def __init__(self): super(GUI, self).__init__() | 8ee11e0cc92310df1931380e880ca1b02cf41ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/8ee11e0cc92310df1931380e880ca1b02cf41ee9/gui.py |
board_box_layout = self.board_box.get_layout_manager() | self.player_score_box.set_width(0.1 * self.get_width()) | def __init__(self): super(GUI, self).__init__() | 8ee11e0cc92310df1931380e880ca1b02cf41ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/8ee11e0cc92310df1931380e880ca1b02cf41ee9/gui.py |
self.game_board.set_size(self.get_width() * 0.9, self.get_height()) | self.board_box.set_size(self.get_width(), self.get_height()) if config.display_player_scores: self.player_score_box.set_size(0.1 * self.get_width(), self.get_height()) self.game_board.set_size(0.9 * self.get_width(), self.get_height()) else: self.game_board.set_size(self.get_width, self.get_height()) | def on_allocation_changed(self, stage, box, flags): """ """ logging.debug("self size %d x %d and stage size %d x %d" % (self.get_width(), self.get_height(), stage.get_width(), stage.get_height())) self.clue_overlay.set_size(self.get_width(), self.get_height()) self.daily_double_overlay.set_size(self.get_width(), self.... | 8ee11e0cc92310df1931380e880ca1b02cf41ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/8ee11e0cc92310df1931380e880ca1b02cf41ee9/gui.py |
self.remove(self.game_board) | self.board_box.remove(self.game_board) | def update(self): """ Update the GUI based on the current state of the game. """ if game.check_update_game_board(): self.remove(self.game_board) self.game_board = GameBoard() self.game_board.set_size(self.get_width(), self.get_height()) self.add(self.game_board) self.game_board.lower_bottom() if game.check_timeout_beep... | 8ee11e0cc92310df1931380e880ca1b02cf41ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/8ee11e0cc92310df1931380e880ca1b02cf41ee9/gui.py |
self.game_board.set_size(self.get_width(), self.get_height()) self.add(self.game_board) | self.board_box.add(self.game_board) if config.display_player_scores: self.game_board.set_size(0.9 * self.get_width(), self.get_height()) else: self.game_board.set_size(self.get_width, self.get_height()) | def update(self): """ Update the GUI based on the current state of the game. """ if game.check_update_game_board(): self.remove(self.game_board) self.game_board = GameBoard() self.game_board.set_size(self.get_width(), self.get_height()) self.add(self.game_board) self.game_board.lower_bottom() if game.check_timeout_beep... | 8ee11e0cc92310df1931380e880ca1b02cf41ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/8ee11e0cc92310df1931380e880ca1b02cf41ee9/gui.py |
self.model = model layout = self.get_layout_manager() layout.set_vertical(False) spacing = int(self.get_width() * 0.01) layout.set_spacing(spacing) self.categories = [] category_number = 0 round = self.model.get_round() for category in round: category = Category(model, category, category_number) self.add(category) ca... | def __init__(self): | def __init__(self, model): super(GameBoard, self).__init__(clutter.BoxLayout()) | 4a20eff78c106901098383c4e8d9906731e06e96 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/4a20eff78c106901098383c4e8d9906731e06e96/model.py |
for category in self.categories: category.set_click_handler(click_handler) | super(Model, self).__init__() | def set_click_handler(self, click_handler): """ """ for category in self.categories: category.set_click_handler(click_handler) | 4a20eff78c106901098383c4e8d9906731e06e96 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/4a20eff78c106901098383c4e8d9906731e06e96/model.py |
self.players.index(player) | return self.players.index(player) | def get_player_index(self, player): """ Given a player return that player's index. """ self.players.index(player) | 35557ca83e71e79cf4803dc28c05c2a9f3148859 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10391/35557ca83e71e79cf4803dc28c05c2a9f3148859/game.py |
bits = next(31) | bits = self.next(31) | def nextInt(self, n = None): """ Return a random int in [0, `n`). | 87b6542119e8b64f12041b25ec3c779382ab9886 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14153/87b6542119e8b64f12041b25ec3c779382ab9886/javarandom.py |
bits = next(31) | bits = self.next(31) | def nextInt(self, n = None): """ Return a random int in [0, `n`). | 87b6542119e8b64f12041b25ec3c779382ab9886 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14153/87b6542119e8b64f12041b25ec3c779382ab9886/javarandom.py |
return bool(next(1)) | return bool(self.next(1)) | def nextBoolean(self): """ Return a random bool. """ | 87b6542119e8b64f12041b25ec3c779382ab9886 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14153/87b6542119e8b64f12041b25ec3c779382ab9886/javarandom.py |
return next(24) / float(1 << 24) | return self.next(24) / float(1 << 24) | def nextFloat(self): """ Return a random float in (0, 1). | 87b6542119e8b64f12041b25ec3c779382ab9886 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14153/87b6542119e8b64f12041b25ec3c779382ab9886/javarandom.py |
return ((next(26) << 27) + next(27)) / float(1 << 53) | return ((self.next(26) << 27) + self.next(27)) / float(1 << 53) | def nextDouble(self): """ Return a random float in (0, 1). """ | 87b6542119e8b64f12041b25ec3c779382ab9886 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14153/87b6542119e8b64f12041b25ec3c779382ab9886/javarandom.py |
retval = (self.next(32) << 32) + self.next(32) if retval & (1 << 63): retval -= (1 << 64) return retval | return (self.next(32) << 32) + self.next(32) | def nextLong(self): """ Return a random long. | bec1b9824cfe416ae0797cb24a1dd6a2dbc36b61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14153/bec1b9824cfe416ae0797cb24a1dd6a2dbc36b61/javarandom.py |
haveEvents = firstEvent != u'' | haveEvents = (firstEvent.id != u'') | def _getPartyStatus(self, now, nextEvents): firstEvent = self.context.getFirstEvent(self.request) lastEvent = self.context.getLastEvent(self.request) | c58431af01765d4a72f2677ec675ea34ce2f45a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/111/c58431af01765d4a72f2677ec675ea34ce2f45a0/app.py |
clshideUntil = datetime.timedelta(seconds=config.defaultHideTime) | cls.hideUntil = datetime.timedelta(seconds=config.defaultHideTime) | def _initialize(config): cls = NoneLocation_cls cls.priority = config.defaultLocationPriority clshideUntil = datetime.timedelta(seconds=config.defaultHideTime) | ed81da281d394c7a705b981bb9b839f540c9505d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/111/ed81da281d394c7a705b981bb9b839f540c9505d/location.py |
self._gen = scheduler.run() | self._gen = self._scheduler.run() | def reinit (self) : """Restart scheduler from 0 """ self._scheduler._tasks = list(self._initial_state) #TODO hack pabo self._current_step = 0 self._gen = scheduler.run() if self._init_func is not None : self._init_func() | ec654bbc5d35459ef1a9cdb643ed1c7888b8191c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/ec654bbc5d35459ef1a9cdb643ed1c7888b8191c/loop.py |
import copy return (copy.copy(inputs[0]), ) | return (dict(inputs[0]), ) | def __call__(self, inputs): """ inputs is the list of input values """ import copy return (copy.copy(inputs[0]), ) | cd58333691d4997b2c1bb16cc3b3bb83a050e519 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/cd58333691d4997b2c1bb16cc3b3bb83a050e519/dicts.py |
while (not loc_mask[bb].any() ) and (bb[ind] < imax) : | while (bb[ind] < imax) and (not loc_mask[bb].any() ) : | def bounding_box (mask) : """Compute the bounding box of a mask :Parameters: - `mask` (array of bool) - a nd array of booleans :Returns: a slice (ind_min,ind_max) for each dimension of the mask or None if the mask do not contain any True value. Where ind_min correspond to the first slice that contains a True value an... | 3ae94eee765b4a7b30650a3bc7bee2b2c39262a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/3ae94eee765b4a7b30650a3bc7bee2b2c39262a0/basic.py |
while mask[bb].any() and (bb[ind] < imax) : | while (bb[ind] < imax) and mask[bb].any() : | def bounding_box (mask) : """Compute the bounding box of a mask :Parameters: - `mask` (array of bool) - a nd array of booleans :Returns: a slice (ind_min,ind_max) for each dimension of the mask or None if the mask do not contain any True value. Where ind_min correspond to the first slice that contains a True value an... | 3ae94eee765b4a7b30650a3bc7bee2b2c39262a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/3ae94eee765b4a7b30650a3bc7bee2b2c39262a0/basic.py |
def flatten (img_list) : | def flatten (img_list, alpha = False) : | def flatten (img_list) : """Concatenate all images into a single image Use alpha to blend images one on top of each other .. warning:: all images must have the same shape either 2D or 3D and an alpha channel .. warning:: the resulting image has no alpha channel :Parameters: - `img_list` (list of NxM(xP)x4 array of ... | 3ae94eee765b4a7b30650a3bc7bee2b2c39262a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/3ae94eee765b4a7b30650a3bc7bee2b2c39262a0/basic.py |
.. warning:: all images must have the same shape either 2D or 3D and an alpha channel .. warning:: the resulting image has no alpha channel | .. warning:: all images must have the same nD shape and an alpha channel (except maybe for the first one) If alpha is True, the resulting image will use the max of all alpha channels as an alpha channel. .. warning:: if the first image is a SpatialImage, the resulting image will also be a SpatialImage but no test is ... | def flatten (img_list) : """Concatenate all images into a single image Use alpha to blend images one on top of each other .. warning:: all images must have the same shape either 2D or 3D and an alpha channel .. warning:: the resulting image has no alpha channel :Parameters: - `img_list` (list of NxM(xP)x4 array of ... | 3ae94eee765b4a7b30650a3bc7bee2b2c39262a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/3ae94eee765b4a7b30650a3bc7bee2b2c39262a0/basic.py |
:Returns Type: NxM(xP)x3 array of uint8 """ R = img_list[0][...,0] G = img_list[0][...,1] B = img_list[0][...,2] | - `alpha` (bool) - the resulting image will have an alpha channel or not :Returns Type: NxM(xP)x3(4) array of uint8 """ bg = img_list[0] R = bg[...,0] G = bg[...,1] B = bg[...,2] if bg.shape[-1] == 4 : alpha_list = [bg[...,3] ] else : alpha_list = [] | def flatten (img_list) : """Concatenate all images into a single image Use alpha to blend images one on top of each other .. warning:: all images must have the same shape either 2D or 3D and an alpha channel .. warning:: the resulting image has no alpha channel :Parameters: - `img_list` (list of NxM(xP)x4 array of ... | 3ae94eee765b4a7b30650a3bc7bee2b2c39262a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/3ae94eee765b4a7b30650a3bc7bee2b2c39262a0/basic.py |
alpha = lay[...,3] / 255. ialpha = 1. - alpha R = R * ialpha + lay[...,0] * alpha G = G * ialpha + lay[...,1] * alpha B = B * ialpha + lay[...,2] * alpha return rollaxis(array([R,G,B],img_list[0].dtype),0,len(img_list[0].shape) ) | A = lay[...,3] alpha_list.append(A) A = A / 255. iA = 1. - A R = R * iA + lay[...,0] * A G = G * iA + lay[...,1] * A B = B * iA + lay[...,2] * A if alpha : A = array(alpha_list).max(axis = 0) ret = rollaxis(array([R,G,B,A],bg.dtype),0,len(bg.shape) ) else : ret = rollaxis(array([R,G,B],bg.dtype),0,len(bg.shape) ) i... | def flatten (img_list) : """Concatenate all images into a single image Use alpha to blend images one on top of each other .. warning:: all images must have the same shape either 2D or 3D and an alpha channel .. warning:: the resulting image has no alpha channel :Parameters: - `img_list` (list of NxM(xP)x4 array of ... | 3ae94eee765b4a7b30650a3bc7bee2b2c39262a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/3ae94eee765b4a7b30650a3bc7bee2b2c39262a0/basic.py |
if instance and name: | if instance is not None and name is not None: | def set_method_name(self, name): instance = self.get_input(0) if instance and name: meth = getattr(instance, name, None) if meth: sig = Signature(meth) inputs = sig.get_all_parameters() prefix = str(instance) if len(prefix)>15: prefix = prefix[:5]+"..."+prefix[-5:] self.set_caption(prefix+" : "+name) self.internal_data... | 42d90f92799040c130836cfc167f8e1343cb7ad2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/42d90f92799040c130836cfc167f8e1343cb7ad2/wrap_method.py |
prefix = str(instance) | prefix = type(instance).__name__ if not hasattr(instance, "__name__") \ else instance.__name__ | def set_method_name(self, name): instance = self.get_input(0) if instance and name: meth = getattr(instance, name, None) if meth: sig = Signature(meth) inputs = sig.get_all_parameters() prefix = str(instance) if len(prefix)>15: prefix = prefix[:5]+"..."+prefix[-5:] self.set_caption(prefix+" : "+name) self.internal_data... | 42d90f92799040c130836cfc167f8e1343cb7ad2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/42d90f92799040c130836cfc167f8e1343cb7ad2/wrap_method.py |
self._transform = self._transform * transfo | self._transform = transfo * self._transform | def transform (self, transfo) : """Combine a transformation with the actual transformation of this element. :Parameters: - `transfo` (:class:`SVGTransform`) """ self._transform = self._transform * transfo | 8baa5d8f0afa6a63751ba27d09dbc1459d8d5d6e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/8baa5d8f0afa6a63751ba27d09dbc1459d8d5d6e/svg_element.py |
self._transform = self._transform * translation(dx,dy) | self._transform = translation(dx,dy) * self._transform | def translate (self, dx, dy) : """Combine a translation with the actual transformation of this element. :Parameters: - `dx` (float) - x displacement - `dy` (float) - y displacement """ self._transform = self._transform * translation(dx,dy) | 8baa5d8f0afa6a63751ba27d09dbc1459d8d5d6e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/8baa5d8f0afa6a63751ba27d09dbc1459d8d5d6e/svg_element.py |
self._transform = self._transform * rotation(angle) | self._transform = rotation(angle) * self._transform | def rotate (self, angle) : """Combine a rotation with the actual transformation of this element. :Parameters: - `angle` (float) - angle of the rotation around Oz in direct orientation. """ self._transform = self._transform * rotation(angle) | 8baa5d8f0afa6a63751ba27d09dbc1459d8d5d6e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/8baa5d8f0afa6a63751ba27d09dbc1459d8d5d6e/svg_element.py |
self._transform = self._transform * scaling(sx,sy) | self._transform = scaling(sx,sy) * self._transform | def scale (self, sx, sy) : """Combine a scaling with the actual transformation of this element. :Parameters: - `sx` (float) - x scaling - `sy` (float) - y scaling """ self._transform = self._transform * scaling(sx,sy) | 8baa5d8f0afa6a63751ba27d09dbc1459d8d5d6e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/8baa5d8f0afa6a63751ba27d09dbc1459d8d5d6e/svg_element.py |
urllib.urlretrieve( "http://gforge.inria.fr/plugins/scmsvn/viewcvs.php/*checkout*/trunk/deploygui/src/openalea/deploygui/auth.py?root=openalea", | urllib.urlretrieve( "http://gforge.inria.fr/scm/viewcvs.php/*checkout*/trunk/deploygui/src/openalea/deploygui/auth.py?root=openalea", | def _validate_md5(egg_name, data): if egg_name in md5_data: digest = md5(data).hexdigest() if digest != md5_data[egg_name]: print >>sys.stderr, ( "md5 validation of %s failed! (Possible download problem?)" % egg_name ) sys.exit(2) return data | 9d2751722052e7a7f806b8c3f54ae122e6e9b38b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/9d2751722052e7a7f806b8c3f54ae122e6e9b38b/ez_alea_setup.py |
self.add_input(name="legend", interface=IBool, value=True) self.add_input(name="show", interface=IBool, value=True) self.add_input(name="figure", interface=IDict, value={"num":1}) self.add_input(name="axes", interface=IDict, value={}) | self.add_input(name="legend", interface=IDict, value={'legend on':True}) self.add_input(name="show", interface=IBool, value=True) self.add_input(name="figure", interface=IDict, value={"num":1}) self.add_input(name="axes", interface=IDict, value={}) | def __init__(self): """init docstring""" from pylab import plot Node.__init__(self) YLabel.__init__(self) XLabel.__init__(self) Title.__init__(self) #self.__doc__+=plot.__doc__ | 7f5159a2a9b1babcf93cb84bae707d2f701bdc7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/7f5159a2a9b1babcf93cb84bae707d2f701bdc7e/py_pylab.py |
figure(**self.get_input("figure")) | fig = figure(**self.get_input("figure")) | def __call__(self, inputs): from pylab import figure, plot, show, clf, xlabel, ylabel, hold, title, grid, Line2D, legend, axes xinputs = self.get_input("x") yinputs = self.get_input("y") clf() #figure(**self.get_input('figure')) kwds = {} kwds['markersize']=self.get_input("markersize") kwds['marker']=markers[self.get_... | 7f5159a2a9b1babcf93cb84bae707d2f701bdc7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/7f5159a2a9b1babcf93cb84bae707d2f701bdc7e/py_pylab.py |
line2dkwds = get_kwds_from_line2d(x, **kwds) | line2dkwds = get_kwds_from_line2d(x, kwds) | def __call__(self, inputs): from pylab import figure, plot, show, clf, xlabel, ylabel, hold, title, grid, Line2D, legend, axes xinputs = self.get_input("x") yinputs = self.get_input("y") clf() #figure(**self.get_input('figure')) kwds = {} kwds['markersize']=self.get_input("markersize") kwds['marker']=markers[self.get_... | 7f5159a2a9b1babcf93cb84bae707d2f701bdc7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/7f5159a2a9b1babcf93cb84bae707d2f701bdc7e/py_pylab.py |
if self.get_input('legend') is True: legend(loc='best') | print self.get_input("legend").keys() if self.get_input("legend")['legend on']==True: mykwds = self.get_input("legend") del mykwds['legend on'] legend(**mykwds) | def __call__(self, inputs): from pylab import figure, plot, show, clf, xlabel, ylabel, hold, title, grid, Line2D, legend, axes xinputs = self.get_input("x") yinputs = self.get_input("y") clf() #figure(**self.get_input('figure')) kwds = {} kwds['markersize']=self.get_input("markersize") kwds['marker']=markers[self.get_... | 7f5159a2a9b1babcf93cb84bae707d2f701bdc7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/7f5159a2a9b1babcf93cb84bae707d2f701bdc7e/py_pylab.py |
dummy=[] return (dummy, ) | return (fig, ) | def __call__(self, inputs): from pylab import figure, plot, show, clf, xlabel, ylabel, hold, title, grid, Line2D, legend, axes xinputs = self.get_input("x") yinputs = self.get_input("y") clf() #figure(**self.get_input('figure')) kwds = {} kwds['markersize']=self.get_input("markersize") kwds['marker']=markers[self.get_... | 7f5159a2a9b1babcf93cb84bae707d2f701bdc7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/7f5159a2a9b1babcf93cb84bae707d2f701bdc7e/py_pylab.py |
def __init__(self): Node.__init__(self) self.add_input(name="legend on", interface=IBool, value=False) self.add_input(name="legend", interface=IStr, value=None) | """to be done""" location = {'best':0, 'upper right': 1, 'upper left': 2, 'lower left': 3, 'lower right': 4, 'right': 5, 'center left': 6, 'center right': 7, 'lower center': 8, 'upper center': 9, 'center': 10} def __init__(self): Node.__init__(self) self.add_input(name="legend on", interface=IBool, value=True) self.ad... | def __init__(self): Node.__init__(self) self.add_input(name="legend on", interface=IBool, value=False) self.add_input(name="legend", interface=IStr, value=None) | 7f5159a2a9b1babcf93cb84bae707d2f701bdc7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/7f5159a2a9b1babcf93cb84bae707d2f701bdc7e/py_pylab.py |
if self.get_input('legend') is None: legend(loc='best') else: legend(self.get_input('legend'), loc='best') | kwds = {} kwds['legend on'] = self.get_input('legend on') kwds['loc'] = self.get_input('location') kwds['numpoints'] = self.get_input('numpoints') kwds['loc'] = self.get_input('location') kwds['fancybox'] = self.get_input('fancybox') kwds['markerscale'] = self.get_input('markerscale') kwds['shadow'] = self.get_input(... | def __call__(self, inputs): from pylab import legend if self.get_input('legend') is None: legend(loc='best') else: legend(self.get_input('legend'), loc='best') | 7f5159a2a9b1babcf93cb84bae707d2f701bdc7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/7f5159a2a9b1babcf93cb84bae707d2f701bdc7e/py_pylab.py |
def __init__(self): #from pylab import figure #self.__doc__+=figure.__doc__ Node.__init__(self) self.add_input(name="num", interface=IInt, value=1) self.add_input(name="figsize", interface=ITuple3, value=(8, 6)) self.add_input(name="dpi", interface=IFloat, value=80.) self.add_input(name="facecolor", interface=IEnumStr(... | 7f5159a2a9b1babcf93cb84bae707d2f701bdc7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/7f5159a2a9b1babcf93cb84bae707d2f701bdc7e/py_pylab.py | ||
self.add_output(name="figure") | def __init__(self): #from pylab import figure #self.__doc__+=figure.__doc__ Node.__init__(self) self.add_input(name="num", interface=IInt, value=1) self.add_input(name="figsize", interface=ITuple3, value=(8, 6)) self.add_input(name="dpi", interface=IFloat, value=80.) self.add_input(name="facecolor", interface=IEnumStr(... | 7f5159a2a9b1babcf93cb84bae707d2f701bdc7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/7f5159a2a9b1babcf93cb84bae707d2f701bdc7e/py_pylab.py | |
fig = figure(num=self.get_input('num'), figsize=self.get_input('figsize'), dpi=self.get_input('dpi'), facecolor=self.get_input('facecolor'), edgecolor=self.get_input('edgecolor')) return fig,kwds | return kwds | def __call__(self, inputs): from pylab import figure kwds={} kwds['num']=self.get_input('num') kwds['figsize']=self.get_input('figsize') kwds['facecolor']=self.get_input('facecolor') kwds['edgecolor']=self.get_input('edgecolor') kwds['dpi']=self.get_input('dpi') | 7f5159a2a9b1babcf93cb84bae707d2f701bdc7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/7f5159a2a9b1babcf93cb84bae707d2f701bdc7e/py_pylab.py |
revision = __revision__.strip().split() if len(revision) > 2: revision = revision[2] else: revision = '0.8' print "Running ez_alea_setup version %s" % revision | try: revision = __revision__.strip().split() if len(revision) > 2: revision = revision[2] else: revision = '0.8' print "Running ez_alea_setup version %s" % revision except: pass | def welcome_setup(): revision = __revision__.strip().split() if len(revision) > 2: revision = revision[2] else: revision = '0.8' print "Running ez_alea_setup version %s" % revision print """ | 21aa64c5833ae91f63d72507db76ede64b05028a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/21aa64c5833ae91f63d72507db76ede64b05028a/ez_alea_setup.py |
print "Running ez_alea_setup version %s" % __revision__.split()[2] | revision = __revision__.strip().split() if len(revision) > 2: revision = revision[2] else: revision = '0.8' print "Running ez_alea_setup version %s" % revision | def welcome_setup(): print "Running ez_alea_setup version %s" % __revision__.split()[2] print """ | c090770fab0be3395f81f92ed108b7377bb969dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4914/c090770fab0be3395f81f92ed108b7377bb969dd/ez_alea_setup.py |
llicense = flag_policy_issue(llicense, status) | llicense = flag_policy_issue(llicense, status) | def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w... | 415573da1155cf94fc2dd3395f825ce2161d45e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/415573da1155cf94fc2dd3395f825ce2161d45e4/views.py |
tcolor = "yellow" if status == 'A': tcolor = "green" | tcolor = '' if status == 'U': tcolor = 'orange' tag_end += '<img src="/site_media/images/orange_flag.png" width="16" height="16" alt="orange_flag.png">' | def flag_policy_issue(value, status): # to highlight the issues tag_start = '<span class="' tag_mid = '">' tag_end = '</span>' tcolor = "yellow" if status == 'A': tcolor = "green" if status == 'D': tcolor = "red" tag_end += '<img src="/site_media/images/red_flag.png" width="16" height="16" alt="red_flag.png">' value = ... | 415573da1155cf94fc2dd3395f825ce2161d45e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/415573da1155cf94fc2dd3395f825ce2161d45e4/views.py |
tcolor = "red" | tcolor = 'red' | def flag_policy_issue(value, status): # to highlight the issues tag_start = '<span class="' tag_mid = '">' tag_end = '</span>' tcolor = "yellow" if status == 'A': tcolor = "green" if status == 'D': tcolor = "red" tag_end += '<img src="/site_media/images/red_flag.png" width="16" height="16" alt="red_flag.png">' value = ... | 415573da1155cf94fc2dd3395f825ce2161d45e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/415573da1155cf94fc2dd3395f825ce2161d45e4/views.py |
pllicense = llicenseset[0].license | pllicense = llicenseset[0].license if llicense != pllicense: llicense = llicense + ' (' + pllicense + ')' | def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w... | 451c4e3c805fe84725cdce5f847784b27c2b1560 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/451c4e3c805fe84725cdce5f847784b27c2b1560/views.py |
pflicense = flicenseset[0].license | pflicense = flicenseset[0].license if flicense != pflicense: flicense = flicense + ' (' + pflicense + ')' | def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w... | 451c4e3c805fe84725cdce5f847784b27c2b1560 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/451c4e3c805fe84725cdce5f847784b27c2b1560/views.py |
if llicense != pllicense: llicense = llicense + ' (' + pllicense + ')' | def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w... | 451c4e3c805fe84725cdce5f847784b27c2b1560 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/451c4e3c805fe84725cdce5f847784b27c2b1560/views.py | |
if flicense != pflicense: flicense = flicense + ' (' + pflicense + ')' | if not policyset and flicense != 'TBD': llicense = flag_policy_issue(llicense, 'U') | def check_policy(flicense, llicense, library, static, issue): # is the lib dynamic or static? ltype = 'Dynamic' if static: ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense = llicense # w... | 451c4e3c805fe84725cdce5f847784b27c2b1560 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/451c4e3c805fe84725cdce5f847784b27c2b1560/views.py |
tag_start = '<font color="' | tag_start = '<span class="' | def flag_policy_issue(value, status): # to highlight the issues tag_start = '<font color="' tag_mid = '">' tag_end = '</font>' tcolor = "yellow" if status == 'A': tcolor = "green" if status == 'D': tcolor = "red" tag_end += '<img src="/site_media/images/red_flag.png" width="16" height="16" alt="red_flag.png">' value = ... | 451c4e3c805fe84725cdce5f847784b27c2b1560 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/451c4e3c805fe84725cdce5f847784b27c2b1560/views.py |
tag_end = '</font>' | tag_end = '</span>' | def flag_policy_issue(value, status): # to highlight the issues tag_start = '<font color="' tag_mid = '">' tag_end = '</font>' tcolor = "yellow" if status == 'A': tcolor = "green" if status == 'D': tcolor = "red" tag_end += '<img src="/site_media/images/red_flag.png" width="16" height="16" alt="red_flag.png">' value = ... | 451c4e3c805fe84725cdce5f847784b27c2b1560 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/451c4e3c805fe84725cdce5f847784b27c2b1560/views.py |
target = dep_path(parent, dep) childdeps = deps_check(target) | if not re.search('(static)', dep): target = dep_path(parent, dep) childdeps = deps_check(target) else: childdeps = [] | def dep_loop(parent, soname, dep, level): if level > depth: return if level == 1: print_path_dep(parent, soname, dep, level) print_dep(dep, level) else: print_path_dep(parent, soname, dep, level) print_dep(dep, level) target = dep_path(parent, dep) childdeps = deps_check(target) if len(childdeps) > 0: for childdep i... | ed3082a8de8d99abceb2e882355a2347ffbb5642 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/ed3082a8de8d99abceb2e882355a2347ffbb5642/readelf.py |
for lib in libs: if lib not in staticlib_list: staticlib_list.append(lib) | if len(libs) == 1: if libs[0] not in staticlib_list: staticlib_list.append(libs[0]) elif len(libs) > 1: staticlib_multiples[func] = libs for func in staticlib_multiples: found = False for lib in staticlib_multiples[func]: if lib in staticlib_list: found = True break if not found: staticlib_list.append(staticlib_mul... | def static_deps_check(target): "Look for statically linked dependencies." # State enumeration for debug parser. FIND_NEXT = 1 FIND_NAME = 2 # The algorithm here is pretty basic. We grab a complete symbol list # and debug information. Any symbols that aren't covered by debug # information are considered to be source... | b16d54ef1ddc193a750e256c84eaf6d5954942fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/b16d54ef1ddc193a750e256c84eaf6d5954942fa/readelf.py |
def dep_path(target, dep): #print target, dep # readelf gives us the lib, but not the path to check during recursion ldcall = "ldd " + target for lddata in os.popen(ldcall).readlines(): if re.search("statically linked", lddata): return "NONE" elif re.search(dep, lddata): ldlist = string.split(lddata) if len(ldlist) > ... | 89ba6d56319b5570ed0de187a733e3a224e3b917 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/89ba6d56319b5570ed0de187a733e3a224e3b917/readelf.py | ||
dep = dep.replace("[","") dep = dep.replace("]","") | dep = dep.strip("[]") | def deps_check(target): deps = [] # run the "file" command and see if it's ELF filetype = os.popen("file " + target).read() if re.search("ELF", filetype): if not re.search("statically linked", filetype): elfcall = "readelf -d " + target for elfdata in os.popen(elfcall).readlines(): # lines we want all have "NEEDED" if... | 89ba6d56319b5570ed0de187a733e3a224e3b917 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/89ba6d56319b5570ed0de187a733e3a224e3b917/readelf.py |
if do_static: deps.extend(static_deps_check(target)) | if do_static: deps.extend(static_deps_check(target)) | def deps_check(target): deps = [] # run the "file" command and see if it's ELF filetype = os.popen("file " + target).read() if re.search("ELF", filetype): if not re.search("statically linked", filetype): elfcall = "readelf -d " + target for elfdata in os.popen(elfcall).readlines(): # lines we want all have "NEEDED" if... | 89ba6d56319b5570ed0de187a733e3a224e3b917 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/89ba6d56319b5570ed0de187a733e3a224e3b917/readelf.py |
def deps_print(title, parent, target, level, deps): | def print_deps(target, deps): | def deps_print(title, parent, target, level, deps): csvstring = '' spacer = '' nospace = '' if level > 0: nospace += spacer for space in range(0, level): spacer += " " if len(deps) < 1: # FIXME - this blows up the recursion, just drop it? #deps.append("NONE") # at ld-linux - just suppress the output return if do_c... | 89ba6d56319b5570ed0de187a733e3a224e3b917 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/89ba6d56319b5570ed0de187a733e3a224e3b917/readelf.py |
nospace = '' if level > 0: nospace += spacer for space in range(0, level): | if len(deps) < 1: return if do_csv: csvstring += str(1) + "," + target for dep in deps: csvstring += "," + dep print csvstring else: print spacer + "[" + str(1) + "]" + target + ":" | def deps_print(title, parent, target, level, deps): csvstring = '' spacer = '' nospace = '' if level > 0: nospace += spacer for space in range(0, level): spacer += " " if len(deps) < 1: # FIXME - this blows up the recursion, just drop it? #deps.append("NONE") # at ld-linux - just suppress the output return if do_c... | 89ba6d56319b5570ed0de187a733e3a224e3b917 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/89ba6d56319b5570ed0de187a733e3a224e3b917/readelf.py |
if len(deps) < 1: | for dep in deps: print spacer + dep def print_dep(dep, indent): spacer = 2 * indent * " " if not do_csv: print spacer + dep def print_path_dep(parent, soname, dep, indent): csvstring = '' spacer = (indent - 1) * " " token = "[" + str(indent) + "]" if not do_csv: print spacer + token + parent + ":" else: csvstring +=... | def deps_print(title, parent, target, level, deps): csvstring = '' spacer = '' nospace = '' if level > 0: nospace += spacer for space in range(0, level): spacer += " " if len(deps) < 1: # FIXME - this blows up the recursion, just drop it? #deps.append("NONE") # at ld-linux - just suppress the output return if do_c... | 89ba6d56319b5570ed0de187a733e3a224e3b917 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/89ba6d56319b5570ed0de187a733e3a224e3b917/readelf.py |
if do_csv: if depth == 1: csvstring += str(level + 1) + "," + target else: csvstring += str(level + 1) + "," + target + "," + title if level > 0 or depth < 2: for dep in deps: csvstring += "," + dep print csvstring else: if level == 1: print spacer + title print spacer + "[" + str(level + 1) + "]" + target + ":" space... | if level == 1: print_path_dep(parent, soname, dep, level) print_dep(dep, level) else: print_path_dep(parent, soname, dep, level) print_dep(dep, level) target = dep_path(parent, dep) childdeps = deps_check(target) if len(childdeps) > 0: for childdep in childdeps: dep_loop(target, dep, childdep, level + 1) | def deps_print(title, parent, target, level, deps): csvstring = '' spacer = '' nospace = '' if level > 0: nospace += spacer for space in range(0, level): spacer += " " if len(deps) < 1: # FIXME - this blows up the recursion, just drop it? #deps.append("NONE") # at ld-linux - just suppress the output return if do_c... | 89ba6d56319b5570ed0de187a733e3a224e3b917 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/89ba6d56319b5570ed0de187a733e3a224e3b917/readelf.py |
deps_print(parent, parent, candidate, 0, deps) | print_deps(candidate, deps) | def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th... | 89ba6d56319b5570ed0de187a733e3a224e3b917 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/89ba6d56319b5570ed0de187a733e3a224e3b917/readelf.py |
dep_loop(candidate, deps) | for dep in deps: dep_loop(candidate, None, dep, 1) | def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th... | 89ba6d56319b5570ed0de187a733e3a224e3b917 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/89ba6d56319b5570ed0de187a733e3a224e3b917/readelf.py |
if not deps: deps.append("STATIC") | def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th... | 89ba6d56319b5570ed0de187a733e3a224e3b917 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/89ba6d56319b5570ed0de187a733e3a224e3b917/readelf.py | |
deps_print(parent, parent, target, 0, deps) | print_deps(target, deps) | def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th... | 89ba6d56319b5570ed0de187a733e3a224e3b917 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/89ba6d56319b5570ed0de187a733e3a224e3b917/readelf.py |
dep_loop(parent, deps) | for dep in deps: dep_loop(parent, None, dep, 1) | def main(): opt_parser = optparse.OptionParser(usage=usage_line, version="%prog version " + version, option_list=command_line_options) (options, args) = opt_parser.parse_args() if len(args) == 0 or len(args) > 2: opt_parser.error("improper number of non-option arguments") # prog_ndx_start is the offset in argv for th... | 89ba6d56319b5570ed0de187a733e3a224e3b917 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/89ba6d56319b5570ed0de187a733e3a224e3b917/readelf.py |
if do_static: deps.extend(static_deps_check(target)) | if do_static: deps.extend(static_deps_check(target)) | def deps_check(target): deps = [] # run the "file" command and see if it's ELF filetype = os.popen("file " + target).read() if re.search("ELF", filetype): if not re.search("statically linked", filetype): elfcall = "readelf -d " + target for elfdata in os.popen(elfcall).readlines(): # lines we want all have "NEEDED" if... | 46aac76bbd39154ef3ed7667e9fc0d0e85fdf487 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/46aac76bbd39154ef3ed7667e9fc0d0e85fdf487/readelf.py |
license = models.CharField('License', max_length=200, unique=True) | license = models.CharField('License', max_length=200) version = models.CharField('Version', max_length=20) | def __unicode__(self): return self.library | 470e160b4192ed7d21ee39ec50e683282ae67ebf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/470e160b4192ed7d21ee39ec50e683282ae67ebf/models.py |
licenses = License.objects.all().order_by('license') choices = [] choices.append(('','')) for lic in licenses: choices.append((lic.license, lic.license)) | def __init__(self, *args, **kwargs): super(PolicyForm, self).__init__(*args, **kwargs) self.fields['tlicense'].choices = license_choices() self.fields['dlicense'].choices = license_choices() | #def __unicode__(self): | 470e160b4192ed7d21ee39ec50e683282ae67ebf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/470e160b4192ed7d21ee39ec50e683282ae67ebf/models.py |
tlicense.choices = choices dlicense.choices = choices | #def __unicode__(self): | 470e160b4192ed7d21ee39ec50e683282ae67ebf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/470e160b4192ed7d21ee39ec50e683282ae67ebf/models.py | |
else: resultsform = ResultsForm() | def results(request): if request.method == 'POST': # If the form has been submitted... testlist = request.POST.get('testlist', '') if testlist != '': tests = testlist.split(",") for test in tests: if test != '': q = Test.objects.filter(id = test) q.delete() q = File.objects.filter(test = test) q.delete() q = Lib.objec... | 0cd2ee1f260409866443266b46988ca3d775ba45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/0cd2ee1f260409866443266b46988ca3d775ba45/views.py | |
if re.search("^Add License", mode): | if re.search("^Add", mode) and re.search("License", mode): | def licenses(request): errmsg = '' if request.method == 'POST': # If the form has been submitted... mode = urllib.unquote(request.POST.get('submit')) if re.search("^Add License", mode): licenseform = LicenseForm(request.POST) # A form bound to the POST data # request to add data if licenseform.is_valid(): # All valida... | 2e95777bbb57daec9fe83e1c64aba699b667ebcc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/2e95777bbb57daec9fe83e1c64aba699b667ebcc/views.py |
TIME_ZONE = 'America/Chicago' | if 'TZ' not in os.environ: TIME_ZONE = 'Etc/GMT%+d' % (time.altzone / 3600) else: TIME_ZONE = os.environ['TZ'] | def get_project_root(): project_root_paths = [ ".", "..", "/opt/linuxfoundation" ] for path in project_root_paths: if os.path.exists(os.path.join(path, "bin/readelf.py")): return path # Shouldn't get here unless we can't find the path. raise RuntimeError, "could not find the project path" | 1825ffd7b380ba9f949d9d09be5daf7ab6cd21cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/1825ffd7b380ba9f949d9d09be5daf7ab6cd21cd/settings.py |
if issue: flicense = flag_policy_issue(flicense, status) | if issue: flicense = flag_policy_issue(flicense, 'D') | def check_policy(flicense, llicense, library, issue): # is the lib dynamic or static? ltype = 'Dynamic' if re.search(is_static, library): ltype = 'Static' # it's possible that the license assigned to the target or library is one of # the aliases, in which case we need the 'official' name for the policy check pllicense... | a7e4843addd56adcd1577e55dc38681d2639fe5c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/a7e4843addd56adcd1577e55dc38681d2639fe5c/views.py |
deps = deps_check(candidate) | try: deps = deps_check(candidate) except NotELFError: deps = [] | def main(argv): if len(argv) < 2 or '-?' in argv or '-h' in argv: show_usage(argv) # prog_ndx_start is the offset in argv for the file/dir and recursion prog_ndx_start = 1 do_search = 0 do_csv = 0 found = 0 parent = "" if '-c' in argv: sloc = string.index(argv, "-c") if prog_ndx_start <= sloc: prog_ndx_start = sloc +... | beee5228726b5eed00af95a02e2574e0f0d6a0b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/beee5228726b5eed00af95a02e2574e0f0d6a0b7/readelf.py |
def start(run_browser, interface=None): | def start_server(run_browser, interface=None): | def start(run_browser, interface=None): if settings.USERDIR_ROOT: setup_userdir() childpid = os.fork() if childpid == 0: os.setsid() log_fn = os.path.join(settings.STATE_ROOT, "server.log") try: log_fd = os.open(log_fn, os.O_WRONLY | os.O_APPEND | os.O_CREAT) except OSError: log_fd = -1 if log_fd < 0: sys.stderr.writ... | d62d6a9d7ff3988726cc9501f9d15ccef1630e7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/d62d6a9d7ff3988726cc9501f9d15ccef1630e7b/dep-checker.py |
def stop(): | def stop_server(): | def stop(): pid_path = os.path.join(settings.STATE_ROOT, "server.pid") if os.path.exists(pid_path): server_pid = int(open(pid_path).read()) sys.stdout.write("Killing process %d...\n" % server_pid) try: try: os.kill(server_pid, signal.SIGTERM) finally: os.unlink(pid_path) except OSError, e: sys.stderr.write("Could not k... | d62d6a9d7ff3988726cc9501f9d15ccef1630e7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/d62d6a9d7ff3988726cc9501f9d15ccef1630e7b/dep-checker.py |
start(not options.server_only, options.interface) | start_server(not options.server_only, options.interface) | def main(): cmdline_parser = optparse.OptionParser(usage=command_line_usage, option_list=command_line_options) (options, args) = cmdline_parser.parse_args() if len(args) != 1 or args[0] not in ["start", "stop"]: cmdline_parser.error("incorrect arguments") # Switch users if needed. if args[0] == "start": if not option... | d62d6a9d7ff3988726cc9501f9d15ccef1630e7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/d62d6a9d7ff3988726cc9501f9d15ccef1630e7b/dep-checker.py |
stop() | stop_server() | def main(): cmdline_parser = optparse.OptionParser(usage=command_line_usage, option_list=command_line_options) (options, args) = cmdline_parser.parse_args() if len(args) != 1 or args[0] not in ["start", "stop"]: cmdline_parser.error("incorrect arguments") # Switch users if needed. if args[0] == "start": if not option... | d62d6a9d7ff3988726cc9501f9d15ccef1630e7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/d62d6a9d7ff3988726cc9501f9d15ccef1630e7b/dep-checker.py |
found_lib = None | found_libs = [] | def find_static_library(func): "Given a symbol, return the most likely static library it's from." found_lib = None dbpath = None for dp in database_search_path: if os.path.exists(os.path.join(dp, "staticdb.sqlite")): dbpath = dp break if dbpath: staticdb = sqlite3.connect(os.path.join(dbpath, "staticdb.sqlite")) curs... | 060a70993f5e772c2507bcc6b5c2f8c71f8415a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/060a70993f5e772c2507bcc6b5c2f8c71f8415a3/readelf.py |
found_lib = results[0][0] + " (static)" | found_libs.append(results[0][0]) | def find_static_library(func): "Given a symbol, return the most likely static library it's from." found_lib = None dbpath = None for dp in database_search_path: if os.path.exists(os.path.join(dp, "staticdb.sqlite")): dbpath = dp break if dbpath: staticdb = sqlite3.connect(os.path.join(dbpath, "staticdb.sqlite")) curs... | 060a70993f5e772c2507bcc6b5c2f8c71f8415a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/060a70993f5e772c2507bcc6b5c2f8c71f8415a3/readelf.py |
found_lib = ",".join(found_libs) + " (static)" return found_lib | return found_libs | def find_static_library(func): "Given a symbol, return the most likely static library it's from." found_lib = None dbpath = None for dp in database_search_path: if os.path.exists(os.path.join(dp, "staticdb.sqlite")): dbpath = dp break if dbpath: staticdb = sqlite3.connect(os.path.join(dbpath, "staticdb.sqlite")) curs... | 060a70993f5e772c2507bcc6b5c2f8c71f8415a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/060a70993f5e772c2507bcc6b5c2f8c71f8415a3/readelf.py |
lib = find_static_library(func) if lib and lib not in staticlib_list: staticlib_list.append(lib) | libs = find_static_library(func) for lib in libs: if lib not in staticlib_list: staticlib_list.append(lib) | def static_deps_check(target): "Look for statically linked dependencies." # State enumeration for debug parser. FIND_NEXT = 1 FIND_NAME = 2 # The algorithm here is pretty basic. We grab a complete symbol list # and debug information. Any symbols that aren't covered by debug # information are considered to be source... | 060a70993f5e772c2507bcc6b5c2f8c71f8415a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/060a70993f5e772c2507bcc6b5c2f8c71f8415a3/readelf.py |
return staticlib_list | staticlib_results = [ x + " (static)" for x in staticlib_list ] return staticlib_results | def static_deps_check(target): "Look for statically linked dependencies." # State enumeration for debug parser. FIND_NEXT = 1 FIND_NAME = 2 # The algorithm here is pretty basic. We grab a complete symbol list # and debug information. Any symbols that aren't covered by debug # information are considered to be source... | 060a70993f5e772c2507bcc6b5c2f8c71f8415a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/060a70993f5e772c2507bcc6b5c2f8c71f8415a3/readelf.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.