Add a Plugin whose Detectors should be added to the execution plan.
976771
public void addPlugin(Plugin plugin) throws OrderingConstraintException {
        if (DEBUG) {
            System.out.println("Adding plugin " + plugin.getPluginId() + " to execution plan");
        }

        pluginList.add(plugin);

        // Add ordering constraints
        copyTo(plugin.interPassConstraintIterator(), interPassConstraintList);
        copyTo(plugin.intraPassConstraintIterator(), intraPassConstraintList);

        // Add detector factories
        for (DetectorFactory factory : plugin.getDetectorFactories()) {
            if (DEBUG) {
                System.out.println("  Detector factory " + factory.getShortName());
            }
            if (factoryMap.put(factory.getFullName(), factory) != null) {
                throw new OrderingConstraintException("Detector " + factory.getFullName() + " is defined by more than one plugin");
            }
        }
    }
379960
def register_plugin(manager):
    '''
    
    '''
    manager.register_blueprint(player)
    manager.register_mimetype_function(detect_playable_mimetype)

    # add style tag
    manager.register_widget(
        place='styles',
        type='stylesheet',
        endpoint='player.static',
        filename='css/browse.css'
    )

    # register link actions
    manager.register_widget(
        place='entry-link',
        type='link',
        endpoint='player.audio',
        filter=PlayableFile.detect
    )
    manager.register_widget(
        place='entry-link',
        icon='playlist',
        type='link',
        endpoint='player.playlist',
        filter=PlayListFile.detect
    )

    # register action buttons
    manager.register_widget(
        place='entry-actions',
        css='play',
        type='button',
        endpoint='player.audio',
        filter=PlayableFile.detect
    )
    manager.register_widget(
        place='entry-actions',
        css='play',
        type='button',
        endpoint='player.playlist',
        filter=PlayListFile.detect
    )

    # check argument (see `register_arguments`) before registering
    if manager.get_argument('player_directory_play'):
        # register header button
        manager.register_widget(
            place='header',
            type='button',
            endpoint='player.directory',
            text='Play directory',
            filter=PlayableDirectory.detect
            )
1303961
def add_to_guardfile
      klass = plugin_class # call here to avoid failing later

      require_relative "guardfile/evaluator"
      # TODO: move this to Generator?
      options = Guard.state.session.evaluator_options
      evaluator = Guardfile::Evaluator.new(options)
      begin
        evaluator.evaluate
      rescue Guard::Guardfile::Evaluator::NoPluginsError
      end

      if evaluator.guardfile_include?(name)
        UI.info "Guardfile already includes #{ name } guard"
      else
        content = File.read("Guardfile")
        File.open("Guardfile", "wb") do |f|
          f.puts(content)
          f.puts("")
          f.puts(klass.template(plugin_location))
        end

        UI.info INFO_ADDED_GUARD_TO_GUARDFILE % name
      end
    end
914463
def configure(self, options, conf):
        
        super(LeakDetectorPlugin, self).configure(options, conf)
        if options.leak_detector_level:
            self.reporting_level = int(options.leak_detector_level)
        self.report_delta = options.leak_detector_report_delta
        self.patch_mock = options.leak_detector_patch_mock
        self.ignore_patterns = options.leak_detector_ignore_patterns
        self.save_traceback = options.leak_detector_save_traceback
        self.multiprocessing_enabled = bool(getattr(options, 'multiprocess_workers', False))
178615
def append(self, cb):
        """"""
        self.callbacks.append(cb.callb)
        self.monitor = self.monitor | cb.callb.bit

        yield from self.pi._pigpio_aio_command(_PI_CMD_NB, self.handle,
                                               self.monitor)
605393
function addPlugin(plugin) {
  if (!plugin) {
    return;
  }
  if (!needFilterPlugin) {
    console.warn('You are adding a plugin after getPlugins is called.');
  }
  needFilterPlugin = true;
  if (!plugin.name) {
    console.log('plugin: ', plugin);
    throw new Error('Each plugin should have a name.');
  }
  if (_.find(allPlugins, { name: plugin.name })) {
    console.warn('You should not add a plugin with same name: ' + plugin.name);
    return;
  }
  allPlugins.push(plugin);
}
573984
public static void registerPluginAnalysisEngines(DetectorFactoryCollection detectorFactoryCollection,
            IAnalysisCache analysisCache) throws IOException {
        for (Iterator<Plugin> i = detectorFactoryCollection.pluginIterator(); i.hasNext();) {
            Plugin plugin = i.next();

            Class<? extends IAnalysisEngineRegistrar> engineRegistrarClass = plugin.getEngineRegistrarClass();
            if (engineRegistrarClass != null) {
                try {
                    IAnalysisEngineRegistrar engineRegistrar = engineRegistrarClass.newInstance();
                    engineRegistrar.registerAnalysisEngines(analysisCache);
                } catch (InstantiationException e) {
                    IOException ioe = new IOException("Could not create analysis engine registrar for plugin "
                            + plugin.getPluginId());
                    ioe.initCause(e);
                    throw ioe;
                } catch (IllegalAccessException e) {
                    IOException ioe = new IOException("Could not create analysis engine registrar for plugin "
                            + plugin.getPluginId());
                    ioe.initCause(e);
                    throw ioe;
                }
            }
        }
    }
23751
def add_plugin(self, plugin):
        
        self.plugin_by_name[plugin.get_plugin_name()] = plugin
        self.plugins.append(plugin)
29032
private void addExecutionGoals(MavenPluginExecutionDescriptor executionDescriptor, PluginExecution pluginExecution, Store store) {
        List<String> goals = pluginExecution.getGoals();
        for (String goal : goals) {
            MavenExecutionGoalDescriptor goalDescriptor = store.create(MavenExecutionGoalDescriptor.class);
            goalDescriptor.setName(goal);
            executionDescriptor.getGoals().add(goalDescriptor);
        }

    }
698810
function applyPlugin(plugin, next) {
    self.pack.register(plugin.plugin, plugin.options || {}, function(err) {
      if(err) return next(err);
      else    return next();
    });
  }
236191
public function setupDetectors()
    {
        $request = $this->_request();
        $detectors = $this->getConfig('detectors');

        foreach ($detectors as $name => $config) {
            $request->addDetector($name, function (ServerRequest $request) use ($config) {
                if ($config['ext'] !== false && $request->getParam('_ext') === $config['ext']) {
                    return true;
                }

                return $request->accepts($config['accepts']);
            });
        }

        $request->addDetector('api', function (ServerRequest $request) use ($detectors) {
            foreach ($detectors as $name => $config) {
                if ($request->is($name)) {
                    return true;
                }
            }

            return false;
        });
    }
114004
def add_watcher(self, fd, callback):
        """"""

        if not isinstance(fd, int):
            fd = fd.fileno()

        self.callbacks[fd] = callback
        self.epoll.register(fd, EPOLLIN)
825410
def add_plugin(self, plugin_type, plugin_name, args_dict):
        

        plugin_modified = False

        for plugin in self.dock_json[plugin_type]:
            if plugin['name'] == plugin_name:
                plugin['args'] = args_dict
                plugin_modified = True

        if not plugin_modified:
            self.dock_json[plugin_type].append({"name": plugin_name, "args": args_dict})
504145
public void enableAllDetectors(boolean enable) {
        detectorEnablementMap.clear();

        Collection<Plugin> allPlugins = Plugin.getAllPlugins();
        for (Plugin plugin : allPlugins) {
            for (DetectorFactory factory : plugin.getDetectorFactories()) {
                detectorEnablementMap.put(factory.getShortName(), enable);
            }
        }
    }
1303837
def add_handler(self, handler):
        ''' 
        '''
        handler['logger'] = self._get_logger(handler)
        handler['reads'] = 0
        handler['data_read'] = 0

        self.capture_handlers.append(handler)
165298
def _new_plugin(self, plugin):
        

        # First store the plugin info into our data store
        self.store_info(plugin, plugin['name'], type_tag='worker')

        # Place it into our active plugin list
        self.plugin_meta[plugin['name']] = plugin
604427
def options(self, parser, env):
        
        Plugin.options(self, parser, env)
        parser.add_option('--filetype', action='append',
                          help='Specify additional filetypes to monitor.')