Create actions associated with Annotations.
345647
def create_action(self):
        """"""
        actions = {}

        act = QAction('New Annotations', self)
        act.triggered.connect(self.new_annot)
        actions['new_annot'] = act

        act = QAction('Load Annotations', self)
        act.triggered.connect(self.load_annot)
        actions['load_annot'] = act

        act = QAction('Clear Annotations...', self)
        act.triggered.connect(self.clear_annot)
        actions['clear_annot'] = act

        act = QAction('New...', self)
        act.triggered.connect(self.new_rater)
        actions['new_rater'] = act
        
        act = QAction('Rename...', self)
        act.triggered.connect(self.rename_rater)
        actions['rename_rater'] = act

        act = QAction('Delete...', self)
        act.triggered.connect(self.delete_rater)
        actions['del_rater'] = act

        act = QAction(QIcon(ICON['bookmark']), 'New Bookmark', self)
        act.setCheckable(True)
        actions['new_bookmark'] = act

        act = QAction(QIcon(ICON['new_eventtype']), 'New Event Type', self)
        act.triggered.connect(self.new_eventtype)
        actions['new_eventtype'] = act

        act = QAction(QIcon(ICON['del_eventtype']), 'Delete Event Type', self)
        act.triggered.connect(self.delete_eventtype)
        actions['del_eventtype'] = act
        
        act = QAction('Rename Event Type', self)
        act.triggered.connect(self.rename_eventtype)
        actions['rename_eventtype'] = act

        act = QAction('New Name', self)
        act.triggered.connect(self.markers_to_events)
        actions['m2e_newname'] = act
        
        act = QAction('Keep Marker Names', self)
        act.triggered.connect(partial(self.markers_to_events, True))
        actions['m2e_keepname'] = act
        
        act = QAction('Merge Events...', self)
        act.triggered.connect(self.parent.show_merge_dialog)
        actions['merge_events'] = act

        act = QAction(QIcon(ICON['event']), 'Event Mode', self)
        act.setCheckable(True)
        actions['new_event'] = act

        uncheck_new_event = lambda: actions['new_event'].setChecked(False)
        uncheck_new_bookmark = lambda: actions['new_bookmark'].setChecked(False)
        actions['new_event'].triggered.connect(uncheck_new_bookmark)
        actions['new_bookmark'].triggered.connect(uncheck_new_event)

        act = {}
        for one_stage, one_shortcut in zip(STAGE_NAME, STAGE_SHORTCUT):
            act[one_stage] = QAction('Score as ' + one_stage, self.parent)
            act[one_stage].setShortcut(one_shortcut)
            stage_idx = STAGE_NAME.index(one_stage)
            act[one_stage].triggered.connect(partial(self.get_sleepstage,
                                                     stage_idx))
            self.addAction(act[one_stage])

        actions['stages'] = act

        act = {}
        for one_qual, one_shortcut in zip(QUALIFIERS, QUALITY_SHORTCUT):
            act[one_qual] = QAction('Score as ' + one_qual, self.parent)
            act[one_qual].setShortcut(one_shortcut)
            qual_idx = QUALIFIERS.index(one_qual)
            act[one_qual].triggered.connect(partial(self.get_quality,
                                                    qual_idx))
            self.addAction(act[one_qual])

        actions['quality'] = act

        act = QAction('Set Cycle Start', self)
        act.setShortcut('Ctrl+[')
        act.triggered.connect(self.get_cycle_mrkr)
        actions['cyc_start'] = act

        act = QAction('Set Cycle End', self)
        act.setShortcut('Ctrl+]')
        act.triggered.connect(partial(self.get_cycle_mrkr, end=True))
        actions['cyc_end'] = act

        act = QAction('Remove Cycle Marker', self)
        act.triggered.connect(self.remove_cycle_mrkr)
        actions['remove_cyc'] = act

        act = QAction('Clear Cycle Markers', self)
        act.triggered.connect(self.clear_cycle_mrkrs)
        actions['clear_cyc'] = act

        act = QAction('Domino', self)
        act.triggered.connect(partial(self.import_staging, 'domino'))
        actions['import_domino'] = act

        act = QAction('Alice', self)
        act.triggered.connect(partial(self.import_staging, 'alice'))
        actions['import_alice'] = act

        act = QAction('Sandman', self)
        act.triggered.connect(partial(self.import_staging, 'sandman'))
        actions['import_sandman'] = act

        act = QAction('RemLogic', self)
        act.triggered.connect(partial(self.import_staging, 'remlogic'))
        actions['import_remlogic'] = act

        act = QAction('Compumedics', self)
        act.triggered.connect(partial(self.import_staging, 'compumedics'))
        actions['import_compumedics'] = act
        
        act = QAction('PRANA', self)
        act.triggered.connect(partial(self.import_staging, 'prana'))
        actions['import_prana'] = act
        
        act = QAction('DeltaMed', self)
        act.triggered.connect(partial(self.import_staging, 'deltamed'))
        actions['import_deltamed'] = act

        act = QAction('FASST', self)
        act.triggered.connect(self.import_fasst)
        actions['import_fasst'] = act

        act = QAction('Domino', self)
        act.triggered.connect(partial(self.import_staging, 'domino', 
                                      as_qual=True))
        actions['import_domino_qual'] = act

        act = QAction('Alice', self)
        act.triggered.connect(partial(self.import_staging, 'alice', 
                                      as_qual=True))
        actions['import_alice_qual'] = act

        act = QAction('Sandman', self)
        act.triggered.connect(partial(self.import_staging, 'sandman', 
                                      as_qual=True))
        actions['import_sandman_qual'] = act

        act = QAction('RemLogic', self)
        act.triggered.connect(partial(self.import_staging, 'remlogic', 
                                      as_qual=True))
        actions['import_remlogic_qual'] = act

        act = QAction('Compumedics', self)
        act.triggered.connect(partial(self.import_staging, 'compumedics', 
                                      as_qual=True))
        actions['import_compumedics_qual'] = act
        
        act = QAction('PRANA', self)
        act.triggered.connect(partial(self.import_staging, 'prana', 
                                      as_qual=True))
        actions['import_prana_qual'] = act
        
        act = QAction('DeltaMed', self)
        act.triggered.connect(partial(self.import_staging, 'deltamed', 
                                      as_qual=True))
        actions['import_deltamed_qual'] = act
        
        act = QAction('Wonambi', self)
        act.triggered.connect(partial(self.import_events, 'wonambi'))
        actions['import_events_wonambi'] = act
        
        act = QAction('RemLogic', self)
        act.triggered.connect(partial(self.import_events, 'remlogic'))
        actions['import_events_remlogic'] = act

        act = QAction('CSV', self)
        act.triggered.connect(partial(self.export, xformat='csv'))
        actions['export_to_csv'] = act
        
        act = QAction('RemLogic', self)
        act.triggered.connect(partial(self.export, xformat='remlogic'))
        actions['export_to_remlogic'] = act
        
        act = QAction('RemLogic FR', self)
        act.triggered.connect(partial(self.export, xformat='remlogic_fr'))
        actions['export_to_remlogic_fr'] = act

        act = QAction('Export Events...', self)
        act.triggered.connect(self.parent.show_export_events_dialog)
        actions['export_events'] = act

        act = QAction('Spindle...', self)
        act.triggered.connect(self.parent.show_spindle_dialog)
        act.setShortcut('Ctrl+Shift+s')
        act.setEnabled(False)
        actions['spindle'] = act

        act = QAction('Slow Wave...', self)
        act.triggered.connect(self.parent.show_slow_wave_dialog)
        act.setShortcut('Ctrl+Shift+w')
        act.setEnabled(False)
        actions['slow_wave'] = act

        act = QAction('Analysis Console', self)
        act.triggered.connect(self.parent.show_analysis_dialog)
        act.setShortcut('Ctrl+Shift+a')
        act.setEnabled(False)
        actions['analyze'] = act

        act = QAction('Sleep Statistics', self)
        act.triggered.connect(self.export_sleeps_stats)
        actions['export_sleepstats'] = act

        self.action = actions
300116
def annotate(self, annotation: Any) -> None:
        
        if isinstance(annotation, list):
            self._annotations += annotation
        else:
            self._annotations.append(annotation)
296308
def annotate(results, settings):
    ''''''
    annotations = (generate_annotation(result, setting)
                   for result, setting in zip(results, settings))
    return '\n'.join(annot for annot in annotations if annot)
1171405
def execute_action_list(obj, target, kw):
    """"""
    env = obj.get_build_env()
    kw = obj.get_kw(kw)
    status = 0
    for act in obj.get_action_list():
        args = ([], [], env)
        status = act(*args, **kw)
        if isinstance(status, SCons.Errors.BuildError):
            status.executor = obj
            raise status
        elif status:
            msg = "Error %s" % status
            raise SCons.Errors.BuildError(
                errstr=msg, 
                node=obj.batches[0].targets,
                executor=obj, 
                action=act)
    return status
1258162
def add_action(self, name, parent, action):
        
        if iskeyword(name):
            name = '_' + name
        self._actions[name] = parent.new_action(**action)
        setattr(self, name, self._actions[name].execute)
1064816
def __add_actions(self):
        

        LOGGER.debug("> Adding '{0}' Component actions.".format(self.__class__.__name__))

        add_project_action = self.__engine.actions_manager.get_action(
            "Actions|Umbra|Components|factory.script_editor|&File|Add Project ...")
        remove_project_action = self.__engine.actions_manager.register_action(
            "Actions|Umbra|Components|factory.script_editor|&File|Remove Project",
            slot=self.__view_remove_project_action__triggered)
        self.__script_editor.file_menu.insertAction(add_project_action, remove_project_action)
        self.__script_editor.file_menu.removeAction(add_project_action)
        self.__script_editor.file_menu.insertAction(remove_project_action, add_project_action)
529006
def action(self, relationship):
        """"""
        action_obj = FileAction(self.xid, relationship)
        self._children.append(action_obj)
1300584
def action(self, *action_names):
        """"""
        def action_wrapper(decorated):

            @functools.wraps(decorated)
            def wrapper(argv):
                kwargs = dict(arg.split('=') for arg in argv)
                try:
                    return decorated(**kwargs)
                except TypeError as e:
                    if decorated.__doc__:
                        e.args += (decorated.__doc__,)
                    raise

            self.register_action(decorated.__name__, wrapper)
            if '_' in decorated.__name__:
                self.register_action(
                    decorated.__name__.replace('_', '-'), wrapper)

            return wrapper

        return action_wrapper
102338
def create_file_new_actions(self, fnames):
        """'"""
        if not fnames:
            return []
        new_file_act = create_action(self, _("File..."), 
                                     icon=ima.icon('filenew'),
                                     triggered=lambda:
                                     self.new_file(fnames[-1]))
        new_module_act = create_action(self, _("Module..."),
                                       icon=ima.icon('spyder'),
                                       triggered=lambda:
                                         self.new_module(fnames[-1]))
        new_folder_act = create_action(self, _("Folder..."),
                                       icon=ima.icon('folder_new'),
                                       triggered=lambda:
                                        self.new_folder(fnames[-1]))
        new_package_act = create_action(self, _("Package..."),
                                        icon=ima.icon('package_new'),
                                        triggered=lambda:
                                         self.new_package(fnames[-1]))
        return [new_file_act, new_folder_act, None,
                new_module_act, new_package_act]
782995
protected void executeActions(TestContext context) {
        context.setVariable(indexName, String.valueOf(index));

        for (TestAction action: actions) {
            setActiveAction(action);
            action.execute(context);
        }
    }
538841
def add_annotation(*annotations)
            self.Annots ||= []

            annotations.each do |annot|
                annot.solve[:P] = self if self.indirect?
                self.Annots << annot
            end
        end
1243044
public void addAnnotations( Annotated other)
    {
    for( Iterator<String> otherAnnotations = other.getAnnotations(); otherAnnotations.hasNext();)
      {
      String name = otherAnnotations.next();
      if( getAnnotation( name) == null)
        {
        setAnnotation( name, other.getAnnotation( name));
        }
      }
    }
469249
private void addNonExcactActions(Construction construction,
	    ParserActionSet set, Map<Construction, ParserActionSet> actions) {
	set.addActions(actions.get(new Terminal(construction.getName(), null)));
    }
1317726
function () {
            var self = this;
            base._create.apply(self, arguments);

            if (self.options.actions.listAction) {
                self._adaptListActionforAbp();
            }

            if (self.options.actions.createAction) {
                self._adaptCreateActionforAbp();
            }

            if (self.options.actions.updateAction) {
                self._adaptUpdateActionforAbp();
            }

            if (self.options.actions.deleteAction) {
                self._adaptDeleteActionforAbp();
            }
        }
627778
def play_actions(self, target):
        
        for method_name, args, kwargs in self.actions:
            method = getattr(target, method_name)
            method(*args, **kwargs)
783724
void addAnnotations(final AnnotationInfoList packageAnnotations) {
        // Currently only class annotations are used in the package-info.class file
        if (packageAnnotations != null && !packageAnnotations.isEmpty()) {
            if (this.annotationInfo == null) {
                this.annotationInfo = new AnnotationInfoList(packageAnnotations);
            } else {
                this.annotationInfo.addAll(packageAnnotations);
            }
        }
    }
906450
def set_annotations(cls, __fn, *notes, **keyword_notes):
        """"""
        if hasattr(__fn, '__func__'):
            __fn = __fn.__func__
        if hasattr(__fn, '__notes__'):
            msg = 'callable already has notes: {!r}'
            raise AttributeError(msg.format(__fn))
        __fn.__notes__ = (notes, keyword_notes)