

def insert(self, index, item):
    ' Inserts an item into the group at the specified index.\n\n        Parameters\n        ----------\n        index : int\n            The position to insert the item.\n        item : ActionManagerItem, Action or callable\n            The item to insert.\n\n        Returns\n        -------\n        item : ActionManagerItem\n            The actually inserted item.\n\n        Notes\n        -----\n\n        If the item is an ActionManagerItem instance it is simply inserted.\n        If the item is an Action instance, an ActionItem is created for the\n        action, and that is inserted.  If the item is a callable, then an\n        Action is created for the callable, and then that is handled as above.\n        '
    if isinstance(item, Action):
        item = ActionItem(action=item)
    elif callable(item):
        name = user_name_for(item.func_name)
        item = ActionItem(action=Action(name=name, on_perform=item))
    item.parent = self
    item._items.insert(index, item)
    return item

dataset/ETHPy150Open enthought/pyface/pyface/action/group.py Group.insert/VarMisuse@78/330 `self`->`item`